Skip to content
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 broken in 1.5.3 #406

Closed
YannickJadoul opened this issue Jul 19, 2020 · 1 comment · Fixed by #408
Closed

CIBW_ENVIRONMENT broken in 1.5.3 #406

YannickJadoul opened this issue Jul 19, 2020 · 1 comment · Fixed by #408

Comments

@YannickJadoul
Copy link
Member

Somehow, my line of export CIBW_ENVIRONMENT='... CCACHE_BASEDIR=python -c "import tempfile; import os; print(os.path.realpath(tempfile.gettempdir()))" ...' (see https://github.com/YannickJadoul/Parselmouth/blob/1f3dd9abc63afdf4a1d26db40d210bb4187118a8/.travis.yml#L143; yes, I know I ought to clean this up) breaks:

    + /bin/true
    + mkdir -p /project
    + /opt/python/cp38-cp38/bin/python -c 'import sys, json, os; json.dump(os.environ.copy(), sys.stdout)'
    + uname -i
x86_64
    + python -c import 'tempfile;' import 'os;' 'print(os.path.realpath(tempfile.gettempdir()))'
  File "<string>", line 1
    import

See https://travis-ci.org/github/YannickJadoul/Parselmouth/jobs/709679114#L392

I'll start investigating, but is this perhaps related to #403, @joerick?

@YannickJadoul
Copy link
Member Author

OK, got it.

Simplified example:

from cibuildwheel import environment
print(environment.parse_environment('X=`python -c "import antigravity"`').as_dictionary({}))

What's going wrong is that node.word is not the same as node.word is not the same as context.input[part.pos[0]:part.pos[1]] (the latter includes the quotes, the first one doesn't), so cibuildwheel loses the quotes, ends up with python -c import antigravity, which gets split by shlex.split into 4 parts, rather than 3.

Let's see if I can make a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant