Skip to content

Commit

Permalink
cli: Fix anchor build --no-docs (coral-xyz#2575)
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto authored Jul 19, 2023
1 parent c306463 commit 8309bb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1484,6 +1486,7 @@ fn _build_rust_cwd(
idl_out: Option<PathBuf>,
idl_ts_out: Option<PathBuf>,
skip_lint: bool,
no_docs: bool,
arch: &ProgramArch,
cargo_args: Vec<String>,
) -> Result<()> {
Expand All @@ -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"),
Expand Down

0 comments on commit 8309bb3

Please sign in to comment.