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

pc file includes absolute paths #340

Open
nmattia opened this issue Dec 16, 2024 · 0 comments
Open

pc file includes absolute paths #340

nmattia opened this issue Dec 16, 2024 · 0 comments
Labels

Comments

@nmattia
Copy link

nmattia commented Dec 16, 2024

Hi,

I've noticed that the .pc file generated by the pkg-config call in libssh2-sys's build.rs includes absolute paths to the build directory. This causes issues for build systems that check the build output for reproducibility (and my particular case leads to cache misses for prebuilt artifacts).

Would things break if the paths were relative or if the .pc file simply wasn't generated? I'm using this as a workaround for now:

diff --git a/build.rs b/build.rs
index c4425ee..f99f132 100644
--- a/build.rs
+++ b/build.rs
@@ -173,6 +173,7 @@ fn main() {
         .unwrap();
     let version = &version_line[version_line.find('"').unwrap() + 1..version_line.len() - 1];
 
+    /*
     let pkgconfig = dst.join("lib/pkgconfig");
     fs::create_dir_all(&pkgconfig).unwrap();
     fs::write(
@@ -188,6 +189,7 @@ fn main() {
             .replace("@LIBSSH2VER@", version),
     )
     .unwrap();
+    */
 
     cfg.warnings(false);
     cfg.compile("ssh2");
nmattia added a commit to dfinity/ic that referenced this issue Dec 16, 2024
This adds a patch that prevents `libssh2-sys` from generating a `.pc`
file. The pkg-config file includes absolute paths which makes it
non-deterministic.

See: alexcrichton/ssh2-rs#340
nmattia added a commit to dfinity/ic that referenced this issue Dec 16, 2024
This adds a patch that prevents `libssh2-sys` from generating a `.pc`
file. The pkg-config file includes absolute paths which makes it
non-deterministic.

See: alexcrichton/ssh2-rs#340
github-merge-queue bot pushed a commit to dfinity/ic that referenced this issue Dec 16, 2024
This adds a patch that prevents `libssh2-sys` from generating a `.pc`
file. The pkg-config file includes absolute paths which makes it
non-deterministic.

See: alexcrichton/ssh2-rs#340

---------

Co-authored-by: IDX GitHub Automation <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants