Skip to content

Releases

0.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Oct 08:53

Rust sed 0.3.0 Release:

We are happy to announce the release of Rust sed 0.3.0.

The GNU-specific commands F, W and R are now implemented. Most of the remaining work went into the details scripts actually depend on: how n and Q end a cycle, when text queued by a, r and R is written or dropped, how l shows an empty pattern space, and how -i treats each file as a separate input.

Diagnostics were reworked as well: errors now follow the modern style used by Rust Coreutils, point at the right position in the script (even at its very end), and report where an unmatched { was opened.

At a terminal, the offending character is underlined in the script. Here is the same typo with both implementations:

GNU sed 4.9:

$ sed 's/foo/bar/gq' file.txt
sed: -e expression #1, char 12: unknown option to `s'

Rust sed 0.3.0:

$ sed 's/Normandie/Bretagne/gq' fromages.txt
sed: <script argument 1>:1:23: error: invalid substitute flag: 'q'
   ╭─[ <script argument 1>:1:23 ]
   β”‚
 1 β”‚ s/Normandie/Bretagne/gq
   β”‚                       ─
───╯

Test in the playground: https://uutils.org/playground/?cmd=sed+%27s%2FNormandie%2FBretagne%2Fgq%27+fromages.txt

GNU sed reports an unknown option somewhere in the s command. We name the faulty flag, give the line and column, and show where it is. Pipes keep the single-line message; set UUTILS_DIAG=always to force the full output.

We are now at 18 passing, 39 failing, 0 errors on the GNU sed test suite.


GNU Test Suite Compatibility:

Result 0.2.0 0.3.0 Change 0.2.0 to 0.3.0 % Total 0.2.0 % Total 0.3.0 % Change 0.2.0 to 0.3.0
Pass 14 18 +4 21.54% 27.69% +6.15%
Skip 10 8 -2 15.38% 12.31% -3.07%
Fail 41 39 -2 63.08% 60.00% -3.08%
Error 0 0 0 0% 0% 0%
Total 65 65 0

Note: four tests now pass: cmd-R, distrib, inplace-hold and stdin-prog. The CI now also generates the multibyte locales the suite needs, so title-case and utf8-ru are no longer skipped; they run and fail for now, which is why the failure count only drops by two. Counting only the tests that actually run, we are at 18/57 (31.6%), up from 14/55 (25.5%). We are comparing against GNU sed from its upstream repository.


GNU testsuite evolution


Highlights:

  • New GNU Commands

    • F: print the current input file name
    • W: write the first line of the pattern space to a file
    • R: read one line from a file and queue it for output
  • GNU Compatibility

    • n continues with the next command instead of starting a new cycle
    • Q discards text queued by a, r and R, and no longer writes a missing final newline
    • Appended text, R text and e output are written at the same point as in GNU sed
    • l shows an empty pattern space as $, even without a trailing newline; Unicode listing matches GNU sed
    • -i treats each file as a separate input, and takes its suffix only when attached (-i.bak), as GNU sed does
    • A range whose numeric first address was already passed now starts, as GNU sed does
  • Diagnostics

    • Error messages use the modern style of Rust Coreutils
    • The script position is kept for errors at the end of the script
    • An unmatched { reports where it was opened
    • An unterminated s or y command is reported instead of aborting
    • At a terminal, the offending character is underlined in the script (see the example above)
  • Robustness

    • Panics and zero steps fixed in ~ and , addresses
  • Performance

    • Literal regex needles are stored in an Arc, avoiding copies
  • Distribution

    • cargo binstall support
    • Extensions and incompatibilities are now documented in docs/src/extensions.md
  • Contributions: This release landed 57 pull requests from 5 new contributors


Call to Action:

Sponsor us on GitHub to accelerate development: github.com/sponsors/uutils

What's Changed

New Commands

GNU Compatibility

  • Make Unicode listing GNU-sed compatible by @dspinellis in #537
  • in-place editing: treat each file as a separate input by @SichenLiang in #569
  • sed: take the -i suffix only when attached, as GNU sed does by @DePasqualeOrg in #583
  • sed: continue with the next command after n instead of starting a new cycle by @DePasqualeOrg in #592
  • sed: show an empty pattern space as $ in l, even without a newline by @DePasqualeOrg in #595
  • sed: discard text queued by a, r and R on Q, as GNU sed does by @DePasqualeOrg in #594
  • sed: write appended text, R text and e output as GNU sed does by @DePasqualeOrg in #589
  • sed: start a range whose numeric first address was already passed by @sap1110 in #581
  • sed: don't write a missing final newline on Q, as GNU sed does by @DePasqualeOrg in #597

Diagnostics & Robustness

  • sed: fix panics and zero steps in ~ and , addresses by @sylvestre in #578
  • sed: keep script position for errors at end of script by @sylvestre in #579
  • sed: implement modern diagnostic like coreutils by @sylvestre in #576
  • compiler: report an unterminated s or y command instead of aborting by @SichenLiang in #571
  • sed: report where an unmatched { was opened by @sylvestre in #580

Performance

Testing

Code Quality & Cleanup

  • clippy: fix warnings from assert_is_empty lint by @cakebaker in #588

CI & Build

  • Add binstall support by @sylvestre in #520
  • ci: generate multibyte locales for the GNU testsuite by @sylvestre in #539
  • ci: use an absolute LLVM_PROFILE_FILE path so coverage includes the sed binary by @DePasqualeOrg in #591
  • ci.yml: avoid full git clone (--depth=1) by @oech3 in #600

Documentation

  • docs: move extensions and incompatibilities to docs/src/extensions.md by @sylvestre in #575

Dependency Updates

  • Update Rust crate ctor to v1.0.13 by @renovate[bot] in #521
  • Update Rust crate clap_mangen to v0.3.3 by @renovate[bot] in #523
  • Update dawidd6/action-download-artifact action to v23 by @renovate[bot] in #524
  • Update Rust crate similar to v3.2.0 by @renovate[bot] in #526
  • fix(deps): refactor sha2 package configuration by @xtqqczze in #534
  • Update dawidd6/action-download-artifact action to v24 by @renovate[bot] in #536
  • Update Rust crate uucore to 0.11.0 by @renovate[bot] in #546
  • Update Rust crate uufuzz to 0.11.0 by @renovate[bot] in #547
  • Update Rust crate uutests to 0.11.0 by @renovate[bot] in #548
  • Bump getrandom from 0.4.2 to 0.4.3 by @cakebaker in #554
  • Bump chacha20 from 0.10.0 to 0.10.2 by @cakebaker in #553
  • Update Rust crate console to v0.16.6 by @renovate[bot] in #555
  • Update Rust crate uufuzz to 0.12.0 by @renovate[bot] in #563
  • Update Rust crate divan to v5.0.2 by @renovate[bot] in #561
  • Update Rust crate uucore to 0.12.0 by @renovate[bot] in #562
  • Update Rust crate uutests to 0.12.0 by @renovate[bot] in #564
  • Update Rust crate rand to v0.10.3 by @renovate[bot] in #566
  • Bump cargo-dist from 0.30.3 to 0.33.0 by @cakebaker in #556
  • Update Rust crate clap to v4.6.7 by @renovate[bot] in #558
  • Update Rust crate clap_complete to v4.6.11 by @renovate[bot] in #559
  • Update Rust crate rustix to v1.1.5 by @renovate[bot] in https://...
Read more

latest-commit

latest-commit Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 28 Jan 07:56

commit: c225cb8

0.1.1

Choose a tag to compare

@github-actions github-actions released this 17 Dec 19:25

uutils sed 0.1.1 Release:

We are excited to announce the first release of uutils sed 0.1.1 - bringing a comprehensive sed implementation to the uutils ecosystem with robust GNU compatibility and high performance!

Note that this release is not production ready.


Highlights:

  • Aims at a complete sed Implementation

    • Full command compilation framework with function pointers for optimal performance
    • Comprehensive address compilation supporting all standard sed addressing modes
    • All major sed commands implemented: a, c, i, d, p, s, y, n, N, l, q, Q, and more
    • Advanced features including in-place editing (-i), multiple files support, and optimized processing
  • Performance focus

    • Optimized text processing with memory-mapped file I/O for large files
    • Efficient operations with copy_file_range(2) on Linux
    • Smart buffer management and text optimization for a, c, i commands
  • GNU sed Compatibility

    • Comprehensive error reporting with accurate line numbers and context
    • Improved GNU compatibility for append, change, and insert commands
    • Proper handling of script and file arguments matching GNU sed semantics
    • Support for silent comment commands and advanced regex handling
  • Modern Rust Implementation

    • Built on Rust 2024 edition with robust safety guarantees
    • Integration with uutils ecosystem using uucore, uutests, and uufuzz built for the Rust Coreutils
    • Comprehensive test suite ensuring reliability and correctness
  • Cross-Platform Support

    • Available for Apple Silicon macOS, Intel macOS, Windows (x64), and Linux (x64, ARM64, MUSL). Port to other OS/arch are welcome.
    • Automated release pipeline with cargo-dist for consistent builds
  • Developer Experience

    • Integrated fuzzing support for enhanced reliability
    • Performance benchmarking infrastructure with CodSpeed integration
    • Comprehensive CI/CD pipeline ensuring code quality

Key Contributions:

This release represents a significant achievement in bringing a high-quality, performant sed implementation to the Rust ecosystem. Diomidis Spinellis has been the primary architect behind this implementation, contributing the core sed engine, command compilation framework, address parsing, and most of the advanced functionality that makes this a GNU-compatible sed alternative.

This work has been documented by Diomidis Spinellis in this paper:
https://ieeexplore.ieee.org/document/11119110


Platform Availability:

Platform Architecture Package
macOS Apple Silicon sed-aarch64-apple-darwin.tar.xz
macOS Intel sed-x86_64-apple-darwin.tar.xz
Windows x64 sed-x86_64-pc-windows-msvc.zip
Linux ARM64 sed-aarch64-unknown-linux-gnu.tar.xz
Linux x64 sed-x86_64-unknown-linux-gnu.tar.xz
Linux x64 MUSL sed-x86_64-unknown-linux-musl.tar.xz

Call to Action:

πŸš€ Sponsor uutils development to accelerate the ecosystem: github.com/sponsors/uutils
πŸ”§ Try sed 0.1.1 and report feedback: github.com/uutils/sed/issues
🌍 Contribute to the project and help build the future of cross-platform utilities

Major Implementation Milestones

Core Architecture

  • Complete CLI processing and compilation framework by @dspinellis in #40
  • Address compilation implementation by @dspinellis in #57
  • Command compilation refactoring with function pointers by @dspinellis in #108
  • Complete implementation of all commands and optimizations by @dspinellis in #77

Command Implementation

Performance & Optimization

Project Infrastructure

Modern Rust Migration

Version & Release Management

New Contributors

Full Changelog: https://github.com/uutils/sed/commits/0.1.1