stdbuf: add feat_external_libstdbuf#8104
Conversation
.cargo/config.toml
Outdated
|
|
||
| [env] | ||
| PROJECT_NAME_FOR_VERSION_STRING = "uutils coreutils" | ||
| LIBSTDBUF_PATH = "/usr/lib/libstdbuf.so" |
There was a problem hiding this comment.
Actually I did not want to include this line, and wanted the build to fail per default when enabling feat_external_stdbuf, so that people who are packaging uutils-coreutils notice that they need to set this variable.
The issue is that the pre-commit hook calls clippy with "all-features".
Can I use something like this in the pre-commit file?
sh -c 'LIBSTDBUF_PATH=libstdbuf.so cargo +stable clippy --workspace --all-targets --all-features -- -D warnings'
I guess not, because the pre-commit hook is also supposed to work on windows?
|
GNU testsuite comparison: |
e07d23d to
9f309b9
Compare
|
GNU testsuite comparison: |
9f309b9 to
8f1648d
Compare
|
GNU testsuite comparison: |
|
|
||
| [env] | ||
| PROJECT_NAME_FOR_VERSION_STRING = "uutils coreutils" | ||
| LIBSTDBUF_DIR = "/usr/lib" |
There was a problem hiding this comment.
please add that it is explained in src/uu/stdbuf/Cargo.toml
There was a problem hiding this comment.
@sylvestre are there other things which I should change?
Fixes uutils#6591 "feat_external_stdbuf": use an external libstdbuf.so for stdbuf instead of embedding it into the stdbuf binary. There are 2 use-cases: 1. Installation of uutils-coreutils using cargo install (e.g. from crates.io which supports only "cargo install" as installation method). In this case, installing libstdbuf.so is impossible, because "cargo install" installs only binary programs (no cdylib), thus libstdbuf.so must be embedded into stdbuf and written to /tmp at runtime. This is a hack, and may not work on some platforms, e.g. because the SELinux permissions may not allow stdbuf to write to /tmp, /tmp may be read-only, libstdbuf.so may not work at all without SELinux labels, etc. 2. Installation of uutils-coreutils using an external tool, e.g. dpkg/apt on debian. In this case, libstdbuf.so should be installed separately to its correct location and the environment variable LIBSTDBUF_PATH configures the installation path during the build. E.g. LIBSTDBUF_PATH="/lib/libstdbuf.so" Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
8f1648d to
99aa51a
Compare
|
GNU testsuite comparison: |
|
ok, let's try with this |
Fixes #6591
"feat_external_libstdbuf": use an external libstdbuf.so for stdbuf instead of embedding it into
the stdbuf binary.
There are 2 use-cases:
Installation of uutils-coreutils using cargo install (e.g. from crates.io which supports only "cargo install" as installation method). In this case, installing libstdbuf.so is impossible, because "cargo install" installs only binary programs (no cdylib), thus libstdbuf.so must be embedded into stdbuf and written to /tmp at runtime. This is a hack, and may not work on some platforms, e.g. because the SELinux permissions may not allow stdbuf to write to /tmp, /tmp may be read-only, libstdbuf.so may not work at all without SELinux labels, etc.
Installation of uutils-coreutils using an external tool, e.g. dpkg/apt on debian. In this case, libstdbuf.so should be installed separately to its correct location and the environment variable LIBSTDBUF_DIR configures the installation path during the build. E.g. LIBSTDBUF_DIR="/usr/lib"