diff --git a/CHANGELOG.md b/CHANGELOG.md index d630cd899f..0659d1725b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,8 @@ The minor version will be incremented upon a breaking change and the patch versi - ts: Packages no longer depend on `assert` ([#2535](https://github.com/coral-xyz/anchor/pull/2535)). - lang: Support for `const` in the `InitSpace` macro ([#2555](https://github.com/coral-xyz/anchor/pull/2555)). - cli: Support workspace inheritence ([#2570](https://github.com/coral-xyz/anchor/pull/2570)). -- client: Compile with Solana `1.14`([#2572](https://github.com/coral-xyz/anchor/pull/2572)). +- client: Compile with Solana `1.14` ([#2572](https://github.com/coral-xyz/anchor/pull/2572)). +- cli: Fix `anchor build --no-docs` adding docs to the IDL ([#2575](https://github.com/coral-xyz/anchor/pull/2575)). ### Breaking diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 33d9984ec8..0c736dcacf 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1120,7 +1120,9 @@ fn build_rust_cwd( Some(p) => std::env::set_current_dir(p)?, }; match build_config.verifiable { - false => _build_rust_cwd(cfg, idl_out, idl_ts_out, skip_lint, arch, cargo_args), + false => _build_rust_cwd( + cfg, idl_out, idl_ts_out, skip_lint, no_docs, arch, cargo_args, + ), true => build_cwd_verifiable( cfg, cargo_toml, @@ -1484,6 +1486,7 @@ fn _build_rust_cwd( idl_out: Option, idl_ts_out: Option, skip_lint: bool, + no_docs: bool, arch: &ProgramArch, cargo_args: Vec, ) -> Result<()> { @@ -1500,7 +1503,7 @@ fn _build_rust_cwd( } // Always assume idl is located at src/lib.rs. - if let Some(idl) = extract_idl(cfg, "src/lib.rs", skip_lint, false)? { + if let Some(idl) = extract_idl(cfg, "src/lib.rs", skip_lint, no_docs)? { // JSON out path. let out = match idl_out { None => PathBuf::from(".").join(&idl.name).with_extension("json"),