Skip to content

Commit eebc16a

Browse files
chore(ci): patch examples to use local crates (openvm-org#1712)
1 parent 2c35253 commit eebc16a

File tree

9 files changed

+40
-20
lines changed

9 files changed

+40
-20
lines changed

.github/workflows/cli.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ jobs:
5151
set -e
5252
for dir in */; do
5353
if [ -f "${dir}Cargo.toml" ]; then
54-
echo "Editing ${dir}Cargo.toml to use the current branch"
55-
sed -i \
56-
-e "s|\(git = \"https://github.com/openvm-org/openvm.git\"\)|\1, branch = \"${{ github.head_ref }}\"|" \
57-
"${dir}Cargo.toml"
58-
5954
echo "Building ${dir%/}"
6055
cd "$dir"
6156
cargo openvm build

.github/workflows/lints.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ jobs:
3131
with:
3232
cache-on-failure: true
3333

34-
- name: Update example dependencies to current ref
35-
working-directory: examples
36-
run: |
37-
set -e
38-
for dir in */; do
39-
if [ -f "${dir}Cargo.toml" ]; then
40-
sed -i \
41-
-e "s|\(git = \"https://github.com/openvm-org/openvm.git\"\)|\1, branch = \"${{ github.head_ref }}\"|" \
42-
"${dir}Cargo.toml"
43-
fi
44-
done
45-
4634
- name: Generate docs
4735
run: |
4836
cargo doc --workspace --exclude "openvm-benchmarks" --exclude "*-tests" --exclude "*-test"

examples/ecc/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ hex-literal = { version = "0.4.1", default-features = false }
1717

1818
[features]
1919
default = []
20+
21+
# remove this if copying example outside of monorepo
22+
[patch."https://github.com/openvm-org/openvm.git"]
23+
openvm = { path = "../../crates/toolchain/openvm" }
24+
openvm-algebra-guest = { path = "../../extensions/algebra/guest" }
25+
openvm-ecc-guest = { path = "../../extensions/ecc/guest" }
26+
k256 = { path = "../../guest-libs/k256" }

examples/i256/Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ alloy-primitives = "1.1.2"
1616
default = []
1717

1818
[patch.crates-io]
19-
ruint = { git = "https://github.com/openvm-org/openvm.git" }
20-
# alloy-primitives uses ruint
19+
# alloy-primitives uses ruint:
20+
# ruint = { git = "https://github.com/openvm-org/openvm.git" }
21+
# Use above if outside of monorepo
22+
ruint = { path = "../../guest-libs/ruint" }
23+
24+
# remove this if copying example outside of monorepo
25+
[patch."https://github.com/openvm-org/openvm.git"]
26+
openvm = { path = "../../crates/toolchain/openvm" }
2127

2228
[profile.release]
2329
lto = "thin"

examples/keccak/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ hex = { version = "0.4.3" }
1515

1616
[features]
1717
default = []
18+
19+
# remove this if copying example outside of monorepo
20+
[patch."https://github.com/openvm-org/openvm.git"]
21+
openvm = { path = "../../crates/toolchain/openvm" }
22+
openvm-keccak256 = { path = "../../guest-libs/keccak256" }

examples/pairing/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ hex-literal = { version = "0.4.1", default-features = false }
2121

2222
[features]
2323
default = []
24+
25+
# remove this if copying example outside of monorepo
26+
[patch."https://github.com/openvm-org/openvm.git"]
27+
openvm = { path = "../../crates/toolchain/openvm" }
28+
openvm-algebra-guest = { path = "../../extensions/algebra/guest" }
29+
openvm-ecc-guest = { path = "../../extensions/ecc/guest" }
30+
openvm-pairing = { path = "../../guest-libs/pairing" }

examples/sha256/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ hex = { version = "0.4.3" }
1515

1616
[features]
1717
default = []
18+
19+
# remove this if copying example outside of monorepo
20+
[patch."https://github.com/openvm-org/openvm.git"]
21+
openvm = { path = "../../crates/toolchain/openvm" }
22+
openvm-sha2 = { path = "../../guest-libs/sha2" }

examples/u256/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ openvm-ruint = { git = "https://github.com/openvm-org/openvm.git", package = "ru
1414

1515
[features]
1616
default = []
17+
18+
# remove this if copying example outside of monorepo
19+
[patch."https://github.com/openvm-org/openvm.git"]
20+
openvm = { path = "../../crates/toolchain/openvm" }
21+
ruint = { path = "../../guest-libs/ruint" }

extensions/bigint/guest/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ strum_macros = { workspace = true }
1313

1414
[features]
1515
default = []
16-
export-intrinsics = [] # export extern no_mangle functions for external linkage
16+
export-intrinsics = [
17+
"openvm-platform/rust-runtime",
18+
] # export extern no_mangle functions for external linkage

0 commit comments

Comments
 (0)