Skip to content

Match platform aliases when looking up packages for a platform #612

Done

Description

@eitsupi

Follow-up to the review discussion in #607: #607 (comment)

Problem

dbc matches registry packages to a platform in two different ways:

  • Driver.GetPackage and hostBuildMissing compare the raw platform tuple of the index.
  • lockArtifacts and publishedArtifacts group packages by canonical target (resolution.CanonicalTarget: darwin → macos, x86_64 → amd64, aarch64 → arm64, bare linux → linux_*_gnu).

For an index that lists only darwin_arm64, on a macos_arm64 host:

  • dbc lock finds no build for the host, but still records the darwin_arm64 package under the host's canonical target when the registry publishes its hash, and dbc sync installs it from the lock file.
  • If a version 1 lock file records a driver library checksum for the driver, dbc lock refuses to check it because it finds no host build (pinned by TestPlanV1ProofWithAliasHostBuild).

hostBuildMissing matches raw tuples on purpose. If only this check matched aliases, dbc lock would pass the host tuple macos_arm64 to GetPackage, which would fail because the index lists only darwin_arm64.

Proposal

Match aliases in both lookups together:

  • Select the package by canonical target, then look it up by the tuple the index lists, as platformPackage in feat: declare target platforms in dbc.toml #608 does for declared platforms.
  • Report several packages for one target (aliases or duplicates) as ambiguous, instead of picking one by registry order.
  • Update TestPlanV1ProofWithAliasHostBuild to expect the alias to be found.

Activity

  1. added a commit that references this issue on Dec 2, 2026
    b922529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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