Skip to content

Commit add5e8c

Browse files
authored
Merge branch 'main' into gnu-cache
2 parents 630424c + 3de9411 commit add5e8c

File tree

32 files changed

+608
-406
lines changed

32 files changed

+608
-406
lines changed

.github/workflows/GnuTests.yml

Lines changed: 5 additions & 50 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 getlimits gperf lcov libexpect limactl pyinotify setenforce shopt texinfo valgrind libattr libcap taiki-e
5+
# spell-checker:ignore (libs/utils) autopoint chksum dpkg getenforce getlimits 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
- name: Restore files for faster configure and skipping make
7855
uses: actions/cache@v5
7956
id: cache-config-gnu
@@ -85,7 +62,6 @@ jobs:
8562
restore-keys: |
8663
${{ runner.os }}-gnu-config-${{ env.REPO_GNU_REF }}-
8764
${{ runner.os }}-gnu-config-
88-
8965
#### Build environment setup
9066
- name: Install dependencies
9167
shell: bash
@@ -94,6 +70,8 @@ jobs:
9470
sudo apt-get update
9571
## Check that build-gnu.sh works on the non SELinux system by installing libselinux only on lima
9672
sudo apt-get install -y autopoint gperf gdb python3-pyinotify valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt
73+
curl http://launchpadlibrarian.net/831710181/automake_1.18.1-3_all.deb > automake-1.18.deb
74+
sudo dpkg -i --force-depends automake-1.18.deb
9775
- name: Add various locales
9876
shell: bash
9977
run: |
@@ -226,16 +204,6 @@ jobs:
226204
with:
227205
path: 'uutils'
228206
persist-credentials: false
229-
- name: Extract GNU version from build-gnu.sh
230-
id: gnu-version-selinux
231-
run: |
232-
GNU_VERSION=$(grep '^release_tag_GNU=' uutils/util/build-gnu.sh | cut -d'"' -f2)
233-
if [ -z "$GNU_VERSION" ]; then
234-
echo "Error: Failed to extract GNU version from build-gnu.sh"
235-
exit 1
236-
fi
237-
echo "REPO_GNU_REF=${GNU_VERSION}" >> $GITHUB_ENV
238-
echo "Extracted GNU version: ${GNU_VERSION}"
239207
- uses: dtolnay/rust-toolchain@master
240208
with:
241209
toolchain: stable
@@ -244,20 +212,7 @@ jobs:
244212
with:
245213
workspaces: "./uutils -> target"
246214
- name: Checkout code (GNU coreutils)
247-
uses: actions/checkout@v6
248-
with:
249-
repository: 'coreutils/coreutils'
250-
path: 'gnu'
251-
ref: ${{ env.REPO_GNU_REF }}
252-
submodules: false
253-
persist-credentials: false
254-
- name: Override submodule URL and initialize submodules
255-
# Use github instead of upstream git server
256-
run: |
257-
git submodule sync --recursive
258-
git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
259-
git submodule update --init --recursive --depth 1
260-
working-directory: gnu
215+
run: (mkdir -p gnu && cd gnu && bash ../uutils/util/fetch-gnu.sh)
261216

262217
#### Lima build environment setup
263218
- name: Setup Lima

.vscode/cspell.dictionaries/jargon.wordlist.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ iflag
7676
iflags
7777
kibi
7878
kibibytes
79+
langinfo
7980
libacl
8081
lcase
8182
listxattr
@@ -129,6 +130,7 @@ semiprimes
129130
setcap
130131
setfacl
131132
setfattr
133+
setlocale
132134
shortcode
133135
shortcodes
134136
siginfo
@@ -163,6 +165,8 @@ xattrs
163165
xpass
164166

165167
# * abbreviations
168+
AMPM
169+
ampm
166170
consts
167171
deps
168172
dev

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,6 @@ should_panic_without_expect = "allow" # 2
667667
doc_markdown = "allow"
668668
unused_self = "allow"
669669
enum_glob_use = "allow"
670-
ptr_cast_constness = "allow"
671-
borrow_as_ptr = "allow"
672-
ptr_as_ptr = "allow"
673670
needless_raw_string_hashes = "allow"
674671
unreadable_literal = "allow"
675672
unnested_or_patterns = "allow"

DEVELOPMENT.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,6 @@ DEBUG=1 bash util/run-gnu-test.sh tests/misc/sm3sum.pl
244244

245245
***Tip:*** First time you run `bash util/build-gnu.sh` command, it will provide instructions on how to checkout GNU coreutils repository at the correct release tag. Please follow those instructions and when done, run `bash util/build-gnu.sh` command again.
246246

247-
Note that GNU test suite relies on individual utilities (not the multicall binary).
248-
249247
You also need to install [quilt](https://savannah.nongnu.org/projects/quilt), a tool used to manage a stack of patches for modifying GNU tests.
250248

251249
On FreeBSD, you need to install packages for GNU coreutils and sed (used in shell scripts instead of system commands):

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ options might be missing or different behavior might be experienced.
2929

3030
<div class="oranda-hide">
3131

32+
We provide prebuilt binaries at https://github.com/uutils/coreutils/releases/latest .
33+
It is recommended to install from main branch if you install from source.
34+
3235
To install it:
3336

3437
```shell
35-
cargo install coreutils
38+
cargo install --git https://github.com/uutils/coreutils coreutils
39+
# cargo install --git https://github.com/uutils/coreutils uu_true # for one util only
3640
~/.cargo/bin/coreutils
3741
```
3842

fuzz/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fuzz/uufuzz/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,8 @@ fn read_from_fd(fd: RawFd) -> String {
193193
let mut captured_output = Vec::new();
194194
let mut read_buffer = [0; 1024];
195195
loop {
196-
let bytes_read = unsafe {
197-
libc::read(
198-
fd,
199-
read_buffer.as_mut_ptr() as *mut libc::c_void,
200-
read_buffer.len(),
201-
)
202-
};
196+
let bytes_read =
197+
unsafe { libc::read(fd, read_buffer.as_mut_ptr().cast(), read_buffer.len()) };
203198

204199
if bytes_read == -1 {
205200
eprintln!("Failed to read from the pipe");

0 commit comments

Comments
 (0)