-
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
Manifest mode #42
Manifest mode #42
Conversation
.DS_Store for Mac users .idea for IntelliJ users
if this var exists, vcpkg-rs will check for installed packages in the rust project dir
optionally manifest mode can be disabled by setting `VCPKGRS_IGNORE_MANIFEST_MODE`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple comments.
Would be good to add some way to test, maybe something simple like systest/
but via manifest mode?
|
||
.DS_Store | ||
|
||
.idea/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are okay to add, though I would prefer to see them in their own PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I can remove these changes from this PR and open a separate one.
Edit: #43
base.push("installed"); | ||
let cargo_base_path = | ||
PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("we use cargo, this exists")); | ||
let is_manifest_mode = env::var_os("VCPKGRS_IGNORE_MANIFEST_MODE").is_none() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this.
Thinking more about this, I think perhaps this is the wrong approach. Exposing another environment variable here to disable manifest mode in the presence of the json file seems overly complicating to add to the exposed interface, feels like a "you aren't going to need it" sort of feature.
I think perhaps a more useful approach would be to defer back to your original change without the environment variable override, but we add some sanity checks at the end here to verify that the target installed directory exists? That way, we can give a useful error message depending on whether manifest mode or not was used (telling the user to run either cargo vcpkg install
for non-manifest mode, and vcpkg(.exe) install
when manifest mode is detected), and otherwise we just make it silently work.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially introduced this variable because of your comment on the issue that it should do the right thing by default but could also be disabled 😅
Just to make sure I understand you correctly: You suggest to add some sanity checks together with having VCPKGRS_MANIFEST_MODE
. If the user sets this variable, we check if that makes sense and, if it doesn't, we return an error. That works for me as well, but then the user would always have to set the variable.
(sry I could only reply now, I was on holiday for the past few days)
I'll look into adding a test for this as well. Edit: I will also add a bit more documentation for this feature to the readme as soon as we have settled for an approach. |
Any progress here? |
This PR adds support for the manifest mode of vcpkg as discussed in issue #41.
By default it will be checked if a
vcpkg.json
file exists. If the user does not explicitly state that they don't want to use manifest mode by settingsVCPKGRS_IGNORE_MANIFEST_MODE
vcpkg-rs
will check for dependencies in$CARGO_MANIFEST_DIR/vcpkg_installed
.