cli: Make `cargo build-sbf` the default build command (#2694)

This commit is contained in:
acheron 2023-11-07 00:53:26 +01:00 committed by GitHub
parent 167c8ecbf5
commit 8f3bb8a556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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)
@ -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,
@ -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.
@ -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>,
},
@ -289,7 +289,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>,
/// Flag to skip building the program in the workspace,
@ -297,7 +297,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,
},
/// Keypair commands.
@ -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>,
},

View File

@ -14,7 +14,7 @@ no-entrypoint = []
no-idl = []
cpi = ["no-entrypoint"]
default = []
test-bpf = []
test-sbf = []
[dependencies]
anchor-lang = { path = "../../../../lang" }

View File

@ -1,4 +1,4 @@
#![cfg(feature = "test-bpf")]
#![cfg(feature = "test-sbf")]
use {
anchor_client::{