Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskellPackages: inconsistent nix-shell behavior #36689

Closed
deepfire opened this issue Mar 9, 2018 · 1 comment
Closed

haskellPackages: inconsistent nix-shell behavior #36689

deepfire opened this issue Mar 9, 2018 · 1 comment

Comments

@deepfire
Copy link
Contributor

deepfire commented Mar 9, 2018

Issue description

It is harder to use nix-shell to reproduce Haskell build problems, because of the following:

nix-shell appears to have inconsistent behavior, which is contrary to what is described on its manpage:

The command nix-shell will build the dependencies of the specified derivation, but
not the derivation itself. It will then start an interactive shell in which all
environment variables defined by the derivation path have been set to their
corresponding values, and the script $stdenv/setup has been sourced. This is useful
for reproducing the environment of a derivation for development.

Specifically -- there appears to be no easy way to have both of the following:

  1. build inputs available
  2. *Phase variables set

Granted, the Haskell version of the mandate goes somewhat beyond the letter (but not the spirit) of the above description, since we also expect the build inputs not just being assigned to environment variables, but also registered within the GHC package data base.

Steps to reproduce

$ nix-shell -A 'pkgs.haskellPackages.haskell-gi'     -E 'import <nixpkgs> {}' --run 'echo buildPhase=$buildPhase; ghc-pkg list | wc -l'
buildPhase=runHook preBuild ./Setup build runHook postBuild
30
$ nix-shell -A 'pkgs.haskellPackages.haskell-gi.env' -E 'import <nixpkgs> {}' --run 'echo buildPhase=$buildPhase; ghc-pkg list | wc -l'
buildPhase=
73

cc @peti

@deepfire
Copy link
Contributor Author

Just realised that #36393 was merged recently!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant