Skip to content

chore: 更新版本号至 0.8.14,并增强对 someboot 的构建配置检测支持#46

Merged
ZR233 merged 1 commit intomainfrom
fix-someboot
Mar 17, 2026
Merged

chore: 更新版本号至 0.8.14,并增强对 someboot 的构建配置检测支持#46
ZR233 merged 1 commit intomainfrom
fix-someboot

Conversation

@ZR233
Copy link
Member

@ZR233 ZR233 commented Mar 17, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 04:35
@ZR233 ZR233 merged commit 4c12ff0 into main Mar 17, 2026
4 checks passed
@ZR233 ZR233 deleted the fix-someboot branch March 17, 2026 04:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates ostool’s “someboot build-info.toml” auto-detection to be package/features aware, so optional/transitively-disabled someboot dependencies don’t incorrectly inject cargo args/rustflags.

Changes:

  • Replace global detect_build_config(...) calls with detect_build_config_for_package(...) in build/config preparation paths.
  • Add a new reachability check via cargo tree to gate applying someboot build-info for a specific package + feature set.
  • Bump ostool version from 0.8.13 to 0.8.14 (and update Cargo.lock).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ostool/src/ctx.rs Use package/features-aware someboot config detection when preparing build config.
ostool/src/build/someboot.rs Add detect_build_config_for_package(...), cargo tree reachability helper, and a new unit test.
ostool/src/build/cargo_builder.rs Use package/features-aware detection when building cargo commands.
ostool/Cargo.toml Version bump to 0.8.14.
Cargo.lock Lockfile updated for ostool version bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +80 to +82
let meta = read_metadata(manifest_path, false)?;
let someboot_roots = collect_someboot_roots(&meta);
if someboot_roots.is_empty() {
Comment on lines +194 to +198
let output = cmd.output().with_context(|| {
format!(
"failed to run `cargo tree` for package `{}` and target `{}`",
package, target
)
Comment on lines +397 to +398
fs::remove_dir_all(&root).expect("failed to remove temp workspace");
}
Comment on lines +367 to +394
fs::write(
root.join("someboot/build-info.toml"),
"[x86_64-unknown-none]\n\
rustflags = [\"-C\", \"relocation-model=pic\"]\n\
cargoargs = [\"-Z\", \"build-std=core,alloc\"]\n",
)
.unwrap();

let manifest_path = root.join("Cargo.toml");

let without_optional =
detect_build_config_for_package(&manifest_path, "app", &[], "x86_64-unknown-none")
.unwrap();
assert!(without_optional.is_empty());

let with_optional = detect_build_config_for_package(
&manifest_path,
"app",
&["app/with-someboot".to_string()],
"x86_64-unknown-none",
)
.unwrap();
assert_eq!(&with_optional[0..2], ["-Z", "build-std=core,alloc"]);
assert_eq!(with_optional[2], "--config");
assert!(
with_optional
.iter()
.any(|arg| arg.starts_with("target.x86_64-unknown-none.rustflags="))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants