Skip to content

Commit 43c488c

Browse files
author
Mike MacCana
committed
Move the Anchor v1 examples to Anchor 1.2.1
anchor-lang and anchor-spl move from 1.2.0 to 1.2.1 in all 57 anchor-v1 examples, the Anchor v1 workflow installs anchor-cli 1.2.1, and the docs name 1.2.1 as the v1 CLI. 1.2.1 only adds the opt-in solana-v4 feature, which no example enables, so no program or test source changes. Claude-Session: https://claude.ai/code/session_01KZaRLaqvHMdDVdafevQfRE
1 parent 30a19c0 commit 43c488c

124 files changed

Lines changed: 240 additions & 226 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/anchor-v1.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,22 +206,22 @@ jobs:
206206
# Pinned to match the anchor-lang/anchor-spl crate version the programs depend on.
207207
# The key deliberately differs from the old avm-based one so a cache entry
208208
# holding an avm-built binary is never restored over this.
209-
key: anchor-cli-crates-io-${{ runner.os }}-1.2.0
210-
- name: Install Anchor 1.2.0
209+
key: anchor-cli-crates-io-${{ runner.os }}-1.2.1
210+
- name: Install Anchor 1.2.1
211211
run: |
212212
export PATH="$HOME/.cargo/bin:$PATH"
213213
# `anchor --version` can emit more than one line; read the first line only so
214214
# a multi-line value never reaches downstream parsing.
215215
current="$(anchor --version 2>/dev/null | head -n1 | awk '{print $2}' || true)"
216-
if [ "$current" != "1.2.0" ]; then
216+
if [ "$current" != "1.2.1" ]; then
217217
# Install the CLI from crates.io rather than through avm, matching the
218218
# Anchor v2 job. `cargo install --git ... avm` builds avm from the tip of
219219
# anchor's main branch, so what CI installs drifts with whatever landed
220-
# there. 1.2.0 is an ordinary published release — unlike the 2.0.0-rc.1
220+
# there. 1.2.1 is an ordinary published release — unlike the 2.0.0-rc.1
221221
# pre-release that forced the v2 job off avm — so the CLI comes straight
222222
# from the registry. --locked builds it against its own published lockfile
223223
# so the result does not drift with the registry either.
224-
cargo install anchor-cli --version 1.2.0 --locked --force
224+
cargo install anchor-cli --version 1.2.1 --locked --force
225225
fi
226226
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
227227
- name: Install Surfpool

‎CHANGELOG.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ All notable changes to this repository are documented here.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [2026-10-15] - Anchor v1 examples on Anchor 1.2.1
8+
9+
Anchor 1.2.1 is a patch release of the v1 line. Its one change is an opt-in
10+
`solana-v4` feature on `anchor-lang` for building against the Solana v4 crates; no
11+
example turns it on, so no program or test source changed.
12+
13+
### Changed
14+
15+
- All 57 `anchor-v1/` examples move `anchor-lang` and `anchor-spl` from `1.2.0` to
16+
`1.2.1`. Feature lists are unchanged.
17+
- The Anchor v1 workflow installs and caches `anchor-cli 1.2.1` instead of `1.2.0`.
18+
- Every `anchor-v1/` README, `CONTRIBUTING.md` and `docs/anchor-v2-migration.md`
19+
name 1.2.1 as the v1 CLI to install.
20+
721
## [2026-10-15] - solana-kite 0.6.1
822

923
### Changed

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See [CHANGELOG.md](./CHANGELOG.md) for release history. This file had no changel
1313

1414
- Each example lives at `category/example-name/<framework>/`, e.g. `basics/counter/anchor/`.
1515
- Supported frameworks: `anchor`, `anchor-v1`, `quasar`, `pinocchio`, `native`, `asm`. Use the existing layout as a reference.
16-
- `anchor-v1/` is Anchor v1 (1.2.0), the current stable Anchor. `anchor/` is the same example
16+
- `anchor-v1/` is Anchor v1 (1.2.1), the current stable Anchor. `anchor/` is the same example
1717
on Anchor v2 (2.0.0-rc.1), the release candidate for the next major version, and is where new
1818
Anchor work starts; the v1 copy tracks its v2 counterpart. A change to what an example does (a new handler, a new check, a
1919
fix, a renamed field) goes into both copies, in the same pull request where practical, so a
@@ -34,7 +34,7 @@ See [CHANGELOG.md](./CHANGELOG.md) for release history. This file had no changel
3434
Run an example's tests with the command for its framework, from the framework directory (e.g. `basics/counter/anchor/`):
3535

