Skip to content

Commit

Permalink
Fix CI failure (#68)
Browse files Browse the repository at this point in the history
* Fix CI failure

* Update Scarb and Cairo to 2.7.1 and fix Nix build

* Add universal-sierra-compiler
  • Loading branch information
soareschen authored Sep 3, 2024
1 parent 8805b33 commit c162189
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 47 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/cairo-contracts.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Cairo Contracts
on:
pull_request:
paths:
- .github/workflows/cairo-contracts.yaml
- cairo-contracts/**
- justfile

pull_request: {}
push:
tags:
- v[0-9]+.*
Expand Down Expand Up @@ -39,5 +34,5 @@ jobs:
- name: Run Tests
working-directory: ./cairo-contracts
run: |
nix shell ..#snforge -c \
nix develop -c \
snforge test
10 changes: 1 addition & 9 deletions .github/workflows/light-client.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
name: Light Client
on:
pull_request:
paths:
- .github/workflows/light-client.yaml
- light-client/**
- "**/Cargo.toml"
- "**/Cargo.lock"
- justfile
- README.md

pull_request: {}
push:
tags:
- v[0-9]+.*
Expand Down
54 changes: 36 additions & 18 deletions flake.lock

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

29 changes: 23 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@
};

cairo-src = {
url = "github:starkware-libs/cairo/v2.7.0";
url = "github:starkware-libs/cairo/v2.7.1";
flake = false;
};

scarb-src = {
url = "github:software-mansion/scarb/v2.7.0";
url = "github:software-mansion/scarb/v2.7.1";
flake = false;
};

snforge-src = {
url = "github:foundry-rs/starknet-foundry/v0.29.0";
flake = false;
};

universal-sierra-compiler-src = {
url = "github:software-mansion/universal-sierra-compiler/v2.2.0";
flake = false;
};
};

outputs =
Expand All @@ -51,11 +56,21 @@

cosmos-nix = inputs.cosmos-nix.packages.${system};

rust = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

rust-wasm = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-wasm.toml;

rust-nightly = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-nightly.toml;

rust-1_79 = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-1.79.toml;

wasm-simapp = cosmos-nix.ibc-go-v8-wasm-simapp;

starknet-devnet = import ./nix/starknet-devnet.nix {
inherit nixpkgs;
inherit (inputs) starknet-devnet-src;

rust = rust-1_79;
};

cairo = import ./nix/cairo.nix {
Expand All @@ -73,18 +88,20 @@
inherit (inputs) snforge-src;
};

rust = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;

rust-wasm = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-wasm.toml;
universal-sierra-compiler = import ./nix/universal-sierra-compiler.nix {
inherit nixpkgs;
inherit (inputs) universal-sierra-compiler-src;

rust-nightly = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-nightly.toml;
rust = rust-1_79;
};

starknet-pkgs = {
inherit
starknet-devnet
cairo
scarb
snforge
universal-sierra-compiler
wasm-simapp
;
};
Expand Down
9 changes: 7 additions & 2 deletions nix/cairo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
let
cairo = nixpkgs.rustPlatform.buildRustPackage {
name = "cairo";
version = "2.7.0";
version = "2.7.1";

doCheck = false;

src = cairo-src;

cargoHash = "sha256-yufWRaLxazbo64jjbH4MGLWqF7K7dWZhBjIBHLaRVHw=";
cargoHash = "sha256-piabK7UNyt2hWoqR5IDnCZoo8+VvSthSao3sQXKjE0o=";

OPENSSL_NO_VENDOR = 1;
PKG_CONFIG_PATH = "${nixpkgs.openssl.dev}/lib/pkgconfig";

nativeBuildInputs = [ nixpkgs.pkg-config ];
};
in
cairo
4 changes: 2 additions & 2 deletions nix/scarb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
let
cairo = nixpkgs.rustPlatform.buildRustPackage {
name = "scarb";
version = "2.7.0";
version = "2.7.1";

doCheck = false;

src = scarb-src;

cargoHash = "sha256-EYepqNEixfuwBQDWUAkIUpJcyTwkh6bnBck+M4VROMY=";
cargoHash = "sha256-cAEwCX1zGJu4+ufdVSqBbksa1FLZWVNt2TLZ5JlGISk=";

SCARB_CORELIB_LOCAL_PATH = cairo-src + "/corelib";
};
Expand Down
13 changes: 11 additions & 2 deletions nix/starknet-devnet.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{ nixpkgs, starknet-devnet-src }:
{
nixpkgs,
rust,
starknet-devnet-src,
}:
let
starknet-devnet = nixpkgs.rustPlatform.buildRustPackage {
rust-platform = nixpkgs.makeRustPlatform {
cargo = rust;
rustc = rust;
};

starknet-devnet = rust-platform.buildRustPackage {
name = "starknet-devnet";
src = starknet-devnet-src;

Expand Down
29 changes: 29 additions & 0 deletions nix/universal-sierra-compiler.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
nixpkgs,
rust,
universal-sierra-compiler-src,
}:

let
rust-platform = nixpkgs.makeRustPlatform {
cargo = rust;
rustc = rust;
};

universal-sierra-compiler = rust-platform.buildRustPackage {
pname = "universal-sierra-compiler";
version = "2.2.0";

src = universal-sierra-compiler-src;

cargoLock = {
lockFile = universal-sierra-compiler-src + "/Cargo.lock";
outputHashes = {
"cairo-lang-casm-1.0.0-alpha.6" = "sha256-U4kTAAktXK7bFEkQAISQK3954hDkyxdsJU9c5hXmzpU=";
};
};

doCheck = false;
};
in
universal-sierra-compiler
3 changes: 3 additions & 0 deletions rust-toolchain-1.79.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.79"
profile = "default"
2 changes: 1 addition & 1 deletion rust-toolchain-wasm.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.80"
channel = "1.80.1"
profile = "default"
targets = ["wasm32-unknown-unknown"]

0 comments on commit c162189

Please sign in to comment.