Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSystem dependencies #145
Comments
This comment has been minimized.
This comment has been minimized.
|
@wycats and I also discussed this at great length, and we ended up coming to a very similar but slightly tweaked solution. The main idea is a syntax extension: https://github.com/alexcrichton/link-config. At compile-time the syntax extension detects It's still a work in progress, but I don't think that we need a |
This comment has been minimized.
This comment has been minimized.
|
In fact I had a similar idea a few days ago, but with CMake: https://github.com/Tomaka17/cmake-rs The problem I encountered is that I couldn't detect the path where to put the libraries (ie. |
This comment has been minimized.
This comment has been minimized.
Cargo passes |
This comment has been minimized.
This comment has been minimized.
But this is only for the If you implement a syntax extension, then you need to pass these variables when building regular targets, except if your idea is to write |
This comment has been minimized.
This comment has been minimized.
|
The purpose of the syntax extension is to discover native dependencies, not to build them currently. This could be expanded in the future, however. |
This comment has been minimized.
This comment has been minimized.
|
This solution does not solve the problem posed by libraries like rust_stb_image. |
This comment has been minimized.
This comment has been minimized.
|
That is the intention of the
|
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton can you elaborate how the syntax extension will get cargo to add an additional |
This comment has been minimized.
This comment has been minimized.
|
That's one of the drawbacks of the current syntax extension. You can compile a crate locally by adding extra |
steveklabnik
referenced this issue
Aug 12, 2014
Closed
Feature request: add possibility to use system-wide installed packages #359
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton we should decide on some canonical solution to this problem, implement what we need to, and then document it. This seems like a somewhat common problem, and even if the solution is somewhat involved, having a clear path for people (ideally as portable as possible) would help a lot. |
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
added
the
A-linkage
label
Oct 13, 2014
This comment has been minimized.
This comment has been minimized.
|
Now that #792 is landed, I think this is basically done. I've included documentation for our solution to this problem in that PR (will soon be pushed to doc.crates.io). If you have any questions, feel free to ask me! |
cmr commentedJul 8, 2014
Fairly long discussion: https://gist.github.com/cmr/10e1633ba7e9569af4b9
The takeway, I think, is that there will be a
pkg-*class of packages. These will integrate with pkg-config to query how to link to a given system dependency, with the ability to fall back on a bundled version that is then built.