Sylvestre Ledru, known for his work on assembly Debian GNU/Linux using the Clang compiler, reported a successful experiment using an alternative set of coreutils utilities, rewritten in Rust. coreutils includes utilities such as sort, cat, chmod, chown, chroot, cp, date, dd, echo, hostname, id, ln, and ls. For the first stage of integration, Debian The following goals were set for the Rust version of coreutils:
- Creating a package with an alternative coreutils in Rust for Debian Šø Ubuntu.
- Download Debian with the GNOME desktop using rust-coreutils.
- Installing the 1000 most popular packages from the repository.
- Build from Firefox, LLVM/Clang, and kernel sources Linux in an environment with rust-coreutils.
After creating more than 100 patches for Rust/coreutils, we managed to successfully implement all the intended goals. From the ongoing work, the implementation of the missing utilities and options, the improvement of the quality and uniformity of the code, the development of the test suite, the elimination of crashes that occur when running the test suite from GNU Coreutils (so far 141 out of 613 tests are successfully completed) are noted.
When creating the rust-coreutils package, it was decided not to replace the coreutils package, but to allow them to work in parallel. Rust utility options are installed in /usr/lib/cargo/bin/ and activated by adding this directory to the PATH environment variable. Creating the rust-coreutils package made it difficult to download all build dependencies into the repository, including Rust and various smaller crate packages.
Creating the boot image was no problem, but customizing the packages for the rust-coreutils environment was a lot of work, as many post-install scripts call utilities from the coreutils suite. The greatest number of problems were caused by the lack of necessary options, for example, the ā-archiveā and ā--no-dereferenceā options were missing in the ācpā utility, ā-relativeā option was not supported in ālnā, mktemp - ā-tā , in sync "-fs", in install - "--owner" and "--group". Other issues surfaced due to differences in behavior, such as the install utility not supporting /dev/null as an input file, mkdir having a --parents option instead of "--parent", and so on.
Testing the build of large codebases didn't present any major issues. Firefox and LLVM/Clang builds use Python scripts and CMake, so replacing coreutils didn't affect them. Kernel build Linux It went relatively smoothly, with only two issues popping up: an error message when using chown with a symbolic link and the lack of the "-n" option in the ln utility.
Source: opennet.ru
