Skip to content

Commit

Permalink
Deprecate --keep-debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Mar 27, 2024
1 parent 88efe46 commit 7d18d91
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,9 @@
* Stabilize Web Share API.
[#3882](https://github.com/rustwasm/wasm-bindgen/pull/3882)

* Deprecate `--keep-debug`.
[#3876](https://github.com/rustwasm/wasm-bindgen/pull/3876)

### Fixed

* Copy port from headless test server when using `WASM_BINDGEN_TEST_ADDRESS`.
Expand Down
9 changes: 1 addition & 8 deletions crates/cli-support/src/lib.rs
Expand Up @@ -30,7 +30,6 @@ pub struct Bindgen {
omit_imports: bool,
demangle: bool,
keep_lld_exports: bool,
keep_debug: bool,
remove_name_section: bool,
remove_producers_section: bool,
omit_default_module_path: bool,
Expand Down Expand Up @@ -99,7 +98,6 @@ impl Bindgen {
omit_imports: false,
demangle: true,
keep_lld_exports: false,
keep_debug: false,
remove_name_section: false,
remove_producers_section: false,
emit_start: true,
Expand Down Expand Up @@ -258,11 +256,6 @@ impl Bindgen {
self
}

pub fn keep_debug(&mut self, keep_debug: bool) -> &mut Bindgen {
self.keep_debug = keep_debug;
self
}

pub fn remove_name_section(&mut self, remove: bool) -> &mut Bindgen {
self.remove_name_section = remove;
self
Expand Down Expand Up @@ -457,7 +450,7 @@ impl Bindgen {
// include shared memory, so it fails that part of
// validation!
.strict_validate(false)
.generate_dwarf(self.keep_debug)
.generate_dwarf(true)
.generate_name_section(!self.remove_name_section)
.generate_producers_section(!self.remove_producers_section)
.parse(bytes)
Expand Down
1 change: 0 additions & 1 deletion crates/cli/src/bin/wasm-bindgen-test-runner/main.rs
Expand Up @@ -220,7 +220,6 @@ fn main() -> anyhow::Result<()> {

b.debug(debug)
.input_module(module, wasm)
.keep_debug(false)
.emit_start(false)
.generate(&tmpdir)
.context("executing `wasm-bindgen` over the wasm file")?;
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/bin/wasm-bindgen.rs
Expand Up @@ -28,7 +28,7 @@ Options:
--debug Include otherwise-extraneous debug checks in output
--no-demangle Don't demangle Rust symbol names
--keep-lld-exports Keep exports synthesized by LLD
--keep-debug Keep debug sections in wasm files
--keep-debug Deprecated, use Rustc to control debug information instead
--remove-name-section Remove the debugging `name` section of the file
--remove-producers-section Remove the telemetry `producers` section
--omit-default-module-path Don't add WebAssembly fallback imports in generated JavaScript
Expand Down Expand Up @@ -67,6 +67,7 @@ struct Args {
flag_weak_refs: Option<bool>,
flag_reference_types: Option<bool>,
flag_keep_lld_exports: bool,
#[allow(dead_code)]
flag_keep_debug: bool,
flag_encode_into: Option<String>,
flag_target: Option<String>,
Expand Down Expand Up @@ -120,7 +121,6 @@ fn rmain(args: &Args) -> Result<(), Error> {
.debug(args.flag_debug)
.demangle(!args.flag_no_demangle)
.keep_lld_exports(args.flag_keep_lld_exports)
.keep_debug(args.flag_keep_debug)
.remove_name_section(args.flag_remove_name_section)
.remove_producers_section(args.flag_remove_producers_section)
.typescript(typescript)
Expand Down
5 changes: 0 additions & 5 deletions guide/src/reference/cli.md
Expand Up @@ -73,11 +73,6 @@ When post-processing the `.wasm` binary, do not demangle Rust symbols in the
When post-processing the `.wasm` binary, do not remove exports that are
synthesized by Rust's linker, LLD.

### `--keep-debug`

When post-processing the `.wasm` binary, do not strip DWARF debug info custom
sections.

### `--browser`

When generating bundler-compatible code (see the section on [deployment]) this
Expand Down

0 comments on commit 7d18d91

Please sign in to comment.