This is fairly nasty. We rely on overriding for TH support, but this then prevents us
from allowing to override in final flake.nix or similar expressions for the final build
package/component/executable. This even fails silently and TH just doesn't work.
This seems to be a larger topic around how we deal with TH, and module inheritance. We should not override
existing keys, but namespace them properly, and thus still allow overriding.
* compiler/ghc: Add useLdGold option
* comp-builder: Remove ld override
* Set CONF_LD_LINKER_OPTS_STAGE2 to ensure gold gets used
* Set LD even if not cross-compiling if we want gold
* set full path of ld.gold
* Don't use ld.gold on musl
* link to musl ld.gold bug
* Support revisions
Cabal files are now obtained from the index tarball (as cabal does)
directly. This allows us to always pick the cabal file revision that
cabal would pick, without having to understand or reference hackage.
* Update nix-tools materialised plan for new tooling
* Update materialized files
* Eval on x86_64-linux
* Turn off full materialization check
* Replace pkgs.writeText with passAsFile
Nix derivations are already able to pass a attribute to the builder as a
file. This means we don't need to use pkgs.writeText to turn the
cabalFile attribute into a file, saving one derivation.
* Bump closure size limit to 540
---------
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
Adds GHC 9.4 and uses hadrian to build it.
This also updates the way iserv-proxy and remote-iserv are built as they now have their own package and gitlab repo.
Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
* Add `shell.allDeps` as a fix for #1793#1769 added all the tool dependencies of the hsPkgs in a project to the shell. This is great for cabal projects where the set of packages will be limited to those in the plan. It allows these packages to be rebuilt by cabal.
For stack projects however this set is much larger (all of stackage), likely to include unwanted tools and tools that may be broken.
This change adds `shell.allDeps` and defaults it to `false` for stack projects.
Fixes#1793
* Added comments
* shellFor: provide build tools for all packages when exactDeps = false
When not using `exactDeps` cabal may try to build arbitrary dependencies
so in this case we need to provide the build tools for all of hsPkgs.
* comp-builder: exclude hsc2hs from build-tools as it is never used,
since it is provided by ghc env, which is first in PATH.
This avoid possible collisions when using eg. devshells, which
fuse all binaries into a single output directory.
* Fix datadir for tests and benchmarks
Broken by #1732
* Update builder/comp-builder.nix
Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
* Keep stderr on stderr
Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
* Use inputMap for soruce of packages in custom repository
* Include inputMap for hspkg-builder to use
* Use inputMap for soruce of packages in custom repository
* Fix url replacement.
* Check all the urls
* Add comments
* update llvm-hs llvm from 11 to 12
* allow passing version args to build-tools; fix llvm-hs build-tools, pass allRefs to builtins.fetchGit to allow fetching non-standard-refs (to mirror stack behaviour)
This adds a way to specify the `evalSystem` or `evalPackages` explicitly when calling the `project` functions.
Currently if we want to make a `flake` that supports multiple systems we have few options:
* Require builders for all the supported systems (even just for `nix flake show`).
* Pass `--impure` so that haskell.nix can see `builtins.currentSystem` to set up `pkgs.evalPackages` to use that. Unfortunately this prevents nix from caching some of the work it does and often results in it recalculating for each supported system when it would otherwise be cached and take no time at all.
* Add an overlay to replace `evalPackages`. This works, but it is not straight forward.
* Materialize the nix files for the project.
This change allows `evalSystem = "x86_64-linux";` to be passed telling `haskell.nix` to run `cabal` and `nix-tools` on that system. The user will have to have a builder for that system, but does not need to have builders for the others (unless building outputs for them).
- This allows nix run to work correctly, so that it knows the correct
name of the executable, as it would otherwise attempt to execute an
executable named "project-name-exe-exeName", for example.
- See #1231.
Fixes Windows cross compilation for GHC 9.0 and 9.2.
Updates wine to use the version that is included with the chosen Nixpkgs (it used to be pinned to an older version).
Moves the configuration of the GHC source into the GHC derivation. This should make adding Hadrian support easier.
Propagates library dependences (not just pkgconfig ones) on windows so that any DLLs in those libraries can be copied for TH evaluation and to the `/bin` directory of executable components.
Adds gcc and mfcgthreads as library dependencies on Windows so that the DLLs they include will be found.
Use `$pkgsHostTarget` (instead of `ghc-pkg`) to find all the DLLs can copy them to the `/bin` directory of executable components.
Adds support for __int128_t and __uint128_t to language-c to fix aarch64-darwin builds.
Fixed reinstalling packages that come with patched versions in ghcjs.
For ghc 9.0.2 Haskell.nix will use the `stm`and `filepath` source that came with `ghc` when the version desired matches. This is because 9.0.2 shipped with packages that differ from the same version in hackage.
`reinstallableLibGhc` is fixed for GHC 8.10 and above. Rather than including a patch file this works by:
* Setting the `subDir` to the `compiler` directory when building. That way relative paths to other parts of the `ghc` source tree (outside the `compiler` directory) still work.
* Files that are needed, but generated when `ghc` builds are added from the `generated` output of the ghc derivation.
`nonReinstallablePkgs` is now sorted and deduplicated before it is used (this reduces the chance of rebuilds when the list is refactored).
We include the /bin directory of `component.libs` in `extra-lib-dirs` on windows, but not `components.pkgconfig`. This causes confusing differences between the behavior depending on how a dependency was specified in the `.cabal` file or added in a module. If it wounds up in `components.libs` the need for DLLs would propagate correctly, but if it was only in `componets.pkgconfig` DLLs would not be included when building TH code and did not get symlinked to `exe` component output /bin dirs.
This is a better fix to the problem of making DLLs available to the process running in wine that is used to evaluate TH code when cross compiling for Windows.
Also fixes macOS loadArchive in TH for ghc 9
Co-authored-by: Michael Peyton Jones <michael.peyton-jones@iohk.io>
* Adds small address space logic
* no numa on android
* Update comp-builder.nix
* Adds android.nix
* host And target.
* Make android remote-iserv static
* Add back mmap_next
* Create rts-android-jemalloc-qemu.patch
* Update bootstrap.nix
* Some android modifications to ghc
* Some modifications to the android overlay.
* disable more hardening flags on android
* Adds stack-protector-symbols.patch
* Adds libraries-prim-os-android.patch
* Adds support for CONDBR relocations
* Adds undef+weak symbol support.
* calloc takes 3 not 2 args :-(
* Adds getauxval
* Needs enable static now
* Fix android cross