Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdenv: add uutils-coreutils stdenv #116274

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Mar 14, 2021

To try this use the pkgsUutils overlay and replace python3 with any package:

nix-build -A pkgsUutils.python3

ToDo:

Issues preventing us from using it in a stdenv:

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@SuperSandro2000 SuperSandro2000 changed the title Uutils coreutils stdenv stdenv: add uutils-coreutils stdenv Mar 14, 2021
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/rust-coreutils-replacement/11867/4

@ofborg ofborg bot added the 6.topic: stdenv Standard environment label Mar 14, 2021
@kvtb
Copy link
Contributor

kvtb commented Mar 14, 2021

Is it ...practical?
Rust is funny, but uutils-coreutils is 80MB vs. 1.5MB of coreutils

@SuperSandro2000
Copy link
Member Author

Is it ...practical?
Rust is funny, but uutils-coreutils is 80MB vs. 1.5MB of coreutils

The single binary is much smaller and when rust supports lining to shared find it will be reduced even further. uutils/coreutils#747

@siraben

This comment has been minimized.

@siraben

This comment has been minimized.

Copy link
Member

@siraben siraben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the hash (temporary workaround) GNU Hello compiles and runs:

$ nix-build --show-trace -E 'with import ./. { }; hello.override { stdenv = stdenvUutilsCoreutils; }' && ./result/bin/hello
[nix-shell:~/nixpkgs]$ nix-build --show-trace -E 'with import ./. { }; hello.override { stdenv = stdenvUutilsCoreutils; }' && ./result/bin/hello
/nix/store/jxklig35p42bxhp9yzk0gkgz2d5i8vml-hello-2.10
Hello, world!

@siraben
Copy link
Member

siraben commented May 30, 2021

Checked as of 2021-06-16

  • ed failed to build
shrinking RPATHs of ELF executables and libraries in /nix/store/19n3pm10rr79445054shvid8m49mab43-ed-1.17
shrinking /nix/store/19n3pm10rr79445054shvid8m49mab43-ed-1.17/bin/ed
gzipping man pages under /nix/store/19n3pm10rr79445054shvid8m49mab43-ed-1.17/share/man/
strip is /nix/store/b8y61srrw1m2n87dr5snfaxy0rqgk6qy-binutils-2.35.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/19n3pm10rr79445054shvid8m49mab43-ed-1.17/bin
patching script interpreter paths in /nix/store/19n3pm10rr79445054shvid8m49mab43-ed-1.17
/nix/store/19n3pm10rr79445054shvid8m49mab43-ed-1.17/bin/red: interpreter directive changed from "#! /bin/sh" to "/nix/store/3xqkrab9zqpv91bw1xp8551sjk7qrc34-bash-4.4-p23/bin/sh"
thread 'main' panicked at 'Unable to parse date
Invalid day.', src/uu/touch/src/touch.rs:248:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
builder for '/nix/store/yh6a7878qfg3qqi24mk61jaax47y2jpa-ed-1.17.drv' failed with exit code 101
error: build of '/nix/store/yh6a7878qfg3qqi24mk61jaax47y2jpa-ed-1.17.drv' failed
  • vim failed to build
these derivations will be built:
  /nix/store/7wna7whwryrrmsm6fpf02sqpsaw4jpv9-vim-8.2.2567.drv
building '/nix/store/7wna7whwryrrmsm6fpf02sqpsaw4jpv9-vim-8.2.2567.drv'...
unpacking sources
unpacking source archive /nix/store/dvh1x2m7gvp1iv5jjlvrf5ry5g3ay23k-source
cp: error: '/nix/store/dvh1x2m7gvp1iv5jjlvrf5ry5g3ay23k-source/src/normal.c' -> 'source/src/normal.c': Too many open files (os error 24)
do not know how to unpack source archive /nix/store/dvh1x2m7gvp1iv5jjlvrf5ry5g3ay23k-source
builder for '/nix/store/7wna7whwryrrmsm6fpf02sqpsaw4jpv9-vim-8.2.2567.drv' failed with exit code 1
error: build of '/nix/store/7wna7whwryrrmsm6fpf02sqpsaw4jpv9-vim-8.2.2567.drv' failed

Compiling other packages with the uutils-based stdenv:

  • vim (symlink converting fails)
  • coreutils-gnu (failed with error: The argument '--symbolic' was provided more than once, but cannot be used multiple times)
  • tinycc (failed)
  • chez
  • pforth
  • nawk
  • gawk
  • guile
  • chicken (failed, unable to parse date)
  • miranda (cp: '/nix/store/dl6ahdcycmw4yry2zpmslq7w7i2mdlvk-source/miralib/ex/box.m' -> 'source/miralib/ex/box.m': Permission denied (os error 13))
  • rustc (error: Found argument '--libdir' which wasn't expected, or isn't valid in this context)
  • bash
  • dash
  • tmux
  • screen
  • go (failed, unable to parse date)
  • htop (cp: '/nix/store/21zp1xfq78bp4rgvdlvd5r2d0rmmp55n-source/README' -> 'source/README': Permission denied (os error 13))
  • uutils-coreutils
  • fish
  • ghc (mkdir: ./utils/ghc-cabal/dist/build/tmp//.: No such file or directory (os error 2))
  • openjdk (error: cannot find symbol)
  • julia (failed, failing test in LinearAlgebra/triangular)
  • tcl (failed, ln: error: No such file or directory (os error 2))
  • sbcl (failed, unable to parse date)
  • emacs (failed, unable to parse date)
  • binutils-unwrapped
  • the-powder-toy
  • gnumake
  • cmake
  • ripgrep
  • gnupg
  • git (test failure)

@siraben
Copy link
Member

siraben commented May 30, 2021

Unfortunately it will take some digging to figure out exactly what went wrong in the builds that failed, so that upstream has a clear view on what incompatibilities they need to address.

@siraben
Copy link
Member

siraben commented Jan 23, 2022

Please rebase and remove patches that were merged. I think that's nearly all the blocking issues needed to be a replacement for coreutils?

@SuperSandro2000
Copy link
Member Author

Please rebase and remove patches that were merged. I think that's nearly all the blocking issues needed to be a replacement for coreutils?

There where still other issues when building rustc which I didn't investigate at the time.

useUutilsCoreutils = true;
config = "${stdenv.hostPlatform.linuxArch}-pc-linux-gnu";
};
} else throw "Musl libc only supports Linux systems.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: copy&paste "Musl".

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 30, 2022
@sylvestre
Copy link

Any chance this pr gets merged? Thanks

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 12, 2023
@SuperSandro2000
Copy link
Member Author

Any chance this pr gets merged? Thanks

No, because it is not practical and uutils is not fully compatible with gnu coreutils.

@AndersonTorres
Copy link
Member

Closing this as sadly abandoned.

@06kellyjac
Copy link
Member

Could draft it until uutils is more matute

@SuperSandro2000
Copy link
Member Author

Please re-open. I have no mechanic to not delete this branch from my fork.

@vcunat vcunat reopened this Sep 2, 2023
@vcunat vcunat added the 2.status: wait-for-upstream Waiting for upstream fix (or their other action). label Sep 2, 2023
@sylvestre
Copy link

I think it is now mature enough to replace gnu.

@nyabinary
Copy link
Contributor

0.0.22 released

@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 19, 2024
m15a added a commit to m15a/bump.fnl that referenced this pull request Mar 25, 2024
Reverts commit d16d129.
This did not work since many depend on stdenv.

References:

- NixOS/nixpkgs#132617
- NixOS/nixpkgs#116274
@siraben
Copy link
Member

siraben commented Jun 20, 2024

Can we rebase again?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet