Sigil 0.24.0

release

A registry and portability release. Packages can now depend on registry packages with from-pkg and install, build and test with no Git fetch, and sigil cli upgrade installs only releases the registry has verified. Native amd64 programs now target baseline x86-64, so a binary built on one machine runs on any x86-64 machine. Socket writes raise a typed error when a connection fails, and a new experimental target lets a Sigil program run straight from UEFI firmware!

Download 0.24.0Get started

Known issue: 0.24.0 published only nine of Sigil's workspace packages to the registry: sigil-build, sigil-deps, sigil-git, sigil-lib, sigil-package, sigil-stdlib, sigil-store, sigil-test and sigil-test-runner. The other sixteen have no 0.24.0 release, and their 0.23 versions don't work with the 0.24.0 packages. Relocking a project that uses one of them, such as sigil-run, against 0.24.0 can fail to link. Sigil 0.24.1 publishes every workspace package, so upgrade to that instead.

Socket write errors

socket-write and socket-write-line used to return #f for any failure, so a full send buffer looked the same as a closed connection. Now #f means only that the write would block. Terminal failures, such as a broken pipe or a reset connection, raise a typed socket-error, and socket-error-operation and socket-error-native-code say what failed. The buffered UDP procedures raise the same error.

(guard (e ((socket-error? e)
           (socket-close sock)
           (socket-error-errno e)))   ; for example epipe or econnreset
  (socket-write sock message))

socket-send-all now returns the byte offset it reached instead of #t, and takes an optional starting offset, so you can resume after would-block without resending anything.

(define sent (socket-send-all sock data))
;; After waiting for the socket to be writable:
(when sent (socket-send-all sock data sent))

If you use sigil-websocket, upgrade to 0.11.0, which is published right after this release.

Registry dependencies and upgrades

Dependencies declared with from-pkg now work end to end, so a package can depend only on registry packages and install, build and test without a single Git fetch.

dependencies: (list
  (from-pkg name: "sigil/sigil-json" version: "^0.16.0"))

The registry entries for the 0.23.1 workspace packages are missing their dependency lists, and published entries can't be changed, so 0.24.0 publishes all nine workspace packages again with complete lists. A caret range on 0.x stays within its minor version, so change ^0.23 or =0.23.1 to ^0.24.0 and run sigil deps update.

sigil cli upgrade and sigil cli use now download releases only from the signed registry. If the registry can't be reached or verification fails, they install nothing. Versions you've already installed still switch with sigil cli use, even offline.

Portable amd64 binaries

Native amd64 builds used to compile for the CPU of the machine that built them. A program built on a machine with AVX-512 could crash with an illegal instruction on one without it, and a cached or registry artifact carried that requirement along.

Every amd64 native output now targets baseline x86-64: native and bundled programs, runtime archives, channel packages and release builds. The CPU profile is part of each artifact's identity, so nothing built the old way is reused. Flags that ask for more, in a build config's c-flags or a channel package's CFLAGS, now stop the build with CPU flag exceeds the portable x86-64 baseline.

Portability costs a little speed. On an Intel i7-8850H, benchmarks covering garbage collection, allocation, JSON, YAML config loading and bytecode ran 1 to 5% slower than code tuned for that CPU.

Experimental UEFI target

Sigil can now build programs that run straight from x64 UEFI firmware, before any operating system starts. The experimental x86_64-uefi build target produces an EFI application with your program's bytecode embedded, and the new (sigil uefi) library gives it the firmware console, the keyboard, files on its own boot volume, the framebuffer, the firmware's boot entries, and a way to start a Linux kernel or another EFI application.

The target runs bytecode programs only, and has no networking, processes, threads or file writes beyond renaming a file.

Channel builds and publishing

During a channel build, each dependency's bin directory is now on PATH after the build inputs' own tools, so a package can run tools its dependencies provide. Build tools that need other store items at run time, such as a script's interpreter, now find them in the sandbox, and a toolchain can come from a store item rather than only the pinned Zig seed. The external build format moved to version 5.

sigil channel publish --new-stream starts a different declared stream at sequence zero, using the current channel as its template, and refuses a stream id that already exists. A --registry-seq higher than the published one now publishes even when the content hasn't changed; without it, unchanged content is still a no-op that needs no signing key. Channel source can also live in declared workspace members. Their source trees are merged by module path, so moving identical source between the root and a member keeps its signed identity, and duplicate files, symlinks and paths that escape the member are refused.

Core UTF-8 conversions and sigil-apps

utf8->string and string->utf8 are now exported from (sigil core) as well as (sigil io). They're the same procedures, so a library that only converts bytes no longer has to import I/O. sigil-crypto 0.19.1, released alongside, uses them to keep minisign verification free of I/O, sockets and scheduling, and it requires Sigil 0.24.

The new sigil-apps package validates application release manifests: app IDs, the files and sets a release contains, signatures and trust grants. It fetches and installs nothing itself, and gives identical results natively and on wasm32-wasi. It's the first piece of publishing apps through the registry. Correction: sigil-apps wasn't published to the registry with 0.24.0. It ships there for the first time in 0.24.2.

Fixes