Skip to content

Commit 0754f22

Browse files
charlielyeAztecBot
authored andcommitted
cherry-pick: fix: some mac install fixes (#20630) (with conflicts)
* jq install only needed on macos 14. * python check/install not needed. * remove inheriterr setting from aztec.sh for mac on bash 3. * added `test_macs` cmd to aztec-up bootstrap. Launches 14/15/26 macos in parallel and installs on each. * add `qemu-utils` to devbox. (cherry picked from commit 44e1ce2)
1 parent ec29c67 commit 0754f22

6 files changed

Lines changed: 63 additions & 4 deletions

File tree

aztec-up/bin/0.0.1/install

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,20 @@
88
set -euo pipefail
99

1010
# Colors
11+
<<<<<<< HEAD
1112
reset="\033[0m"
1213
g="\033[38;5;114m" # green
1314
y="\033[38;5;222m" # yellow
1415
b="\033[38;5;111m" # blue
1516
p="\033[38;5;176m" # purple
1617
r="\033[38;5;203m" # red
18+
=======
19+
r="\033[31m" # Red
20+
g="\033[32m" # Green
21+
y="\033[33m" # Yellow
22+
b="\033[34m" # Blue
23+
reset="\033[0m"
24+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
1725

1826
# Helper function to safely read version from versions file
1927
function get_version {
@@ -140,8 +148,13 @@ function install_node {
140148
fi
141149

142150
. "$HOME/.nvm/nvm.sh"
151+
<<<<<<< HEAD
143152
nvm install "$node_min_version"
144153
nvm alias default "$node_min_version"
154+
=======
155+
nvm install --lts
156+
nvm alias default lts/*
157+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
145158
}
146159

147160
function install_versions_file {
@@ -319,8 +332,13 @@ function main {
319332
dump_fail install_node
320333
echo_green "done."
321334

335+
<<<<<<< HEAD
322336
# Source nvm to ensure node is in PATH (if using nvm).
323337
[ -f "$HOME/.nvm/nvm.sh" ] && . "$HOME/.nvm/nvm.sh"
338+
=======
339+
# Source nvm to ensure node is in PATH.
340+
. "$HOME/.nvm/nvm.sh"
341+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
324342

325343
# Install noir
326344
echo -n "Installing nargo... "

aztec-up/bootstrap.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,14 @@ function prep_test_mac {
166166
fi
167167

168168
# Cleanup background processes on exit.
169+
<<<<<<< HEAD
169170
# Note: can't use local - the trap fires after function scope is gone.
170171
_bg_pids=()
171172
trap 'kill "${_bg_pids[@]}" &>/dev/null || true' EXIT
173+
=======
174+
local pids=()
175+
trap 'kill "${pids[@]}" &>/dev/null || true' EXIT
176+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
172177

173178
# Start Verdaccio in offline mode (no uplinks), bound to all interfaces.
174179
cat > /tmp/verdaccio-mac-test.yaml <<EOF
@@ -190,13 +195,21 @@ logs: { type: stdout, format: pretty, level: warn }
190195
EOF
191196

192197
verdaccio --config /tmp/verdaccio-mac-test.yaml --listen 0.0.0.0:$verdaccio_port &>/dev/null &
198+
<<<<<<< HEAD
193199
_bg_pids+=($!)
200+
=======
201+
pids+=($!)
202+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
194203
while ! nc -z localhost $verdaccio_port &>/dev/null; do sleep 1; done
195204
echo "Verdaccio running on 0.0.0.0:$verdaccio_port"
196205

197206
# Serve bin/ directory over HTTP to mimic S3-hosted install scripts.
198207
python3 -m http.server $http_port --directory ./bin --bind 0.0.0.0 &>/dev/null &
208+
<<<<<<< HEAD
199209
_bg_pids+=($!)
210+
=======
211+
pids+=($!)
212+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
200213
while ! nc -z localhost $http_port &>/dev/null; do sleep 1; done
201214
echo "HTTP server running on 0.0.0.0:$http_port (serving ./bin/)"
202215
}
@@ -218,24 +231,38 @@ function install_on_mac_vm {
218231
# Point npm at local Verdaccio and scripts at local HTTP server.
219232
export npm_config_registry=http://$host_ip:$verdaccio_port
220233
export INSTALL_URI=http://$host_ip:$http_port
234+
<<<<<<< HEAD
221235
export INFRA_VERSION=0.0.1
222236
export NO_NEW_SHELL=1
237+
=======
238+
export NO_NEW_SHELL=1
239+
export NON_INTERACTIVE=1
240+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
223241
224242
touch \$HOME/.zshrc
225243
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash
226244
. "\$HOME/.nvm/nvm.sh"
227245
228246
echo
229247
echo "Running aztec install script..."
248+
<<<<<<< HEAD
230249
bash <(curl -sL \$INSTALL_URI/0.0.1/aztec-install)
250+
=======
251+
VERSION=0.0.1 bash <(curl -sL \$INSTALL_URI/0.0.1/aztec-install)
252+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
231253
232254
# Fake fresh shell.
233255
export PATH="\$HOME/.aztec/current/bin:\$HOME/.aztec/current/node_modules/.bin:\$HOME/.aztec/bin:\$PATH"
234256
. "\$HOME/.nvm/nvm.sh"
235257
236258
# Verify installation.
259+
<<<<<<< HEAD
237260
aztec-nargo --version
238261
aztec-bb --version
262+
=======
263+
nargo --version
264+
bb --version
265+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
239266
aztec --version
240267
REMOTE_EOF
241268
}
@@ -256,20 +283,29 @@ export -f install_on_mac_vm launch_and_install_on_mac_vm
256283

257284
# Assumes a macos vm is already running.
258285
# Starts services, and runs install script on the mac vm via ssh.
286+
<<<<<<< HEAD
259287
function test_on_mac_vm {
260288
local mac_name="${1:?Mac vm name (e.g. 14)}"
261289
echo_header "aztec-up test_on_mac_vm"
290+
=======
291+
function test_mac {
292+
echo_header "aztec-up test_mac"
293+
local mac_name="${1:?Mac vm name (e.g. 14)}"
294+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
262295
prep_test_mac
263296
install_on_mac_vm $mac_name
264297
}
265298

299+
<<<<<<< HEAD
266300
function test_mac {
267301
local mac_name="${1:?Mac vm name (e.g. 14)}"
268302
echo_header "aztec-up test_mac"
269303
prep_test_mac
270304
launch_and_install_on_mac_vm $mac_name
271305
}
272306

307+
=======
308+
>>>>>>> 44e1ce22abb (fix: some mac install fixes)
273309
# Starts services, launches a mac vm for each version and runs install script via ssh.
274310
function test_macs {
275311
echo_header "aztec-up test_macs"

barretenberg/ts/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function release {
6868
}
6969

7070
function cross_copy {
71-
./scripts/copy_cross.sh
71+
./scripts/copy_cross.sh "$@"
7272
}
7373

7474
case "$cmd" in

barretenberg/ts/scripts/copy_cross.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ NO_CD=1 source $(git rev-parse --show-toplevel)/ci3/source
55

66
cd $(dirname $0)/..
77

8-
if semver check "${REF_NAME:-}" && [[ "$(arch)" == "amd64" ]]; then
8+
if [ -n "${1:-}" ]; then
9+
arch="$1"
10+
mkdir -p ./build/$arch
11+
cp ../cpp/build-zig-$arch/bin/bb ./build/$arch
12+
cp ../cpp/build-zig-$arch/lib/nodejs_module.node ./build/$arch
13+
elif semver check "${REF_NAME:-}" && [[ "$(arch)" == "amd64" ]]; then
914
# We're building a release.
1015
# We take host build for amd64-linux.
1116
mkdir -p ./build/amd64-linux

build-images/src/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ RUN apt update && \
203203
neovim \
204204
psmisc \
205205
python3-blessed \
206+
qemu-utils \
206207
redis-tools \
207208
rsync \
208209
software-properties-common \
@@ -264,7 +265,7 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
264265
# It can be used independently:
265266
# - The user should use the ./run.sh script to launch.
266267
# - A persistent volume will be mounted to /home/aztec-dev.
267-
# - It provides docker via the hosts docker instance, mounted at /var/lib/docker.sock.
268+
# - It provides docker-in-docker.
268269
# - It uses an entrypoint script at runtime to perform uid/gid alignment with the host and drop into user account.
269270
FROM basebox AS devbox
270271

yarn-project/aztec/scripts/aztec.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
3-
shopt -s inherit_errexit
43

54
# Re-execute using correct version if we have an .aztecrc file.
65
if [ "${AZTEC_VERSIONED:-0}" -eq 0 ] && [ -f .aztecrc ] && command -v aztec-up &>/dev/null; then

0 commit comments

Comments
 (0)