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

Thrussh crate fails to build #3016

Open
kyle-figure opened this issue Nov 21, 2024 · 1 comment
Open

Thrussh crate fails to build #3016

kyle-figure opened this issue Nov 21, 2024 · 1 comment

Comments

@kyle-figure
Copy link

kyle-figure commented Nov 21, 2024

Hello, apologies if this is the wrong place to post a crate build issue but I haven't found this mentioned anywhere else yet.

I am using the direct Bazel dependency method through Bzlmod following the example here.

When I build Thrussh, I get the following error:

thread 'main' panicked at external/rules_rust~~crate~crates__libsodium-sys-0.0.10/build.rs:18:47:
called `Result::unwrap()` on an `Err` value: "\npkg-config exited with status code 1\n> PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libsodium\n\nThe system library `libsodium` required by crate `libsodium-sys` was not found.\nThe file `libsodium.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.\nThe PKG_CONFIG_PATH environment variable is not set.\n\nHINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libsodium.pc`.\n"

Full error here:
build_error.txt

Does rules_rust set up this PKG_CONFIG_PATH correctly? What can I do to debug further and possibly patch this build error?

MODULE.bazel

bazel_dep(name = "rules_rust", version = "0.54.1")
RUST_EDITION = "2021"
RUST_VERSION = "1.82.0"
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
    edition = RUST_EDITION,
    versions = [RUST_VERSION],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.spec(package = "thrussh", version = "0.35.6")
crate.from_specs()
use_repo(crate, "crates")

Command: bazel build @crates//:thrussh
Platform: Ubuntu 22.04 x86_64

@illicitonion
Copy link
Collaborator

rules_rust doesn't automatically set anything up for pkgconfig - if you want to use pkgconfig, you'll need to set it up yourself.

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