-
Notifications
You must be signed in to change notification settings - Fork 426
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
Handle commas in environment variables #6088
Comments
Please provide a full reproducer that anybody can run by copy & paste. I don't think it is supported to pass environment variables after the exec command like that at all so I'm not sure what you're actually trying. |
I typoed the command above and forgot the --env switch
to ensure that my application is linked against the proper standard libraries and has the needed rpath |
I see, and that results in these warnings
and LDFLAGS is only set to the part before the comma. What you'd like is a feature like #6008 recently merged from @cclerget but for --env instead of --bind. Meanwhile a workaround could be to replace the
which takes advantage of bash process substitution to create a "file" where the separator is newlines instead of commas. I also don't see why using
would be inconvenient. |
It is inconvenient to use --env-file or SINGULARITY_ENV because I am running singularity via ansible and I do not have an easy way to set the environment variables at the proper level of script hierarchy. I can manage, it is just a lot of ugly scripting. I would indeed like a feature like #6008 for env variables. What is the proper way to request such a thing? |
I don't understand; why is --env-file with <() or SINGULARITYENV on the singularity command line any less convenient than --env? Aren't they both a single command line that ansible could run? singularity is an open source project, so to get code updates the best way to do it is either submit a pull request or hire someone to do it. The person who did #6008 works for a company that accepts contracts for updates to singularity, you could try contacting them if it's important to you. |
I really can't go into explaining the complexities of our workflow. If it were easy to do, I wouldn't have asked. I will either submit a pull request, or develop a workflow to work-around this issue. Feel free to close the ticket. |
Maybe you're saying that ansible makes it more difficult to use anything that requires a shell to expand. So this might be nice to have but I think most people would rather use a workaround than invest the time to write the singularity modification PR. I'll close the issue for now as you request. |
Version of Singularity:
3.8.0-1.el7
Expected behavior
using
singularity exec --env LDFLAGS='-L/some/path -Wl,-rpath,/some/path' image.sif
should pass the LDFLAGS variable properlyActual behavior
LDFLAGS is truncated at the comma due to --env splitting variables by comma.
I am aware that I can pass variables using --env-file or SINGULARITYENV_* but for my use case this is very inconvenient
What OS/distro are you running
How did you install Singularity
yum install singularity
from rpelThe text was updated successfully, but these errors were encountered: