-
Notifications
You must be signed in to change notification settings - Fork 22
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 override vcpkg installed dir #49
Conversation
Thank you for your submission! This looks reasonable to me in isolation, although I don't feel like I understand the broader context of when this mode is useful. (Which is just a matter of my ignorance, not a problem with the PR.) |
In a hybrid C++/Rust project, one can use a vcpkg.json manifest file to manage vcpkg installations. The path for vcpkg installations can be altered to any desired location using CMake. 'vcpkg-rs' thus can be a bridge between the existing vcpkg installation and Rust, even in manifest mode. |
@waych Any feedback on this one? |
Hmm. My initial thought is that this is fine and can go in as is. Thinking longer term, I'm not particularly fond of the way this extends the interface on the Config directly, because this can cause problems with dependent crates that also want to pull in vcpkg dependencies. This makes me think that perhaps we should be propagating this information down through the crate dependencies somehow so that dependent crates' vcpkg dependencies can be fulfilled by a single top level vcpkg.json manifest. Given that there isn't any good way for the top-level crate to pass this information to dependent crates (?) from build.rs, it seems perhaps it would be clearer, although maybe more inconvenient to be passing this installed path via an environment variable where all vcpkg-rs::Config's in the build tree see the same thing. That said I think this is okay for now given the problem already exists in the config interface with the existing |
Hmmm. I can see how environment variables can address the issue you raise, although I guess it's less "passing information from the top-level crate to dependents" and more "user specifies global-level information". Maybe there would be some way to specify this configuration, or where to find this configuration, in the Cargo.toml metadata? I am wondering if Anyway, since I definitely don't have a strong feeling about how to do a better job of solving this problem, I'm also in favor of merging this PR. |
Thank you for those good reviews. I think perhaps adding environment variable like |
OK; more to do on this topic, but I've merged this piece. |
This might be more generic than #42 . As manifest mode is a sub case of overriding an existing vcpkg installed directory, So this pr is made.