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

pkgsStatic for 18.09 #51957

Merged

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Dec 13, 2018

Motivation for this change

A backport of #48803 for those wanting to use this but unable to switch from stable to master. A note is adding saying the interface is provisional. Presumably in 19.03 this will arrive on staging "the normal way" and the dust will have settled again.

Rebased on a recentish common ancestor of master and relase-18.09. This way any further fixes can be made on top of this (minus the top commit) and then easily merged into both master and release-19.09. This is a lot easier than cherry-pick; with cherry-pick alone it wouldn't make sense to pre-release new interfaces on stable.

N.B. I skipped b966d3c because that is a breaking interface change not appropriate for stable.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

CC @vaibhavsagar

matthewbauer and others added 7 commits December 13, 2018 14:04
crossOverlays only apply to the packages being built, not the build
packages. It is useful when you don’t care what is used to build your
packages, just what is being built. The idea relies heavily on the
cross compiling infrastructure. Using this implies that we need to
create a cross stdenv.

(cherry picked from commit a3a6ad7)
- makeStaticBinaries don’t work on Darwin (no stable ABI!)
- Need to make sure NIX_CFLAGS_LINK appends
- isStatic is not used anymore

(cherry picked from commit 8726f6a)
The conditional was incorrect - postInstall script should only hsppen
when enableShared = true.

(cherry picked from commit 5e06294)
This is kind of a mess, but basically:

- static=true, shared=true means to build statically but move it to
  the static output
- static=true, shared=false means to build statically and leave it in
  the main output
- static=false, shared=true means to not build static at all

Confusingly, the old default was static=true, shared=true even though
static=false? Still can’t figure out what was meant by that.

(cherry picked from commit e999def)
when enableShared = false, we set --without-shared flag.

(cherry picked from commit 53a6789)
Adds the static overlay that can be used to build Nixpkgs statically.
Can be used like:

  nix build pkgsStatic.hello

Not all packages build, as some rely on dynamic linking.

(cherry picked from commit 6d90a8b)
@GrahamcOfBorg GrahamcOfBorg added the 6.topic: stdenv Standard environment label Dec 13, 2018
@matthewbauer
Copy link
Member

This is missing a patch for portable libsystem

@Ericson2314
Copy link
Member Author

Ericson2314 commented Dec 13, 2018

@matthewbauer that was done after the original PR, right? I'm fine skipping it for the moment; I just need the Linux side on stable.

@Ericson2314 Ericson2314 mentioned this pull request Dec 13, 2018
10 tasks
@Ericson2314
Copy link
Member Author

Ah I think you mean #51881 or 5d6b7c74adbcd067d46c8bd7866ba553968bad56, both of which are not merged (not sure whether the last one is in a PR either.) So I think this is ready to go; I can comment what branch to rebase unmerged work on or (with permission) do the force-push myself.

@Ericson2314 Ericson2314 merged commit 62c6099 into NixOS:release-18.09 Dec 13, 2018
@Ericson2314 Ericson2314 deleted the crossOverlays-for-18.09 branch December 13, 2018 22:31
@matthewbauer
Copy link
Member

0b85745 Should be added. Otherwise darwin stuff is broken.

@Ericson2314
Copy link
Member Author

Oh 5d6b7c74adbcd067d46c8bd7866ba553968bad56 was rebased onto master by github but the original commit not deleted. Fix now, with a small tangle of merges (sorry!).

@Ericson2314
Copy link
Member Author

af2cebe is the cherry-pick. It's on master and release-18.09 as expected.

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.

None yet

4 participants