Repository navigation
Description
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 lockselects 3.0.0 on every host, including Intel macOS.dbc syncwithout an existing lock selects the same version.dbc syncon Intel macOS fails to install 3.0.0 because no compatible artifact exists. It must not silently downgrade to 2.5.0.dbc lockmust 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 lockanduv syncshare universal project resolution.required-environmentscan 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 lockcan lock a driver without a host-compatible artifact when the necessary hashes are available.dbc lockand new-lockdbc syncselect the same source and version given identical inputs.dbc syncdoes not change the locked version or registry to accommodate the host platform.- Direct
dbc installselects the latest host-compatible version within the selected registry and requested constraint. This may be implemented separately. - Explicit target-platform declarations can be added.
Activity
feat: lock a version without a build for the current platform (#607)
feat: declare target platforms in dbc.toml (#608)