-
Notifications
You must be signed in to change notification settings - Fork 248
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
CIBW_ENVIRONMENT not evaluated on Linux #235
Comments
Hi @JesseFarebro , CIBW_ENVIRONMENT items are evaluated by bash on Linux, not by cibuildwheel directly. Maybe you could share an example of it not working as expected? |
Hi @joerick, Perhaps this is an issue with Github Actions. I have a minimal reproduction with @mayeut's branch for Github Actions. Here is the repo: https://github.com/JesseFarebro/cibuildwheel-env-repo. Just check the actions tab and you can look at the logs. I try to forward |
On further searching, this does seem to be what's going on. Github Actions doesn't evaluate the YML inside of a shell context (see https://github.community/t5/GitHub-Actions/Set-env-to-command-output/td-p/30322). I guess I could just define it in the script or perhaps for Github Actions cibuildwheel could evaluate |
Those threads look like they might contain solutions, but we've also discussed the possibility of a otherwise, some people have worked around this by using a shell command before invoking cibw, like: run: |
export CIBW_ENVIRONMENT="GITHUB_REF=$GITHUB_REF"
cibuildwheel --output-dir dist |
Evaluating It's a very fine line between having useful abstraction and having a hindersome one :-/ |
It seems that the environment variables passed through
CIBW_ENVIRONMENT
aren't evaluated on Linux. From a first look, it seems thatas_shell_commands()
doesn't use the evaluated environment variables.https://github.com/joerick/cibuildwheel/blob/7709989603e88d28419bb936c46d1030a0aefaf3/cibuildwheel/linux.py#L145
https://github.com/joerick/cibuildwheel/blob/7709989603e88d28419bb936c46d1030a0aefaf3/cibuildwheel/environment.py#L76-L77
https://github.com/joerick/cibuildwheel/blob/7709989603e88d28419bb936c46d1030a0aefaf3/cibuildwheel/environment.py#L56-L57
This wouldn't be an issue on Windows or macOS as they seem to use
as_dictionary
which uses the evaluated values.The text was updated successfully, but these errors were encountered: