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 fails due to missing libpq (#213) #220

Closed
wants to merge 2 commits into from
Closed

Conversation

davepacheco
Copy link
Collaborator

No description provided.

@davepacheco
Copy link
Collaborator Author

See #213 for context. This change moves us to our local fork of pq-sys. I'm also going to try moving us to a modern nightly toolchain, since that's necessary for that workaround to work.

@davepacheco
Copy link
Collaborator Author

This felt so promising, but I don't think it works. The fix works for binaries generated within the pq-sys crate. But from omicron, although we pass the right linker flag:

dap@helios omicron $ cargo clean -p pq-sys
dap@helios omicron $ cargo build -vv -p pq-sys
   Compiling pq-sys v0.4.6 (https://github.com/oxidecomputer/pq-sys?branch=oxide#580b9da9)
     Running `CARGO=/home/dap/.rustup/toolchains/nightly-2021-09-03-x86_64-unknown-illumos/bin/cargo CARGO_CRATE_NAME=build_script_build CARGO_MANIFEST_DIR=/home/dap/.cargo/git/checkouts/pq-sys-b85381a66dd4f47f/580b9da CARGO_PKG_AUTHORS='Sean Griffin <sean@seantheprogrammer.com>' CARGO_PKG_DESCRIPTION='Auto-generated rust bindings for libpq' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=pq-sys CARGO_PKG_REPOSITORY='https://github.com/sgrif/pq-sys' CARGO_PKG_VERSION=0.4.6 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=4 CARGO_PKG_VERSION_PATCH=6 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/home/dap/omicron/target/debug/deps:/home/dap/.rustup/toolchains/nightly-2021-09-03-x86_64-unknown-illumos/lib:/home/dap/.rustup/toolchains/nightly-2021-09-03-x86_64-unknown-illumos/lib' rustc --crate-name build_script_build /home/dap/.cargo/git/checkouts/pq-sys-b85381a66dd4f47f/580b9da/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=85f15dd7fd2f49e2 -C extra-filename=-85f15dd7fd2f49e2 --out-dir /home/dap/omicron/target/debug/build/pq-sys-85f15dd7fd2f49e2 -L dependency=/home/dap/omicron/target/debug/deps --cap-lints warn`
     Running `/home/dap/omicron/target/debug/build/pq-sys-85f15dd7fd2f49e2/build-script-build`
[pq-sys 0.4.6] cargo:rerun-if-env-changed=PQ_LIB_DIR
[pq-sys 0.4.6] cargo:rerun-if-env-changed=PQ_LIB_STATIC
[pq-sys 0.4.6] cargo:rerun-if-env-changed=TARGET
[pq-sys 0.4.6] cargo:rerun-if-env-changed=PG_CONFIG_X86_64_UNKNOWN_ILLUMOS
[pq-sys 0.4.6] cargo:rustc-link-search=native=/opt/ooce/pgsql-13/lib/amd64
[pq-sys 0.4.6] cargo:rustc-link-arg=-Wl,-R/opt/ooce/pgsql-13/lib/amd64
[pq-sys 0.4.6] cargo:rerun-if-env-changed=PQ_LIB_STATIC_X86_64_UNKNOWN_ILLUMOS
[pq-sys 0.4.6] cargo:rustc-link-lib=pq
     Running `CARGO=/home/dap/.rustup/toolchains/nightly-2021-09-03-x86_64-unknown-illumos/bin/cargo CARGO_CRATE_NAME=pq_sys CARGO_MANIFEST_DIR=/home/dap/.cargo/git/checkouts/pq-sys-b85381a66dd4f47f/580b9da CARGO_PKG_AUTHORS='Sean Griffin <sean@seantheprogrammer.com>' CARGO_PKG_DESCRIPTION='Auto-generated rust bindings for libpq' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=pq-sys CARGO_PKG_REPOSITORY='https://github.com/sgrif/pq-sys' CARGO_PKG_VERSION=0.4.6 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=4 CARGO_PKG_VERSION_PATCH=6 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/home/dap/omicron/target/debug/deps:/home/dap/.rustup/toolchains/nightly-2021-09-03-x86_64-unknown-illumos/lib:/home/dap/.rustup/toolchains/nightly-2021-09-03-x86_64-unknown-illumos/lib' OUT_DIR=/home/dap/omicron/target/debug/build/pq-sys-129650a0a2f9acc9/out rustc --crate-name pq_sys /home/dap/.cargo/git/checkouts/pq-sys-b85381a66dd4f47f/580b9da/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C panic=abort -C embed-bitcode=no -C debuginfo=2 -C metadata=d50eee596e0278df -C extra-filename=-d50eee596e0278df --out-dir /home/dap/omicron/target/debug/deps -L dependency=/home/dap/omicron/target/debug/deps --cap-lints warn -L native=/opt/ooce/pgsql-13/lib/amd64 -l pq -C link-arg=-Wl,-R/opt/ooce/pgsql-13/lib/amd64`
    Finished dev [unoptimized + debuginfo] target(s) in 1.85s

We can see it passing the args at the end there, but they don't do anything because we're not building a dynamic object. And so the RPATH information gets lost. This might doom this whole approach. I'm going to revisit next week.

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 this pull request may close these issues.

1 participant