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

niv: only build the executable #106906

Merged
merged 1 commit into from Dec 14, 2020
Merged

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Dec 14, 2020

Motivation for this change

Installing pkgs.niv shouldn't pull all of GHC.

Fixes nmattia/niv#299

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Installing `pkgs.niv` shouldn't pull all of GHC.

Fixes nmattia/niv#299
@zimbatm zimbatm requested a review from nmattia December 14, 2020 14:40
@zimbatm
Copy link
Member Author

zimbatm commented Dec 14, 2020

Result of nixpkgs-review pr 106906 run on x86_64-linux 1

1 package built:
  • niv

@nmattia
Copy link
Contributor

nmattia commented Dec 14, 2020

thanks!

@maralorn
Copy link
Member

maralorn commented Dec 15, 2020

Hey, hey! Thanks for this change, but this PR broke rebuild on my system, because the niv binary is not in the resulting package. I use niv in a script which checks the existence of binaries at nixos-rebuild time.

/nix/store/c3p0a7k0pj34d8swq5k1ghm7lasylfmf-niv-0.2.18/bin: getDirectoryContents:openDirStream: does not exist (No such file or directory)

The issue is that you dropped the .bin. The changed line should probably to be:

niv = lib.getBin (haskell.lib.justStaticExecutables haskellPackages.niv);

@maralorn
Copy link
Member

I just realize this PR was open for 20 minutes without any hint of a second opinion. The change was pretty trivial, but it introduced a typo. I’ll take this as a reminder that more eyes are better, even for changes which one is confident about.

@nmattia
Copy link
Contributor

nmattia commented Dec 17, 2020

Ah, yes indeed. Looks like adding .bin or getBin doesn't help much. Someone will need to figure out what's happening in haskell.lib.justStaticExecutables, maybe it's interfering with enableSeparateBinOutput. Won't have time to investigate until next week, for now I'll revert: #107091

CC @zimbatm

@zimbatm
Copy link
Member Author

zimbatm commented Dec 17, 2020

Indeed, I have been too hasty :/ Here is a proper fix for my fix: #107096

zimbatm added a commit to zimbatm/nixpkgs that referenced this pull request Dec 17, 2020
I merged this PR too soon and forgot to check that the output was still
containing the binary.
zimbatm added a commit that referenced this pull request Dec 17, 2020
I merged this PR too soon and forgot to check that the output was still
containing the binary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install instructions require installing ~3GB of dependencies
3 participants