Skip to content

Commit e4a774c

Browse files
author
oech3
committed
GnuTests: Split online process to a script
1 parent 64203e3 commit e4a774c

File tree

3 files changed

+16
-62
lines changed

3 files changed

+16
-62
lines changed

.github/workflows/GnuTests.yml

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ jobs:
4242
with:
4343
path: 'uutils'
4444
persist-credentials: false
45-
- name: Extract GNU version from build-gnu.sh
46-
id: gnu-version
47-
run: |
48-
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
49-
if [ -z "$GNU_VERSION" ]; then
50-
echo "Error: Failed to extract GNU version from build-gnu.sh"
51-
exit 1
52-
fi
53-
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
54-
echo "Extracted GNU version: ${GNU_VERSION}"
5545
- uses: dtolnay/rust-toolchain@master
5646
with:
5747
toolchain: stable
@@ -60,20 +50,7 @@ jobs:
6050
with:
6151
workspaces: "./uutils -> target"
6252
- name: Checkout code (GNU coreutils)
63-
uses: actions/checkout@v6
64-
with:
65-
repository: 'coreutils/coreutils'
66-
path: 'gnu'
67-
ref: ${{ env.REPO_GNU_REF }}
68-
submodules: false
69-
persist-credentials: false
70-
- name: Override submodule URL and initialize submodules
71-
# Use github instead of upstream git server
72-
run: |
73-
git submodule sync --recursive
74-
git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
75-
git submodule update --init --recursive --depth 1
76-
working-directory: gnu
53+
run: (mkdir -p gnu && cd gnu && bash ..uutils/util/fetch-gnu.sh)
7754

7855
#### Build environment setup
7956
- name: Install dependencies
@@ -206,16 +183,6 @@ jobs:
206183
with:
207184
path: 'uutils'
208185
persist-credentials: false
209-
- name: Extract GNU version from build-gnu.sh
210-
id: gnu-version-selinux
211-
run: |
212-
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
213-
if [ -z "$GNU_VERSION" ]; then
214-
echo "Error: Failed to extract GNU version from build-gnu.sh"
215-
exit 1
216-
fi
217-
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
218-
echo "Extracted GNU version: ${GNU_VERSION}"
219186
- uses: dtolnay/rust-toolchain@master
220187
with:
221188
toolchain: stable
@@ -224,20 +191,7 @@ jobs:
224191
with:
225192
workspaces: "./uutils -> target"
226193
- name: Checkout code (GNU coreutils)
227-
uses: actions/checkout@v6
228-
with:
229-
repository: 'coreutils/coreutils'
230-
path: 'gnu'
231-
ref: ${{ env.REPO_GNU_REF }}
232-
submodules: false
233-
persist-credentials: false
234-
- name: Override submodule URL and initialize submodules
235-
# Use github instead of upstream git server
236-
run: |
237-
git submodule sync --recursive
238-
git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
239-
git submodule update --init --recursive --depth 1
240-
working-directory: gnu
194+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
241195

242196
#### Lima build environment setup
243197
- name: Setup Lima

util/build-gnu.sh

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,13 @@ path_GNU="$("${READLINK}" -fm -- "${path_GNU:-${path_UUTILS}/../gnu}")"
3434

3535
###
3636

37-
release_tag_GNU="v9.9"
38-
3937
# check if the GNU coreutils has been cloned, if not print instructions
40-
# note: the ${path_GNU} might already exist, so we check for the .git directory
41-
if test ! -d "${path_GNU}/.git"; then
38+
# note: the ${path_GNU} might already exist, so we check for the configure
39+
if test ! -f "${path_GNU}/configure"; then
4240
echo "Could not find the GNU coreutils (expected at '${path_GNU}')"
4341
echo "Download them to the expected path:"
44-
echo " git clone --recurse-submodules https://github.com/coreutils/coreutils.git \"${path_GNU}\""
45-
echo "Afterwards, checkout the latest release tag:"
46-
echo " cd \"${path_GNU}\""
47-
echo " git fetch --all --tags"
48-
echo " git checkout tags/${release_tag_GNU}"
42+
echo " (cd '${path_GNU}' && fetch-gnu.sh ) "
43+
echo "You can edit fetch-gnu.sh to change the tag"
4944
exit 1
5045
fi
5146

@@ -131,8 +126,6 @@ if test -f gnu-built; then
131126
else
132127
# Disable useless checks
133128
"${SED}" -i 's|check-texinfo: $(syntax_checks)|check-texinfo:|' doc/local.mk
134-
"${SED}" -i '/^wget.*/d' bootstrap.conf # wget is used to DL po. Remove the dep.
135-
./bootstrap --skip-po
136129
# Use CFLAGS for best build time since we discard GNU coreutils
137130
CFLAGS="${CFLAGS} -pipe -O0 -s" ./configure --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references \
138131
--enable-single-binary=symlinks \
@@ -175,9 +168,6 @@ grep -rl '\$abs_path_dir_' tests/*/*.sh | xargs -r "${SED}" -i "s|\$abs_path_dir
175168
# Different message
176169
"${SED}" -i "s|coreutils: unknown program 'blah'|blah: function/utility not found|" tests/misc/coreutils.sh
177170

178-
# Remove hfs dependency (should be merged to upstream)
179-
"${SED}" -i -e "s|hfsplus|ext4 -O casefold|" -e "s|cd mnt|rm -d mnt/lost+found;chattr +F mnt;cd mnt|" tests/mv/hardlink-case.sh
180-
181171
# Use the system coreutils where the test fails due to error in a util that is not the one being tested
182172
"${SED}" -i "s|grep '^#define HAVE_CAP 1' \$CONFIG_HEADER > /dev/null|true|" tests/ls/capability.sh
183173

util/fetch-gnu.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash -e
2+
ver="9.9"
3+
repo=https://github.com/coreutils/coreutils
4+
curl -L "${repo}/releases/download/v${ver}/coreutils-${ver}.tar.xz" | tar --strip-components=1 -xJf -
5+
6+
# backport from coreutils > 9.9
7+
curl ${repo}/raw/refs/heads/master/tests/mv/hardlink-case.sh > tests/mv/hardlink-case.sh
8+
curl ${repo}/raw/refs/heads/master/tests/mkdir/writable-under-readonly.sh > tests/mkdir/writable-under-readonly.sh
9+
curl ${repo}/raw/refs/heads/master/tests/cp/cp-mv-enotsup-xattr.sh > tests/cp/cp-mv-enotsup-xattr.sh #spell-checker:disable-line
10+
# tests/misc/tac-continue.sh # our tac fills RAM issue/9594

0 commit comments

Comments
 (0)