-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
doc: specify that *Flags are string lists #9607
Conversation
I certainly agree, but I want to leave some timeframe for others to react. |
Thanks. (D'oh. Nice catch. I changed the title of the commit as well.) |
We call them lists, but unlike what's typical in functional languages, they actually are implemented as contiguous arrays IIRC. |
+1, I've been fixing occurrences of plain strings in |
There was a time when I wrote them as a single string myself, because that makes it harder to forget that spaces aren't allowed. TBH I still think that's a weird implementation issue that needs to be fixed, but assume there are good reasons for not just throwing everything at the shell quoted. |
If you want to say it's a list of string, I think it must be noted that it's just a string in the end in the builder. The fact is that all In theory the correct thing is writing |
Lists are rad - when they're not easily (and worse, quietly) broken by spaces. The current situation seems like the worst of both worlds.
Honestly, if I was sure there was no hope of that changing and thought a PR changing *Flags to strings instead would stand a chance, I would have submitted that instead. But people (I remember not who) seemed less than wild about that idea. I just wanted to hear some consensus on this before I started asking silly questions like: why aren't lists exported as bash arrays, besides the obvious compatibility reasons? |
It's just not true that it's a list, so I find this PR misleading. The truth in the docs should be: it's a string, but you can pass a list of strings and nix will automatically join it with spaces because of |
To elaborate my opinion: I feel that logically |
I believe we agree that we would like to truly have the flags as lists of strings in future. Why not have that formulation now, to announce that intention, but we should add a note that spaces in these strings aren't supported (yet). Then we can improve the implementation later. (Out of scope of this PR.) Note that our stdenv does accept e.g. |
I fully agree with @vcunat's last comment and will add that caveat to the PR. |
ping @nckx :) |
There's a better approach: #15799 EDIT: I didn't notice you merged :-) but it'll be good after that issue is solved (implemented and merged). |
If *Flags are only for string lists, please chime in on #17886 about ideas for another name for |
Current practice is wildly inconsistent: