-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,7 @@ Cargo.lock | |
target/ | ||
.vscode/ | ||
vcp/ | ||
|
||
.DS_Store | ||
|
||
.idea/ | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,8 +390,17 @@ fn find_vcpkg_target(cfg: &Config, target_triplet: &TargetTriplet) -> Result<Vcp | |
let vcpkg_root = try!(find_vcpkg_root(&cfg)); | ||
try!(validate_vcpkg_root(&vcpkg_root)); | ||
|
||
let mut base = vcpkg_root.clone(); | ||
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 commentThe 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 What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 (sry I could only reply now, I was on holiday for the past few days) |
||
&& Path::exists(cargo_base_path.join("vcpkg.json").as_path()); | ||
|
||
let mut base = if !is_manifest_mode { | ||
vcpkg_root.join("installed") | ||
} else { | ||
cargo_base_path.join("vcpkg_installed") | ||
}; | ||
|
||
let status_path = base.join("vcpkg"); | ||
|
||
base.push(&target_triplet.triplet); | ||
|
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