Skip to content

Commit 8c5fa48

Browse files
committed
[Chore] Support octez-smart-rollup-wasm-debugger
Problem: There is a demand for octez-smart-rollup-wasm-debugger to be included into release. Solution: Support it.
1 parent 3a6bfd8 commit 8c5fa48

File tree

6 files changed

+78
-3
lines changed

6 files changed

+78
-3
lines changed

.github/workflows/build-bottles.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
os: [ { id: macos-12, name: "monterey" } ]
1919
# we don't bottle meta-formulas that contain only services
20-
formula: [tezos-accuser-PtNairob, tezos-accuser-Proxford, tezos-admin-client, tezos-baker-PtNairob, tezos-baker-Proxford, tezos-client, tezos-codec, tezos-node, tezos-signer, tezos-smart-rollup-client-PtNairob, tezos-smart-rollup-client-Proxford, tezos-smart-rollup-node-PtNairob, tezos-smart-rollup-node-Proxford, tezos-dac-client, tezos-dac-node]
20+
formula: [tezos-accuser-PtNairob, tezos-accuser-Proxford, tezos-admin-client, tezos-baker-PtNairob, tezos-baker-Proxford, tezos-client, tezos-codec, tezos-node, tezos-signer, tezos-smart-rollup-client-PtNairob, tezos-smart-rollup-client-Proxford, tezos-smart-rollup-node-PtNairob, tezos-smart-rollup-node-Proxford, tezos-dac-client, tezos-dac-node, tezos-smart-rollup-wasm-debugger]
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env ruby
2+
# SPDX-FileCopyrightText: 2023 Oxhead Alpha
3+
# SPDX-License-Identifier: LicenseRef-MIT-OA
4+
5+
class TezosSmartRollupWasmDebugger < Formula
6+
@all_bins = []
7+
8+
class << self
9+
attr_accessor :all_bins
10+
end
11+
homepage "https://gitlab.com/tezos/tezos"
12+
13+
url "https://gitlab.com/tezos/tezos.git", :tag => "v18.0-rc1", :shallow => false
14+
15+
version "v18.0-rc1-1"
16+
17+
build_dependencies = %w[pkg-config coreutils autoconf rsync wget rustup-init cmake]
18+
build_dependencies.each do |dependency|
19+
depends_on dependency => :build
20+
end
21+
22+
dependencies = %w[gmp hidapi libev tezos-sapling-params]
23+
dependencies.each do |dependency|
24+
depends_on dependency
25+
end
26+
desc "Smart contract rollup wasm debugger"
27+
28+
bottle do
29+
root_url "https://github.com/serokell/tezos-packaging/releases/download/#{TezosSmartRollupWasmDebugger.version}/"
30+
end
31+
32+
def make_deps
33+
ENV.deparallelize
34+
ENV["CARGO_HOME"]="./.cargo"
35+
# Disable usage of instructions from the ADX extension to avoid incompatibility
36+
# with old CPUs, see https://gitlab.com/dannywillems/ocaml-bls12-381/-/merge_requests/135/
37+
ENV["BLST_PORTABLE"]="yes"
38+
# Here is the workaround to use opam 2.0.9 because Tezos is currently not compatible with opam 2.1.0 and newer
39+
arch = RUBY_PLATFORM.include?("arm64") ? "arm64" : "x86_64"
40+
system "curl", "-L", "https://github.com/ocaml/opam/releases/download/2.0.9/opam-2.0.9-#{arch}-macos", "--create-dirs", "-o", "#{ENV["HOME"]}/.opam-bin/opam"
41+
system "chmod", "+x", "#{ENV["HOME"]}/.opam-bin/opam"
42+
ENV["PATH"]="#{ENV["HOME"]}/.opam-bin:#{ENV["PATH"]}"
43+
system "rustup-init", "--default-toolchain", "1.64.0", "-y"
44+
system "opam", "init", "--bare", "--debug", "--auto-setup", "--disable-sandboxing"
45+
system ["source .cargo/env", "make build-deps"].join(" && ")
46+
end
47+
48+
def install_template(dune_path, exec_path, name)
49+
bin.mkpath
50+
self.class.all_bins << name
51+
system ["eval $(opam env)", "dune build #{dune_path}", "cp #{exec_path} #{name}"].join(" && ")
52+
bin.install name
53+
ln_sf "#{bin}/#{name}", "#{bin}/#{name.gsub("octez", "tezos")}"
54+
end
55+
56+
def install
57+
make_deps
58+
install_template "src/bin_wasm_debugger/main_wasm_debugger.exe",
59+
"_build/default/src/bin_wasm_debugger/main_wasm_debugger.exe",
60+
"octez-smart-rollup-wasm-debugger"
61+
end
62+
end

