You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Set build-time env vars about the current build for scripts to use #944
We already set CIBUILDWHEEL=1 for our builds, so we could add CIBUILDWHEEL_BUILD_IDENTIFIER - the CIBUILDWHEEL prefix distinguishing these variables from CIBW options.
Or just CIBUILDWHEEL_BUILD might work.
An arch variable was also mooted, which might be easier to switch on. In this naming structure, that would be CIBUILDWHEEL_BUILD_ARCH
The build identifier is not singular during the before-all step, though possibly we could set it to a list of build identifiers? That would have the handy feature that the suffix of the list would always be the correct suffix, because that cannot change for a batch.
The BUILD_ARCH would still be handy, especially for build-all, and easier to set. For @hynek's case, though, I'd argue it's the wrong solution - for making decisions inside your Python build backend (setuptools, in this case), you want to avoid CIBW specific controls so that you can also support Conda-build and other build tooling. It's really only for use in before-all and before-build.
I'd be more than more happy to see better solutions – I'm sure I'm not the only one with this problem. :)
If I could just set ARGON2_CFFI_USE_SSE2=0 whenever cross-compiling to non-amd64, that would be even better. Right now, I'm parsing ARCHFLAGS tho which is unfortunate. :D
If I could just set ARGON2_CFFI_USE_SSE2=0 whenever cross-compiling to non-amd6
I'd say this is a non-ideal solution too, as it requires special setup to cross compile unique to your project. An ideal solution would work if anyone was cross compiling (such as in conda-build, etc), and would not tied to cibuildwheel at all. The ARCHFLAGS is how setuptools is configured to cross-compile on macOS, so I don't think it's bad - using that will work for everyone who tries to cross compile, not just a cibuildwheel setup. I left some comments on improving it, though.
(Correction: not that bad, didn't really pay attention to what you were specifying with the variable. I'd still say that the default for ARGON2_CFFI_USE_SSE2 should be smart, though, and pick up on cross compiling via ARCHFLAGS.)
Activity
henryiii commentedon Nov 30, 2021
The build identifier is not singular during the before-all step, though possibly we could set it to a list of build identifiers? That would have the handy feature that the suffix of the list would always be the correct suffix, because that cannot change for a batch.
The BUILD_ARCH would still be handy, especially for build-all, and easier to set. For @hynek's case, though, I'd argue it's the wrong solution - for making decisions inside your Python build backend (setuptools, in this case), you want to avoid CIBW specific controls so that you can also support Conda-build and other build tooling. It's really only for use in before-all and before-build.
hynek commentedon Nov 30, 2021
I'd be more than more happy to see better solutions – I'm sure I'm not the only one with this problem. :)
If I could just set
ARGON2_CFFI_USE_SSE2=0whenever cross-compiling to non-amd64, that would be even better. Right now, I'm parsingARCHFLAGStho which is unfortunate. :Dhenryiii commentedon Nov 30, 2021
I'd say this is a non-ideal solution too, as it requires special setup to cross compile unique to your project. An ideal solution would work if anyone was cross compiling (such as in conda-build, etc), and would not tied to cibuildwheel at all. The ARCHFLAGS is how setuptools is configured to cross-compile on macOS, so I don't think it's bad - using that will work for everyone who tries to cross compile, not just a cibuildwheel setup. I left some comments on improving it, though.
henryiii commentedon Nov 30, 2021
(Correction: not that bad, didn't really pay attention to what you were specifying with the variable. I'd still say that the default for
ARGON2_CFFI_USE_SSE2should be smart, though, and pick up on cross compiling viaARCHFLAGS.)henryiii commentedon Nov 30, 2021
I think making this smarter is likely the best way to go, but of course you can do this if you want.
Just be warned that this will replace rather than augment your environment if you've set it at any higher cibuildwheel level.
joerick commentedon Jun 17, 2022
PRs would be welcome for this!
feat: add CIBUILDWHEEL_BUILD_IDENTIFIER environment variable (pypa#2872)