Skip to content

Commit e63e0af

Browse files
committed
Only run chelf on Linux hosts
This makes `muslstack` the primary source of truth.
1 parent 5cc1156 commit e63e0af

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

.github/workflows/stack-size.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ jobs:
5151
fi
5252
# macOS has the benefit of packaging `oksh`, `osh`, and having distinct core tools
5353
if [ "$OS" = "macOS" ]; then
54-
brew install elfutils # Install `elfutils` for `chelf` has `elf.h` available
5554
brew install ksh93 bash dash-shell zsh posh mksh oksh yash oils-for-unix
5655
SHELLS="sh ksh bash dash zsh posh mksh oksh yash osh"
5756
fi
@@ -64,18 +63,22 @@ jobs:
6463
GOBIN=$(pwd) go install github.com/u-root/u-root/cmds/core/gosh@latest
6564
SHELLS="$SHELLS gosh"
6665
67-
cp monerod monerod-chelf
68-
git clone https://github.com/Gottox/chelf
69-
cd chelf
70-
git checkout b2994186cea7b7d61a588fd06c1cc1ae75bcc21a
71-
make
72-
./chelf -s "$STACK" ../monerod-chelf
73-
cd ..
74-
66+
# Patch with `muslstack`
7567
cp monerod monerod-muslstack
7668
GOBIN=$(pwd) go install github.com/yaegashi/muslstack@d19cc5866abce3ca59dfc1666df7cc97097d0933
7769
./muslstack -s "$STACK" ./monerod-muslstack
7870
71+
# Patch with `chelf`, which only works on a Linux host
72+
if [ "$OS" = "Linux" ]; then
73+
cp monerod monerod-chelf
74+
git clone https://github.com/Gottox/chelf
75+
cd chelf
76+
git checkout b2994186cea7b7d61a588fd06c1cc1ae75bcc21a
77+
make
78+
./chelf -s "$STACK" ../monerod-chelf
79+
cd ..
80+
fi
81+
7982
# Run our script with all installed shells
8083
for shell in $SHELLS; do
8184
cp monerod monerod-idss-$shell
@@ -88,11 +91,11 @@ jobs:
8891
sha256() {
8992
sha256sum "$1" | cut -d' ' -f1
9093
}
91-
CHELF=$(sha256 monerod-chelf)
94+
CHELF=$(sha256 monerod-muslstack)
9295
find . -iname "monerod-*" | while read -r bin; do
9396
BIN=$(sha256 "$bin")
9497
if [ ! "$CHELF" = "$BIN" ]; then
95-
echo "Different artifact between monerod-chelf ($CHELF) and $bin ($BIN)"
98+
echo "Different artifact between monerod-muslstack ($CHELF) and $bin ($BIN)"
9699
exit 1
97100
fi
98101
done
@@ -109,14 +112,14 @@ jobs:
109112
exit 2
110113
fi
111114
112-
UPDATED_STACK=$(read_stack monerod-chelf)
115+
UPDATED_STACK=$(read_stack monerod-muslstack)
113116
if [ "$UPDATED_STACK" -ne "$STACK" ]; then
114117
echo "Updated \`PT_GNU_STACK\` ($UPDATED_STACK) wasn't 8 MB ($STACK)"
115118
exit 3
116119
fi
117120
118121
# Only one byte should be different due to the bit pattern of 8 MB
119-
BYTES_DIFFERENT=$(cmp -l monerod monerod-chelf | wc -l || true)
122+
BYTES_DIFFERENT=$(cmp -l monerod monerod-muslstack | wc -l || true)
120123
if [ "$BYTES_DIFFERENT" -ne 1 ]; then
121124
echo "More than one byte was different between the two binaries"
122125
exit 4

0 commit comments

Comments
 (0)