feat(install): generate NuGet packages
VoidBuildSystem CI / signing-openssl-gcc16 (push) Successful in 1m36s
VoidBuildSystem CI / fuzz-clang (push) Failing after 1m43s
VoidBuildSystem CI / sanitizers-gcc16 (push) Successful in 3m9s
VoidBuildSystem CI / build-and-test-gcc16 (push) Canceled after 7m56s

This commit is contained in:
faumaray committed 2026-12-05 14:31:31 +03:00
1 parent 97709d37a5
commit b7c224cf67
7 files changed
+172 -5

No files matched your search

+2
View File
@@ -379,6 +379,8 @@ Stage: VERIFIED — Plans 01–19 + Plan 20 Slices 1–2C + Track A + Track B (B
- **Wave 143 (First Release v0.1.0)**: the Release build (Ninja, GCC 16.2) passed the full suite (8/8, 271.91 s) and the release packaging produced `dist/vbs-v0.1.0-linux-x86_64.tar.gz` (binaries + SDK + headers), `dist/vbs-v0.1.0-source.tar` (`vbs pack`) and `SHA256SUMS`. Tag `v0.1.0` and the [first Gitea release](https://git.faumaray.com/Void/Build-System/releases/tag/v0.1.0) were created; the workflows now target the available Gitea runners (`linux` host). Binary assets cannot be uploaded through the available tooling - the release workflow attaches them when it runs. - **Wave 143 (First Release v0.1.0)**: the Release build (Ninja, GCC 16.2) passed the full suite (8/8, 271.91 s) and the release packaging produced `dist/vbs-v0.1.0-linux-x86_64.tar.gz` (binaries + SDK + headers), `dist/vbs-v0.1.0-source.tar` (`vbs pack`) and `SHA256SUMS`. Tag `v0.1.0` and the [first Gitea release](https://git.faumaray.com/Void/Build-System/releases/tag/v0.1.0) were created; the workflows now target the available Gitea runners (`linux` host). Binary assets cannot be uploaded through the available tooling - the release workflow attaches them when it runs.
- **Wave 144 (NuGet Package Generator)**: `vbs install --archive FILE --archive-format nuget` writes a `.nupkg` - an OPC ZIP with the `<id>.nuspec` manifest, `[Content_Types].xml`, `_rels/.rels` and the installed files mapped to `runtimes/<rid>/native/**` (headers under `build/native/include`). The RID comes from the profile (e.g. `linux-x64`). Python `zipfile` + ElementTree validate the generated package (id/version/authors parse, CRCs clean); the install test asserts the manifest, layout and native asset paths.
## Remaining future scope ## Remaining future scope
- **Superiority plan ([22-superiority-and-gaps.md](../roadmap/22-superiority-and-gaps.md), 2026-12-05)**: revised platform strategy - **macOS deferred**, **Windows via MinGW-w64 cross-compilation + Wine execution** (`dev cpp-gcc -p pkgsCross.mingwW64.stdenv.cc`, `dev cpp-gcc -p wine64`), native MSVC deferred; plus packaging parity (ZIP/DEB/RPM), IDE ecosystem, migration tooling, test-runner parity, benchmarks, CI runners, and remote execution in prioritized order. - **Superiority plan ([22-superiority-and-gaps.md](../roadmap/22-superiority-and-gaps.md), 2026-12-05)**: revised platform strategy - **macOS deferred**, **Windows via MinGW-w64 cross-compilation + Wine execution** (`dev cpp-gcc -p pkgsCross.mingwW64.stdenv.cc`, `dev cpp-gcc -p wine64`), native MSVC deferred; plus packaging parity (ZIP/DEB/RPM), IDE ecosystem, migration tooling, test-runner parity, benchmarks, CI runners, and remote execution in prioritized order.
+1
View File
@@ -143,4 +143,5 @@ Base HEAD: `fe0d1a6`
| Wave 140 (pkg-config discovery) | `.pkgconfig(spec)` dependency, `.pc` parser with variables/Requires/version compare, lock entries | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; E2E builds/runs and checks version errors, full CTest 8/8) | `include/Void/Build.hpp`, `sdk/Build.cpp`, `src/Provider/PkgConfig.cpp`, `src/Graph/Graph.cpp`, `src/Package/Resolver.cpp`, `src/Main.cpp`, `tests/FullV1Tests.cpp`, docs | | Wave 140 (pkg-config discovery) | `.pkgconfig(spec)` dependency, `.pc` parser with variables/Requires/version compare, lock entries | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; E2E builds/runs and checks version errors, full CTest 8/8) | `include/Void/Build.hpp`, `sdk/Build.cpp`, `src/Provider/PkgConfig.cpp`, `src/Graph/Graph.cpp`, `src/Package/Resolver.cpp`, `src/Main.cpp`, `tests/FullV1Tests.cpp`, docs |
| Wave 141 (ASM + shader languages) | `.s`/`.S` assembly; `shader_bundle`/`.shader()` lowered to SPIR-V (glslang/slangc/dxc) | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; both E2Es pass, GLSL/Slang/HLSL produce SPIR-V, full CTest 8/8) | `src/Graph/Graph.cpp`, `src/Toolchain/Driver.cpp`, `include/Void/Build.hpp`, `sdk/Build.cpp`, `tests/FullV1Tests.cpp`, docs | | Wave 141 (ASM + shader languages) | `.s`/`.S` assembly; `shader_bundle`/`.shader()` lowered to SPIR-V (glslang/slangc/dxc) | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; both E2Es pass, GLSL/Slang/HLSL produce SPIR-V, full CTest 8/8) | `src/Graph/Graph.cpp`, `src/Toolchain/Driver.cpp`, `include/Void/Build.hpp`, `sdk/Build.cpp`, `tests/FullV1Tests.cpp`, docs |
| Wave 142 (Gitea CI + release workflow) | Gitea-hosted CI with artifacts; tag-driven release workflow with asset upload | COMPLETE (YAML-validated; unexecuted without a runner) | `.gitea/workflows/ci.yml`, `.gitea/workflows/release.yml`, docs | | Wave 142 (Gitea CI + release workflow) | Gitea-hosted CI with artifacts; tag-driven release workflow with asset upload | COMPLETE (YAML-validated; unexecuted without a runner) | `.gitea/workflows/ci.yml`, `.gitea/workflows/release.yml`, docs |
| Wave 144 (NuGet generator) | `--archive-format nuget`: `.nupkg` with nuspec, OPC parts and `runtimes/<rid>/native` assets | COMPLETE & VERIFIED (GCC 16.2, pin `0002e74`; Python validates the package, install test passes, full CTest 8/8) | `src/Install/Installer.cpp`, `src/Main.cpp`, `tests/FullV1Tests.cpp`, docs |
| Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions) |"}] Live `conan` CLI verification; macOS/Windows/cross-compile; binary-variant signing and key distribution; daemon-side dependency materialization and editor plugins; `Void::Net`/`Void::Sqlite` alignment | PLANNED (unimplemented) | [21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md), [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md) | | Future (Plan 20 Slice 3 / Tracks C, E3 editor extensions) |"}] Live `conan` CLI verification; macOS/Windows/cross-compile; binary-variant signing and key distribution; daemon-side dependency materialization and editor plugins; `Void::Net`/`Void::Sqlite` alignment | PLANNED (unimplemented) | [21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md), [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md) |
+10
View File
@@ -1850,6 +1850,16 @@ VOID_INCLUDE_DIR=/tmp/opencode/vl-pin/include dev cpp -c bash fuzz/run.sh 30
manually to valid SPIR-V in this environment. manually to valid SPIR-V in this environment.
- Full CTest: **8 / 8 passed** in 314.56 s. - Full CTest: **8 / 8 passed** in 314.56 s.
## NuGet Package Generation (GCC 16.2, pin `0002e74`)
- `vbs install --archive cli_hi.nupkg --archive-format nuget` produced a 7-entry ZIP whose
nuspec, `[Content_Types].xml` and `_rels/.rels` all parse with ElementTree, every CRC is
clean (`zipfile.testzip()` is None), and native assets live under
`runtimes/linux-x64/native/`.
- `FullV1Tests.foreign_cmake_meson_providers_bridge_and_relocatable_install` asserts the ZIP
magic, the nuspec id/version, the OPC parts and the runtime asset paths (**passed**, 6.36 s).
- Full CTest: **8 / 8 passed** in 337.44 s.
## Limits and Unrun Checks ## Limits and Unrun Checks
1. **HTTPS git fetch**: the host shell is proxy-restricted, but the Docker container could clone `https://git.faumaray.com/Void/VoidLibrary.git`; the pinned commit `3e254055e081a104f08df68dde39711bc7813518` was fetched directly for the verification above. A separate configure against the local `/home/faumaray/Projects/Library` checkout via `VBS_VOID_SOURCE_DIR` also succeeded (development-only override, checkout unmodified). 1. **HTTPS git fetch**: the host shell is proxy-restricted, but the Docker container could clone `https://git.faumaray.com/Void/VoidLibrary.git`; the pinned commit `3e254055e081a104f08df68dde39711bc7813518` was fetched directly for the verification above. A separate configure against the local `/home/faumaray/Projects/Library` checkout via `VBS_VOID_SOURCE_DIR` also succeeded (development-only override, checkout unmodified).
+2 -2
View File
@@ -122,8 +122,8 @@ first, then what makes VBS *better* rather than merely equal.
3. **Platform breadth - deferred.** Native MSVC and Apple Clang/macOS stay deferred by 3. **Platform breadth - deferred.** Native MSVC and Apple Clang/macOS stay deferred by
decision; MinGW cross + Wine is the current Windows story. decision; MinGW cross + Wine is the current Windows story.
4. **Package-generator parity.** CPack also ships NuGet, PKG/productbuild, APK and IFW 4. **Package-generator parity.** CPack also ships NuGet, PKG/productbuild, APK and IFW
installers; VBS has tar, `sh`, ZIP, DEB, RPM, WiX and UDIF. NuGet and PKG are the next installers; VBS has tar, `sh`, ZIP, DEB, RPM, WiX, UDIF and NuGet (Wave 144). PKG is
useful ones. the next useful one.
### 8.2 Developer experience and IDE integration ### 8.2 Developer experience and IDE integration
+131
View File
@@ -635,6 +635,131 @@ write_dmg_archive(const std::filesystem::path &output, const std::filesystem::pa
return {}; return {};
} }
// ── NuGet package (.nupkg) ─────────────────────────────────────────────────────────────────
// A .nupkg is an OPC ZIP (a nuspec manifest plus content parts). Native assets follow the
// `runtimes/<rid>/native` convention; public headers go to `build/native/include`.
std::string nuget_rid(std::string_view os, std::string_view architecture) {
const std::string arch = architecture == "aarch64" || architecture == "arm64" ? "arm64"
: architecture == "x86" || architecture == "i686" ? "x86"
: "x64";
const auto lower_os = Void::Str::to_lower_ascii(os);
if (lower_os == "windows" || lower_os == "win32") {
return "win-" + arch;
}
if (lower_os == "darwin" || lower_os == "macos") {
return "osx-" + arch;
}
return "linux-" + arch;
}
Void::Result::Result<void, Void::Result::Error>
write_nuget_package(const std::filesystem::path &output, const InstallOptions &options,
const Graph::BuildGraph &graph,
const std::vector<Package::ArchiveEntrySpec> &entries) {
const std::string id = options.package_name;
const std::string version =
options.package_version.empty() ? std::string{"1.0.0"} : options.package_version;
const std::string rid = nuget_rid(graph.profile.os, graph.profile.architecture);
const std::string authors =
options.maintainer.empty() ? std::string{"Void"} : options.maintainer;
const std::string description = options.package_description.empty()
? options.package_name
: options.package_description;
// Map the installed tree onto the NuGet layout.
std::vector<std::pair<std::string, std::filesystem::path>> mapped;
std::set<std::string> extensions;
for (const auto &entry : entries) {
const auto rel = entry.archive_path;
std::string dest;
if (rel.starts_with("include/")) {
dest = "build/native/include/" + rel.substr(std::string{"include/"}.size());
} else {
dest = "runtimes/" + rid + "/native/" + rel;
}
mapped.emplace_back(dest, entry.source_file);
const auto dot = dest.rfind('.');
if (dot != std::string::npos && dot > dest.rfind('/')) {
extensions.insert(dest.substr(dot + 1));
}
}
const std::string nuspec =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<package xmlns=\"http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd\">\n"
" <metadata>\n"
" <id>" +
wix_xml_escape(id) + "</id>\n"
" <version>" + wix_xml_escape(version) + "</version>\n"
" <authors>" + wix_xml_escape(authors) + "</authors>\n"
" <description>" + wix_xml_escape(description) + "</description>\n"
" <tags>native;c++;vbs</tags>\n"
" </metadata>\n"
"</package>\n";
std::string content_types =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\n"
" <Default Extension=\"rels\" "
"ContentType=\"application/vnd.openxmlformats-package.relationships+xml\" />\n"
" <Default Extension=\"nuspec\" ContentType=\"application/octet\" />\n";
for (const auto &ext : extensions) {
content_types += " <Default Extension=\"" + wix_xml_escape(ext) +
"\" ContentType=\"application/octet\" />\n";
}
content_types += "</Types>\n";
const std::string rels =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n"
" <Relationship Type=\"http://schemas.microsoft.com/packaging/2010/07/manifest\" "
"Target=\"/" +
wix_xml_escape(id) +
".nuspec\" Id=\"Re0\" />\n"
"</Relationships>\n";
const auto staging = output.parent_path() / (output.filename().string() + ".stage");
std::error_code ec;
std::filesystem::remove_all(staging, ec);
std::filesystem::create_directories(staging, ec);
if (ec) {
return std::unexpected{Void::System::make_system_error(
Void::System::map_errno_to_system_code(ec.value()),
std::format("cannot create NuGet staging directory '{}'", staging.string()),
ec.value())};
}
auto cleanup = Void::Scope::on_exit([&] {
std::error_code cleanup_ec;
std::filesystem::remove_all(staging, cleanup_ec);
});
std::vector<Package::ArchiveEntrySpec> zip_entries;
const auto stage_file = [&](std::string_view name,
std::string_view content) -> std::optional<std::filesystem::path> {
const auto path = staging / std::filesystem::path{name};
std::error_code file_ec;
std::filesystem::create_directories(path.parent_path(), file_ec);
if (auto written = Platform::atomic_write_file(path, content, true); !written) {
return std::nullopt;
}
return path;
};
const auto nuspec_path = stage_file(id + ".nuspec", nuspec);
const auto types_path = stage_file("[Content_Types].xml", content_types);
const auto rels_path = stage_file("_rels/.rels", rels);
if (!nuspec_path || !types_path || !rels_path) {
return std::unexpected{Void::System::make_system_error(
Void::System::SystemErrorCode::io_error, "cannot stage NuGet metadata")};
}
zip_entries.push_back({"[Content_Types].xml", *types_path, 0644u});
zip_entries.push_back({"_rels/.rels", *rels_path, 0644u});
zip_entries.push_back({id + ".nuspec", *nuspec_path, 0644u});
for (const auto &[name, source] : mapped) {
zip_entries.push_back({name, source, 0644u});
}
return Package::create_stored_zip(output, zip_entries);
}
// Debian package: ar container with debian-binary, control.tar and data.tar (uncompressed). // Debian package: ar container with debian-binary, control.tar and data.tar (uncompressed).
Void::Result::Result<void, Void::Result::Error> Void::Result::Result<void, Void::Result::Error>
write_deb_package(const std::filesystem::path &output, const InstallOptions &options, write_deb_package(const std::filesystem::path &output, const InstallOptions &options,
@@ -1090,6 +1215,12 @@ install_project(const Graph::ProjectDescription &description, const Graph::Build
if (auto packed = write_dmg_archive(*options.archive_path, payload); !packed) { if (auto packed = write_dmg_archive(*options.archive_path, payload); !packed) {
return std::unexpected{packed.error()}; return std::unexpected{packed.error()};
} }
} else if (options.archive_format == "nuget") {
if (auto packed =
write_nuget_package(*options.archive_path, options, graph, archive_entries);
!packed) {
return std::unexpected{packed.error()};
}
} else { } else {
const bool archive_as_script = options.archive_format == "sh"; const bool archive_as_script = options.archive_format == "sh";
const auto archive_target = archive_as_script const auto archive_target = archive_as_script
+3 -3
View File
@@ -2547,9 +2547,9 @@ int execute_install_command(const InstallCmdOptions &opts) {
if (opts.archive_format_arg != "tar" && opts.archive_format_arg != "sh" && if (opts.archive_format_arg != "tar" && opts.archive_format_arg != "sh" &&
opts.archive_format_arg != "zip" && opts.archive_format_arg != "deb" && opts.archive_format_arg != "zip" && opts.archive_format_arg != "deb" &&
opts.archive_format_arg != "rpm" && opts.archive_format_arg != "wix" && opts.archive_format_arg != "rpm" && opts.archive_format_arg != "wix" &&
opts.archive_format_arg != "dmg") { opts.archive_format_arg != "dmg" && opts.archive_format_arg != "nuget") {
std::cerr << "vbs install: unsupported --archive-format '" << opts.archive_format_arg std::cerr << "vbs install: unsupported --archive-format '" << opts.archive_format_arg
<< "' (expected tar, sh, zip, deb, rpm, wix or dmg)\n"; << "' (expected tar, sh, zip, deb, rpm, wix, dmg or nuget)\n";
return 2; return 2;
} }
if (opts.archive_arg && !opts.archive_arg->empty()) { if (opts.archive_arg && !opts.archive_arg->empty()) {
@@ -3762,7 +3762,7 @@ int main(int argc, char **argv) {
.option("--archive", "", "Write a deterministic installer archive of the prefix", .option("--archive", "", "Write a deterministic installer archive of the prefix",
install_opts.archive_arg) install_opts.archive_arg)
.option_default("--archive-format", "", .option_default("--archive-format", "",
"Installer archive format: tar (default), sh, zip, deb, rpm, wix or dmg", "Installer archive format: tar (default), sh, zip, deb, rpm, wix, dmg or nuget",
install_opts.archive_format_arg, "tar") install_opts.archive_format_arg, "tar")
.option("--signing-key", "", .option("--signing-key", "",
"Ed25519 seed file; signs the archive and writes .sha256/.sig/.pub", "Ed25519 seed file; signs the archive and writes .sha256/.sig/.pub",
+23
View File
@@ -1137,6 +1137,29 @@ void build(Void::Build::Project &p) {
Void::Testing::expect_eq(read_be64(koly, 492), (data_fork_length + 511) / 512); Void::Testing::expect_eq(read_be64(koly, 492), (data_fork_length + 511) / 512);
Void::Testing::expect(dmg_bytes->substr(257, 5) == "ustar"); // tar payload Void::Testing::expect(dmg_bytes->substr(257, 5) == "ustar"); // tar payload
// NuGet package (.nupkg): OPC ZIP with the nuspec and native runtime assets.
const auto nupkg_archive = tmp / "cli_hi.nupkg";
auto nuget_req = inst_req;
for (auto &arg : nuget_req.arguments) {
if (arg == installer_archive.string()) {
arg = nupkg_archive.string();
}
}
nuget_req.arguments.push_back("--archive-format");
nuget_req.arguments.push_back("nuget");
auto nuget_res = Platform::run_supervised(nuget_req);
Void::Testing::expect(nuget_res.has_value() && nuget_res->succeeded());
auto nupkg_bytes = Void::FileSystem::read_file(nupkg_archive);
Void::Testing::require(nupkg_bytes.has_value());
Void::Testing::expect(nupkg_bytes->starts_with(std::string("PK\x03\x04", 4)));
Void::Testing::expect(nupkg_bytes->find("CliHiPkg.nuspec") != std::string::npos);
Void::Testing::expect(nupkg_bytes->find("<id>CliHiPkg</id>") != std::string::npos);
Void::Testing::expect(nupkg_bytes->find("<version>0.1.0</version>") != std::string::npos);
Void::Testing::expect(nupkg_bytes->find("[Content_Types].xml") != std::string::npos);
Void::Testing::expect(nupkg_bytes->find("_rels/.rels") != std::string::npos);
Void::Testing::expect(nupkg_bytes->find("runtimes/") != std::string::npos);
Void::Testing::expect(nupkg_bytes->find("/native/bin/cli_hi") != std::string::npos);
// RPM package generator: lead + header magic + newc cpio payload. // RPM package generator: lead + header magic + newc cpio payload.
const auto rpm_archive = tmp / "cli_hi.rpm"; const auto rpm_archive = tmp / "cli_hi.rpm";
auto rpm_req = inst_req; auto rpm_req = inst_req;