-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Only use cargo-vendor if building from git sources #41047
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
Changes from 2 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 |
---|---|---|
|
@@ -162,6 +162,7 @@ pub struct Build { | |
cxx: HashMap<String, gcc::Tool>, | ||
crates: HashMap<String, Crate>, | ||
is_sudo: bool, | ||
src_is_git: bool, | ||
} | ||
|
||
#[derive(Debug)] | ||
|
@@ -233,6 +234,7 @@ impl Build { | |
}; | ||
let rust_info = channel::GitInfo::new(&src); | ||
let cargo_info = channel::GitInfo::new(&src.join("cargo")); | ||
let src_is_git = src.join(".git").is_dir(); | ||
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. This won't work if rust itself is a git submodule. Checking if .git exists at all would be an improvement. 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. Hmm, I thought it was better to be more precise, but I see your point. I'll check just for existence. 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.e. using 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. Or |
||
|
||
Build { | ||
flags: flags, | ||
|
@@ -251,6 +253,7 @@ impl Build { | |
lldb_version: None, | ||
lldb_python_dir: None, | ||
is_sudo: is_sudo, | ||
src_is_git: src_is_git, | ||
} | ||
} | ||
|
||
|
@@ -307,10 +310,7 @@ impl Build { | |
OutOfSync, | ||
} | ||
|
||
if !self.config.submodules { | ||
return | ||
} | ||
if fs::metadata(self.src.join(".git")).is_err() { | ||
if !self.src_is_git || !self.config.submodules { | ||
return | ||
} | ||
let git = || { | ||
|
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.
doesn't this allow the build to use an installed cargo-vendor of the wrong version?
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.
Maybe so, but FWIW I didn't really change any of these lines, only their indentation.