Releases: StormByte-Suite/StormByte-System
Release list
Version 2.0.0
[Summary]
StormByte System is the C++26 process, device and host layer of the StormByte suite.
It depends directly on StormByte Base 2.0.0 or newer. This repository is not Base, Buffer, Config, Crypto, Database, Logger, Multimedia or Network.
Spawn children with piped stdin/stdout/stderr, classify the medium behind a path, resolve directories and the current executable, inspect the machine, name the calling thread, and expand environment strings. POSIX and Windows stay behind one API. Failures are StormByte::Error::Fault in a per-type domain (StormByte.System.*). Nothing in this module throws. Text that crosses a DLL boundary is StormByte::Safe::String / StormByte::Safe::WString, not std::string by value.
From 2.0.0, original System sources are dual-licensed: GNU Lesser General Public License v3.0 or later, or a commercial license from the copyright holder. That change does not cover other StormByte modules or third-party material under thirdparty/ (including bundled StormByte Base).
If you landed here from a release link and have not read the tree:
- What this module is, how to build it, and short examples: README.md
- License: dual license LGPL-3.0-or-later or commercial, LICENSE
Added
- Device: classify the medium behind a path (
Kind,Accessbitmask, nominalThroughput, suggestedWindow).- Copyable; stores only the caller accessor as
StormByte::Safe::String. - Probe is on-demand.
operator boolis probe success, not permission. - Errors are
StormByte::System::Device::Errorin domainStormByte.System.Device, held asStormByte::Error::Fault.
- Copyable; stores only the caller accessor as
- Directory: current, home, temporary and current-executable directories.
bool+ outString;LastError()is TLS in this module. - File:
Temporary(prefix, suffix)creates an empty file the caller unlinks;CurrentExecutableis the running image. - Host: name, architecture, CPU brand, OS, kernel, page size, physical/available memory, logical processors, process bitness.
- ThisThread:
Sleep; get/set thread name (TooLongif the platform limit is exceeded; the name is not truncated). - Dual license on original System sources: LGPL-3.0-or-later or commercial (
LICENSE+COPYING.LGPLv3). - Shared vs static follows CMake
BUILD_SHARED_LIBS(declared inlib/, default ON). There is noSTORMBYTE_SYSTEM_SHAREDCMake option. When the library is shared, the compile definitionSTORMBYTE_SYSTEM_SHAREDis still set sovisibility.hcan distinguishdllexport/dllimport/ static. Vendored StormByte Base follows the sameBUILD_SHARED_LIBSmode and is configured withENABLE_TEST=OFF.
Changed
- Breaking: Windows
Process::Pid()returns only the child process identifier (DWORD); process and thread handles remain private to theProcessowner. - Breaking: Process no longer throws. Spawn, wait and stdin failures are
StormByte::System::Process::Errorin domainStormByte.System.Process, held asFault().operator boolis true only while a child is live (RUNNINGorSUSPENDED).- Timed
WaitsetsTimedOutand leaves the child running. A second wait after a successful reap setsAlreadyExited. - A failed stdin write sets
BrokenPipe.
- Breaking:
Variable::ExpandreturnsStormByte::Safe::String. On Windows, a failedExpandEnvironmentStringsWreturns the original text (same as a missing UNIX home). - Breaking: Process constructors take a UTF-8
StormByte::Safe::Stringexecutable path andStormByte::Safe::Vector<StormByte::Safe::String>arguments. Native filesystem-path conversion stays inside System, so neitherstd::filesystem::pathnorstd::vectorcrosses the DLL boundary. - Pipe construction and I/O no longer throw. Invalid pipes convert to
false. - Public text across a DLL boundary uses
StormByte::Safe::String/StormByte::Safe::WString; borrowed views carry explicit lengths. Native C-string copies are allocated and destroyed inside System, without relying on NUL termination in Base text buffers. - Breaking: System vendors StormByte Base 2.0.0 directly instead of StormByte-String and exposes Base's
StormByte::Safeowned-text types in its public API. Headers includeStormByte/safe/*.hxxinstead ofStormByte/string/*.hxx,StormByte/cstring.hxxandStormByte/wcstring.hxx. - Visibility macros follow Base/Logger (
EXPORTS/STORMBYTE_SYSTEM_SHARED/ static empty). - Windows Device probe links
iphlpapiandws2_32. Host CPU name linksadvapi32. macOS Device probe links IOKit and CoreFoundation. - Breaking:
Host::PageSize,PhysicalMemoryandAvailableMemoryreturnByteSize. They are octet lengths. - Breaking:
Device::WindowisByteSize.Device::Throughputstores octets per second asByteSize, notstd::size_t. - Breaking:
Process::operator>>andStderrtakeStormByte::Safe::String, notstd::string. The captured text is owned by Base.operator<<(std::ostream&, const Process&)isSTORMBYTE_FORCE_INLINE, so the stream buffer grows in the caller.operator<<onProcessandPipeacceptsstd::string_viewandString.operator>>staysStringonly: a view cannot own the bytes that were read. - Process path. Both constructors copy UTF-8 text into module-owned native path and argument storage;
std::filesystem::pathremains behind the private implementation. - Process owns its private implementation through
StormByte::Safe::Unique, allocated and freed on Base's heap.
Fixed
- Process lifecycle and errors
- Construction and forwarding-thread exceptions are contained; startup failures after private state exists, plus native wait/suspend/resume failures, are reported through the Process error domain.
- Interrupted POSIX timed waits retry
EINTRwhile continuing to enforce the requested deadline. - The Windows suspend/resume regression uses an explicit stdin barrier and exit status.
- The forwarding-thread owner is allocated before the thread starts, and the POSIX argument vector is prepared before
fork, preventing standard-library exceptions from escapingnoexceptconstruction or reaching the forked child. - Moving a failed or moved-from Process no longer carries a stale initialization error.
- Filesystem and device errors
- Directory and File operations retain permission and missing-path causes in their own error domains and contain filesystem exceptions in
LastError()results. - A denied symlink target is reported as
Permission, notBrokenSymlink; broken targets remain distinguishable on POSIX and Windows. - File temporary creation maps missing and inaccessible temporary directories to the corresponding File errors.
- Directory and File operations retain permission and missing-path causes in their own error domains and contain filesystem exceptions in
- Public value and resource contracts
- Device
Access,ThroughputandWindoware registered asMaybeSafevalues for Base safe collections. - The
Device(filesystem::path)adapter converts a native view in the caller module; probing contains conversion failures asProbeFailed. - Windows thread-name buffers are released through an owner even if conversion fails.
- Windows environment expansion, temporary-file creation and thread naming materialize module-local NUL-terminated strings before calling native APIs; bounded views do not expose trailing text or require a terminator beyond their range.
- The Windows bounded-environment regression uses
_dupenv_swith module-local RAII cleanup to preserve the previous value without deprecated CRT calls or suppressing warnings.
- Device
Removed
- Breaking:
Processstdin andVariable::Expandoverloads for Base's removedCString/WCStringtypes. UseString,WStringor the corresponding length-aware views. - Breaking:
StormByte/system/exception.hxx(Exception,FileIOError,ExecutableNotFound,ProcessCreationError). - Breaking:
StormByte::System::ErrorandStormByte/system/error.hxx(domainStormByte.System). Device, Process, Directory, File, Host and ThisThread keep their own domains.
Version 1.1.0
[Summary]
StormByte System is the C++26 process and environment layer of the StormByte suite.
Dependency baseline: StormByte (base) 1.1.0.
Spawn children with piped stdin/stdout/stderr, chain them, suspend/resume, and expand environment strings. POSIX and Windows stay behind one API.
Changed
- Public process behavior
- Ported System exception messages to the
StormByte::Componentformat and addedProcessCreationErrorfor process creation failures. - Added a public timed
Wait(std::chrono::milliseconds)overload; the existing untimed overload remains unchanged.
- Ported System exception messages to the
- Process pipeline internals
- Moved forwarding into the internal
Pipeabstraction while preserving buffered and future output. - Moved Process state into the private process implementation header, reducing public-header ABI exposure.
- Moved forwarding into the internal
- Dependencies and build configuration
- Updated the StormByte/base dependency to 1.1.0.
- Switched Windows release optimization handling to CMake interprocedural optimization without duplicate manual compiler/linker flags.
Fixed
- Pipe and process lifecycle
- Pipe construction now checks platform errors, normalizes UNIX descriptors, and moved pipes invalidate their source endpoints.
- Pipe reads, writes, polling, EOF handling, and descriptor binding now distinguish interruption, EOF, and failure.
- Process pipeline forwarding retains pipe ownership independently of Process lifetime, supports safe reconnection, and cancels without cross-thread descriptor closure.
- Process waiting no longer deadlocks on downstream backpressure; lifecycle joins handle unexpected thread errors without escaping
noexceptcleanup paths. - Direct writes, interrupted waits, and Windows wait failures now preserve error and ownership semantics.
- Process startup and platform handling
- UNIX startup reports
execvpfailures to the parent and throws the appropriate exception eagerly. - Windows startup quotes command-line arguments and distinguishes missing executables from other creation failures.
- Environment expansion handles missing home directories safely, expands only leading
~paths, and grows Windows buffers as needed.
- UNIX startup reports
- Regression coverage
- Added coverage for pipelines, process moves, signal termination, interrupted waits, descriptor reuse, consumer exit, direct write failures, and oversized Windows environment expansion.
- CI portability
- Fixed Windows-only Process implementation initialization.
- Made UNIX process tests resolve utilities through
PATHfor macOS portability.
Version 1.0.0
[Summary]
StormByte System is the C++26 process and environment layer of the StormByte suite.
Spawn children with piped stdin/stdout/stderr, chain them, suspend/resume, and expand environment strings. POSIX and Windows stay behind one API.
Initial public release of StormByte-System.
Added
- Process: run external programs with piped stdin / stdout / stderr
- Move-only ownership; starts on construction
Wait()for exit code (blocking, no timeout)Suspend()/Resume()- Stream operators: write stdin, read stdout,
<< System::EoFto close stdin - Process chaining (
p1 >> p2) via background forwarder Stderr()to read the stderr pipe- Cross-platform (POSIX fork/exec and Windows
CreateProcessW)
- Pipe (internal): anonymous pipes for IPC (UNIX
pipe/pipe2, WindowsCreatePipe)- Atomic chunked writes, bind/dup helpers, handle inheritance flags on Windows
- Variable: expand environment strings (Windows
ExpandEnvironmentStrings; UNIX~→ home) - Exceptions:
Exception,FileIOError,ExecutableNotFound - Unit tests for Linux, macOS and Windows (pipelines, stdin, exit codes, move)
Fixed
- Process move no longer double-waits the same child (ownership is fully transferred)
- Failed
execvpin the child uses_exit(127)instead of throwing acrossfork - Removed unimplemented
Pipe::BindRead(Pipe&)/BindWrite(Pipe&)declarations - Pipes owned with
std::unique_ptrinstead of rawnew/delete SIGPIPEignored once per process (not on every Pipe construction)WriteAtomictreats empty input as success- Windows command line built without a trailing space
Notes
- On UNIX, if the executable cannot be started, the child exits with status 127; the parent does not throw from the child path.
Wait()has no timeout; it blocks until the process ends.