Git Product home page Git Product logo

posixutils-rs's Introduction

posixutils-rs

This is a suite of Rust-native core command line utilties (cp, mv, c99, m4, make, ...) using SuSv3 as the base POSIX specification.

Goals

The goal is to create clean, race-free userland utilities that are POSIX compliant, maximizing compatibility with existing shell scripts while minimizing bloat.

Implementation goals include clean, safe Rust code and maximal use of small Rust community crates. This project's utilities should "look like normal Rust programs."

WANTED: Volunteers!

Contributions are welcome. Developers and non-developers alike, please read CONTRIBUTING for details.

Core specification: https://pubs.opengroup.org/onlinepubs/9699919799/

Non-goals

It is not a goal to be compatible with GNU utilities, which are sometimes viewed as bloated and overloaded with rarely-used options.

Popular GNU options will be supported by virtue of the "don't break scripts" rule. Unpopular options will not be implemented, to prevent bloat.

Similar projects

A similar project from the author, written in C++, is https://github.com/jgarzik/posixutils

A project with more narrow scope, with the aim of GNU coreutils compatibility, is uutils: https://github.com/uutils/coreutils

Because it is a FAQ, the major differences between this project and uutils are:

  1. Wider scope: posixutils is far more ambitious than uutils from a breadth standpoint: posixutils will include bc, m4, c99 compiler, a cron daemon etc. uutils is far more limited in the scope of programs covered, mimicing GNU coreutils.
  2. More minimalist: Each posixutils utility implementation is intentionally more minimalist, intending to avoid the bloat of supporting rarely-used, non-POSIX features. Our common denominator and baseline is the POSIX spec, then add non-POSIX features that users cannot live without.
  3. Transportable: Each posixutils utility should look like normal Rust code, easily stand alone with little-or-no deps, and be used in another project. This project is MIT-licensed, not GPL licensed, to aid in that transportability goal.

Utility status

Stage 6 - Audited

(none)

Stage 5 - Fully Translated to 2+ languages

(none)

Stage 4 - Code coverage

(none)

Stage 3 - Test coverage

  • ar (Development)
  • basename
  • bc
  • cksum
  • cmp
  • comm
  • compress (compress cat.)
  • cp
  • csplit
  • cut
  • diff
  • dirname
  • expand
  • expr
  • false
  • file
  • find
  • fold
  • grep
  • head
  • join
  • link
  • ls
  • mkdir
  • mv
  • nl
  • nm (Development)
  • od
  • paste
  • pr
  • readlink
  • rm
  • rmdir
  • sort
  • split
  • strings
  • strip (Development)
  • tail
  • time
  • tr
  • true
  • uncompress (compress cat.)
  • uudecode (uue)
  • uuencode (uue)
  • unexpand
  • uniq
  • unlink
  • wc
  • what (SCCS)
  • zcat (compress cat.)

Stage 2 - Feature-complete and POSIX compliant

  • cat
  • chgrp
  • chmod
  • chown
  • date
  • env
  • ipcrm (IPC)
  • ln
  • logname
  • mesg
  • mkfifo
  • nice
  • nohup
  • pathchk
  • pwd
  • renice
  • sleep
  • tee
  • touch
  • tty
  • uname
  • write

Stage 1 - Rough draft

  • asa
  • cal
  • df
  • du
  • echo
  • dd
  • getconf
  • id
  • ipcs (IPC)
  • kill
  • logger
  • printf
  • ps
  • realpath
  • stty
  • tabs
  • test
  • tput
  • tsort
  • who
  • xargs

Stage 0 - Not started

Cron category

  • at (cron cat.)
  • batch (cron cat.)
  • crontab (cron cat.)

Development category

  • c17 (Development)
  • cflow (Development)
  • ctags (Development)
  • cxref (Development)
  • lex (Development)
  • yacc (Development)

SCCS category

  • admin (SCCS)
  • delta (SCCS)
  • get (SCCS)
  • prs (SCCS)
  • rmdel (SCCS)
  • sact (SCCS)
  • sccs (SCCS)
  • unget (SCCS)
  • val (SCCS)

i18n category

  • gencat (i18n)
  • gettext (i18n)
  • iconv (i18n)
  • locale (i18n)
  • localedef (i18n)
  • msgfmt (i18n)
  • ngettext (i18n)
  • xgettext (i18n)

UUCP category

  • uucp (UUCP)
  • uustat (UUCP)
  • uux (UUCP)

Editors category

  • ed (Editors)
  • ex (Editors)
  • vi (Editors)

Misc. category

  • awk
  • fuser
  • lp
  • m4
  • mailx
  • make
  • man
  • more
  • newgrp
  • patch
  • pax
  • sed
  • sh
  • talk
  • timeout

Testing

A few tests require additional setup such as a case-insensitive filesystem or the use of another command like script. They are locked under the posixutils_test_all feature flag to exclude them from GitHub CI. These tests can be run by passing the feature flag to cargo:

cargo test --release --features posixutils_test_all

A further subset of posixutils_test_all tests are marked as requires_root. Running as root would override Unix permissions and thus give false failures on tests where such permissions are expected to be upheld so it is recommended to run these tests individually. There are currently 4 such tests:

  • test_cp_special_bits
  • test_mv_sticky_to_xpart
  • test_rm_fail_2eperm
  • test_rm_no_give_up
sudo -E cargo test --release --features posixutils_test_all,requires_root <test_name>

Integration tests may generate test data under CARGO_TARGET_TMPDIR (usually resolves to target/tmp) and /dev/shm (Linux only).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.