Skip to content

Commit 93d3ea8

Browse files
committed
Prefer /usr/local/bin to /usr/bin, which is read-only on macOS
1 parent ba6bbfe commit 93d3ea8

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

.github/workflows/stack-size.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,17 @@ jobs:
5454
sudo apt install ./gash_0.3.1-1_amd64.deb
5555
SHELLS="sh ksh bash dash zsh ash hush posh mksh lksh gash yash"
5656
fi
57-
# macOS has the benefit of packaging `oksh`, `osh`, and having distinct core tools
5857
if [ "$OS" = "macOS" ]; then
5958
brew install binutils # `readelf`
6059
61-
# `binutils` is not placed within the path, so find its `readelf` bin and manually move
62-
# it into our path. Due to the two possible prefixes, this consolidates them to a single
63-
# parent directory which is cursed, yet functional
64-
sudo mkdir -p /opt/homebrew
65-
sudo cp -r /opt/homebrew /usr/local/opt_homebrew
66-
sudo cp $(find /usr/local -name readelf) /usr/bin/
67-
sudo rm -rf /usr/local/opt_homebrew
60+
# `binutils` is not placed within the path, so find its
61+
# `readelf` bin and manually move it into our path
62+
HOMEBREW_ROOT_PATH=/opt/homebrew # Apple Silicon
63+
if [ $(uname -m) = "x86_64" ]; then HOMEBREW_ROOT_PATH=/usr/local; fi # Intel
64+
sudo cp $(find "$HOMEBREW_ROOT_PATH" -name readelf) /usr/local/bin/
6865
66+
# macOS has the benefit of packaging `oksh`, `osh`, and having distinct core tools
67+
# TODO: `posh` is packaged but doesn't work: https://github.com/serai-dex/serai/issues/703
6968
brew install ksh93 bash dash-shell zsh mksh oksh yash oils-for-unix
7069
SHELLS="sh ksh bash dash zsh mksh oksh yash osh"
7170
fi
@@ -76,16 +75,15 @@ jobs:
7675
7776
# Install shells available via `go`
7877
# TODO: https://github.com/u-root/u-root/issues/3474
79-
# GOBIN=$(pwd) go install github.com/u-root/u-root/cmds/core/gosh@latest
80-
# sudo mv ./gosh /usr/bin
78+
# GOBIN=/usr/local/bin go install github.com/u-root/u-root/cmds/core/gosh@latest
8179
# SHELLS="$SHELLS gosh"
8280
8381
# Patch with `muslstack`
8482
cp monerod monerod-muslstack
8583
GOBIN=$(pwd) go install github.com/yaegashi/muslstack@d19cc5866abce3ca59dfc1666df7cc97097d0933
8684
./muslstack -s "$STACK" ./monerod-muslstack
8785
88-
# Patch with `chelf`, which only works on a Linux host
86+
# Patch with `chelf`, which only works on a Linux host (due to requiring `elf.h`)
8987
if [ "$OS" = "Linux" ]; then
9088
cp monerod monerod-chelf
9189
git clone https://github.com/Gottox/chelf

0 commit comments

Comments
 (0)