Skip to content

Commit 6e8b65f

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

File tree

4 files changed

+19
-65
lines changed

4 files changed

+19
-65
lines changed

.github/workflows/GnuTests.yml

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: GnuTests
22

33
# spell-checker:ignore (abbrev/names) CodeCov gnulib GnuTests Swatinem
44
# spell-checker:ignore (jargon) submodules devel
5-
# spell-checker:ignore (libs/utils) autopoint chksum getenforce gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e
5+
# spell-checker:ignore (libs/utils) autopoint chksum dpkg getenforce gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e
66
# spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic
77
# spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay
88
# spell-checker:ignore (vars) FILESET SUBDIRS XPASS
@@ -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
@@ -83,6 +60,8 @@ jobs:
8360
sudo apt-get update
8461
## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
8562
sudo apt-get install -y autopoint gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt
63+
curl http://launchpadlibrarian.net/831710181/automake_1.18.1-3_all.deb > automake-1.18.deb
64+
sudo dpkg -i --force-depends automake-1.18.deb
8665
- name: Add various locales
8766
shell: bash
8867
run: |
@@ -206,16 +185,6 @@ jobs:
206185
with:
207186
path: 'uutils'
208187
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}"
219188
- uses: dtolnay/rust-toolchain@master
220189
with:
221190
toolchain: stable
@@ -224,20 +193,7 @@ jobs:
224193
with:
225194
workspaces: "./uutils -> target"
226195
- 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
196+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
241197

242198
#### Lima build environment setup
243199
- 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

util/why-skip.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,3 @@
3131

3232
= Disabled. Enabled at GNU coreutils > 9.9 =
3333
* tests/misc/tac-continue.sh
34-
* tests/mkdir/writable-under-readonly.sh
35-
* tests/cp/cp-mv-enotsup-xattr.sh

0 commit comments

Comments
 (0)