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

Unbreak stdenv #27650

Merged
merged 3 commits into from
Jul 26, 2017
Merged

Unbreak stdenv #27650

merged 3 commits into from
Jul 26, 2017

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jul 26, 2017

Motivation for this change

Solves the nix-env and Darwin nix-shell issues. No evals so far! After this I'll merge with master, basically with -Xours.

Things done

Please check what applies. Note that these are not hard requirements but mereley serve as information for reviewers.

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built stdenv on platform(s)
    • NixOS -- old version worked
    • macOS -- old version worked
    • Linux
  • Tested nix-shell on Darwin -- old version worked
  • 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/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@Ericson2314, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @Profpatsch and @vcunat to be potential reviewers.

@Ericson2314
Copy link
Member Author

Unfortunately declare -g is new syntax, so I'll have to use eval there instead.

[[ "$#" -gt 0 ]] || return 0
printf '%s\n' "$@"
}

printWords() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you have a duplicated definition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err I meant to keep printLines, but I guess it's now unused so there's no point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, haha, just realized my find & replace renamed the old one.

…files

We cannot switch to line-delimited yet, because certain Nix commands do
not read in the entire file, but just the first line.
This is a temporary measure until this impurity is removed from Nix.
This is invalid before bash-4.2, affecting bash used impurely in
nix-shell on MacOS.
@@ -211,7 +211,7 @@ stdenv.mkDerivation ({
configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags"

# nativePkgs defined in stdenv/setup.hs
for p in "''${!nativePkgs[@]}"; do
for p in "''${nativePkgs[@]}"; do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was that bang?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keys of the map, instead of the values. (With arrays, really int maps, it gives you the indices.)

Copy link
Member

@copumpkin copumpkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay but haven't tested

@Ericson2314
Copy link
Member Author

Ok it builds and I tested nix-shell. Merge?

@Ericson2314 Ericson2314 merged commit 8ce4780 into NixOS:staging Jul 26, 2017
@Ericson2314 Ericson2314 deleted the unbreak-stdenv branch July 26, 2017 17:23
@copumpkin
Copy link
Member

Sure!

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

6 participants