Skip to content

Commit ad61536

Browse files
authored
Bump Zig to 0.14, Rust to 1.86, Solana to 2.3 (#1)
* Bump Zig to 0.14, Rust to 1.86, Solana to 2.3 * Don't run unit tests under Solana * Update windows job * Fixup windows build * Try something slightly different * Change how PERL is set
1 parent 93bdc82 commit ad61536

File tree

15 files changed

+8446
-2691
lines changed

15 files changed

+8446
-2691
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
name: Build and test hello-world program
1+
name: Main
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
branches:
6+
- 'main'
7+
push:
8+
branches:
9+
- 'main'
410

511
env:
6-
SOLANA_ZIG_VERSION: v1.43.0
12+
SOLANA_ZIG_VERSION: v1.47.0
713
SOLANA_ZIG_DIR: solana-zig
814

915
jobs:
1016
unit-test:
11-
name: Run helloworld unit tests
17+
name: Unit tests
1218
strategy:
1319
matrix:
1420
os: [ubuntu-latest, macos-latest, windows-latest]
@@ -35,7 +41,7 @@ jobs:
3541
$SOLANA_ZIG_DIR/zig build test --summary all --verbose
3642
3743
integration-test:
38-
name: Run helloworld integration tests
44+
name: Integration tests
3945
strategy:
4046
matrix:
4147
os: [ubuntu-latest, macos-latest, windows-latest]
@@ -62,7 +68,35 @@ jobs:
6268
- name: Install Rust
6369
uses: dtolnay/rust-toolchain@master
6470
with:
65-
toolchain: 1.78.0
71+
toolchain: 1.86.0
72+
73+
# took the workaround from https://github.com/sfackler/rust-openssl/issues/2149
74+
- name: Set Perl environment variables
75+
if: runner.os == 'Windows'
76+
run: |
77+
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
78+
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
79+
80+
- name: Setup openssl on Windows
81+
if: runner.os == 'Windows'
82+
shell: bash
83+
run: |
84+
cat > vcpkg.json <<EOL
85+
{
86+
"dependencies": ["openssl"],
87+
"overrides": [
88+
{
89+
"name": "openssl",
90+
"version": "3.4.1"
91+
}
92+
],
93+
"builtin-baseline": "5ee5eee0d3e9c6098b24d263e9099edcdcef6631"
94+
}
95+
EOL
96+
vcpkg install --triplet x64-windows-static-md
97+
rm vcpkg.json
98+
echo "OPENSSL_LIB_DIR=$PWD/vcpkg_installed/x64-windows-static-md/lib" >> $GITHUB_ENV
99+
echo "OPENSSL_INCLUDE_DIR=$PWD/vcpkg_installed/x64-windows-static-md/include" >> $GITHUB_ENV
66100
67101
- name: Install build deps
68102
shell: bash
@@ -73,7 +107,7 @@ jobs:
73107
run: ./program-test/test.sh
74108

75109
cli-test:
76-
name: Run helloworld CLI tests
110+
name: CLI tests
77111
if: false
78112
strategy:
79113
matrix:
@@ -101,7 +135,7 @@ jobs:
101135
- name: Install Rust
102136
uses: dtolnay/rust-toolchain@master
103137
with:
104-
toolchain: 1.78.0
138+
toolchain: 1.86.0
105139

106140
- name: Install Rust build deps
107141
shell: bash

build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const std = @import("std");
2-
const solana = @import("solana-program-sdk");
2+
const solana = @import("solana_program_sdk");
33
const base58 = @import("base58");
44

55
pub fn build(b: *std.Build) !void {
@@ -28,7 +28,7 @@ pub fn build(b: *std.Build) !void {
2828
const lib_unit_tests = b.addTest(.{
2929
.root_source_file = b.path("src/main.zig"),
3030
});
31-
lib_unit_tests.root_module.addImport("solana-program-sdk", solana_mod);
31+
lib_unit_tests.root_module.addImport("solana_program_sdk", solana_mod);
3232
const run_unit_tests = b.addRunArtifact(lib_unit_tests);
3333
test_step.dependOn(&run_unit_tests.step);
3434
}

build.zig.zon

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
.{
2-
.name = "solana-helloworld-zig",
2+
.fingerprint = 0x1ed04a41859b7c7d,
3+
.name = .solana_helloworld_zig,
34
// This is a [Semantic Version](https://semver.org/).
45
// In a future version of Zig it will be used for package deduplication.
5-
.version = "0.13.0",
6+
.version = "0.14.0",
67

78
// This field is optional.
89
// This is currently advisory only; Zig does not yet do anything
910
// with this value.
10-
.minimum_zig_version = "0.12.0",
11+
.minimum_zig_version = "0.14.0",
1112

1213
// This field is optional.
1314
// Each dependency must either provide a `url` and `hash`, or a `path`.
@@ -16,16 +17,12 @@
1617
// internet connectivity.
1718
.dependencies = .{
1819
.base58 = .{
19-
.url = "https://github.com/joncinque/base58-zig/archive/refs/tags/v0.13.3.tar.gz",
20-
.hash = "1220fd067bf167b9062cc29ccf715ff97643c2d3f8958beea863b6036876bb71bcb8",
20+
.url = "https://github.com/joncinque/base58-zig/archive/refs/tags/v0.14.0.tar.gz",
21+
.hash = "base58-0.14.0-6-CZm81qAAD4JCRHgewcNh8FS0pmnk7-OmwUkosaFKvg",
2122
},
22-
.clap = .{
23-
.url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.9.1.tar.gz",
24-
.hash = "122062d301a203d003547b414237229b09a7980095061697349f8bef41be9c30266b",
25-
},
26-
.@"solana-program-sdk" = .{
27-
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.14.0.tar.gz",
28-
.hash = "1220bdfa4ea1ab6330959ce4bc40feb5b39a7f98923a266a94b69e27fd20c3526786",
23+
.solana_program_sdk = .{
24+
.url = "https://github.com/joncinque/solana-program-sdk-zig/archive/refs/tags/v0.16.2.tar.gz",
25+
.hash = "solana_program_sdk-0.16.2-wGj9UHXjAAAK5z6ZdLUJ5uu2SxgE8o7ZJ9Il4EG22IJP",
2926
},
3027
},
3128

0 commit comments

Comments
 (0)