Skip to content

Commit

Permalink
cli: Make cargo build-sbf the default build command (#2694)
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto committed Nov 6, 2023
1 parent 167c8ec commit 8f3bb8a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/reusable-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ jobs:
path: tests/declare-id
- cmd: cd tests/typescript && anchor test --skip-lint && npx tsc --noEmit
path: tests/typescript
- cmd: cd tests/zero-copy && anchor test --skip-lint && cd programs/zero-copy && cargo test-bpf
# `solana-program-test` crate doesn't compile because `index_list` crate had a breaking change with a patch release
# TODO: Remove the `cargo update` command after the issue is fixed
- cmd: cd tests/zero-copy && cargo update -p index_list --precise 0.2.7 && anchor test --skip-lint && cd programs/zero-copy && cargo test-sbf
path: tests/zero-copy
- cmd: cd tests/chat && anchor test --skip-lint
path: tests/chat
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The minor version will be incremented upon a breaking change and the patch versi

### Breaking

- cli: Make `cargo build-sbf` the default build command ([#2694](https://github.com/coral-xyz/anchor/pull/2694)).

## [0.29.0] - 2023-10-16

### Features
Expand Down
20 changes: 10 additions & 10 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ pub enum Command {
/// Environment variables to pass into the docker container
#[clap(short, long, required = false)]
env: Vec<String>,
/// Arguments to pass to the underlying `cargo build-bpf` command
/// Arguments to pass to the underlying `cargo build-sbf` command
#[clap(required = false, last = true)]
cargo_args: Vec<String>,
/// Suppress doc strings in IDL output
#[clap(long)]
no_docs: bool,
/// Architecture to use when building the program
#[clap(value_enum, long, default_value = "bpf")]
#[clap(value_enum, long, default_value = "sbf")]
arch: ProgramArch,
},
/// Expands macros (wrapper around cargo expand)
Expand Down Expand Up @@ -166,12 +166,12 @@ pub enum Command {
#[clap(value_enum, short, long, default_value = "none")]
bootstrap: BootstrapMode,
/// Architecture to use when building the program
#[clap(value_enum, long, default_value = "bpf")]
#[clap(value_enum, long, default_value = "sbf")]
arch: ProgramArch,
/// Environment variables to pass into the docker container
#[clap(short, long, required = false)]
env: Vec<String>,
/// Arguments to pass to the underlying `cargo build-bpf` command.
/// Arguments to pass to the underlying `cargo build-sbf` command.
#[clap(required = false, last = true)]
cargo_args: Vec<String>,
/// Flag to skip building the program in the workspace,
Expand Down Expand Up @@ -199,7 +199,7 @@ pub enum Command {
#[clap(long)]
skip_build: bool,
/// Architecture to use when building the program
#[clap(value_enum, long, default_value = "bpf")]
#[clap(value_enum, long, default_value = "sbf")]
arch: ProgramArch,
/// Flag to keep the local validator running after tests
/// to be able to check the transactions.
Expand All @@ -212,7 +212,7 @@ pub enum Command {
/// Environment variables to pass into the docker container
#[clap(short, long, required = false)]
env: Vec<String>,
/// Arguments to pass to the underlying `cargo build-bpf` command.
/// Arguments to pass to the underlying `cargo build-sbf` command.
#[clap(required = false, last = true)]
cargo_args: Vec<String>,
},
Expand Down Expand Up @@ -289,15 +289,15 @@ pub enum Command {
/// Environment variables to pass into the docker container
#[clap(short, long, required = false)]
env: Vec<String>,
/// Arguments to pass to the underlying `cargo build-bpf` command.
/// Arguments to pass to the underlying `cargo build-sbf` command.
#[clap(required = false, last = true)]
cargo_args: Vec<String>,
/// Flag to skip building the program in the workspace,
/// use this to save time when publishing the program
#[clap(long)]
skip_build: bool,
/// Architecture to use when building the program
#[clap(value_enum, long, default_value = "bpf")]
#[clap(value_enum, long, default_value = "sbf")]
arch: ProgramArch,
},
/// Keypair commands.
Expand All @@ -320,12 +320,12 @@ pub enum Command {
#[clap(long)]
skip_lint: bool,
/// Architecture to use when building the program
#[clap(value_enum, long, default_value = "bpf")]
#[clap(value_enum, long, default_value = "sbf")]
arch: ProgramArch,
/// Environment variables to pass into the docker container
#[clap(short, long, required = false)]
env: Vec<String>,
/// Arguments to pass to the underlying `cargo build-bpf` command.
/// Arguments to pass to the underlying `cargo build-sbf` command.
#[clap(required = false, last = true)]
cargo_args: Vec<String>,
},
Expand Down
2 changes: 1 addition & 1 deletion tests/zero-copy/programs/zero-copy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
default = []
test-bpf = []
test-sbf = []

[dependencies]
anchor-lang = { path = "../../../../lang" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "test-bpf")]
#![cfg(feature = "test-sbf")]

use {
anchor_client::{
Expand Down

1 comment on commit 8f3bb8a

@vercel
Copy link

@vercel vercel bot commented on 8f3bb8a Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anchor-docs – ./

anchor-docs-200ms.vercel.app
anchor-docs-git-master-200ms.vercel.app
www.anchor-lang.com
anchor-lang.com

Please sign in to comment.