Skip to content

buildenv: Read muliple lines in propagated-user-env-packages #1480

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

Closed

Conversation

Ericson2314
Copy link
Member

For comparability with old and new nixpkgs, either ' ' or '\n' can serve as a delimiter between entries. I'll rewrite for the existing 11.x perl version next.

See NixOS/nixpkgs#27427 for background.

@ttuegel I wrote it this way not because I disagree with making Nix and Nixpkgs share a buildenv, but because this is the simpler change. Also, it is unclear to me whether the nix-support/* files are a Nix interface or Nixpkgs interface---seems to very case to case.

Do not merge just yet---I only built it and did not test it yet.

}
for (const auto & p : tokenizeString<std::vector<string>>(propagated, " "))
if (done.find(p) == done.end())
postponed.insert(p);
Copy link
Member

Choose a reason for hiding this comment

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

I don't get what all this readUntil stuff is needed for (or why the original used readLine in a loop). Wouldn't something like

tokenizeString<Strings>(readFile(propagatedFN), " \n"))

work?

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 does tokenizeString conceptually take a list of deliminators (disjunction) rather than single deliminating string (conjunction)? Fine with me then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Btw, what does if (done.find(p) == done.end()) do re empty entries? Want to make sure split and this coincide?

@Ericson2314 Ericson2314 force-pushed the fix-propagated-user-env-packages branch from 2703257 to 7da117c Compare July 24, 2017 19:06
@Ericson2314
Copy link
Member Author

@edolstra Made your simplification.

@@ -114,7 +114,7 @@ static void addPkg(const Path & pkgDir, int priority)
return;
throw SysError(format("opening ‘%1%’") % propagatedFN);
}
propagated = readLine(fd.get());
propagated = readFile(fd.get());
}
for (const auto & p : tokenizeString<std::vector<string>>(propagated, " "))
Copy link
Member

Choose a reason for hiding this comment

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

Now it only tokenizes on spaces right? Dropping the " " will cause it to split on any whitespace.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah sorry. I went to shrink my diff and did so too much.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
infinisil Silvan Mosberger
For compatibility with old and new nixpkgs, either ' ' or '\n' can
serve as a delimiter between entries.
@Ericson2314 Ericson2314 force-pushed the fix-propagated-user-env-packages branch from 7da117c to bfac92a Compare July 24, 2017 21:38
@Ericson2314
Copy link
Member Author

See NixOS/nixpkgs#27859 for talk of doing the same thing in nixpkgs.

@stale
Copy link

stale bot commented Feb 12, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 12, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants