diff --git a/crates/moon/src/cli.rs b/crates/moon/src/cli.rs index 36f160e7..6eb52e4a 100644 --- a/crates/moon/src/cli.rs +++ b/crates/moon/src/cli.rs @@ -151,6 +151,14 @@ pub struct BuildFlags { #[clap(long, conflicts_with = "debug")] pub release: bool, + /// Enable stripping debug information + #[clap(long, conflicts_with = "no_strip")] + pub strip: bool, + + /// Disable stripping debug information + #[clap(long, conflicts_with = "strip")] + pub no_strip: bool, + /// Select output target #[clap(long, value_delimiter = ',')] pub target: Option>, @@ -201,6 +209,16 @@ impl BuildFlags { (true, true) => panic!("both std and no_std flags are set"), } } + + pub fn strip(&self) -> bool { + if self.strip { + true + } else if self.no_strip { + false + } else { + !self.debug + } + } } pub fn get_compiler_flags(src_dir: &Path, build_flags: &BuildFlags) -> anyhow::Result { @@ -237,6 +255,7 @@ pub fn get_compiler_flags(src_dir: &Path, build_flags: &BuildFlags) -> anyhow::R let build_opt = BuildPackageFlags { debug_flag, + strip_flag: build_flags.strip(), source_map, enable_coverage, deny_warn: false, diff --git a/crates/moon/src/cli/test.rs b/crates/moon/src/cli/test.rs index 8005ca05..078a9646 100644 --- a/crates/moon/src/cli/test.rs +++ b/crates/moon/src/cli/test.rs @@ -164,6 +164,13 @@ fn run_test_internal( // release is 'false' by default, so we will run test at debug mode(to gain more detailed stack trace info), unless `--release` is specified // however, other command like build, check, run, etc, will run at release mode by default moonc_opt.build_opt.debug_flag = !cmd.build_flags.release; + moonc_opt.build_opt.strip_flag = if cmd.build_flags.strip { + true + } else if cmd.build_flags.no_strip { + false + } else { + cmd.build_flags.release + }; moonc_opt.link_opt.debug_flag = !cmd.build_flags.release; let raw_target_dir = target_dir.to_path_buf(); diff --git a/crates/moon/tests/test_cases/mod.rs b/crates/moon/tests/test_cases/mod.rs index 77372c34..9c88751e 100644 --- a/crates/moon/tests/test_cases/mod.rs +++ b/crates/moon/tests/test_cases/mod.rs @@ -8131,3 +8131,90 @@ fn test_moon_install_bin() { "#]], ); } + +#[test] +fn test_strip_debug() { + let dir = TestDir::new("strip_debug.in"); + + check( + get_stdout(&dir, ["build", "--dry-run"]), + expect![[r#" + moonc build-package ./lib/hello.mbt -o ./target/wasm-gc/release/build/lib/lib.core -pkg moon_new/lib -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc + moonc build-package ./main/main.mbt -o ./target/wasm-gc/release/build/main/main.core -pkg moon_new/main -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -i ./target/wasm-gc/release/build/lib/lib.mi:lib -pkg-sources moon_new/main:./main -target wasm-gc + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/release/build/lib/lib.core ./target/wasm-gc/release/build/main/main.core -main moon_new/main -o ./target/wasm-gc/release/build/main/main.wasm -pkg-config-path ./main/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moon_new/main:./main -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -target wasm-gc + "#]], + ); + check( + get_stdout(&dir, ["build", "--no-strip", "--dry-run"]), + expect![[r#" + moonc build-package ./lib/hello.mbt -o ./target/wasm-gc/release/build/lib/lib.core -pkg moon_new/lib -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -g + moonc build-package ./main/main.mbt -o ./target/wasm-gc/release/build/main/main.core -pkg moon_new/main -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -i ./target/wasm-gc/release/build/lib/lib.mi:lib -pkg-sources moon_new/main:./main -target wasm-gc -g + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/release/build/lib/lib.core ./target/wasm-gc/release/build/main/main.core -main moon_new/main -o ./target/wasm-gc/release/build/main/main.wasm -pkg-config-path ./main/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moon_new/main:./main -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -target wasm-gc -g + "#]], + ); + check( + get_stdout(&dir, ["build", "--debug", "--strip", "--dry-run"]), + expect![[r#" + moonc build-package ./lib/hello.mbt -o ./target/wasm-gc/debug/build/lib/lib.core -pkg moon_new/lib -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -O0 -source-map + moonc build-package ./main/main.mbt -o ./target/wasm-gc/debug/build/main/main.core -pkg moon_new/main -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -i ./target/wasm-gc/debug/build/lib/lib.mi:lib -pkg-sources moon_new/main:./main -target wasm-gc -O0 -source-map + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/debug/build/lib/lib.core ./target/wasm-gc/debug/build/main/main.core -main moon_new/main -o ./target/wasm-gc/debug/build/main/main.wasm -pkg-config-path ./main/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moon_new/main:./main -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -target wasm-gc -O0 -source-map + "#]], + ); + check( + get_stdout(&dir, ["build", "--debug", "--no-strip", "--dry-run"]), + expect![[r#" + moonc build-package ./lib/hello.mbt -o ./target/wasm-gc/debug/build/lib/lib.core -pkg moon_new/lib -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -g -O0 -source-map + moonc build-package ./main/main.mbt -o ./target/wasm-gc/debug/build/main/main.core -pkg moon_new/main -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -i ./target/wasm-gc/debug/build/lib/lib.mi:lib -pkg-sources moon_new/main:./main -target wasm-gc -g -O0 -source-map + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/debug/build/lib/lib.core ./target/wasm-gc/debug/build/main/main.core -main moon_new/main -o ./target/wasm-gc/debug/build/main/main.wasm -pkg-config-path ./main/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moon_new/main:./main -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -target wasm-gc -g -O0 -source-map + "#]], + ); + check( + get_stdout(&dir, ["build", "--debug", "--dry-run"]), + expect![[r#" + moonc build-package ./lib/hello.mbt -o ./target/wasm-gc/debug/build/lib/lib.core -pkg moon_new/lib -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -g -O0 -source-map + moonc build-package ./main/main.mbt -o ./target/wasm-gc/debug/build/main/main.core -pkg moon_new/main -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -i ./target/wasm-gc/debug/build/lib/lib.mi:lib -pkg-sources moon_new/main:./main -target wasm-gc -g -O0 -source-map + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/debug/build/lib/lib.core ./target/wasm-gc/debug/build/main/main.core -main moon_new/main -o ./target/wasm-gc/debug/build/main/main.wasm -pkg-config-path ./main/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moon_new/main:./main -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -target wasm-gc -g -O0 -source-map + "#]], + ); + + check( + get_stdout(&dir, ["test", "--dry-run"]), + expect![[r#" + moon generate-test-driver --source-dir . --target-dir ./target --package moon_new/lib --target wasm-gc --driver-kind internal + moonc build-package ./lib/hello.mbt ./target/wasm-gc/debug/test/lib/__generated_driver_for_internal_test.mbt -o ./target/wasm-gc/debug/test/lib/lib.internal_test.core -pkg moon_new/lib -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -g -O0 -no-mi + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/debug/test/lib/lib.internal_test.core -main moon_new/lib -o ./target/wasm-gc/debug/test/lib/lib.internal_test.wasm -test-mode -pkg-config-path ./lib/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -exported_functions moonbit_test_driver_internal_execute,moonbit_test_driver_finish -target wasm-gc -g -O0 + "#]], + ); + check( + get_stdout(&dir, ["test", "--debug", "--dry-run"]), + expect![[r#" + moon generate-test-driver --source-dir . --target-dir ./target --package moon_new/lib --target wasm-gc --driver-kind internal + moonc build-package ./lib/hello.mbt ./target/wasm-gc/debug/test/lib/__generated_driver_for_internal_test.mbt -o ./target/wasm-gc/debug/test/lib/lib.internal_test.core -pkg moon_new/lib -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -g -O0 -source-map -no-mi + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/debug/test/lib/lib.internal_test.core -main moon_new/lib -o ./target/wasm-gc/debug/test/lib/lib.internal_test.wasm -test-mode -pkg-config-path ./lib/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -exported_functions moonbit_test_driver_internal_execute,moonbit_test_driver_finish -target wasm-gc -g -O0 -source-map + "#]], + ); + check( + get_stdout(&dir, ["test", "--release", "--dry-run"]), + expect![[r#" + moon generate-test-driver --source-dir . --target-dir ./target --package moon_new/lib --target wasm-gc --driver-kind internal --release + moonc build-package ./lib/hello.mbt ./target/wasm-gc/release/test/lib/__generated_driver_for_internal_test.mbt -o ./target/wasm-gc/release/test/lib/lib.internal_test.core -pkg moon_new/lib -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -no-mi + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/release/test/lib/lib.internal_test.core -main moon_new/lib -o ./target/wasm-gc/release/test/lib/lib.internal_test.wasm -test-mode -pkg-config-path ./lib/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -exported_functions moonbit_test_driver_internal_execute,moonbit_test_driver_finish -target wasm-gc + "#]], + ); + check( + get_stdout(&dir, ["test", "--release", "--no-strip", "--dry-run"]), + expect![[r#" + moon generate-test-driver --source-dir . --target-dir ./target --package moon_new/lib --target wasm-gc --driver-kind internal --release + moonc build-package ./lib/hello.mbt ./target/wasm-gc/release/test/lib/__generated_driver_for_internal_test.mbt -o ./target/wasm-gc/release/test/lib/lib.internal_test.core -pkg moon_new/lib -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -g -no-mi + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/release/test/lib/lib.internal_test.core -main moon_new/lib -o ./target/wasm-gc/release/test/lib/lib.internal_test.wasm -test-mode -pkg-config-path ./lib/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -exported_functions moonbit_test_driver_internal_execute,moonbit_test_driver_finish -target wasm-gc -g + "#]], + ); + check( + get_stdout(&dir, ["test", "--debug", "--no-strip", "--dry-run"]), + expect![[r#" + moon generate-test-driver --source-dir . --target-dir ./target --package moon_new/lib --target wasm-gc --driver-kind internal + moonc build-package ./lib/hello.mbt ./target/wasm-gc/debug/test/lib/__generated_driver_for_internal_test.mbt -o ./target/wasm-gc/debug/test/lib/lib.internal_test.core -pkg moon_new/lib -is-main -std-path $MOON_HOME/lib/core/target/wasm-gc/release/bundle -pkg-sources moon_new/lib:./lib -target wasm-gc -g -O0 -source-map -no-mi + moonc link-core $MOON_HOME/lib/core/target/wasm-gc/release/bundle/core.core ./target/wasm-gc/debug/test/lib/lib.internal_test.core -main moon_new/lib -o ./target/wasm-gc/debug/test/lib/lib.internal_test.wasm -test-mode -pkg-config-path ./lib/moon.pkg.json -pkg-sources moon_new/lib:./lib -pkg-sources moonbitlang/core:$MOON_HOME/lib/core -exported_functions moonbit_test_driver_internal_execute,moonbit_test_driver_finish -target wasm-gc -g -O0 -source-map + "#]], + ); +} diff --git a/crates/moon/tests/test_cases/strip_debug.in/lib/hello.mbt b/crates/moon/tests/test_cases/strip_debug.in/lib/hello.mbt new file mode 100644 index 00000000..a7ac2bee --- /dev/null +++ b/crates/moon/tests/test_cases/strip_debug.in/lib/hello.mbt @@ -0,0 +1,4 @@ +pub fn hello() -> String { + "Hello, world!" +} + diff --git a/crates/moon/tests/test_cases/strip_debug.in/lib/moon.pkg.json b/crates/moon/tests/test_cases/strip_debug.in/lib/moon.pkg.json new file mode 100644 index 00000000..9585a087 --- /dev/null +++ b/crates/moon/tests/test_cases/strip_debug.in/lib/moon.pkg.json @@ -0,0 +1,3 @@ +{ + "import": {} +} diff --git a/crates/moon/tests/test_cases/strip_debug.in/main/main.mbt b/crates/moon/tests/test_cases/strip_debug.in/main/main.mbt new file mode 100644 index 00000000..d25cb935 --- /dev/null +++ b/crates/moon/tests/test_cases/strip_debug.in/main/main.mbt @@ -0,0 +1,3 @@ +fn main { + println(@lib.hello()) +} diff --git a/crates/moon/tests/test_cases/strip_debug.in/main/moon.pkg.json b/crates/moon/tests/test_cases/strip_debug.in/main/moon.pkg.json new file mode 100644 index 00000000..4343a4ef --- /dev/null +++ b/crates/moon/tests/test_cases/strip_debug.in/main/moon.pkg.json @@ -0,0 +1,6 @@ +{ + "is-main": true, + "import": { + "moon_new/lib": "" + } +} \ No newline at end of file diff --git a/crates/moon/tests/test_cases/strip_debug.in/moon.mod.json b/crates/moon/tests/test_cases/strip_debug.in/moon.mod.json new file mode 100644 index 00000000..b5d8b346 --- /dev/null +++ b/crates/moon/tests/test_cases/strip_debug.in/moon.mod.json @@ -0,0 +1,3 @@ +{ + "name": "moon_new" +} diff --git a/crates/moonbuild/src/gen/gen_build.rs b/crates/moonbuild/src/gen/gen_build.rs index 31311903..3c57fb5f 100644 --- a/crates/moonbuild/src/gen/gen_build.rs +++ b/crates/moonbuild/src/gen/gen_build.rs @@ -239,6 +239,11 @@ pub fn gen_build_command( let mut build = Build::new(loc, ins, outs); + let (debug_flag, strip_flag) = ( + moonc_opt.build_opt.debug_flag, + moonc_opt.build_opt.strip_flag, + ); + let command = CommandBuilder::new("moonc") .arg("build-package") .args_with_cond(moonc_opt.render, vec!["-error-format", "json"]) @@ -281,7 +286,10 @@ pub fn gen_build_command( &item.package_full_name, &item.package_source_dir )) .args(["-target", moonc_opt.build_opt.target_backend.to_flag()]) - .args_with_cond(moonc_opt.build_opt.debug_flag, vec!["-g", "-O0"]) + .args_with_cond(debug_flag && !strip_flag, vec!["-g", "-O0"]) + .arg_with_cond(debug_flag && strip_flag, "-O0") + .arg_with_cond(!debug_flag && !strip_flag, "-g") + // .arg_with_cond(!debug_flag && strip_flag, "") .arg_with_cond(moonc_opt.link_opt.source_map, "-source-map") .arg_with_cond(enable_coverage, "-enable-coverage") .arg_with_cond(self_coverage, "-coverage-package-override=@self") @@ -341,6 +349,11 @@ pub fn gen_link_command( let native_cc_flags = item.native_cc_flags(moonc_opt.link_opt.target_backend); let native_cc_link_flags = item.native_cc_link_flags(moonc_opt.link_opt.target_backend); + let (debug_flag, strip_flag) = ( + moonc_opt.build_opt.debug_flag, + moonc_opt.build_opt.strip_flag, + ); + let command = CommandBuilder::new("moonc") .arg("link-core") .arg_with_cond( @@ -374,7 +387,10 @@ pub fn gen_link_command( ], ) .args(["-target", moonc_opt.link_opt.target_backend.to_flag()]) - .args_with_cond(moonc_opt.link_opt.debug_flag, vec!["-g", "-O0"]) + .args_with_cond(debug_flag && !strip_flag, vec!["-g", "-O0"]) + .arg_with_cond(debug_flag && strip_flag, "-O0") + .arg_with_cond(!debug_flag && !strip_flag, "-g") + // .arg_with_cond(!debug_flag && strip_flag, "") .arg_with_cond(moonc_opt.link_opt.source_map, "-source-map") .lazy_args_with_cond(exports.is_some(), || { let es = exports.unwrap(); diff --git a/crates/moonbuild/src/gen/gen_bundle.rs b/crates/moonbuild/src/gen/gen_bundle.rs index dc4d09db..0ae0cbd2 100644 --- a/crates/moonbuild/src/gen/gen_bundle.rs +++ b/crates/moonbuild/src/gen/gen_bundle.rs @@ -206,6 +206,11 @@ pub fn gen_build_command( let mut build = Build::new(loc, ins, outs); + let (debug_flag, strip_flag) = ( + moonc_opt.build_opt.debug_flag, + moonc_opt.build_opt.strip_flag, + ); + let command = CommandBuilder::new("moonc") .arg("build-package") .args_with_cond(moonc_opt.render, vec!["-error-format", "json"]) @@ -228,7 +233,10 @@ pub fn gen_build_command( &item.package_full_name, &item.package_source_dir )) .args(["-target", moonc_opt.build_opt.target_backend.to_flag()]) - .args_with_cond(moonc_opt.build_opt.debug_flag, vec!["-g", "-O0"]) + .args_with_cond(debug_flag && !strip_flag, vec!["-g", "-O0"]) + .arg_with_cond(debug_flag && strip_flag, "-O0") + .arg_with_cond(!debug_flag && !strip_flag, "-g") + // .arg_with_cond(!debug_flag && strip_flag, "") .arg_with_cond(moonc_opt.link_opt.source_map, "-source-map") .args(moonc_opt.extra_build_opt.iter()) .build(); diff --git a/crates/moonbuild/src/gen/gen_runtest.rs b/crates/moonbuild/src/gen/gen_runtest.rs index 3b70935a..3449c224 100644 --- a/crates/moonbuild/src/gen/gen_runtest.rs +++ b/crates/moonbuild/src/gen/gen_runtest.rs @@ -915,6 +915,11 @@ pub fn gen_runtest_build_command( let mut build = Build::new(loc, ins, outs); + let (debug_flag, strip_flag) = ( + moonc_opt.build_opt.debug_flag, + moonc_opt.build_opt.strip_flag, + ); + let command = CommandBuilder::new("moonc") .arg("build-package") .args_with_cond(moonc_opt.render, vec!["-error-format", "json"]) @@ -946,7 +951,10 @@ pub fn gen_runtest_build_command( &item.package_full_name, &item.package_source_dir )) .args(["-target", moonc_opt.build_opt.target_backend.to_flag()]) - .args_with_cond(moonc_opt.build_opt.debug_flag, vec!["-g", "-O0"]) + .args_with_cond(debug_flag && !strip_flag, vec!["-g", "-O0"]) + .arg_with_cond(debug_flag && strip_flag, "-O0") + .arg_with_cond(!debug_flag && !strip_flag, "-g") + // .arg_with_cond(!debug_flag && strip_flag, "") .arg_with_cond(moonc_opt.link_opt.source_map, "-source-map") // Coverage arg .args(coverage_args.iter()) @@ -1012,6 +1020,11 @@ pub fn gen_runtest_link_command( let native_cc_flags = item.native_cc_flags(moonc_opt.link_opt.target_backend); let native_cc_link_flags = item.native_cc_link_flags(moonc_opt.link_opt.target_backend); + let (debug_flag, strip_flag) = ( + moonc_opt.build_opt.debug_flag, + moonc_opt.build_opt.strip_flag, + ); + let command = CommandBuilder::new("moonc") .arg("link-core") .arg_with_cond( @@ -1054,7 +1067,10 @@ pub fn gen_runtest_link_command( ["-js-format", "cjs", "-no-dts"], ) .args(["-target", moonc_opt.link_opt.target_backend.to_flag()]) - .args_with_cond(moonc_opt.link_opt.debug_flag, vec!["-g", "-O0"]) + .args_with_cond(debug_flag && !strip_flag, vec!["-g", "-O0"]) + .arg_with_cond(debug_flag && strip_flag, "-O0") + .arg_with_cond(!debug_flag && !strip_flag, "-g") + // .arg_with_cond(!debug_flag && strip_flag, "") .arg_with_cond(moonc_opt.link_opt.source_map, "-source-map") .lazy_args_with_cond(native_cc.is_some(), || { vec!["-cc".to_string(), native_cc.unwrap().to_string()] diff --git a/crates/moonutil/src/common.rs b/crates/moonutil/src/common.rs index adacaf3d..1925f561 100644 --- a/crates/moonutil/src/common.rs +++ b/crates/moonutil/src/common.rs @@ -308,6 +308,7 @@ impl TargetBackend { #[derive(Debug, Clone, Default)] pub struct BuildPackageFlags { pub debug_flag: bool, + pub strip_flag: bool, pub source_map: bool, pub enable_coverage: bool, // treat all warnings as errors @@ -321,6 +322,7 @@ impl BuildPackageFlags { pub fn new() -> Self { Self { debug_flag: false, + strip_flag: true, source_map: false, enable_coverage: false, deny_warn: false, diff --git a/docs/manual-zh/src/commands.md b/docs/manual-zh/src/commands.md index b9fd2d10..2a9d241f 100644 --- a/docs/manual-zh/src/commands.md +++ b/docs/manual-zh/src/commands.md @@ -98,6 +98,8 @@ Build the current package * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all` @@ -131,6 +133,8 @@ Check the current package, but don't build object files * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all` @@ -168,6 +172,8 @@ Run a main package * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all` @@ -197,6 +203,8 @@ Test the current package * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all` diff --git a/docs/manual/src/commands.md b/docs/manual/src/commands.md index b9fd2d10..2a9d241f 100644 --- a/docs/manual/src/commands.md +++ b/docs/manual/src/commands.md @@ -98,6 +98,8 @@ Build the current package * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all` @@ -131,6 +133,8 @@ Check the current package, but don't build object files * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all` @@ -168,6 +172,8 @@ Run a main package * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all` @@ -197,6 +203,8 @@ Test the current package * `--nostd` — Disable the standard library * `-g`, `--debug` — Emit debug information * `--release` — Compile in release mode +* `--strip` — Enable stripping debug information +* `--no-strip` — Disable stripping debug information * `--target ` — Select output target Possible values: `wasm`, `wasm-gc`, `js`, `native`, `all`