This makes it work like work-on-multi from Reflex Platform. In
particular, rather than making `.env` from `shellFor`, we make `.env`
the primitive, and `shellFor` works by combining together the arguments
of all the packages to `generic-builder` and taking the `.env` of the
resulting mashup-package.
There are 2 benefits of this:
1. The dependency logic is deduplicated. generic builder just concatted
lists, whereas all the envs until now would sieve apart haskell and
system build inputs. Now, they both decide haskell vs system the same
way: according to the argument list and without reflection.
Consistency is good, especially because it mean that if the build
works, the shell is more likely to work.
2. Cross is handled better. For native builds, because the
`ghcWithPackages` calls would shadow, we through both the regular
component (lib, exe, test, bench) haskell deps and Setup.hs haskell
deps in the same `ghcWithPackages` call. But for cross builds we use
`buildPackages.ghcWithPackages` to get the setup deps. This ensures
everything works correctly.
Fix#49818. See the bug for more details.
The work done by haskellSrc2nix is usually lightweight, but needs to
be done each time a cabal file change. This triggers unexpected
network activity for a cache query which results most of the time on a
cache miss.
By disabling substitutes we:
- avoid the, mostly useless, binary cache query
- avoid unexpected network failure when users change a cabal file and
try to rebuild without connectivity.
The purpose of this argument is to allow you to get at the derivation (rather
than it's env) even when in the evaluation context of a nix-shell invocation.
Among other things, this will allow *2nix tools to output plain data
while still being composable with the traditional
callPackage/.override interfaces.
Cabal2nix expects a --compiler flag that contains a Cabal Compiler description.
We used to use the compiler's derivation name for this, but this breaks when
cross-compiling due to the target suffix. Instead we add an explicit
haskellCompilerName attribute to Haskell compiler derivations.
The correct ghc version was not passed through anymore, I'm not entirely
sure this is the correct fix or if this is the only argument that was
missing.
broken by 5e31e828f8
cc @Ericson2314