-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathcheck_wasm.sh
More file actions
executable file
·181 lines (168 loc) · 4.36 KB
/
Copy pathcheck_wasm.sh
File metadata and controls
executable file
·181 lines (168 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#!/usr/bin/env bash
set +e # Disable immediate exit on error
# Array of crates to compile
crates=($(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name' | grep '^reth' | sort))
# Array of crates to exclude
# Used with the `contains` function.
# shellcheck disable=SC2034
exclude_crates=(
# The following require investigation if they can be fixed
reth-basic-payload-builder
reth-bench
reth-cli
reth-cli-commands
reth-cli-runner
reth-consensus-debug-client
reth-db-common
reth-discv4
reth-discv5
reth-dns-discovery
reth-downloaders
reth-e2e-test-utils
reth-engine-service
reth-engine-tree
reth-engine-util
reth-eth-wire
reth-ethereum-cli
reth-ethereum-payload-builder
reth-etl
reth-exex
reth-exex-test-utils
reth-ipc
reth-net-nat
reth-network
reth-node-api
reth-node-builder
reth-node-core
reth-node-ethereum
reth-node-events
reth-node-metrics
reth-optimism-cli
reth-optimism-flashblocks
reth-optimism-node
reth-optimism-payload-builder
reth-optimism-rpc
reth-optimism-storage
reth-rpc
reth-rpc-api
reth-rpc-api-testing-util
reth-rpc-builder
reth-rpc-convert
reth-rpc-e2e-tests
reth-rpc-engine-api
reth-rpc-eth-api
reth-rpc-eth-types
reth-rpc-layer
reth-stages
reth-engine-local
reth-ress-protocol
reth-ress-provider
# The following are not supposed to be working (jemalloc/tokio dependencies)
reth # all of the crates below
reth-chain-state # jemalloc, tokio
reth-config # jemalloc
reth-consensus # jemalloc
reth-consensus-common # jemalloc, tokio
reth-db # jemalloc
reth-db-api # jemalloc
reth-engine-primitives # jemalloc, tokio
reth-errors # jemalloc
reth-ethereum-consensus # jemalloc, tokio
reth-ethereum-engine-primitives # jemalloc, tokio
reth-evm # jemalloc
reth-evm-ethereum # jemalloc
reth-execution-types # jemalloc, tokio
reth-exex-types # jemalloc, tokio
reth-network-api # jemalloc, tokio
reth-network-p2p # jemalloc, tokio
reth-node-types # jemalloc
reth-optimism-consensus # jemalloc, tokio
reth-optimism-evm # jemalloc
reth-payload-builder-primitives # jemalloc, tokio
reth-payload-primitives # jemalloc, tokio
reth-revm # jemalloc
reth-rpc-server-types # jemalloc, tokio
reth-stages-types # jemalloc
reth-stateless # jemalloc
reth-storage-api # jemalloc, tokio
reth-trie # jemalloc
reth-trie-common # jemalloc
reth-trie-db # jemalloc
reth-trie-sparse # jemalloc
reth-storage-rpc-provider
reth-invalid-block-hooks # reth-provider
reth-libmdbx # mdbx
reth-mdbx-sys # mdbx
reth-payload-builder # reth-metrics
reth-provider # tokio
reth-prune # tokio
reth-stages-api # reth-provider, reth-prune
reth-static-file # tokio
reth-transaction-pool # c-kzg
reth-payload-util # reth-transaction-pool
reth-trie-parallel # tokio
reth-trie-sparse-parallel # rayon
reth-testing-utils
reth-optimism-txpool # reth-transaction-pool
reth-era-downloader # tokio
reth-era-utils # tokio
reth-tracing-otlp
reth-node-ethstats
)
# Array to hold the results
results=()
# Flag to track if any command fails
any_failed=0
# Function to check if a value exists in an array
contains() {
local array="$1[@]"
local seeking=$2
local in=1
for element in "${!array}"; do
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
done
return $in
}
for crate in "${crates[@]}"; do
if contains exclude_crates "$crate"; then
results+=("3:⏭️:$crate")
continue
fi
cmd="cargo +stable build -p $crate --target wasm32-wasip1 --no-default-features"
if [ -n "$CI" ]; then
echo "::group::$cmd"
else
printf "\n%s:\n %s\n" "$crate" "$cmd"
fi
set +e # Disable immediate exit on error
# Run the command and capture the return code
$cmd
ret_code=$?
set -e # Re-enable immediate exit on error
# Store the result in the dictionary
if [ $ret_code -eq 0 ]; then
results+=("1:✅:$crate")
else
results+=("2:❌:$crate")
any_failed=1
fi
if [ -n "$CI" ]; then
echo "::endgroup::"
fi
done
# Sort the results by status and then by crate name
IFS=$'\n' sorted_results=($(sort <<<"${results[*]}"))
unset IFS
# Print summary
echo -e "\nSummary of build results:"
for result in "${sorted_results[@]}"; do
status="${result#*:}"
status="${status%%:*}"
crate="${result##*:}"
echo "$status $crate"
done
# Exit with a non-zero status if any command fails
exit $any_failed