Skip to content

v0.6.0 - One way in, and in the browser

Choose a tag to compare

@buvinghausen buvinghausen released this 03 Oct 02:03
· 31 commits to master since this release
83e2fd5

0.6.0 gives every binding one way to reach the core, puts HyperUuid in the browser for C#, Rust, Python, Go and Swift, and makes every package smaller. The full list is in CHANGELOG.md.

Highlights

  • In the browser, proven in a browser. Every route below runs in headless Chrome in CI, on every PR.

    Language How
    C# Blazor WebAssembly (.NET 11+): a plain PackageReference, as before
    Rust wasm32-unknown-unknown with getrandom's wasm_js feature
    Python (new) Pyodide: await micropip.install("hyperuuid") finds a new pyemscripten wheel on PyPI (~73 KB). The whole test suite runs inside Pyodide in CI.
    Go (new) TinyGo 0.42+ with -target=wasm, the core linked in
    Swift (new) the wasm32-wasip1 build, run in a page through a WASI shim
  • Go links the core, and that's the only way. cgo statically links a ~20 KB archive on Linux, macOS and now Windows, using the same MSVC archive C# links under Native AOT.

    • Removed: purego, the loading cgo backend, the wasmtime backend, and the nine embedded libraries a build used to extract to a temp file.
    • Dependencies: go.mod needs only google/uuid.
  • Swift links the core on every platform. macOS and Windows join Linux and WebAssembly: no loader, no resource bundle, and nothing to deploy beside your executable.

  • Ruby runs Magnus on Alpine.

    • New musl platform gems carry Magnus extensions for Ruby 3.4 and 4.0.
    • Fiddle is now only the universal gem's last resort, for Ruby 3.3, a Ruby newer than this release, Intel Macs and unbuilt platforms.
    • Platform gems no longer carry Fiddle libraries.
  • Smaller everywhere.

    • Every shipped library is stripped: linux-x64 is 16 KB, with identical machine code.
    • The Ruby x86_64-linux-gnu gem is 339 KB, from 459 KB.
    • Go's module and the Composer package drop the embedded libraries.
    • A Blazor app no longer copies a 3 MB archive into its output.

Upgrade notes

Go (breaking: the reason this is 0.6.0).

  • Needs cgo and a C compiler where it's built:
    • Linux: gcc or clang (build-base on Alpine)
    • macOS: the Xcode command-line tools
    • Windows: MinGW-w64 gcc (llvm-mingw on arm64)
  • Unsupported builds fail at compile time, with an error that names the fix. That covers CGO_ENABLED=0, stock Go's GOOS=js/wasip1, and any other platform.
  • Drop the old build tags -tags hyperuuid_dynamic and -tags hyperuuid_wasm.
  • API unchanged: Available() is always true, and ErrNativeUnavailable is deprecated.

Swift.

  • Nothing to deploy any more on macOS and Windows: remove the step that copied HyperUuid_HyperUuid.bundle/.resources beside your executable.
  • NativeLibraryError has no cases now, so code matching .openFailed/.symbolNotFound no longer compiles.
  • Unsupported platforms fail at compile time.

Ruby.

  • Alpine moves from Fiddle to Magnus automatically.
  • The glibc platform gems are renamed x86_64-linux-gnu / aarch64-linux-gnu. RubyGems and Bundler resolve them by themselves; only an explicit --platform x86_64-linux or a pinned gem file name needs updating.
  • Intel Macs stay on Fiddle via the universal gem.

Python and Ruby.

  • The opt-in wasmtime backend is gone, along with the [wasm] extra and the Gemfile group.
  • HYPERUUID_WASM is now ignored. The native backend always loads.

Rust, C#, Java and PHP are drop-in. Rust now declares rust-version = "1.85".

Fixes

  • Python on Pyodide: about a quarter of no-argument new_v6()/new_v7() calls would have stamped the previous millisecond, because of how Emscripten reports the clock. Fixed before the wheel shipped.
  • C#: a Blazor WebAssembly app no longer gets the 3 MB libhyperuuid.a in bin/ and the publish output.
  • Rust: the no-panic proof from a consumer's crate is documented: it needs lto = true in your release profile.

Proven, not shipped

  • PHP and Ruby in the browser both work.
    • PHP: the ext-php-rs extension runs as a WordPress Playground side module, and php/README.md has the full recipe.
    • Ruby: ruby.wasm with Magnus works too, but waits on two Magnus fixes.
    • Both are documented with what it would take to ship them.
  • Upstream issues filed on the way:

Verifying

Every native library and static archive in this release is built by CI and carries a build-provenance attestation:

gh attestation verify go/staticlib/linux_amd64/libhyperuuid.a \
  --repo SkunkWerkx/HyperUuid --signer-repo SkunkWerkx/.github

The Python wheels, the Pyodide wheel included, verify the same way, or with --owner SkunkWerkx.