explicit_imports.py: BASE_CONFIG for the residual step

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-14 17:10:41 +01:00
co-authored by Claude Sonnet 5.5
parent 878f6f9a94
commit 0c913a2b5c
+3 -2
View File
@@ -739,7 +739,7 @@ def check_round(wt, package, configs):
errors = collections.defaultdict(set)
a_flags, b_flags = [], []
for i, feat in enumerate(configs):
base = f"-p {package}" + (" --all-features" if feat else "")
base = f"-p {package} {feat}" if isinstance(feat, str) else f"-p {package}" + (" --all-features" if feat else "")
a = run_cargo(wt, f"{base} --lib --bins", f"a{i}.json")
b = run_cargo(wt, f"{base} --tests", f"b{i}.json")
for ms in (a, b):
@@ -885,7 +885,8 @@ def main():
if not changed:
break
if features:
default_errors, a_default, b_default = check_round(wt, package, [False])
# the smallest feature set that builds (BASE_CONFIG, for example `--features cuda-driver`), else the default one
default_errors, a_default, b_default = check_round(wt, package, [os.environ.get("BASE_CONFIG") or False])
if default_errors:
print("WARNING: errors in the default feature set:", dict(list(default_errors.items())[:5]), flush=True)
moved = 0