-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Support cargo (Rust) libraries #20619
Comments
Can you provide more build documentation for cargo? |
As per the docs https://github.com/rust-lang/cargo, The pre-compiled package is available for different platforms and compilers. It also allows unattended install with specifying CLI options. Custom installation path can be set with environment variables, see rust-lang/rustup#618 (comment) |
@HappySeaFox The last question is: are there other libraries that can be compiled with cargo? |
That's a good question. I haven't done any research as resvg is the only Rust lib I need. However, to support |
This would be neat. I have an odd use case for this which I don't think I'd try to upstream, but it could be a nice hack for our overlay. In Mixxx we use sccache, which is a Rust program, for complier caching on Windows with MSVC. It would be nice if vcpkg could automatically install this as a build tool along with the libraries the application uses. FWIW there is a Rust crate to do the opposite and integrate vcpkg into Cargo. |
Rust libraries are can be easily converted to FFI compatible libraries, for example, crypto-crawler-ffi. If vcpkg supports building cargo projects out-of-box, many rust libraries can be imported to vcpkg.io. |
It looks like rustup doesn't provide a full tarball, but uses the built-in management tools to install and manage its dependencies. |
I think the question here might not be getting Although it seems that And since I'm not quite familiar with vcpkg and how it works now (I saw discussion in #15441 but still not quite clear), I have no idea how Rust support can be added to vcpkg, or how possible/difficult it can be. What I know is that most C/C++ projects uses CMake or Makefile to manage the build, while Rust projects use Anyway I believe it would be nice if some Rust libraries can be brought onto vcpkg, like besides the |
Looking at how Debian packages librsvg (no resvg): |
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment. |
I've added experimental support for a Rust/Cargo package on ConanCenter, if it helps: https://github.com/valgur/conan-center-index/tree/dev/recipes/rust/all I've found Rust support necessary/useful for a few libraries: Unfortunately, while Also, Rust-based libraries tend to be picky about the version of the Rust toolchain used to build them. Vcpkg generally always wants to use the latest version of any packages. Would this be a problem or can this be simply overridden in |
Is your feature request related to a problem? Please describe.
Some Rust libraries can be built with
cargo
tool into aC
library with dll+lib files. For example,resvg
. It would be great to enablevcpkg
to build such libraries.For example: to compile
resvg
C binding:rustup-init.exe
from https://www.rust-lang.org/tools/installresvg
:This creates
resvg.dll
andresvg.dll.lib
.Proposed solution
Add
cargo
as build tool.Describe alternatives you've considered
-
Additional context
-
The text was updated successfully, but these errors were encountered: