One release, four kinds of artefact, from wai-release.yml on a wai-v* tag: - C: each Linux job attaches libwai-<version>-<triple>.tar.gz for x86_64- and aarch64-unknown-linux-gnu (wai/quickstart/build-libwai.sh): lib/libwai.a, the feature native_sink, built for the glibc target without crt-static; the committed include/wai.h; lib/pkgconfig/wai.pc, relocatable, its Libs naming rustc's native-static-libs. Static, so a program carries it and looks for nothing at run time. Before the attach: the header the build regenerates is the committed one, the library defines exactly the envelope's and the native sink's functions, and a C program compiles, links and runs against the archive through pkg-config (wai/quickstart/test/c-library.sh). - Swift: Package.swift names WaiFFI by URL and checksum once a release has written them, and build/WaiFFI.xcframework while it is built there. The swift job attaches the zipped framework and wai-sink-swift-<version>.zip, the package naming it by download URL and SwiftPM checksum; scripts/check-release-package.sh resolves, builds and runs an application against it (before the attach through a mirror of the URL, after from the URL) and requires a wrong checksum to be refused. wai-sink-swift.yml runs the first on every change. - Kotlin: maven-publish as science.transaction.wai:wai-sink:<version>, manifest package science.transaction.wai.sink (the Kotlin classes keep wai.sink). The android job checks the publication (scripts/check-publication.sh), attaches the AAR and publishes it to the forge's Maven registry; wai-sink-android.yml writes and checks it on every change. - OCI: Containerfiles and check-image.sh for the relay and the room service (deploy/ beside each crate). The images job, on a runner labelled oci, builds and checks both and pushes them to the forge's container registry (wai/quickstart/release-images.sh, oci-push.py); an image that fails its check is not pushed. The forge's job token reads the organisation's packages and cannot write them, so the Maven publication and the images read the repository secret WAI_PACKAGES_TOKEN (scope write:package). Every upload goes to the forge over the private network. The release body names the new files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1.9 KiB
libwai, WAI's C library
WAI's C interface for Linux, as a static library:
| path | what |
|---|---|
include/wai.h |
the header, generated from the C interface of wai/wai-rs and committed there |
lib/libwai.a |
the library, built from wai/wai-rs with the feature native_sink |
lib/pkgconfig/wai.pc |
the pkg-config file: the flags to compile against the header and link the library |
Link
export PKG_CONFIG_PATH=/path/to/this/directory/lib/pkgconfig
cc your-program.c $(pkg-config --cflags --libs wai) -o your-program
wai.pc finds its own directory, so this directory can be unpacked anywhere. The library is
static: the program carries it, and nothing of libwai is looked for when the program runs. It is
built for this archive's glibc target without a static C runtime, so the program uses the C
library it is linked against. pkg-config --libs wai names the system libraries libwai needs
beside -lwai.
What it holds
The envelope and the native sink: wai_envelope_pack, wai_envelope_unpack,
wai_envelope_detect_version, wai_envelope_pack_multi, wai_envelope_unpack_multi,
wai_envelope_select, wai_int_payload_declared, wai_buffer_free, wai_last_error, every
wai_sink_* function (extensions/native-sink.md §9) and wai_audit_verify_bundle. It is the
interface the Swift package's WaiFFI.xcframework and the Android library carry, and it needs no
library but the C runtime.
wai.h also declares the codec wrappers (wai_image_*, wai_audio_*, wai_text_*,
wai_video_*) and the neural decoders (wai_neural_*). They need codec and model libraries, and
they are not in this library: a program that calls one of them does not link.
A call that can fail returns a status, 0 for success, and wai_last_error() says why it failed;
a buffer a call writes is freed with wai_buffer_free. The header's comments state each
function's contract.