Skip to content

Commit 17cb3ff

Browse files
committed
fix(ci): repair main CI (five8/wincode, anchor 1.0.2, asm pnpm)
Main was red across the Native, ASM, Pinocchio and Anchor workflows. Native/Pinocchio/ASM dependency builds: - solana-signature 3.3.0 (via the litesvm dev-dependency) pulled five8 1.0.0, which is no_std and dropped DecodeError's Error impl, so host test builds failed to compile. Pin the lockfile to solana-signature 3.4.1. - 3.4.1 moved wincode to 0.5.x while solana-hash 4.2.0, solana-message 4.0.0 and solana-transaction 4.0.0 stayed on 0.4.x, splitting the graph across two wincode versions. Bump those three (4.4.0 / 4.1.0 / 4.1.0) so the graph resolves a single wincode 0.5.3. Anchor: - Programs were split across anchor-lang 1.0.0-rc.5 and 1.0.0 while the workflow installed anchor-cli 0.32.1. Standardize all programs and the workflow on anchor 1.0.2, and sync the two committed sub-workspace locks. - Build with --ignore-keys and run anchor keys sync for the ephemeral keypairs CI generates; run anchor test with --validator legacy since surfpool (the Anchor 1.0 default) is not installed. - cross-program-invocation: declare_program!(lever) bakes lever's IDL address into hand at build time, so ephemeral keys broke the CPI owner check. Commit stable hand/lever keypairs and align declare_id!, Anchor.toml and idls/lever.json. ASM: - Pin pnpm to 10.33.0 (unpinned latest fails CI with ERR_PNPM_IGNORED_BUILDS) and mark bufferutil/utf-8-validate as ignoredBuiltDependencies. CI hardening: - Force the sparse registry protocol, raise CARGO_NET_RETRY and retry anchor build to ride out transient crates.io index fetch failures. - Trigger the native/pinocchio/asm workflows on root Cargo.lock/Cargo.toml changes so dependency bumps actually exercise them (this gap is why the dependabot solana-* bumps broke main without being caught). Ignore basics/favorites/native: pre-existing failure where bankrun's runtime rejects an instruction the current build-sbf toolchain emits; tracked for a bankrun -> litesvm test migration.
1 parent b166e57 commit 17cb3ff

68 files changed

Lines changed: 274 additions & 243 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/.ghaignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
basics/realloc/native
33
basics/cross-program-invocation/native
44

5+
# bankrun runtime rejects an instruction the current build-sbf toolchain emits
6+
basics/favorites/native
7+
58
# uses generated client from shank, can't rewrite to solana-bankrun
69
tools/shank-and-solita/native
710

.github/workflows/anchor.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ env:
1717
MIN_PROJECTS_FOR_MATRIX: 4
1818
# See https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
1919
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
20+
# Harden cargo against transient crates.io index fetch failures that flake
21+
# cargo build-sbf ("failed to get <crate> as a dependency").
22+
CARGO_NET_RETRY: "10"
23+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
2024

2125
jobs:
2226
changes:
@@ -109,7 +113,7 @@ jobs:
109113
- uses: pnpm/action-setup@v4
110114
- uses: heyAyushh/setup-anchor@v4.999
111115
with:
112-
anchor-version: 0.32.1
116+
anchor-version: 1.0.2
113117
solana-cli-version: stable
114118
- name: Display Versions
115119
run: |
@@ -137,16 +141,31 @@ jobs:
137141
fi
138142
139143
# Run anchor build
140-
if ! anchor build; then
144+
# --ignore-keys: most examples don't commit program keypairs, so CI
145+
# generates ephemeral ones that won't match the source declare_id!
146+
# Retry to ride out transient crates.io index fetch failures.
147+
build_ok=false
148+
for attempt in 1 2 3; do
149+
if anchor build --ignore-keys; then
150+
build_ok=true
151+
break
152+
fi
153+
echo "anchor build attempt $attempt failed for $project; retrying"
154+
done
155+
if [ "$build_ok" != "true" ]; then
141156
echo "::error::anchor build failed for $project"
142157
echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
143158
rm -rf target
144159
cd - > /dev/null
145160
return 1
146161
fi
147162
163+
# Align declare_id! and Anchor.toml with the ephemeral keypair
164+
anchor keys sync
165+
148166
# Run anchor test
149-
if ! anchor test; then
167+
# --validator legacy: surfpool (the Anchor 1.0 default) isn't installed in CI
168+
if ! anchor test --validator legacy; then
150169
echo "::error::anchor test failed for $project"
151170
echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
152171
rm -rf target node_modules

.github/workflows/solana-asm.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ env:
1515
MAX_JOBS: 64
1616
MIN_PROJECTS_PER_JOB: 4
1717
MIN_PROJECTS_FOR_MATRIX: 4
18+
# Harden cargo against transient crates.io index fetch failures that flake
19+
# cargo build-sbf ("failed to get <crate> as a dependency").
20+
CARGO_NET_RETRY: "10"
21+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
1822

1923
jobs:
2024
changes:
@@ -37,6 +41,8 @@ jobs:
3741
- added|modified: '**/asm/**'
3842
workflow:
3943
- added|modified: '.github/workflows/solana-asm.yml'
44+
- added|modified: 'Cargo.lock'
45+
- added|modified: 'Cargo.toml'
4046
- name: Analyze Changes
4147
id: analyze
4248
run: |
@@ -180,8 +186,9 @@ jobs:
180186
# Make the script executable
181187
chmod +x build_and_test.sh
182188
183-
# Install pnpm
184-
npm install --global pnpm
189+
# Install pnpm (pin to the repo's packageManager version; unpinned
190+
# latest pnpm fails CI with ERR_PNPM_IGNORED_BUILDS)
191+
npm install --global pnpm@10.33.0
185192
186193
# Install sbpf assembler
187194
cargo install --git https://github.com/blueshift-gg/sbpf.git

.github/workflows/solana-native.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ env:
1515
MAX_JOBS: 64
1616
MIN_PROJECTS_PER_JOB: 4
1717
MIN_PROJECTS_FOR_MATRIX: 4
18+
# Harden cargo against transient crates.io index fetch failures that flake
19+
# cargo build-sbf ("failed to get <crate> as a dependency").
20+
CARGO_NET_RETRY: "10"
21+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
1822
# See https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
1923
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
2024

@@ -39,6 +43,8 @@ jobs:
3943
- added|modified: '**/native/**'
4044
workflow:
4145
- added|modified: '.github/workflows/solana-native.yml'
46+
- added|modified: 'Cargo.lock'
47+
- added|modified: 'Cargo.toml'
4248
- name: Analyze Changes
4349
id: analyze
4450
run: |

.github/workflows/solana-pinocchio.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ env:
1515
MAX_JOBS: 64
1616
MIN_PROJECTS_PER_JOB: 4
1717
MIN_PROJECTS_FOR_MATRIX: 4
18+
# Harden cargo against transient crates.io index fetch failures that flake
19+
# cargo build-sbf ("failed to get <crate> as a dependency").
20+
CARGO_NET_RETRY: "10"
21+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
1822
# See https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
1923
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
2024

@@ -39,6 +43,8 @@ jobs:
3943
- added|modified: '**/pinocchio/**'
4044
workflow:
4145
- added|modified: '.github/workflows/solana-pinocchio.yml'
46+
- added|modified: 'Cargo.lock'
47+
- added|modified: 'Cargo.toml'
4248
- name: Analyze Changes
4349
id: analyze
4450
run: |

0 commit comments

Comments
 (0)