Skip to content

Nupkg layout

What a worker nupkg contains in each packaging mode, which MIME type loads it, how it is versioned, and its .supported-rids sidecar. When to pick which mode: Packaging modes.

What the nupkg contains

Mode 1 (managed):

<PackageId>.nupkg/
├── <PackageId>.nuspec                # id, version, virtufinAbiVersion, etc.
└── lib/
    └── net11.0/
        └── HttpGetWorker.dll        # the worker only; dependencies are in the nuspec

Mode 2 (native):

<PackageId>.nupkg/
├── <PackageId>.nuspec
├── .supported-rids                  # one RID per line
└── runtimes/
    ├── linux-x64/
    │   └── native/
    │       └── libHttpGetWorker.so
    └── linux-arm64/
        └── native/
            └── libHttpGetWorker.so

Mode 3 (both):

<PackageId>.nupkg/
├── <PackageId>.nuspec
├── .supported-rids
├── lib/
│   └── net11.0/...                  # same as mode 1
└── runtimes/
    └── <rid>/native/...             # same as mode 2

The <PackageId> is Virtufin.Worker.HttpGet in all three modes (the project directory carries the variant suffix but the NuGet id does not — the id is the wire contract). The <virtufinLibrary> is HttpGetWorker in all three modes (matches the assembly basename; the AOT .so is renamed from HttpGetWorker.so to libHttpGetWorker.so at build time).

The MIME-type contract

The nupkg's engine is selected by the mime_type field passed to CreateWorker:

  • application/x-dotnet-dll → DotNetDllEngine (managed path)
  • application/x-native-dll → NativeDllEngine (AOT path)

If the nupkg was built in mode 1 and you create a worker from it as application/x-native-dll, the Runtime's NativeDllEngine finds no .so and the worker is load-failed. Built in mode 2 and created as application/x-dotnet-dll, the DotNetDllEngine finds no .dll.

A mode 3 (both) nupkg works with either MIME type. It contains both layouts, and each engine reads its own.

Versioning

Every mode publishes <PackageId>.<LIBRARY_VERSION>.nupkg, with LIBRARY_VERSION from the worker's versions.env used verbatim. The feed rejects a version it already holds, so bump LIBRARY_VERSION (with a CHANGELOG.md entry) in the same commit as the change. virtufin-worker build writes build_version.txt next to the nupkg for virtufin-worker publish. Entries are zipped with a fixed mtime (1980-01-01) and zip -X, so rebuilding unchanged sources gives a byte-identical nupkg.

The sidecar format

A plain text file at the nupkg root, one RID per line, in build order:

linux-arm64
linux-x64

The order matters: it's the same order the build script processed the RIDs. Consumers may rely on the first entry as a "default" RID.