Skip to content

Commit

Permalink
Update nixpkgs and add latest Anchor/Solana versions (#41)
Browse files Browse the repository at this point in the history
* Update nixpkgs

* updates to the build

* update nix actions

* update github sha of solana 1.17

* solana and Rust updates

* cargo output hashes specify

* don't build on old macos anymore

* build all basic in ci

* downgrde rust for 1.13

* fix 1.17 build

* force old rust

* remove solana 1.7 support

* remove cargo.lock for solana 1.7

* remove goki-cli

* add anchor cargo.locks

* fix cargo.lock patches

* readd spl-token-cli and saber-devenv to env

* formatting

* fix 0.18

* fix nix flake check

* fix some hashes

* more hashes

* more hashes

* more hash fixes

* hash mismatch

* fix hashes again

* remove support for really old anchor
  • Loading branch information
macalinao authored Nov 29, 2023
1 parent e1c8575 commit d3e2155
Show file tree
Hide file tree
Showing 49 changed files with 138,826 additions and 207 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- uses: cachix/install-nix-action@v20
- name: Setup Cachix
uses: cachix/cachix-action@v10
uses: cachix/cachix-action@v12
with:
name: saber
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
Expand All @@ -30,16 +30,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11.0, macos-12]
os: [ubuntu-latest, macos-12]
package:
- solana-1_7-basic
- solana-1_8-basic
- solana-1_9-basic
- solana-1_10-basic
- solana-1_11-basic
- solana-1_13-basic
- solana-1_17-basic
- solana-basic
- spl-token-cli
- anchor-0_12_0
- anchor-0_13_2
- anchor-0_15_0
- anchor-0_16_1
- anchor-0_17_0
Expand All @@ -53,15 +53,18 @@ jobs:
- anchor-0_23_0
- anchor-0_24_0
- anchor-0_24_2
- anchor-0_25_0
- anchor-0_25
- anchor-0_26
- anchor-0_27
- anchor-0_28
- anchor-0_29
- anchor
- saber-devenv
- goki-cli
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- uses: cachix/install-nix-action@v20
- name: Setup Cachix
uses: cachix/cachix-action@v10
uses: cachix/cachix-action@v12
with:
name: saber
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
Expand All @@ -74,18 +77,18 @@ jobs:
matrix:
os: [ubuntu-latest]
package:
- solana-1_7-full
- solana-1_8-full
- solana-1_9-full
- solana-1_10-full
- solana-1_11-full
- solana-1_13-full
- solana-1_17-full
- solana-full
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- uses: cachix/install-nix-action@v20
- name: Setup Cachix
uses: cachix/cachix-action@v10
uses: cachix/cachix-action@v12
with:
name: saber
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
Expand Down
6 changes: 5 additions & 1 deletion env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
with pkgs;
buildEnv {
name = "saber-env";
paths = [ spl-token-cli saber-devenv ];
paths = [
spl-token-cli
saber-devenv
gnupatch
];
}
60 changes: 48 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ let
cargo = rust;
});
};
rustNightly = mkRust prev.rust-bin.nightly."2022-05-21".minimal;
rustNightly = mkRust prev.rust-bin.nightly."2023-11-28".minimal;
rust-1_60 = mkRust prev.rust-bin.stable."1.60.0".minimal;
rustStable = mkRust prev.rust-bin.stable."1.61.0".minimal;
rustStable = mkRust prev.rust-bin.stable."1.74.0".minimal;
saberPackages = (import ./packages {
inherit rustNightly rustStable rust-1_60;
pkgs = prev;
Expand Down
38 changes: 38 additions & 0 deletions packages/anchor/cargo-lock-dl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash -xe

VERSIONS=(
"0.12.0"
"0.13.2"
"0.15.0"
"0.16.1"
"0.17.0"
"0.18.0"
"0.18.2"
"0.19.0"
"0.20.0"
"0.20.1"
"0.21.0"
"0.22.0"
"0.23.0"
"0.24.0"
"0.24.2"
"0.25.0"
"0.26.0"
"0.27.0"
"0.28.0"
"0.29.0"
)

for VERSION in "${VERSIONS[@]}"; do
echo "Downloading Cargo.lock@$VERSION"
mkdir -p cargo/v$VERSION
curl https://raw.githubusercontent.com/coral-xyz/anchor/v$VERSION/Cargo.lock >cargo/v$VERSION/Cargo.lock

PATCH_FILE=./patches/cargo-$VERSION.patch
if [ -f $PATCH_FILE ]; then
echo "We have a patch for $VERSION. Patching"
patch --reject-file=/dev/null --no-backup-if-mismatch -f ./cargo/v$VERSION/Cargo.lock <$PATCH_FILE || {
echo "Patched."
}
fi
done
Loading

0 comments on commit d3e2155

Please sign in to comment.