Commit Graph

216 Commits

Author SHA1 Message Date
Jean-Baptiste G cebbb6d232 shellFor: provide build tools for all packages when exactDeps = false. Fix #1753. (#1769)
* 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.
2022-11-08 15:24:01 +13:00
Hamish Mackenzie 69a42f8620 Workaround for Hydra cp corruption (#1766)
See https://github.com/input-output-hk/ouroboros-network/pull/4007
2022-11-02 18:18:33 +13:00
Hamish Mackenzie 582e9ee5db Fix datadir for tests and benchmarks (#1765)
* 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>
2022-10-31 21:18:08 +13:00
Hamish Mackenzie 57cb1649c9 Use inputMap for soruce of packages in custom repository (#1750)
* 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
2022-10-14 17:03:47 +13:00
Mango The Fourth e49b15fefc Choose proper llvm version for llvm-hs and make stack infra work like stack does (#1724)
* 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)
2022-10-04 23:20:50 +13:00
Hamish Mackenzie ec0c59e2de Support for packages with only tests (#1732)
* Support for packages with only tests

Fixes #362

* Fix for ghcjs
2022-10-03 15:39:47 +13:00
Hamish Mackenzie 7462e537ef Fix building the stack tool (#1723)
Fixes #218

Tested with:

```
nix-build -E '((import ./. {}).pkgs-unstable.haskell-nix.tool "ghc924" "stack" "2.9.1")'
```
2022-09-30 21:54:38 +13:00
Hamish Mackenzie 6c7f9d0042 Use cabal 3.8 (#1641)
A bug was fixed in cabal 3.8 (https://github.com/haskell/cabal/issues/6771) that haskell.nix relied on for `pkg-config` in support.  To work around this we added a dummy `pkg-config` that `cabal configure` now uses when haskell.nix runs it `cabal configure` internally.  That returns version information for all the `pkg-config` packages in `lib/pkgconfig-nixpkgs-map.nix`.  This mapping has also been expanded based on the results of searching nixpkgs for `*.pc` files.

This update also includes workarounds for:

https://github.com/haskell/cabal/issues/8352
https://github.com/haskell/cabal/issues/8370
https://github.com/haskell/cabal/issues/8455
2022-09-13 12:00:04 +12:00
Alexander Vieth 7f3bf673c9 use Hamish's suggestion for faster dedup 2022-08-25 10:15:15 -04:00
Alexander Vieth 872043aadc use attrsets for deduplication
'name' should be unique for haskell packages; not necessarily so for
other things
2022-08-24 10:38:41 -04:00
Alexander Vieth 839515b97d deduplicate build inputs for the shell
https://github.com/input-output-hk/haskell.nix/issues/1297
2022-08-23 11:32:12 -04:00
Yvan Sraka bc1de42afa Fix #1587: the option shell.buildInputs does not exist ... (#1598) 2022-08-18 16:07:27 +02:00
Hamish Mackenzie 1662092eab Fix for tests broken by cabal update in hackage (#1585) 2022-08-18 14:45:17 +12:00
Hamish Mackenzie ce047883ac Fix tool functions (#1570) 2022-08-01 23:57:29 +12:00
Hamish Mackenzie a443611ecf Add evalSystem and evalPackages project args (#1546)
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).
2022-07-28 20:03:05 +12:00
Hamish Mackenzie 4e01f34543 Add nixpkgs-2205 and update other nixpkgs pins (#1506) 2022-07-17 18:18:19 +12:00
Chua Hou 5d5d471409 Set meta.mainProgram for executable components (#1539)
- 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.
2022-07-06 23:25:58 +12:00
Teo Camarasu 54b86efe7c Avoid duplicated packages in ghc-pkg list (#1530)
Filter out the setup dependencies of `Simple` packages from the shell. Fixes #1518.

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2022-06-30 21:16:35 +12:00
Andrea Ciceri 2c1701b681 Supporting ca-derivations experimental feature (#1494)
* Supporting `ca-derivations` experimental feature

* Improved `contentAddressed.include` option description

* Ensure deterministic output for content addressed components

* Comment transformed into a Nix comment

To avoid possibly useless rebuilds

* Use `modules` arg `contentAddressed` flag

* Tutorial about CA derivations

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2022-06-23 12:39:35 +12:00
Hamish Mackenzie 1eaa396e9c Fix #1507 by running postBuild hook in setup build (#1519)
* Includes very temporary work around for CI issue
2022-06-21 15:38:41 +12:00
Hamish Mackenzie d3ba497b5f Fixes to help building of all packages in stackage (#1503)
These are the less controversial changes from #1251
2022-06-02 22:45:09 +12:00
Hamish Mackenzie fa2fa131fe Add ghc 9.2.3 (#1491)
Also:

* Updates the GHC's built on CI
* Use Cabal 3.6.2.0 for default Setup
* Fixes haskell-language-server and hlint on CI
2022-06-01 19:33:58 +12:00
Hamish Mackenzie 82bc945818 Fix ghc 9 windows cross compilation (#1450)
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.
2022-05-19 20:21:16 +12:00
Shea Levy bfeea3e894 Allow packages to specify external static plugins 2022-05-02 11:08:42 -04:00
Hamish Mackenzie f3ea06dcac Work around for packages in lts that do not install. (#1437)
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).
2022-04-20 15:25:21 +12:00
Hamish Mackenzie e9a93540c3 Look for DLLs in /bin directory of pkgconfig deps (#1422)
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.
2022-04-01 16:35:04 +13:00
Hamish Mackenzie 4b6ee9767d Make DLLs in deps available to wine TH runner (#1405)
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>
2022-03-25 21:44:02 +13:00
Hamish Mackenzie 864c0aff9c Pass enableDWARF to makeConfigFiles to fix -g3 support in nix-shell (#1385) 2022-02-25 01:52:16 +13:00
Cheng Shao 18ebf60137 Fix libnuma dependency in rts.conf (#1342) 2022-02-15 23:49:45 +13:00
Hamish Mackenzie 41682ea1fd update pins (#1371) 2022-02-15 11:11:34 +13:00
Teo Camarasu 02f34c6f36 fix typo (#1362) 2022-02-04 14:52:37 +00:00
Moritz Angermann eb7e669d63 Enable aarch64 builds (#1316)
* 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
2022-01-09 11:36:53 +13:00
Moritz Angermann 001df758bf fix ghcjs (#1311) 2022-01-09 03:11:37 +13:00
Michael Peyton Jones c58c5946eb Don't set LANG and LOCALE_ARCHIVE in shellFor (#1341) 2022-01-07 19:01:07 +08:00
Cheng Shao 65c7172b42 Use fixed ghc version when building hoogle (#1322) 2021-12-28 21:51:16 +08:00
Javier Sagredo 0e2ae928e2 Rename executable-profiling flag as suggested by Cabal (#1136) 2021-12-27 15:28:59 +08:00
Moritz Angermann 59ad2995cc Update ghcjs810-src.json (#1291)
* Update ghcjs810-src.json

* Update ghcjs-project.nix

* Update ghcjs.nix

Use nodejs-12_x, to allow larger strings to be loaded. See https://github.com/nodejs/node/issues/33960

* Update comp-builder.nix

Allow large strings, see https://github.com/nodejs/node/issues/33960

* Update cabal-os-arch-comp.nix

* Update ghcjs-src

* Update ghcjs ref

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-11-17 02:17:02 +13:00
Hamish Mackenzie 24b421cbfc Add ghc 9.2.1 and update internal cabal to 3.6.2 (#1286) 2021-11-13 12:43:04 +13:00
Will Fancher e8bfc03091 shellFor: Add withHaddocks and fix ghc-pkg reporting no haddocks for dependencies. (#1279) 2021-11-03 22:29:53 +13:00
Hamish Mackenzie 062a0317b6 Check that the library component package.conf.d/*.conf file is created (#956)
Had a strange issue where eval of #955 and it might have been caused
by a the nix-tools library seeming to have no `.conf` files.

Since it seemed to go away by itself I think this was a nix GC issue
or something.  Here is some code we could add to the builders to
double check the files are created if it turns out that is not the
case.

Co-authored-by: Rodney Lorrimar <rodney.lorrimar@iohk.io>
2021-07-06 13:24:17 +12:00
Teo Camarasu 3856d2d24d Improve shellFor selectComponents performance (#1146)
* factor out isSelectedComponent

* Optimise `flatLibDepends`

We no longer force the `outPath` attribute to avoid instantiating the
derivation, which is expensive
2021-06-28 16:46:19 +12:00
Teo Camarasu d7e5cface8 Fix: shellFor doesn't filter based on transitive dependencies (#1145)
* Fix shellFor not accounting for transitive dependencies

ensure that the following invariant is enforced:
  `shellFor` never adds the selected packages to its environment

* Fix missing selectedComponentsBitmap attribute

Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-06-21 16:22:48 +12:00
Ollie Charles 37b9ce1670 Add writeHieFiles (#1022)
* Bump nix-tools to latest master revision

* Add writeHieFiles

* Update modules/plan.nix

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>

* Move where the hie flags are specified

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2021-06-18 20:25:19 +12:00
Hamish Mackenzie a5b74bf002 niv update nixpkgs-unstable and add ghc 8.10.5 (#1121) 2021-06-15 19:50:45 +12:00
Moritz Angermann dd31db0a0a Add enough logic to make plugins work conceptually. (#1131) 2021-06-07 12:07:56 +12:00
Richard Wallace f9e3eafbe0 there isn't always an autogen directory on macOS, which can cause the builds to fail (#1117) 2021-05-20 14:26:41 +12:00
Hamish Mackenzie ae7be4559f Fixes for windows cross compilation (#1103) 2021-05-03 19:14:19 +12:00
Hamish Mackenzie 618ff607d3 Fix shellFor components argument (#1079) 2021-04-08 15:33:09 +12:00
Richard Wallace 93ab4310e9 improve keepSource cleanup (#1080) 2021-03-25 14:07:04 +13:00
Dennis Gosnell 6c627b429b support cabal-doctest (#427)
* Add test.

* wip

* Fix merge regression

* Combine drv, drv.source and drv.dist for doctest

* Skip cabal-doctests test when cross compiling

* Add the --no-magic flag to the .cabal file for the cabal-doctests test.

This appears to be necessary on OSX.

The --no-magic flag stops the doctest executable from expanding path
arguments, trying to locate the package db, etc.

This shouldn't be necessary with cabal-doctest, since all the
necessary options to pass to doctest are computed when running the Setup.hs
script.

See
https://github.com/input-output-hk/haskell.nix/pull/427#issuecomment-605761780.

* Fix cabal-doctest support

* Skip cabal-doctest test plan cross compiling

* More fixes for cabal-doctest

* Skip cabal-doctest tests when cross compiling

Co-authored-by: Moritz Angermann <moritz.angermann@gmail.com>
Co-authored-by: Hamish Mackenzie <Hamish.Mackenzie@iohk.io>
Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
2021-03-20 14:25:30 +13:00