Skip to content

1.11 backport: buildenv: Read muliple lines in propagated-user-env-packages#1482

Closed
Ericson2314 wants to merge 1 commit intoNixOS:1.11-maintenancefrom
Ericson2314:backport-fix-propagated-user-env-packages
Closed

1.11 backport: buildenv: Read muliple lines in propagated-user-env-packages#1482
Ericson2314 wants to merge 1 commit intoNixOS:1.11-maintenancefrom
Ericson2314:backport-fix-propagated-user-env-packages

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jul 23, 2017

For compatability with current and future nixpkgs, either ' ' or '\n' can serve as a delimiter between entries. Trailing empty entries are also skipped.

See NixOS/nixpkgs#27427 for background, and #1480 for the master version.

I tested the parsing logic in a standalone script, but not buildenv yet.

my @propagated = split ' ', $propagated;
foreach my $p (@propagated) {
$postponed{$p} = 1 unless defined $done{$p};
while (my $propagated = <DATA>) {
Copy link
Member

Choose a reason for hiding this comment

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

I think you meant <PROP> here instead of <DATA>.

Slightly simpler is to read the whole file and split it on arbitrary whitespace:

local $/;
foreach my $p (split " ", <PROP>) {
  $postponed{$p} = 1 unless defined $done{$p};
}

Copy link
Member Author

Choose a reason for hiding this comment

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

@edolstra sounds good to me. That exactly mirrors what stdenv/setup.sh did before my changes.

For compatability with current and future nixpkgs, either ' ' or '\n'
can serve as a delimiter between entries. Trailing empty entries are
skipped.
@Ericson2314 Ericson2314 force-pushed the backport-fix-propagated-user-env-packages branch from f99fc6f to 971f82e Compare July 24, 2017 18:45
@Ericson2314
Copy link
Member Author

@edolstra Updated per your suggestion.

@domenkozar
Copy link
Member

This ship has sailed

@domenkozar domenkozar closed this Apr 8, 2020
@Ericson2314
Copy link
Member Author

Indeed!

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

Successfully merging this pull request may close these issues.

5 participants