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

Cannot provide libsodium without extra config #129

Open
ThetaSinner opened this issue Mar 16, 2024 · 1 comment
Open

Cannot provide libsodium without extra config #129

ThetaSinner opened this issue Mar 16, 2024 · 1 comment

Comments

@ThetaSinner
Copy link
Contributor

Currently the libsodium crate isn't building because there's a hash mismatch on the file its downloading. On its own that's a little concerning but it should be possible to provide a libsodium another way.

The following Nix shell hook should be enough to instruct libsodium-sys-stable to link against the libsodium that I'm providing

export SODIUM_LIB_DIR="${pkgs.libsodium}/lib/"
export SODIUM_SHARED="1"

Unfortunately, this fails with:

Caused by:
  process didn't exit successfully: `/home/thetasinner/source/projectname/target/debug/build/lair_keystore-523f875434d8fda4/build-script-build` (exit status: 127)
  --- stderr
  /home/thetasinner/source/projectname/target/debug/build/lair_keystore-523f875434d8fda4/build-script-build: error while loading shared libraries: libsodium.so.26: cannot open shared object file: No such file or directory
warning: build failed, waiting for other jobs to finish...

That means the build.rs for lair_keystore can't be compiled because it can't find the libsodium I'm asking it to link with. I don't fully get why but I'm assuming the build process for build scripts differs in some way to the way Cargo builds crates. Just depending on lair_keystore_api in my project works fine, but as soon as lair_keystore is pulled in it breaks... so I'm fairly sure I've configured everything right.

The only workaround for this I can find is to set export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SODIUM_LIB_DIR. That does work but it's requiring me to set something that is linker specific, outside the Cargo build process which is more likely to break than I'd like.

Is there any way the build dependency on lair_keystore_api from lair_keystore can be dropped to make this build configuration simpler?

@ThetaSinner ThetaSinner changed the title Cannot provide libsodium Cannot provide libsodium without extra config Mar 16, 2024
@ThetaSinner
Copy link
Contributor Author

The download seems to have been fixed now, that's good. Still think it's important to be able to configure the libsodium build through Lair

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

1 participant