3636
- **Anchor v2** (in `anchor/`): `anchor test` (runs `cargo test`, per the `[scripts]` table in `Anchor.toml`), with the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked`.
37-
- **Anchor v1** (in `anchor-v1/`): the same `anchor test`, with the v1 CLI: `avm install 1.2.0 && avm use 1.2.0`. Selecting the wrong CLI is the usual cause of a confusing build failure in these directories.
37+
- **Anchor v1** (in `anchor-v1/`): the same `anchor test`, with the v1 CLI: `avm install 1.2.1 && avm use 1.2.1`. Selecting the wrong CLI is the usual cause of a confusing build failure in these directories.
3838
Anchor v1 tests send v1 transactions (4,096 bytes, resource limits in the message) through
3939
`solana-kite` 0.6. Its senders take a last `compute_unit_limit: Option<u32>`: pass `None` and kite
4040
simulates the transaction and sends it with the compute units the simulation used. A test that needs the

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Working, tested, up-to-date examples of common Solana programs (what other chain
1414

1515
Each example is available in one or more of the following frameworks:
1616

17-
- [⚓ Anchor v1](https://www.anchor-lang.com/) - the most popular framework for Solana development, in its current major version. Lives in `anchor-v1/`. Install with `avm install 1.2.0 && avm use 1.2.0`, build with `anchor build`, test with `anchor test`.
17+
- [⚓ Anchor v1](https://www.anchor-lang.com/) - the most popular framework for Solana development, in its current major version. Lives in `anchor-v1/`. Install with `avm install 1.2.1 && avm use 1.2.1`, build with `anchor build`, test with `anchor test`.
1818
- [⚓ Anchor v2](https://www.anchor-lang.com/) - the next major version of Anchor, a ground-up rewrite that is not yet released. Lives in `anchor/`, alongside the v1 copy of the same example, and builds on the release candidate: install with `cargo install anchor-cli --version 2.0.0-rc.1 --locked`, then the same `anchor build` / `anchor test`.
1919
- [💫 Quasar](https://quasar-lang.com/docs) - a newer, more performant framework with Anchor-compatible ergonomics. Build with `quasar build`, test with `quasar test`.
2020
- [🤥 Pinocchio](https://github.com/anza-xyz/pinocchio) - a zero-copy, zero-allocation library for Solana programs. Build with `cargo build-sbf --manifest-path=./program/Cargo.toml`, test with `cargo test --manifest-path=./program/Cargo.toml`.

‎basics/account-data/anchor-v1/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Account Data (Anchor)
22

33
> [!NOTE]
4-
> This is the **Anchor v1** copy of this example, on Anchor 1.2.0, the current
4+
> This is the **Anchor v1** copy of this example, on Anchor 1.2.1, the current
55
> stable Anchor release. Every `anchor` command on this page needs the v1 CLI:
6-
> `avm install 1.2.0 && avm use 1.2.0`. The Anchor v2 version of this example is in
6+
> `avm install 1.2.1 && avm use 1.2.1`. The Anchor v2 version of this example is in
77
> [`../anchor`](../anchor/).
88
99
Store and retrieve arbitrary data in a Solana [account](https://solana.com/docs/terminology#account) owned by this [program](https://solana.com/docs/terminology#program).

‎basics/account-data/anchor-v1/programs/anchor-program-example/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ custom-heap = []
2020
custom-panic = []
2121

2222
[dependencies]
23-
anchor-lang = "1.2.0"
23+
anchor-lang = "1.2.1"
2424

2525
[dev-dependencies]
2626
litesvm = "0.16.0"

‎basics/checking-accounts/anchor-v1/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Checking Accounts (Anchor)
22

33
> [!NOTE]
4-
> This is the **Anchor v1** copy of this example, on Anchor 1.2.0, the current
4+
> This is the **Anchor v1** copy of this example, on Anchor 1.2.1, the current
55
> stable Anchor release. Every `anchor` command on this page needs the v1 CLI:
6-
> `avm install 1.2.0 && avm use 1.2.0`. The Anchor v2 version of this example is in
6+
> `avm install 1.2.1 && avm use 1.2.1`. The Anchor v2 version of this example is in
77
> [`../anchor`](../anchor/).
88
99
Validate that accounts passed into an [instruction](https://solana.com/docs/terminology#instruction) meet signer, owner, and address constraints before handler logic runs.

‎basics/checking-accounts/anchor-v1/programs/anchor-program-example/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ custom-heap = []
2020
custom-panic = []
2121

2222
[dependencies]
23-
anchor-lang = "1.2.0"
23+
anchor-lang = "1.2.1"
2424

2525
[dev-dependencies]
2626
litesvm = "0.16.0"

‎basics/close-account/anchor-v1/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Close Account
22

33
> [!NOTE]
4-
> This is the **Anchor v1** copy of this example, on Anchor 1.2.0, the current
4+
> This is the **Anchor v1** copy of this example, on Anchor 1.2.1, the current
55
> stable Anchor release. Every `anchor` command on this page needs the v1 CLI:
6-
> `avm install 1.2.0 && avm use 1.2.0`. The Anchor v2 version of this example is in
6+
> `avm install 1.2.1 && avm use 1.2.1`. The Anchor v2 version of this example is in
77
> [`../anchor`](../anchor/).
88
99
Two [instruction handlers](https://solana.com/docs/terminology#instruction-handler): `create_user` initializes a [PDA](https://solana.com/docs/terminology#program-derived-address-pda) `User` [account](https://solana.com/docs/terminology#account), and `close_user` closes it and returns the [rent](https://solana.com/docs/terminology#rent) to the user.

‎basics/close-account/anchor-v1/programs/close-account/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ custom-heap = []
2020
custom-panic = []
2121

2222
[dependencies]
23-
anchor-lang = "1.2.0"
23+
anchor-lang = "1.2.1"
2424

2525
[dev-dependencies]
2626
litesvm = "0.16.0"

0 commit comments

Comments
 (0)