Skip to content

Commit b41f025

Browse files
committed
Restore chelf on macOS via libelf from MacPorts
1 parent 2185194 commit b41f025

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

.github/workflows/stack-size.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484
# Now, we install `mrsh`.
8585
sudo port install mrsh
8686
SHELLS="$SHELLS mrsh"
87+
88+
# `chelf` requires `elf.h` which may be provided via `libelf`
89+
sudo port install libelf
8790
fi
8891
8992
# Install shells available via `cargo`
@@ -95,25 +98,23 @@ jobs:
9598
# GOBIN=/usr/local/bin go install github.com/u-root/u-root/cmds/core/gosh@latest
9699
# SHELLS="$SHELLS gosh"
97100
101+
# Patch with `chelf`
102+
cp monerod monerod-chelf
103+
git clone https://github.com/Gottox/chelf
104+
cd chelf
105+
git checkout b2994186cea7b7d61a588fd06c1cc1ae75bcc21a
106+
make
107+
./chelf -s "$STACK" ../monerod-chelf
108+
cd ..
109+
98110
# Patch with `muslstack`
99111
cp monerod monerod-muslstack
100112
GOBIN=$(pwd) go install github.com/yaegashi/muslstack@d19cc5866abce3ca59dfc1666df7cc97097d0933
101113
./muslstack -s "$STACK" ./monerod-muslstack
102114
103-
# Patch with `chelf`, which only works on a Linux host (due to requiring `elf.h`)
104-
if [ "$OS" = "Linux" ]; then
105-
cp monerod monerod-chelf
106-
git clone https://github.com/Gottox/chelf
107-
cd chelf
108-
git checkout b2994186cea7b7d61a588fd06c1cc1ae75bcc21a
109-
make
110-
./chelf -s "$STACK" ../monerod-chelf
111-
cd ..
112-
fi
113-
114115
# Run our script with all installed shells
115116
for shell in $SHELLS; do
116-
echo "Executing $shell"
117+
echo "Executing \`$shell\`"
117118
cp monerod monerod-idss-$shell
118119
ln -s "$(which $shell)" sh
119120
./sh ./orchestration/increase_default_stack_size.sh monerod-idss-$shell
@@ -124,11 +125,11 @@ jobs:
124125
sha256() {
125126
sha256sum "$1" | cut -d' ' -f1
126127
}
127-
CHELF=$(sha256 monerod-muslstack)
128+
CHELF=$(sha256 monerod-chelf)
128129
find . -name "monerod-*" | while read -r bin; do
129130
BIN=$(sha256 "$bin")
130131
if [ ! "$CHELF" = "$BIN" ]; then
131-
echo "Different artifact between monerod-muslstack ($CHELF) and $bin ($BIN)"
132+
echo "Different artifact between \`monerod-chelf\` ($CHELF) and \`$bin\` ($BIN)"
132133
exit 1
133134
fi
134135
done
@@ -145,14 +146,14 @@ jobs:
145146
exit 2
146147
fi
147148
148-
UPDATED_STACK=$(read_stack monerod-muslstack)
149+
UPDATED_STACK=$(read_stack monerod-chelf)
149150
if [ "$UPDATED_STACK" -ne "$STACK" ]; then
150151
echo "Updated \`PT_GNU_STACK\` ($UPDATED_STACK) wasn't 8 MB ($STACK)"
151152
exit 3
152153
fi
153154
154155
# Only one byte should be different due to the bit pattern of 8 MB
155-
BYTES_DIFFERENT=$(cmp -l monerod monerod-muslstack | wc -l || true)
156+
BYTES_DIFFERENT=$(cmp -l monerod monerod-chelf | wc -l || true)
156157
if [ "$BYTES_DIFFERENT" -ne 1 ]; then
157158
echo "More than one byte was different between the two binaries"
158159
exit 4

0 commit comments

Comments
 (0)