-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
buildenv: Read muliple lines in propagated-user-env-packages #1480
Conversation
src/buildenv/buildenv.cc
Outdated
} | ||
for (const auto & p : tokenizeString<std::vector<string>>(propagated, " ")) | ||
if (done.find(p) == done.end()) | ||
postponed.insert(p); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
2703257
to
7da117c
Compare
@edolstra Made your simplification. |
src/buildenv/buildenv.cc
Outdated
@@ -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, " ")) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
For compatibility with old and new nixpkgs, either ' ' or '\n' can serve as a delimiter between entries.
7da117c
to
bfac92a
Compare
See NixOS/nixpkgs#27859 for talk of doing the same thing in nixpkgs. |
I marked this as stale due to inactivity. → More info |
I closed this issue due to inactivity. → More info |
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.