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
bundlerApp: add support for wildcards [WIP] #64238
Conversation
I’m personally -1 on this, because I don’t think a high-level Nix function should be exposing low level shell functionality. I won’t block it if somebody else thinks it’s a good idea though. |
I'm not a fan of this. I agree that it's unexpected for the entries in the If anything, we should be updating this code to use the library function for correctly quoting shell strings (I forget offhand what it is but it's in there) instead of just assuming a single quote is sufficient. Granted, an exe with a single quote in it would be rather surprising, but it would currently break the code. If there's a compelling reason to want to support wildcards then we should expose that as a separate property. |
For gems where the list varies a lot it's nice to be able to pattern-match. Is there any other way to implement this that doesn't rely on forwarding the logic to bash? |
Maybe add an
|
Let me recap:
I'll address points 2 to 4 and resubmit. |
I think there is also an issue if the prefix matches multiple results. It might be best to use something like this; set -o nullglob
${(lib.concatMapStrings (x: "for file in '${basicEnv}/bin/${x}'* ; do ln -s "$file" "$out/bin/$(basename "$file")"; done;\n") exesPrefix)} |
|
I'm going to be using |
How is that any better than the shell |
For 2 reasons:
|
I don't mind either way, as long as it's correct it doesn't matter that much |
Thank you for your contributions.
|
I marked this as stale due to inactivity. → More info |
I'm going to go ahead and drop this. Don't really have a need for it any longer. |
Motivation for this change
We currently quote the executable we link to in a
bundlerApp
which is neat because it supports files with spaces, but the problem is that we then cannot use wildcards in thebundlerApp.exes
property.None of the existing
bundlerApp
users in nixpkgs has executables with spaces in their names.Supporting regular wildcards, means we can do stuff like this:
exes = [ "check-*" "metrics-*" ];
which is great when one is using a script to automatically package a lot of ruby plugins for sensu.Cc: @manveru @cstrahan @lilyball
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)