Do not override the normal algorithm for finding config.toml files#384
Do not override the normal algorithm for finding config.toml files#384netsweng wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates cargo xtask precheck to stop hardcoding a .cargo/config.toml lookup path and instead rely on Cargo’s default config discovery, while adding a --config passthrough so CI/pipelines can supply an explicit Cargo config override when needed.
Changes:
- Removed custom
.cargo/config.tomlpath probing logic fromprecheck. - Added a
--configCLI option toprecheckand wired it into theSetupsubtask.
Comments suppressed due to low confidence (1)
xtask/src/precheck.rs:129
self.configis moved intoSetup(config: self.config), which partially movesselfand will prevent later use of other non-Copy fields (e.g.,self.exclude,self.package, etc.) in this function. Clone or take the value (e.g.,config: self.config.clone()orfn run(mut self, ..)+self.config.take()) to avoid a borrow-checker error.
if stage.setup || stage.all {
Setup {
force: false,
config: self.config,
skip_taplo: self.skip_taplo,
skip_audit: self.skip_audit,
skip_openssl: self.skip_openssl,
}
.run(ctx.clone())?;
as the 2 choices encoded here do not cover all situations. Instead, leave the default to let cargo do it's normal thing, but add a --config option so pipelines can pass something in for unusual cases.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
3e4a9f5 to
ece9204
Compare
| Setup { | ||
| force: false, | ||
| config: Some(config_path), | ||
| config: self.config, |
There was a problem hiding this comment.
will users need to pass this config when running precheck either when enlisted with azihsm-sdk or its other counterpart location?
There was a problem hiding this comment.
mostly in the other location. Default in azihsm-sdk seem to do the right thing already.
There was a problem hiding this comment.
We need to ensure that cargo xtask precheck can work on any location that we regularly use for development without having to pass additional arguments manually.
There was a problem hiding this comment.
pipelines can pass overrides and that is ok, user shouldnt have to pass it for local runs on devbox
There was a problem hiding this comment.
config.toml is in the expected location withing the azihsm-sdk tree. By removing the hardcoded paths here, the default behavior of walking up the tree as many levels as is needed should once again be in effect.
Do not override the normal algorithm for finding config.toml files as the 2 choices encoded here do not cover all situations. Instead, leave the default to let cargo do it's normal thing, but add a --config option so pipelines can pass something in for unusual cases.