feat(ostool): 支持显式配置 Cargo 构建 profile#96
Open
MRNIU wants to merge 1 commit intodrivercraft:mainfrom
Open
Conversation
Cargo 的 Debug/Release 会影响优化级别、debug assertions 和最终代码形态,而 QEMU debug 只应该控制 GDB 等运行时调试参数。此前 ostool 通过 QEMU --debug 隐式推导 Cargo profile,导致这两个维度无法独立表达。 - 在 system.Cargo 中增加可选 profile 字段,支持 Debug 和 Release。 - 未配置 profile 时保留旧行为,避免影响现有 .build.toml。 - 让 log feature 的 release/debug 选择跟随 Cargo profile。 - 更新中英文 README,建议用 profile 表达 release 构建。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
system.Cargo中增加可选profile字段,支持显式选择Debug或Release。--debug中解耦;未配置profile时保持旧行为。原因
Cargo 的 Debug/Release 会影响优化级别、debug assertions 和最终代码形态;QEMU debug 只应该控制 GDB 等运行时调试参数。此前 OSTool 通过 QEMU
--debug隐式推导 Cargo profile,导致这两个维度无法独立表达。这个 PR 增加最小配置面:只允许
Debug和Release两个 Cargo profile 标签,不引入自定义 named profile 或新的 CLI 覆盖参数。验证
cargo fmt --all -- --checkgit diff --checkcargo check -p ostool