Skip to content

Commit f8f7eb5

Browse files
authored
refactor(gctx): extract config schema to a module (#16195)
### What does this PR try to resolve? Make config schema types a bit more outstanding from the way-too-long `context/mod.rs` module. The long-term(-and-hard-to-achieve) is to make a similar crate like `cargo-util-schemas` for config, or just make these schemas into `cargo-util-schemas`. ### How to test and review this PR? This may conflict with #16194
2 parents f7acf44 + b64297e commit f8f7eb5

File tree

6 files changed

+562
-433
lines changed

6 files changed

+562
-433
lines changed

src/cargo/core/compiler/compile_kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl CompileKind {
114114
let kinds = match (fallback, &gctx.build_config()?.target) {
115115
(_, None) | (CompileKindFallback::JustHost, _) => Ok(vec![CompileKind::Host]),
116116
(CompileKindFallback::BuildConfig, Some(build_target_config)) => {
117-
dedup(&build_target_config.values(gctx)?)
117+
dedup(&build_target_config.values(gctx.cwd())?)
118118
}
119119
};
120120

src/cargo/ops/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ pub fn add_overrides<'a>(
540540
// The path listed next to the string is the config file in which the
541541
// key was located, so we want to pop off the `.cargo/config` component
542542
// to get the directory containing the `.cargo` folder.
543-
(paths::normalize_path(&def.root(gctx).join(s)), def)
543+
(paths::normalize_path(&def.root(gctx.cwd()).join(s)), def)
544544
});
545545

546546
for (path, definition) in paths {

0 commit comments

Comments
 (0)