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

Feature request: CIBW_AFTER_ALL #1329

Closed
smheidrich opened this issue Oct 29, 2022 · 2 comments
Closed

Feature request: CIBW_AFTER_ALL #1329

smheidrich opened this issue Oct 29, 2022 · 2 comments

Comments

@smheidrich
Copy link
Contributor

Description

To allow running commands in Linux1 build containers before any builds are started, cibuildwheel has the CIBW_BEFORE_ALL* env vars. I would like it if there was a complementary CIBW_AFTER_ALL env var to allow running commands after all builds within a container are completed.

This would be useful to e.g. move around cache directories that are specific to the architecture and hence container image used.

In my specific use case, I could probably get around needing this if something like the CIBUILDWHEEL_BUILD_ARCH env var from #944 was implemented and available when the CIBW_ENVIRONMENT* env vars are evaluated and if that evaluation happened separately for each container, because then I could set an architecture-dependent cached directory outside the container to be used directly instead of having to move it around. But others might need this even then because not all build tools are as flexible with directory locations as Cargo.

Related issues:

1 Of course it also works for Mac OS and Windows builds, but in principle it could be replaced by a separate CI step for those and isn't strictly needed.

Build log

No response

CI config

No response

@joerick
Copy link
Contributor

joerick commented Oct 31, 2022

@smheidrich , just so I understand, what are you wanting to do after the build is finished? My confusion is that the container is going to be deleted once it's closed (i.e. immediately after after-all), so I'm not sure what cleanup tasks would actually affect anything. Or are you thinking that the after-all command would run outside the container?

@smheidrich
Copy link
Contributor Author

smheidrich commented Oct 31, 2022

@joerick The basic problem was to have container-specific cache directories, but I only now found out that CIBW_ENVIRONMENT is evaluated inside each container, so the alternative solution I mentioned in the 3rd paragraph above with arch-containing paths defined in CIBW_ENVIRONMENT will work (e.g. using $(uname -m)) and I no longer need to move cache directories around like I thought I'd have to as a workaround.

So at least for my use case this is no longer needed, if anyone has another reason to need this they can ask to reopen or write a new ticket.

Sorry!

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

No branches or pull requests

2 participants