Skip to content

proposal: make project locking host-independent and clarify install/lock/sync resolution #592

Done

Description

@eitsupi

Problem

dbc lock (#575) currently requires a package for the host platform.
Consequently, a Linux CI runner cannot lock a macOS-only driver, even though dbc lock installs nothing and lockfile v2 records artifacts for multiple platforms.

PR #584 makes registry and version selection host-independent, but the lockfile creation path still requires a host-compatible artifact.

Proposed behavior

Command Version selection Host platform
dbc install Latest host-compatible version within the constraint Used for version selection
dbc lock Host-independent project resolution Not required
dbc sync Same project resolution as lock, or reuse the existing lock Used only for installation

Registry selection should remain independent of the host platform. Missing platform support must not trigger fallback to another registry.

Example: dropping Intel macOS support

Suppose a driver publishes:

Version Linux amd64 macOS arm64 macOS amd64
3.0.0 Yes Yes No
2.5.0 Yes Yes Yes

With a constraint of >=2.0.0:

Direct installation

dbc install 'driver=>=2.0.0'
  • On Linux or Apple Silicon macOS: install 3.0.0.
  • On Intel macOS: install 2.5.0, the newest compatible version.

Project locking without declared target platforms

[drivers.driver]
version = ">=2.0.0"
  • dbc lock selects 3.0.0 on every host, including Intel macOS.
  • dbc sync without an existing lock selects the same version.
  • dbc sync on Intel macOS fails to install 3.0.0 because no compatible artifact exists. It must not silently downgrade to 2.5.0.
  • dbc lock must still succeed on Intel macOS, provided the required artifact hashes can be recorded.

This preserves the same source and version in the lockfile regardless of which machine generates it.

Explicit project platforms

A future dbc.toml option could declare the platforms that a project must support:

# Proposed syntax, not currently supported
platforms = ["linux_amd64", "macos_arm64", "macos_amd64"]

[drivers.driver]
version = ">=2.0.0"

With these targets, both dbc lock and new-lock dbc sync would select 2.5.0 on every host, because 3.0.0 does not support all declared platforms.

Without platforms, version selection would remain host-independent and would not require compatibility with any particular platform.

Lockfile v2 stores one source and version per driver, so this proposal does not require supporting different locked versions for different platforms.

Existing precedents

  • uv: uv lock and uv sync share universal project resolution. required-environments can require compatible distributions for specified environments.
  • pixi: resolves declared project platforms into a shared lockfile, separately from installing the local environment.
  • mise: records platform-specific artifact URLs and checksums, and supports mise lock --platform.

The common principle is to separate project resolution from installation on the current host.

Acceptance criteria

  • dbc lock can lock a driver without a host-compatible artifact when the necessary hashes are available.
  • dbc lock and new-lock dbc sync select the same source and version given identical inputs.
  • dbc sync does not change the locked version or registry to accommodate the host platform.
  • Direct dbc install selects the latest host-compatible version within the selected registry and requested constraint. This may be implemented separately.
  • Explicit target-platform declarations can be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions