From 04235854fa5f3f184eded4c34f6552a717395420 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 7 Apr 2021 20:17:52 -0500 Subject: [PATCH 1/7] docs/README ~ fix markdown lint complaints (no-trailing-spaces) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2257b3fd..ad4a3393a 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Why? Many GNU, Linux and other utilities are useful, and obviously [some](http://gnuwin32.sourceforge.net) [effort](http://unxutils.sourceforge.net) has been spent in the past to port them to Windows. However, those projects -are written in platform-specific C, a language considered unsafe compared to Rust, and +are written in platform-specific C, a language considered unsafe compared to Rust, and have other issues. Rust provides a good, platform-agnostic way of writing systems utilities that are easy From 26937b5d692f950df55b941aafba01ff9b1fe91d Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 7 Apr 2021 20:20:48 -0500 Subject: [PATCH 2/7] docs/README ~ fix markdown lint complaints (heading-style) --- README.md | 56 ++++++++++++++++++++++--------------------------------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index ad4a3393a..ce257002d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -uutils coreutils -================ +# uutils coreutils [![Crates.io](https://img.shields.io/crates/v/coreutils.svg)](https://crates.io/crates/coreutils) [![Discord](https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat)](https://discord.gg/wQVJbvJ) @@ -17,8 +16,7 @@ uutils is an attempt at writing universal (as in cross-platform) CLI utilities in [Rust](http://www.rust-lang.org). This repository is intended to aggregate GNU coreutils rewrites. -Why? ----- +## Why? Many GNU, Linux and other utilities are useful, and obviously [some](http://gnuwin32.sourceforge.net) [effort](http://unxutils.sourceforge.net) @@ -29,23 +27,21 @@ have other issues. Rust provides a good, platform-agnostic way of writing systems utilities that are easy to compile anywhere, and this is as good a way as any to try and learn it. -Requirements ------------- +## Requirements * Rust (`cargo`, `rustc`) * GNU Make (required to build documentation) * [Sphinx](http://www.sphinx-doc.org/) (for documentation) * gzip (for installing documentation) -### Rust Version ### +### Rust Version uutils follows Rust's release channels and is tested against stable, beta and nightly. The current oldest supported version of the Rust compiler is `1.40.0`. On both Windows and Redox, only the nightly version is tested currently. -Build Instructions ------------------- +## Build Instructions There are currently two methods to build uutils: GNU Make and Cargo. However, while there may be two methods, both systems are required to build on Unix @@ -57,7 +53,7 @@ $ git clone https://github.com/uutils/coreutils $ cd coreutils ``` -### Cargo ### +### Cargo Building uutils using Cargo is easy because the process is the same as for every other Rust program: @@ -87,7 +83,7 @@ build the utilities as individual binaries, that is possible too. For example: $ cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rm ``` -### GNU Make ### +### GNU Make Building using `make` is a simple process as well. @@ -106,10 +102,9 @@ To build only a few of the available utilities: $ make UTILS='UTILITY_1 UTILITY_2' ``` -Installation Instructions -------------------------- +## Installation Instructions -### Cargo ### +### Cargo Likewise, installing can simply be done using: ```bash @@ -118,7 +113,7 @@ $ cargo install --path . This command will install uutils into Cargo's *bin* folder (*e.g.* `$HOME/.cargo/bin`). -### GNU Make ### +### GNU Make To install all available utilities: ```bash @@ -156,7 +151,7 @@ Set install parent directory (default value is /usr/local): $ make PREFIX=/my/path install ``` -### NixOS ### +### NixOS The [standard package set](https://nixos.org/nixpkgs/manual/) of [NixOS](https://nixos.org/) provides this package out of the box since 18.03: @@ -165,21 +160,20 @@ provides this package out of the box since 18.03: nix-env -iA nixos.uutils-coreutils ``` -Uninstallation Instructions ---------------------------- +## Uninstallation Instructions Uninstallation differs depending on how you have installed uutils. If you used Cargo to install, use Cargo to uninstall. If you used GNU Make to install, use Make to uninstall. -### Cargo ### +### Cargo To uninstall uutils: ```bash $ cargo uninstall uutils ``` -### GNU Make ### +### GNU Make To uninstall all utilities: ```bash @@ -202,12 +196,11 @@ To uninstall from a custom parent directory: $ make PREFIX=/my/path uninstall ``` -Test Instructions ------------------ +## Test Instructions Testing can be done using either Cargo or `make`. -### Cargo ### +### Cargo Just like with building, we follow the standard procedure for testing using Cargo: @@ -238,7 +231,7 @@ $ gdb --args target/debug/coreutils ls (gdb) run ``` -### GNU Make ### +### GNU Make To simply test all available utilities: ```bash @@ -260,8 +253,7 @@ To include tests for unimplemented behavior: $ make UTILS='UTILITY_1 UTILITY_2' SPEC=y test ``` -Run Busybox Tests ------------------ +## Run Busybox Tests This testing functionality is only available on *nix operating systems and requires `make`. @@ -281,13 +273,11 @@ To pass an argument like "-v" to the busybox test runtime $ make UTILS='UTILITY_1 UTILITY_2' RUNTEST_ARGS='-v' busytest ``` -Contribute ----------- +## Contribute To contribute to uutils, please see [CONTRIBUTING](CONTRIBUTING.md). -Utilities ---------- +## Utilities | Done | Semi-Done | To Do | |-----------|-----------|--------| @@ -377,8 +367,7 @@ Utilities | whoami | | | | yes | | | -Targets that compile -------- +## Targets that compile This is an auto-generated table showing which binaries compile for each target-triple. Note that this **does not** indicate that they are fully implemented, or that the tests pass. @@ -405,8 +394,7 @@ This is an auto-generated table showing which binaries compile for each target-t |fuchsia|aarch64| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |fuchsia|x86_64| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -License -------- +## License uutils is licensed under the MIT License - see the `LICENSE` file for details From a309c7cab08a29273b2f74b9e35e2654802caa8d Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 7 Apr 2021 20:22:33 -0500 Subject: [PATCH 3/7] docs/README ~ fix markdown lint complaints (blanks-around-fences) --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index ce257002d..2eacbf173 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ while there may be two methods, both systems are required to build on Unix (only Cargo is required on Windows). First, for both methods, we need to fetch the repository: + ```bash $ git clone https://github.com/uutils/coreutils $ cd coreutils @@ -57,6 +58,7 @@ $ cd coreutils Building uutils using Cargo is easy because the process is the same as for every other Rust program: + ```bash # to keep debug information, compile without --release $ cargo build --release @@ -65,6 +67,7 @@ $ cargo build --release Because the above command attempts to build utilities that only work on Unix-like platforms at the moment, to build on Windows, you must do the following: + ```bash # to keep debug information, compile without --release $ cargo build --release --no-default-features --features windows @@ -73,12 +76,14 @@ $ cargo build --release --no-default-features --features windows If you don't want to build every utility available on your platform into the multicall binary (the Busybox-esque binary), you can also specify which ones you want to build manually. For example: + ```bash $ cargo build --features "base32 cat echo rm" --no-default-features ``` If you don't even want to build the multicall binary and would prefer to just build the utilities as individual binaries, that is possible too. For example: + ```bash $ cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rm ``` @@ -88,16 +93,19 @@ $ cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rm Building using `make` is a simple process as well. To simply build all available utilities: + ```bash $ make ``` To build all but a few of the available utilities: + ```bash $ make SKIP_UTILS='UTILITY_1 UTILITY_2' ``` To build only a few of the available utilities: + ```bash $ make UTILS='UTILITY_1 UTILITY_2' ``` @@ -107,6 +115,7 @@ $ make UTILS='UTILITY_1 UTILITY_2' ### Cargo Likewise, installing can simply be done using: + ```bash $ cargo install --path . ``` @@ -116,36 +125,43 @@ This command will install uutils into Cargo's *bin* folder (*e.g.* `$HOME/.cargo ### GNU Make To install all available utilities: + ```bash $ make install ``` To install using `sudo` switch `-E` must be used: + ```bash $ sudo -E make install ``` To install all but a few of the available utilities: + ```bash $ make SKIP_UTILS='UTILITY_1 UTILITY_2' install ``` To install only a few of the available utilities: + ```bash $ make UTILS='UTILITY_1 UTILITY_2' install ``` To install every program with a prefix (e.g. uu-echo uu-cat): + ```bash $ make PROG_PREFIX=PREFIX_GOES_HERE install ``` To install the multicall binary: + ```bash $ make MULTICALL=y install ``` Set install parent directory (default value is /usr/local): + ```bash # DESTDIR is also supported $ make PREFIX=/my/path install @@ -169,6 +185,7 @@ Make to uninstall. ### Cargo To uninstall uutils: + ```bash $ cargo uninstall uutils ``` @@ -176,21 +193,25 @@ $ cargo uninstall uutils ### GNU Make To uninstall all utilities: + ```bash $ make uninstall ``` To uninstall every program with a set prefix: + ```bash $ make PROG_PREFIX=PREFIX_GOES_HERE uninstall ``` To uninstall the multicall binary: + ```bash $ make MULTICALL=y uninstall ``` To uninstall from a custom parent directory: + ```bash # DESTDIR is also supported $ make PREFIX=/my/path uninstall @@ -204,27 +225,32 @@ Testing can be done using either Cargo or `make`. Just like with building, we follow the standard procedure for testing using Cargo: + ```bash $ cargo test ``` By default, `cargo test` only runs the common programs. To run also platform specific tests, run: + ```bash $ cargo test --features unix ``` If you would prefer to test a select few utilities: + ```bash $ cargo test --features "chmod mv tail" --no-default-features ``` If you also want to test the core utilities: + ```bash $ cargo test -p uucore -p coreutils ``` To debug: + ```bash $ gdb --args target/debug/coreutils ls (gdb) b ls.rs:79 @@ -234,21 +260,25 @@ $ gdb --args target/debug/coreutils ls ### GNU Make To simply test all available utilities: + ```bash $ make test ``` To test all but a few of the available utilities: + ```bash $ make SKIP_UTILS='UTILITY_1 UTILITY_2' test ``` To test only a few of the available utilities: + ```bash $ make UTILS='UTILITY_1 UTILITY_2' test ``` To include tests for unimplemented behavior: + ```bash $ make UTILS='UTILITY_1 UTILITY_2' SPEC=y test ``` @@ -259,16 +289,19 @@ This testing functionality is only available on *nix operating systems and requires `make`. To run busybox's tests for all utilities for which busybox has tests + ```bash $ make busytest ``` To run busybox's tests for a few of the available utilities + ```bash $ make UTILS='UTILITY_1 UTILITY_2' busytest ``` To pass an argument like "-v" to the busybox test runtime + ```bash $ make UTILS='UTILITY_1 UTILITY_2' RUNTEST_ARGS='-v' busytest ``` From bf81f93be3aa03e3572c06b9405bf184ae504550 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 7 Apr 2021 20:29:43 -0500 Subject: [PATCH 4/7] docs/README ~ fix markdown lint complaints (fenced-code-language) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2eacbf173..230b08d3b 100644 --- a/README.md +++ b/README.md @@ -172,8 +172,8 @@ $ make PREFIX=/my/path install The [standard package set](https://nixos.org/nixpkgs/manual/) of [NixOS](https://nixos.org/) provides this package out of the box since 18.03: -``` -nix-env -iA nixos.uutils-coreutils +```shell +$ nix-env -iA nixos.uutils-coreutils ``` ## Uninstallation Instructions From 6551d29a6e896caa2c829ab0c1c9b560c325ffaa Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 7 Apr 2021 20:32:58 -0500 Subject: [PATCH 5/7] docs/README ~ fix markdown lint complaints (*disable* commands-show-output & no-duplicate-heading) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 230b08d3b..c485c5c63 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ ----------------------------------------------- + + uutils is an attempt at writing universal (as in cross-platform) CLI utilities in [Rust](http://www.rust-lang.org). This repository is intended to aggregate GNU coreutils rewrites. From d0abe9e6c9756b49875b7d2923c1f4584e4050f5 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 7 Apr 2021 20:36:51 -0500 Subject: [PATCH 6/7] docs/README ~ fix spelling (words and exceptions) --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c485c5c63..5bad664c1 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,12 @@ [![Build Status](https://api.travis-ci.org/uutils/coreutils.svg?branch=master)](https://travis-ci.org/uutils/coreutils) [![Build Status (FreeBSD)](https://api.cirrus-ci.com/github/uutils/coreutils.svg)](https://cirrus-ci.com/github/uutils/coreutils/master) -[![codecov](https://codecov.io/gh/uutils/coreutils/branch/master/graph/badge.svg)](https://codecov.io/gh/uutils/coreutils) +[![CodeCov](https://codecov.io/gh/uutils/coreutils/branch/master/graph/badge.svg)](https://codecov.io/gh/uutils/coreutils) ----------------------------------------------- + uutils is an attempt at writing universal (as in cross-platform) CLI utilities in [Rust](http://www.rust-lang.org). This repository is intended to @@ -178,9 +179,9 @@ provides this package out of the box since 18.03: $ nix-env -iA nixos.uutils-coreutils ``` -## Uninstallation Instructions +## Un-installation Instructions -Uninstallation differs depending on how you have installed uutils. If you used +Un-installation differs depending on how you have installed uutils. If you used Cargo to install, use Cargo to uninstall. If you used GNU Make to install, use Make to uninstall. From 8d7d1b0f355dc576f41083a13d02ad40b83444c9 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 7 Apr 2021 20:59:40 -0500 Subject: [PATCH 7/7] docs/README ~ revise build instructions for binaries --- README.md | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5bad664c1..76ea92ab5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ----------------------------------------------- - + uutils is an attempt at writing universal (as in cross-platform) CLI utilities in [Rust](http://www.rust-lang.org). This repository is intended to @@ -46,11 +46,13 @@ On both Windows and Redox, only the nightly version is tested currently. ## Build Instructions -There are currently two methods to build uutils: GNU Make and Cargo. However, -while there may be two methods, both systems are required to build on Unix -(only Cargo is required on Windows). +There are currently two methods to build the uutils binaries: either Cargo +or GNU Make. -First, for both methods, we need to fetch the repository: +> Building the full package, including all documentation, requires both Cargo +> and Gnu Make on a Unix platform. + +For either method, we first need to fetch the repository: ```bash $ git clone https://github.com/uutils/coreutils @@ -63,29 +65,37 @@ Building uutils using Cargo is easy because the process is the same as for every other Rust program: ```bash -# to keep debug information, compile without --release $ cargo build --release ``` -Because the above command attempts to build utilities that only work on -Unix-like platforms at the moment, to build on Windows, you must do the -following: +This command builds the most portable common core set of uutils into a multicall +(BusyBox-type) binary, named 'coreutils', on most Rust-supported platforms. + +Additional platform-specific uutils are often available. Building these +expanded sets of uutils for a platform (on that platform) is as simple as +specifying it as a feature: ```bash -# to keep debug information, compile without --release -$ cargo build --release --no-default-features --features windows +$ cargo build --release --features macos +# or ... +$ cargo build --release --features windows +# or ... +$ cargo build --release --features unix ``` If you don't want to build every utility available on your platform into the -multicall binary (the Busybox-esque binary), you can also specify which ones -you want to build manually. For example: +final binary, you can also specify which ones you want to build manually. +For example: ```bash $ cargo build --features "base32 cat echo rm" --no-default-features ``` -If you don't even want to build the multicall binary and would prefer to just -build the utilities as individual binaries, that is possible too. For example: +If you don't want to build the multicall binary and would prefer to build +the utilities as individual binaries, that is also possible. Each utility +is contained in it's own package within the main repository, named +"uu_UTILNAME". To build individual utilities, use cargo to build just the +specific packages (using the `--package` [aka `-p`] option). For example: ```bash $ cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rm