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

Add libsodium feature in the crate #32

Closed
conanoc opened this issue Oct 10, 2023 · 6 comments
Closed

Add libsodium feature in the crate #32

conanoc opened this issue Oct 10, 2023 · 6 comments

Comments

@conanoc
Copy link

conanoc commented Oct 10, 2023

libsodium feature is only in the testcrate. Can we have it in the zeromq-src crate also?

@jean-airoldie
Copy link
Owner

The test crate does nothing special. You can simply copy the configuration to your own crate if you need to link to libsodium.

@conanoc
Copy link
Author

conanoc commented Oct 10, 2023

I see. The testcrate is just an example to show how to link to libsodium.
It is not clear how to use DEP_SODIUM_LIB and DEP_SODIUM_INCLUDE in the build.rs of testcrate. Must I set env variables? or I can use any static strings for lib_dir and include_dir to create zeromq_src::LibLocation::new(lib_dir, include_dir)?

I thought the reason that rust-zmq does not support libsodium was because zeromq-src does not support it. Do you have any idea?

@jean-airoldie
Copy link
Owner

The DEP_* env variables are produced during the build and are specific to each library. The specific variables you talk about are described here. In this case they are used to indicate the locations of files for the build script.

See this link for more information.

I thought the reason that erickt/rust-zmq#357 was because zeromq-src does not support it. Do you have any idea?

There's no reason why libsodium wouldn't be supported. Last time I used zeromq (about 6 years ago), it could link to libsodium just fine. Could be a bug in the windows build script, based on the issue you showed.

@jean-airoldie
Copy link
Owner

You can take a look at this archived repo for an example that should work.

@conanoc
Copy link
Author

conanoc commented Oct 11, 2023

Those env variables are set by sodium side and zmq builders can use them. testcrate's build.rs demonstrates it. Thank you for your kind explanation.

@jean-airoldie
Copy link
Owner

jean-airoldie commented Oct 11, 2023

You're welcome.

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