Hare 0.24.2 This is the stable release of Hare 0.24.2. Highlights of this release include: * NetBSD support * for-each loops and the "done" type * Optional parameters for functions * Support for shared memory and memfds on supported platforms * Revised and improved APIs for unix::* * Improved performance for bufio and related APIs * regex:: now supports multiple alternation (i.e. (x|y|z)) * New cryptography APIs: * crypto::ec * crypto::ecdh * crypto::ecdsa This release includes a number of breaking changes. The introduction of the "done" type to improve the iterator pattern introduces the following changes: * "done" is now a reserved word and cannot be used in user-defined names * The following standard library symbols have been updated to use done types in their API: * bytes::next_token/bytes::prev_token * encoding::utf8 * fs::next * glob::next * io::EOF * mime * path::nextiter * strings::next/strings::prev * strings::next_token/strings::prev_token * In short, if your program matches on a function using the iterator pattern with "void" and this causes an error from 0.24.2, the correct solution is likely to rewrite it to use a for-each loop, or replace "void" with "done" in the relevant match case. bytes::tokenize now accepts multiple single-byte delimiters and removes support for multi-byte delimiters. strings::tokenize accepts multiple delimiters, limited to the set of ASCII characters. The following APIs have been overhauled and programs depending on them may need to be refactored: * unix::hosts * unix::passwd Several breaking changes have been made to time: * time::date now accepts a zone offset (zoff) parameter in time::date::reckon and time::date::truncate. * time::date::calculus has been renamed to time::date::rflag. * time::date::realize requires .vloc to be set, and no longer defaults to UTC. * time::date::now() is renamed to time::date::localnow() and time::date::nowutc() is renamed to time::date::now() * time::date::EPOCHAL_JULIAN and EPOCHAL_GREGORIAN have been renamed to EPOCHDAY_JULIAN and EPOCHDAY_GREGORIAN respectively * time::chrono::eq has been removed and replaced with time::chrono::simultaneous and time::chrono::coincident * time::chrono::mzone has been renamed to time::chrono::ozone * The type of time::date::parsefail has been chnaged from rune (storing the offending format specifier) to (size, rune), which adds the index of the position where the parsing failure occured. * Several constants for format layouts in time::date have been renamed: [[EMAILZ]] => [[EMAILZONE]] [[STAMP_NANO]] => [[STAMPNANO]] [[STAMP_ZOFF]] => [[STAMPZOFF]] [[STAMP_ZONE]] => [[STAMPZONE]] [[STAMP_NOZL]] => [[STAMPLOC]] strconv's "b" family of functions (those which accept a base for the conversion) have been removed, and the remaining functions accept the desired base as an optional parameter. The following modules have been removed from the standard library and placed in the extended library: * crypto::bcrypt https://git.sr.ht/~sircmpwn/hare-bcrypt * format::tar https://git.sr.ht/~sircmpwn/hare-tar Alexey Yerin (8): sort: Replace []void with []opaque in README os+linux: Match resolve_flag values with OS flag values strconv: Merge functions with their -b versions all: Use optional parameters for flags cmd/haredoc: Correctly display HTML module references Use 'def' globals where possible hare::unparse: Add 'done' literal net::uri: Clean up memory handling after failure Andreas Schwab (1): debug+riscv: use correct comment syntax Armin Preiml (30): asn1: add types and errors asn1: encoder asn1: decoder asn1: oid support asn1: add decode support for non utf8 string types asn1: add readme add crypto::ec crypto::ec: port the i31 p256 implementation from BearSSL crypto::ec: port the prime implementation from BearSSL crypto::ec: add max sz constants for static allocation add crypto::ecdh crypto::ecdha: testcases crypto::hmac: fix fail when buf is non-zero crypto: s/eliptic curve/elliptic curve crypto::sha512: export BLOCKSZ net::{tcp,unix}: set default values for flags strings::sub: end as default parameter crypto::ec: improve doc on curve parameters add crypto::ecdsa crypto::ecdsa: implement hmac_drbg crypto::ecdsa: key management functions crypto::ecdsa: implement sign and verify crypto::ecdsa: validation test crypto::ecdsa: add testcases from RFC 6979 ecdsa: fix docs encoding::asn1: fix doc references os::exec: open /dev/null with RDWR flag on nullfd crypto::ecdsa: change api to match other crypto apis crypto:ec: be more strict with return values crypto::ecdsa: add privkey_finish Bor Grošelj Simić (11): ascii: fix compare-by-subtraction in strcasecmp test: don't count result interpretation in consumed time crypto/ec: remove trailing empty lines mime: add license headers for +platform files encoding::base64: rewrite decoder encoding::base64: improve encoder struct size encoding::base64: document behavior after errors regex: fix typos in error messages make bootstrap all: drop trailing ... in functions that are not variadic os::move: fix invalid match usage Byron Torres (43): time::chrono: leap-seconds.list whitespace parsing fmt: improve docs time::chrono: rename _lookupzone to lookupzone time::chrono: improve LOCAL, tz() time::chrono: moment.daytime: i64, not duration time::chrono: rename mzone to ozone time::chrono: rename path constant exports time::date: rename some calc functions time::date: make type insufficient an enum time::date: change type parsefail, add byteindex time::date: change, add layout constants time::date: virtual: add .vsec, .vnsec test: add HARETEST_INCLUDE, require(); slow tests time::chrono: improve LOCAL docs time::chrono: rm eq; add simultaneous, coincident time::date: improve observer fn docs time::date: improve new() docs time::date: rename epochal day constants time::date: improve realize() docs, describe .hour time::date: rename .halfhour to .hour12 time::date: rename nowutc(), now(), use localnow() time::date: use "virtual date" phrase in docs getopt: README: use for-each time::chrono: lookupzone: use sort time::chrono: make zoneindex type size time::date: use nomimal constants throughout time::date: realize: require .vloc, no UTC default time::date: rename calculus to rflag time::date: add zflag enum, zfunresolved error time::date: implement zflag in realize() time::date: implement zflag in new() time::date: implement zflag in from_str() time::date: implement zflag in truncate() time::date: implement zflag in reckon() time::date: realize: fix v.year time::date: fix week(), isoweek() time::date: format: tidy time::date: format: fix time::date: format: docs time::date: format: add %G, %V, ISOWKSTAMP time::date: format: layout docs time::date: README: mention ISO week-numbering cal bufio: replace 'file' with 'h' Cephon Altera (1): added `os::hostname()` to OpenBSD Curtis Arthaud (9): syscalls: add utimensat, futimens os: add chtimes, fchtimes syscalls: add fchmod, fchown os: add fchmod, fchown time::date: add v.century, v.year100 fmt: clarify docs syscalls: add clock_settime time: add set() time: set(): don't abort on EPERM Drew DeVault (44): rt+openbsd: add missing copyright headers encoding::asn1: clean up doc strings and style add docs/release.md cmd/hare: add toolchains to hare version -v rt+freebsd: expand ioctl support unix::tty: add tcsetpgrp unix::signal: add sigset_fill docs: drop docs which are obsoleted by harelang.org unix: unify and normalize credentials bytes: refactor tokenize unix, rt: add alarm(2) support unix::signal: add sigwait(2) family of functions rt+linux: fix getpgrp, alarm for !x86_64 make bootstrap make bootstrap debug: updates per for-each support debug: fix issues with invalid frame pointers rt+linux: MCL_*: change type to uint hare(1): don't auto-add -lc if freestanding encoding::hex::dump: add optional base address .builds: disable NetBSD rt: rewrite platform_abort to use writev .builds/netbsd.yml: restore file path MAINTAINERS: Add Mallory Adams .builds/netbsd: install to /usr os: add shared memory support regex: use bufio::scanner for enumerating runes crypto::bcrypt: move to extlib format::ini: use bufio::scanner bytes::tokenize: clean up code bytes, strings::tokenize: support multiple delimiters unix::passwd: use bufio::scanner and refine API time::chrono: parse leap seconds with bufio::scanner unix::tty: use bufio::scanner for +test cmd/harec: remove cmd/ioctlgen: remove format::tar: move to extlib unix::hosts: rewrite with bufio::scanner unix::resolvconf: rewrite and expand parser Add missing copyright headers README.md: drop explanation of non-free spec license scripts/version: set version to 0.24.2-rc2 errors: add netunreachable scripts/version: upgrade to 0.24.2 Dridi Boukelmoune (1): Makefile: Build haredoc(1) with LDLINKFLAGS Ember Sawady (7): hare build: create empty td file if necessary hare build: pass -a to harec output to ./foo on `hare build foo.ha` rt::u64tos: return *[*]const u8 rather than *const u8 get rid of trailing empty lines os::exec: add fallback for pre-faccessat2 linux os::exec: fix cmd() error case Hugo Osvaldo Barrera (5): os::exec: return concrete error when feasible syscalls: add setxattr syscalls: add getxattr syscalls: add removexattr os: add wrappers for xattr syscalls Jeremy Baxter (1): fix bootstrapping and installation link in readme Joe Finney (5): strconv: Simplify and fix bugs in stoi/stou. strconv: Minor stylistic fixes for stoi/stou. Update hare::parse for optional function params. Make bufio::newscanner's maxread parameter optional. Handle base::HEX_LOWER in stof and stou. Lennart Jablonka (3): rt: add TIOCSPGRP to +linux and +openbsd rt/+openbsd: add getpgid rt/+openbsd: fix writev syscall Lorenz (xha) (4): for-each changes mime: make SYSTEM_DB platform-dependent (fix openbsd) TREES: remove openbsd openbsd: remove the step for downloading leap-seconds.list Mallory Adams (5): hare::lex: allow digit separators all: replace spaces with tabs NetBSD: port Hare to NetBSD/amd64 NetBSD: make the build pass, replace all compat syscalls NetBSD: add os::shm_open() Martin Quinson (1): Fix 102 memleaks in the stdlib tests Max Schillinger (4): regex: implement whole-expression alternation regex: fix typo in error message regex: implement multiple alternation bufio: remove scanner inefficiency Mykyta Holubakha (3): std: fix some low-hanging memory leaks tests: fix low-hanging memory leaks net/uri: fix some leaks Philipp Wolfer (1): haredoc: fix call to log warnings Sebastian (30): TREES: add harec-plus-plus (april fools 2024) regex: get rid of unnecessary void casts crypto::ec: replace pointer cast with integer cast regex: fix inexhaustive match debug: fix inexhaustive match debug: ignore io::close error in printframe debug: remove error assertion from signal handler test: fix require's signature outside of +test types: note where uintptr is excluded fmt: change order of tagged union return types fmt: remove unused variable fmt: ignore error in fatal/fatalf types::c+test: remove sizes test types::c: add strnlen types::c+test: add strlen and strnlen tests strings: mention == in strings::compare docs all: add trailing :: to module references strings: return done from peek_token bytes: return done from next_token/peek_token mime: return done from next_param fs: update documentation to use done test: color skipped tests gray test: fail gracefully on stack overflow math::checked: fix subi* with *_MAX and *_MIN math::checked: cast to int/uint math::checked: add saturating arithmetic functions haredoc: warn and continue on parsing error haredoc: fix accidental reuse of static string encoding::utf8: return done from next/prev hare.1: add note about poor error message quality Song Shuai (1): genbootstrap: Use '$@' in the rule for ssa target Vlad-Stefan Harbuz (1): haredoc: fix symbol links Willow Barraco (2): Help reading inotify_events unix::passwd: implement getgroups citrons (2): hare::module::find(): fix symlink resolution hare::module::find(): provide more error context lunacb (1): Make glob::strerror's buffer static spxtr (3): strconv: add sto(f64|f32)b with hex base support. hare::lex: lex hex. Remove most unused imports. ubq323 (1): math: add TAU constant wackbyte (3): follow style guide for void match/switch cases fix mixed indentation time::date: fix typo