docker/docker-static-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -euo pipefail
1010

1111
if [ -z ${OCTEZ_EXECUTABLES+x} ]; then
1212

13-
binaries=("octez-admin-client" "octez-dac-client" "octez-dac-node" "octez-client" "octez-node" "octez-signer" "octez-codec")
13+
binaries=("octez-admin-client" "octez-dac-client" "octez-dac-node" "octez-client" "octez-node" "octez-signer" "octez-codec" "octez-smart-rollup-wasm-debugger")
1414

1515
for proto in $(jq -r ".active | .[]" ../protocols.json); do
1616
binaries+=("octez-accuser-$proto" "octez-baker-$proto" "octez-smart-rollup-client-$proto" "octez-smart-rollup-node-$proto")

docker/package/packages.py

+8
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@
192192
dune_filepath="src/bin_dac_node/main_dac.exe",
193193
)
194194
},
195+
{
196+
"tezos-smart-rollup-wasm-debugger": TezosBinaryPackage(
197+
"tezos-smart-rollup-wasm-debugger",
198+
"Smart contract rollup wasm debugger",
199+
meta=packages_meta,
200+
dune_filepath="src/bin_wasm_debugger/main_wasm_debugger.exe",
201+
)
202+
},
195203
]
196204

197205

nix/build/release-binaries.nix

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ in [
4343
description = "A client to decode and encode JSON";
4444
supports = protocolsFormatted;
4545
}
46+
{
47+
name = "octez-smart-rollup-wasm-debugger";
48+
description = "Smart contract rollup wasm debugger";
49+
supports = protocolsFormatted;
50+
}
4651
] ++ builtins.concatMap (protocol: [
4752
{
4853
name = "octez-baker-${protocol}";

scripts/build-all-bottles.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set -euo pipefail
1919
retval="0"
2020

2121
# we don't bottle meta-formulas that contain only services
22-
formulae=("tezos-accuser-PtNairob" "tezos-accuser-Proxford" "tezos-admin-client" "tezos-baker-PtNairob" "tezos-baker-Proxford" "tezos-client" "tezos-codec" "tezos-node" "tezos-signer" "tezos-smart-rollup-client-PtNairob" "tezos-smart-rollup-client-Proxford" "tezos-smart-rollup-node-PtNairob" "tezos-smart-rollup-node-Proxford" "tezos-dac-client" "tezos-dac-node")
22+
formulae=("tezos-accuser-PtNairob" "tezos-accuser-Proxford" "tezos-admin-client" "tezos-baker-PtNairob" "tezos-baker-Proxford" "tezos-client" "tezos-codec" "tezos-node" "tezos-signer" "tezos-smart-rollup-client-PtNairob" "tezos-smart-rollup-client-Proxford" "tezos-smart-rollup-node-PtNairob" "tezos-smart-rollup-node-Proxford" "tezos-dac-client" "tezos-dac-node" "tezos-smart-rollup-wasm-debugger")
2323

2424
# tezos-sapling-params is used as a dependency for some of the formulas
2525
# so we handle it separately.

0 commit comments

Comments
 (0)