alpm.rs icon indicating copy to clipboard operation
alpm.rs copied to clipboard

alpm & alpm-sys rebuilds every time if the static feature is enabled

Open VorpalBlade opened this issue 1 year ago • 4 comments

I checked even with rust-analyzer not running:

cargo new reproducer
cd reproducer
cargo add alpm --features=static
cargo build
cargo build

VorpalBlade avatar Feb 12 '24 21:02 VorpalBlade

This seems to be part of the problem:

    #[cfg(feature = "static")]
    println!("cargo:rerun-if-changed=/usr/lib/pacman/lib/pkgconfig");

That doesn't actually exist

VorpalBlade avatar Feb 12 '24 22:02 VorpalBlade

It exists if you have pacman-static installed. If the dir doesn't exist this shouldn't trigger a rebuild as there's no change right?

Morganamilo avatar Mar 05 '24 23:03 Morganamilo

I think it's the

  env::set_var("PKG_CONFIG_LIBDIR", "/usr/lib/pacman/lib/pkgconfig");

in the build script triggering a rerun_if_env_changed set by pkgconf. I didnt think a change would trigger itself. There may be a better way to set this.

Morganamilo avatar Mar 05 '24 23:03 Morganamilo

Okay no it is the line you pointed out. Will see if there's a better way to do that.

Morganamilo avatar Mar 05 '24 23:03 Morganamilo