Skip to content

Create a missing vex.lock when fetching a dependency-free project #147

Closed

Description

@LunaStev

Problem

A valid project with no dependencies and no vex.lock can lose the distinction between "no file" and "an existing empty lockfile" during resolution. The resolver substitutes Lockfile::empty for a missing file, then only publishes a lockfile when the resolved graph differs. An empty graph can compare equal, leaving the file absent even though the diagnostic for a later --locked command tells the user to run vex fetch.

This is a source-derived failure scenario at master 0f29f5e53df27f7fb60eeb084897d89763a01a0f; an executed regression fixture is still required. See resolver/src/lib.rs.

Regression scenario

  1. Create a valid dependency-free vex.ws with no vex.lock.
  2. Run vex fetch.
  3. Check that a current-format empty vex.lock exists.
  4. Run vex fetch --locked --offline and require success with unchanged bytes.

Acceptance criteria

  • Distinguish missing-file state from an existing semantically empty lockfile.
  • Ordinary fetch writes the current-format empty lockfile even when there are zero packages.
  • Offline fetch can create it without invoking Git or accessing the network.
  • A subsequent --locked --offline command succeeds and preserves the resulting file exactly.
  • --locked with a missing file still fails without creating it; dry-run must not create or rewrite vex.lock.
  • Preserve existing compatible v2/v3 files under --locked and retain the explicit migration policy for ordinary commands.
  • Use existing coordination and atomic publication guarantees; publication failure must not leave a partial lockfile.
  • Cover both missing and pre-existing empty files with local integration tests on Linux, macOS and Windows.

Related: #79 covers format compatibility. This issue specifically owns initial creation of a missing empty lockfile, rather than a new format or migration policy.

Activity

  1. added
    bug
    needs testing
    dependencies
    on Sep 25, 2026
  2. self-assigned this
    on Oct 1, 2026
  3. LunaStev commented on Oct 2, 2026

    @LunaStev
    MemberAuthor

    Verified completed against master 67797f6415f640e8c33f9a072879124b83934f84.

    Missing lockfile state is distinguished from an existing empty graph. Ordinary/offline dependency-free fetch creates the current-format empty lockfile; missing --locked fails without writing, and subsequent locked/offline reuse preserves bytes. Existing compatible empty files remain covered.

    Evidence: resolver/src/lib.rs, tests/git_lock_reproducibility.rs, tests/lockfile_compatibility.rs.

    Master CI run 36963423149 passed all eight jobs, including native Windows, macOS, and Linux tests. Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdependenciesneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions