Change the default behavior of all commands to debug#1153
Change the default behavior of all commands to debug#1153
Conversation
b1214f3 to
a697b9f
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request changes the default build mode from "release" to "debug" across various commands in the MoonBit build system. The change affects the output directory structure, compiler flags, and test expectations throughout the codebase.
Key changes:
- Default build mode changed from
releasetodebugfor most commands exceptbundle - Build artifacts now output to
target/<backend>/debug/instead oftarget/<backend>/release/by default - Debug information (
-g) and source maps are now enabled by default - Optimization level defaults to
-O0(no optimization) for debug builds - Updated documentation to reflect new flag descriptions
Reviewed Changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/manual/src/commands.md | Updated command-line flag descriptions for debug/release/strip options |
| docs/manual-zh/src/commands.md | Chinese version of documentation updates |
| crates/moon/src/cli/*.rs | Updated default build behavior for run, test, doc, info, bundle commands |
| crates/moon/tests/test_cases/**/mod.rs | Updated test expectations to use debug paths instead of release paths |
| crates/moonrun/tests/test.rs | Updated test expectations for debug build paths |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| moonc build-package ./lib/hello.mbt -o ./target/wasm-gc/debug/build/lib/lib.core -pkg hello/lib -pkg-sources hello/lib:./lib -target wasm-gc -g -O0 -source-map -g -no-builtin -workspace-path . | ||
| moonc build-package ./main/main.mbt -o ./target/wasm-gc/debug/build/main/main.core -pkg hello/main -is-main -i ./target/wasm-gc/debug/build/lib/lib.mi:lib -pkg-sources hello/main:./main -target wasm-gc -g -O0 -source-map -g -no-builtin -workspace-path . |
There was a problem hiding this comment.
The -g flag appears twice in the compiler command line (once from the default debug flags and once from the extra flags). While not causing errors, this duplication is redundant and could be confusing. Consider deduplicating flags in the command builder to avoid repetition.
a697b9f to
c1981ab
Compare
c1981ab to
4d1a0f9
Compare
Debugmode #1151Closes #1151
Summary
As said, this PR will unify the default behavior of all subcommands of
moonto debug, except formoon benchandmoon bundlewhich will remain in release mode.This PR also changes the behavior of debug information to emit by default, irrelevant of the debug/release flag set, and only disabled upon
--strip.Metadata