archlinux / alpm.rs

Rust bindings for libalpm
GNU General Public License v3.0
111 stars 20 forks source link

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

Open VorpalBlade opened 5 months ago

VorpalBlade commented 5 months ago

I checked even with rust-analyzer not running:

cargo new reproducer
cd reproducer
cargo add alpm --features=static
cargo build
cargo build
VorpalBlade commented 5 months ago

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

Morganamilo commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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