5.1 KiB
5.1 KiB
Changelog
All notable changes to cargoxx will be documented in this file.
[Unreleased]
Added
- M0 repo skeleton: hand-written
CMakeLists.txt, bootstrapflake.nix, empty C++23 module units for every component listed inTECH_SPEC.md§1 (util,exec,manifest,lockfile,layout,linkdb,resolver,codegen,cli), root modulecargoxx, and a stubmain.cppthat builds an emptycargoxxbinary. .clang-format(LLVM, 100-column) and.gitignore.SPEC.md,TECH_SPEC.md.- M1 foundation in
cargoxx.util:ErrorCode(numbers perTECH_SPEC.md§4),Error,Result<T> = std::expected<T, Error>, andformat(Error)renderingerror[Ennnn]: ...with optional--> path:line:colandhint:lines.formatlives insrc/util/error.cppas a module implementation unit. Catch2 v3wired throughflake.nix(libc++-built override) and registered in CMake;tests/util_error.cppcovers six format cases viacatch_discover_tests.cargoxx.manifestpublic types (Package,Dependency,BuildSettings,Edition,Manifest) andparse(path)returningResult<Manifest>, backed by toml++ vendored asthird_party/toml.hpp. Unknown keys in[package]/[build]and unknown top-level keys are rejected; reserved fields (description,repository,[dev-dependencies],[features],[workspace]) are accepted.tests/manifest_parse.cppcovers 17 cases.manifest::write(m, path)serializes aManifestas TOML using toml++. Dependencies are emitted alphabetically (matches Cargo). Round-trip property is exercised bytests/manifest_write.cpp(9 cases). Defaultedoperator==on the manifest structs supports comparison.cargoxx.layoutpublic types (Target,TargetKind,DiscoveredLayout) anddiscover(project_root, package_name). Walkssrc/recursively for the library (excluding thesrc/bin/subtree), enumeratessrc/main.cpp,src/bin/*.cpp,tests/*.cpp,examples/*.cppflat, sorts results for deterministic output, and returnsLayoutNoTargetwhen neither a library nor any binary is present.tests/layout_discovery.cppcovers 12 cases.cargoxx new <name>andcargoxx new --lib <name>scaffold a project directory withCargoxx.toml,src/main.cpporsrc/lib.cppm, and a minimal.gitignore. Hyphens in the package name are mapped to underscores when generating the module/namespace identifier. Codegen offlake.nix/CMakeLists.txtis intentionally deferred to M3. CLI11 v2.6.2 vendored atthird_party/CLI11.hpp; entry point is nowcargoxx::cli::run(argc, argv).tests/cmd_new.cppcovers 9 cases.util::satisfies(version, range)— minimal semver range matcher supporting*,==/>=/<=/>/<operators, and comma-separated AND clauses. Versions are zero-padded to three components.tests/semver_satisfies.cppcovers 7 cases.cargoxx.linkdb:Recipe,Database::open(),Database::resolve(...)for curated lookups. The curated database ships atdata/linkdb.jsonwith all 25 packages fromSPEC.md§11. Component-substitution helpers expand{{components}}(space-joined) infind_packageand fan out{{component}}per-target. Path is injected via theCARGOXX_LINKDB_DEFAULT_PATHcompile definition. nlohmann/json 3.12.0 vendored atthird_party/json.hpp. SQLite overlay andadd_manualare deferred to the M2 follow-up commit.tests/linkdb_lookup.cppcovers 13 cases including a smoke test that resolves all 25 curated packages.cargoxx.lockfile:Lockfile,LockfilePackagetypes andparse(path)/write(lock, path)matching the format inSPEC.md§5. AlsoLockfile::nixpkgs_rev()returns the shared revision (codegen will consume this in M3).tests/lockfile_round_trip.cppcovers 9 cases.cargoxx.codegen:GenerateInputsplus the pure functionflake_nix(in) -> std::string. Substitutes the package name, the resolved nixpkgs revision (defaulting tonixos-unstablewhen the lockfile pins none), and a deduplicated list of depnixpkgs_attrentries intobuildInputs. Output is byte-deterministic.tests/codegen_flake.cppcovers 7 cases. Note: SPEC §7's template did not showbuildInputs; we add one betweennativeBuildInputsand theenv.NIX_CFLAGS_COMPILEblock as the natural slot for the deps that TECH_SPEC §10 says we splice in.- SQLite overlay:
Database::open(overlay_path)now opens (and creates, if missing) a per-userlinkdb.sqlitecache, applying the schema fromSPEC.md§9 idempotently. Default path is$XDG_CACHE_HOME/cargoxx/linkdb.sqlite(falling back to$HOME/.cache/cargoxx/...); tests pass an explicit temp path so they never touch the user cache.Database::add_manual(pkg, range, recipe)inserts a row withsource = 'manual'andverified_at = now();resolve()consults the overlay first and falls back to curated when no overlay row matches the requested version range. Manual entries never expire;nix-probe(v0.2) entries respect a 30-day freshness window.tests/linkdb_overlay.cppcovers 7 cases (insert/persist, override-curated, version-range gating, components rejection, move semantics).