Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,13 @@ jobs:
disable_search: true
flags: makefile,${{ matrix.job.os }}
fail_ci_if_error: false
- name: "`make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n`"
- name: "`make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n`"
shell: bash
run: |
set -x
DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-fast COMPLETIONS=n MANPAGES=n LOCALES=n
DESTDIR=/tmp/ make install PROG_PREFIX=uu- PROFILE=release-small COMPLETIONS=n MANPAGES=n LOCALES=n
# Check that utils are built with given profile
./target/release-fast/true
./target/release-small/true
# Check that the progs have prefix
test -f /tmp/usr/local/bin/uu-tty
test -f /tmp/usr/local/libexec/uu-coreutils/libstdbuf.*
Expand Down Expand Up @@ -501,10 +501,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9
- name: "`make install PROFILE=release-fast`"
- name: "`make install PROFILE=release`"
shell: bash
run: |
export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release-fast MANPAGES=n COMPLETIONS=n LOCALES=n
export CARGO_TARGET_DIR=cargo-target RUSTFLAGS="${RUSTFLAGS} -C strip=symbols" PROFILE=release MANPAGES=n COMPLETIONS=n LOCALES=n
mkdir -p "${CARGO_TARGET_DIR}" && sudo mount -t tmpfs -o noatime,size=16G tmpfs "${CARGO_TARGET_DIR}"
make install DESTDIR=target/size-release/
make install COMPLETIONS=n MULTICALL=y LN="ln -vf" DESTDIR=target/size-multi-release/
Expand Down
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -606,18 +606,19 @@ name = "uudoc"
path = "src/bin/uudoc.rs"
required-features = ["uudoc"]

# The default release profile with some optimizations.
[profile.release]
lto = true
panic = "abort"

[profile.release-fast]
inherits = "release"
codegen-units = 1
# FIXME: https://github.com/uutils/coreutils/issues/10654
[profile.release.package.uu_expand]
codegen-units = 16
[profile.release.package.uu_unexpand]
codegen-units = 16

# A release-like profile that is as small as possible.
[profile.release-small]
inherits = "release-fast"
inherits = "release"
opt-level = "z"
strip = true

Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ other Rust program:
cargo build --release
```

Replace `--release` with `--profile=release-fast` or `--profile=release-small` to use all optimizations or save binary size.
Replace `--release` with `--profile=release-small` to optimize binary size.

This command builds the most portable common core set of uutils into a multicall
(BusyBox-type) binary, named 'coreutils', on most Rust-supported platforms.
Expand Down Expand Up @@ -155,10 +155,10 @@ To simply build all available utilities (with debug profile):
make
```

In release-fast mode:
In release mode:

```shell
make PROFILE=release-fast
make PROFILE=release
```

To build all but a few of the available utilities:
Expand Down Expand Up @@ -192,18 +192,12 @@ manpages or shell completion to work, use `GNU Make` or see

### Install with GNU Make

To install all available utilities:
To install all available utilities (PROFILE=release by default):

```shell
make install
```

To install all utilities with all possible optimizations:

```shell
make PROFILE=release-fast install
```

To install using `sudo` switch `-E` must be used:

```shell
Expand Down
13 changes: 3 additions & 10 deletions docs/src/packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,10 @@ view the full documentation in the
We provide three release profiles out of the box, though you may want to tweak
them:

- `release`: This is the standard Rust release profile, but with link-time
optimization enabled. It is a balance between compile time, performance and a
reasonable amount of debug info. The main drawback of this profile is that the
binary is quite large (roughly 2x the GNU coreutils).
- `release-fast`: Every setting is tuned for the best performance, at the cost
of compile time. This binary is still quite large.
- `release-small`: Generates the smallest binary possible. This strips _all_
debug info from the binary, resulting in less informative backtraces. The performance of
this profile is also really good as it is close to the `release-fast` profile,
but with all debuginfo stripped.
- `release`: The profile with all performance optimization enabled.
- `release-small`: Optimize binary size.

They include panic abort which removes stack traces on old rust [https://blog.rust-lang.org/2025/12/11/Rust-1.92.0/].
For the precise definition of these profiles, you can look at the root
[`Cargo.toml`](https://github.com/uutils/coreutils/blob/main/Cargo.toml).

Expand Down
Loading