nanomsg.rs
nanomsg.rs copied to clipboard
Ability to pass directory of C library
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.
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.
@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
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
?
@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?
@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.
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