Debian Adaptation for Rust Implementation of coreutils

Sylvestre Ledru, known for his work on assembling Debian GNU/Linux using the Clang compiler, reported the successful completion of an experiment involving an alternative set of coreutils rewritten in Rust. The coreutils include utilities such as sort, cat, chmod, chown, chroot, cp, date, dd, echo, hostname, id, ln, and ls. The first phase of integration of the Rust version of coreutils into Debian aimed to achieve the following goals:

  • Create a package with the alternative Rust version of coreutils for Debian and Ubuntu.
  • Download Debian with GNOME desktop, using rust-coreutils.
  • Install the 1000 most popular packages from the repository.
  • Build Firefox, LLVM/Clang, and the Linux kernel from source in an environment with rust-coreutils.

After creating over 100 patches for Rust/coreutils, all planned goals were successfully implemented. Ongoing work includes implementing missing utilities and options, improving code quality and consistency, developing the test suite, and addressing failures during the test suite run from GNU Coreutils (141 out of 613 tests are currently passing).

When creating the rust-coreutils package, it was decided not to replace the coreutils package but to allow for their parallel operation. The Rust utility versions are installed in /usr/lib/cargo/bin/ and activated by adding this directory to the PATH environment variable. The creation of the rust-coreutils package was complicated by the need to upload all build dependencies to the repository, including Rust and various small crate packages.

Creating the boot image did not pose special problems, but adapting the packages for the environment with rust-coreutils required significant effort because many post-install scripts call utilities from the coreutils set. The majority of issues arose from the absence of necessary options; for example, the 'cp' utility lacked the '--archive' and '--no-dereference' options, 'ln' did not support the '--relative' option, 'mktemp' was missing '-t', 'sync' lacked '-fs', and 'install' was missing '--owner' and '--group'. Other problems arose from behavioral differences; for instance, the install utility did not support specifying /dev/null as an input file, while in mkdir, instead of '--parent', there was the option '--parents', and so on.

During the testing of large codebase builds, no significant issues arose. The builds of Firefox and LLVM/Clang utilize python scripts and cmake, so replacing coreutils with them had no impact. The Linux kernel build went relatively smoothly, with only two issues arising: an error output when using chown with a symbolic link and the absence of the "-n" option in the ln utility.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster