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

Use rerun-if-env-changed in libsqlite3-sys #329

Closed
Diggsey opened this issue Feb 14, 2018 · 4 comments · Fixed by #344
Closed

Use rerun-if-env-changed in libsqlite3-sys #329

Diggsey opened this issue Feb 14, 2018 · 4 comments · Fixed by #344
Assignees

Comments

@Diggsey
Copy link

Diggsey commented Feb 14, 2018

Build scripts which access environment variables should output lines like:

cargo:rerun-if-env-changed=PATH
cargo:rerun-if-env-changed=SQLITE3_LIB_DIR

To indicate that cargo should rerun the build script if those environment variables change.

Without that, it is confusing for people building crates which depend on this one, because even after they configure their environment, the build will fail until they run cargo clean.

@gwenn gwenn self-assigned this Apr 6, 2018
gwenn added a commit to gwenn/rusqlite that referenced this issue Apr 6, 2018
@gwenn
Copy link
Collaborator

gwenn commented Apr 6, 2018

@Diggsey Would you mind give #344 a try ?

@Boscop
Copy link

Boscop commented Dec 9, 2018

Is it really necessary to rebuild libsqlite3-sys just because PATH changed?
I think this is the cause of my issue https://github.com/jgallagher/rusqlite/issues/435
Would it be possible to exclude PATH from the set of env vars used with rerun-if-env-changed? :)

@gwenn
Copy link
Collaborator

gwenn commented Dec 9, 2018

@Boscop
Copy link

Boscop commented Feb 8, 2020

@gwenn
Please don't rebuild when the PATH env var changes. It is still SO annoying every day because it massively increases my build times every time when doing cargo check in Sublime and cargo run in the console (because cargo prepends %HOME%\.cargo\bin to PATH even if it's already in PATH).
It causes a rebuild of diesel, migrations_internals, r2d2-diesel, migrations_macros, diesel_migrations and my workspace's crates that depend on diesel. Every time!
It's especially annoying with cargo watch -x run and makes cargo-watch unuseable..

(Please at least allow opting out of the rebuild via a feature flag, but better not do this at all, because a feature flag would require using a [patch] override.)

It should be sufficient to rebuild when the sqlite-specific env vars change!

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.

3 participants