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

build.rs script is missing rerun-if-env-changed indicators #101

Open
orlp opened this issue Aug 12, 2024 · 4 comments
Open

build.rs script is missing rerun-if-env-changed indicators #101

orlp opened this issue Aug 12, 2024 · 4 comments

Comments

@orlp
Copy link

orlp commented Aug 12, 2024

The build.rs script for jemallocator should output cargo::rerun-if-env-changed=VAR for each variable that its behavior depends on. One example where this currently goes wrong is if you specify environment variables in the [env] section of .cargo/config.toml and then change them.

@BusyJay
Copy link
Member

BusyJay commented Aug 13, 2024

Do you have a reproduce repo?

@orlp
Copy link
Author

orlp commented Aug 13, 2024

Sure, just use jemalloc in an otherwise empty new binary crate Then add .cargo/config.toml with

[env]
JEMALLOC_SYS_WITH_MALLOC_CONF = "stats_print:false"

and cargo build the crate. Now edit `.cargo/config.toml to

[env]
JEMALLOC_SYS_WITH_MALLOC_CONF = "stats_print:true"

Now jemalloc should be re-built and stats printed when you do cargo run, but it doesn't.

@BusyJay
Copy link
Member

BusyJay commented Aug 13, 2024

Perhaps it's an issue about your setup or cargo itself, I can see jemalloc-sys does respect environment variable changes:

> env JEMALLOC_SYS_WITH_MALLOC_CONF="stats_print:false" cargo build
   Compiling tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 29.56s
> env JEMALLOC_SYS_WITH_MALLOC_CONF="stats_print:true" cargo build
   Compiling tikv-jemalloc-sys v0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 29.68s
> env JEMALLOC_SYS_WITH_MALLOC_CONF="stats_print:true" cargo build
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s

@orlp
Copy link
Author

orlp commented Aug 13, 2024

Those are not the reproduction steps I mentioned.

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