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

Ability to pass directory of C library #180

Open
fuine opened this issue Nov 11, 2017 · 6 comments
Open

Ability to pass directory of C library #180

fuine opened this issue Nov 11, 2017 · 6 comments

Comments

@fuine
Copy link

fuine commented Nov 11, 2017

I would like to be able to somehow pass path to the C sources of nanomsg, when feature bundled is set - that way I don't have to rely on git and I can easily choose which version of nanomsg will the crate be compiled against. Is it doable and if so would maintainers consider incorporating this feature into the crate?

I can see that nanomsg-sys checks if nanomsg/.git path exists, but it's not clear to me that working directory is it checking - I have C nanomsg in my project directory as git's submodule but it doesn't look like nanomsg-sys finds it.

@blabaere
Copy link
Collaborator

Compiling with the 'bundle' feature activated has cloned the nanomsg git repository in the nanomsg_sys directory, version 1.0.0. It seems you can control the version of nanomsg that will be included by cloning it manually and checking out the desired tag before building.

If this is not sufficient for your needs I would happily merge any PR that adds this option without breaking the existing behavior.

@fuine
Copy link
Author

fuine commented Nov 11, 2017

@blabaere it doesn't work that way, or I can't get it to work that way - what should be the path of my clone? If I clone it in the main directory of the repository this approach doesn't work - nanomsg.rs will link to version 1.0.0

@blabaere
Copy link
Collaborator

Here is the layout my local clone:

nanomsg.rs/
nanomsg.rs/src
nanomsg.rs/nanomsg_sys
nanomsg.rs/nanomsg_sys/nanomsg
nanomsg.rs/nanomsg_sys/src
nanomsg.rs/examples

The nanomsg folder under nanomsg.rs/nanomsg_sys/ is the clone of the nanomsg git repository.
From what I understand of the build code, if nanomsg/.git exists, this is the code that will be used to build the nanomsg static library.

Does it work for you if you clone the nanomsg git repository under nanomsg_sys ?

@fuine
Copy link
Author

fuine commented Dec 1, 2017

@blabaere oh I thought that there might be a way to just include C sources in a submodule, but you suggest putting both nanomsg.rs and nanomsg sources into submodules? Do you know if there's a way to include C sources only?

@blabaere
Copy link
Collaborator

blabaere commented Dec 1, 2017

@fuine I have not thought of the problem any further than getting the rust library to compile a locally modified C library. I now understand that you want to setup your working environment to actually work on the nanomsg source but use it from a rust progrem, is that correct ? If it is, I guess that making nanomsg a submodule of nanomsg.rs, right inside the nanomsg_sys directory is the way to go. But that's only a guess since I have never worked with submodules.

@fuine
Copy link
Author

fuine commented Dec 1, 2017

Sort of, I would like to use a different version than 1.0 and I figured that the only real way to do this would be to maintain C sources as a submodule, but then I'd need to point nanomsg.rs to these sources

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