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

Please consider making a build script to build the actual C library #63

Closed
ehiggs opened this issue Jun 9, 2016 · 4 comments
Closed

Comments

@ehiggs
Copy link

ehiggs commented Jun 9, 2016

The crates documentation discusses build scripts where you would have a git submodule in tree which is built. Usually this is done in a separate -sys crate but there's no requirement. Building the underlying library is done because there is a desire to reduce the dependencies on system wide installed libraries since it results in inconsistent behaviour. It also means that when cargo has built a package, it's ready to go and doesn't result in errors like these.

@dwrensha
Copy link
Member

dwrensha commented Jun 12, 2016

Interesting suggestion! I guess we could basically follow the pattern of libgit2-sys and add a submodule pointing to the capnp compiler source code. I think it would make sense to bundle this as part of the capnpc crate rather than create an entirely new crate. Note that the -sys suffix usually implies linking to native libraries and using the foreign function interface --- which capnpc does not do. Rather, it is a "schema compiler plugin", and invokes the upstream capnp as an executable, not a library.

Note also that building the capnp executable requires a recent-ish c++ compiler plus autotools or cmake. So it's not like we'd be completely eliminating the dependencies on non-Rust things.

@ehiggs
Copy link
Author

ehiggs commented Aug 31, 2016

I guess we could basically follow the pattern of libgit2-sys and add a submodule pointing to the capnp compiler source code. I think it would make sense to bundle this as part of the capnpc crate rather than create an entirely new crate.

I think that's a good idea. The crates that @alexcrichton works on also tend to use pkg-config and a few other heuristics to see if a library is installed. This could be used to see if capnp is installed.

Note that the -sys suffix usually implies linking to native libraries and using the foreign function interface --- which capnpc does not do. Rather, it is a "schema compiler plugin", and invokes the upstream capnp as an executable, not a library.

I hadn't realized that when I made the ticket. I'm not sure how that is/should be handled.

Note also that building the capnp executable requires a recent-ish c++ compiler plus autotools or cmake. So it's not like we'd be completely eliminating the dependencies on non-Rust things.

Maybe just sticking the dependencies and required versions in the README.md will be 70-80% of the solution.

@tv42
Copy link

tv42 commented Dec 29, 2023

This is the same as option 2 in #182. I think that issue is a better overview into this problem (even if it came later) -- maybe close this one as duplicate?

@dwrensha
Copy link
Member

Closing as a duplicate of #182.

@dwrensha dwrensha closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2023
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

3 participants