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

Rerun build-script if important variables change. #184

Conversation

de-vri-es
Copy link
Contributor

@de-vri-es de-vri-es commented May 3, 2020

This PR ensures that the build script for torch-sys is rerun when certain environment values are changed. This is limited to environment variables that change the behaviour of the build script that cargo doesn't already know about (so not the ones set by cargo).

This should prevent confusing situations like this: #182 (comment) . A clean build and or incremental build should normally be equivalent.

One downside of this PR: right now, if you build once with the right environment variables, subsequent runs of cargo build with the wrong environment variables won't break your build. On the other hand, this is somewhat unpredictable, as there might be other factors that lead cargo to rebuild your dependencies, and then the environment matters again.

All considered, I believe it's better that changing the environment for incremental builds gets picked up by the build script.

@LaurentMazare
Copy link
Owner

Looks good, thanks!

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 this pull request may close these issues.

2 participants