Announcement

Collapse
No announcement yet.

Uutils 0.0.23 Implements More GNU Coreutils Functionality In Rust

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Uutils 0.0.23 Implements More GNU Coreutils Functionality In Rust

    Phoronix: Uutils 0.0.23 Implements More GNU Coreutils Functionality In Rust

    The uutils open-source project continues working on re-implementing the widely-used GNU Coreutils utilities within the Rust programming language for better security and a fresh take on rm, cd, cat, ls, and other commands...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    It would be really nice to see uutils expanded to replace busybox too. then it could really become the ultimate replacement tool

    Comment


    • #3
      Originally posted by Quackdoc View Post
      It would be really nice to see uutils expanded to replace busybox too. then it could really become the ultimate replacement tool
      Uhm, nope. The reason busybox is coded using C is the small size of the final statically compiled binary. Even if you go for basically all possible options to produce the smallest possible statically compiled binary (
      Code:
      rustc -C code-model=small -C debuginfo=none -C lto=true -C opt-level=z -C strip=symbols -C codegen-units=1 -C panic=abort -C target-feature=+crt-static ...
      , a simple hello world example still ends up to be more than 1 MiB on amd64. This is an absolute no-go for such a tool. And if you go for using the c-runtime instead of the Rust-runtime you still end up with much bigger binaries minus the security Rust provides. Rust for sure is a good modern and secure language, but that comes with a price.

      Comment


      • #4
        Originally posted by Akiko View Post

        Uhm, nope. The reason busybox is coded using C is the small size of the final statically compiled binary. Even if you go for basically all possible options to produce the smallest possible statically compiled binary (
        Code:
        rustc -C code-model=small -C debuginfo=none -C lto=true -C opt-level=z -C strip=symbols -C codegen-units=1 -C panic=abort -C target-feature=+crt-static ...
        , a simple hello world example still ends up to be more than 1 MiB on amd64. This is an absolute no-go for such a tool. And if you go for using the c-runtime instead of the Rust-runtime you still end up with much bigger binaries minus the security Rust provides. Rust for sure is a good modern and secure language, but that comes with a price.
        <removed wrong info>

        Edit: just realised you wanted a fully static binary, sorry. This is dynamically compiled against libc6, not static, the same way as there's busybox and busybox-static is a separate thing.
        Last edited by iustinp; 16 November 2023, 04:17 PM.

        Comment


        • #5
          Originally posted by Akiko View Post

          Uhm, nope. The reason busybox is coded using C is the small size of the final statically compiled binary. Even if you go for basically all possible options to produce the smallest possible statically compiled binary (
          Code:
          rustc -C code-model=small -C debuginfo=none -C lto=true -C opt-level=z -C strip=symbols -C codegen-units=1 -C panic=abort -C target-feature=+crt-static ...
          , a simple hello world example still ends up to be more than 1 MiB on amd64. This is an absolute no-go for such a tool. And if you go for using the c-runtime instead of the Rust-runtime you still end up with much bigger binaries minus the security Rust provides. Rust for sure is a good modern and secure language, but that comes with a price.
          This is not an issue for me, even if I cared about a couple extra mb, which I really couldn't care less, the platforms I target work with upx anyways which brings uutils from 6.4Mb (after stripping) down to 1.9Mb using a fairly conservative
          Code:
          RUSTFLAGS='-C target-feature=+crt-static -C opt-level=z -C panic=abort' cargo build --target=x86_64-unknown-linux-gnu --release
          this is more then good enough for me as it's not too far off busybox-static, and while im sure busybox-static can be compressed to even smaller, I really don't care to much about going beyond this. this is quite "good enough" for me

          Comment


          • #6
            Originally posted by Akiko View Post

            Uhm, nope. The reason busybox is coded using C is the small size of the final statically compiled binary. Even if you go for basically all possible options to produce the smallest possible statically compiled binary (
            Code:
            rustc -C code-model=small -C debuginfo=none -C lto=true -C opt-level=z -C strip=symbols -C codegen-units=1 -C panic=abort -C target-feature=+crt-static ...
            , a simple hello world example still ends up to be more than 1 MiB on amd64. This is an absolute no-go for such a tool. And if you go for using the c-runtime instead of the Rust-runtime you still end up with much bigger binaries minus the security Rust provides. Rust for sure is a good modern and secure language, but that comes with a price.
            There are many use cases though where a binary in the order of magnitude of 1M would work perfectly well, like initramfs, containers, etc. Of course if you need something you can run on an ESP32, busybox-static is your go to solution.
            Last edited by jacob; 16 November 2023, 04:36 PM.

            Comment


            • #7
              Originally posted by Akiko View Post

              Uhm, nope. The reason busybox is coded using C is the small size of the final statically compiled binary. Even if you go for basically all possible options to produce the smallest possible statically compiled binary (
              Code:
              rustc -C code-model=small -C debuginfo=none -C lto=true -C opt-level=z -C strip=symbols -C codegen-units=1 -C panic=abort -C target-feature=+crt-static ...
              , a simple hello world example still ends up to be more than 1 MiB on amd64. This is an absolute no-go for such a tool. And if you go for using the c-runtime instead of the Rust-runtime you still end up with much bigger binaries minus the security Rust provides. Rust for sure is a good modern and secure language, but that comes with a price.
              I wonder if something like eyra could help there. I am still wondering why Rust stdlib decided to use libc instead of implementing everything they need using syscalls (like Go does).

              Comment


              • #8
                Originally posted by V1tol View Post

                I wonder if something like eyra could help there. I am still wondering why Rust stdlib decided to use libc instead of implementing everything they need using syscalls (like Go does).
                Eyra seems like a cool project, ill have to keep an eye on it

                Comment


                • #9
                  Originally posted by Quackdoc View Post
                  It would be really nice to see uutils expanded to replace busybox too. then it could really become the ultimate replacement tool
                  This doesn't make much sense, busybox and coreutils have very different goals and compromises, the same project couldn't replace both at the same time.

                  There was a busybox rust fork project, but it's currently abandoned (probably because it was transpiled from C, making it initially of dubious value and a PITA to cleanup). If you want a rust shell (but not a minimalist one) you could try nu (lots of builtins, like busybox, and has recently started integrating uutils code, but feels more like MS powershell than a POSIX shell) or fish (a more traditional but ergonomic shell, which is about halfway in its C++ to Rust migration).

                  Comment


                  • #10
                    So it passes 65% of the tests, can we start talking if we have about 90% pass rate?

                    Comment

                    Working...
                    X