Skip to content

A root's override = true of a version group's member is announced as taken, then refused after the walk #1045

Done

Description

@speak-agent

What

Under a platform whose version group names a member (openkal-platform 0.31.2: openkal = "0.26.0", openkal-linux = "0.27.0"), a root that chooses another version of the member with override = true is told the override is taken, and the build is then refused:

warning: openkal 0.26.2 overrides the version openkal-platform 0.31.2 names, 0.26.0: the platform gives the default, and this project chose another
warning: openkal-linux 0.27.4 overrides the version openkal-platform 0.31.2 names, 0.27.0: the platform gives the default, and this project chose another
error: openkal is requested as '^0.26.2' by mcpplibs.openkal-linux@0.27.4, and the platform openkal-platform 0.31.2 is a version group

Written in [workspace.dependencies] instead, the dependency's request is overridden, and the check after the walk refuses the version the override chose:

error: openkal 0.26.2 is in this build, and the platform openkal-platform 0.31.2 is a version group that names openkal 0.26.0.
       requested by: mcpplibs.openkal-run@path

The same two overrides as git sources at the tags ({ git = "...", tag = "0.26.2", override = true }) build: a development tree is not bound by the group.

Measured

mcpp 2026.11.22.1 and 2026.12.4.1 (2026-12-06), mcpplibs/openkal-image at 0.7.4: tools/ built --target i686-linux-musl with [target.i686-linux-musl] platform = "openkal-platform@0.31.2", the overrides in tools/mcpp.toml (a member of the workspace) and then in the root's [workspace.dependencies].

Where

  • src/build/prepare/overrides.cpp, step4b_root_overrides_group: a root's override = true passes the group's pin and prints the warning.
  • src/build/prepare/platform.cpp, step4b_check_platform_versions: the check after the walk exempts only a package whose source is not version (a path or a repository); a version a root override chose is refused there.
  • step4b_read_root_overrides reads the root's tables and [workspace.dependencies]; a selected member's own override = true answers its own request (the warning) but not a dependency's request for the same package, so the first refusal names openkal-linux's request.

Expected

One answer for one declaration. Either a root's override = true of a member's version is the project's choice, as the warning says, and the check after the walk accepts the version it chose (with the warning kept); or the group refuses it at the declaration, naming the group and the remedy (a platform release whose group holds the version, or a development tree). The same for a member's own override in a workspace: it governs the requests of the build it is declared for, or it says it does not.

Meanwhile

openkal-image's CI builds that runner with the tagged trees as [workspace.dependencies] overrides (mcpplibs/openkal-image#49), until openkal-platform 0.32.2, whose group holds the versions.

Activity

  1. speak-agent commented on Dec 6, 2026

    @speak-agent
    MemberAuthor

    Fixed in mcpp 2026.12.6.2 (#1046), by the first of the two answers: a root's override = true of a member of the platform's version group is the project's choice, as the warning says.

    • Every request takes it. A dependency's request for the package (openkal asked as ^0.26.2 by openkal-linux) is answered by the override instead of being pinned to the group, and the check after the walk accepts the version the override chose. The warning naming the group's version is said once, from whichever request reaches the group first, and not at all when the override chooses the group's own version (SPEC-013 §7.5, v1.18).
    • A selected member is the root of its build. The overriding declarations are the root's tables, [workspace.dependencies], and the tables of each member the build selects (-p tools, --workspace), as [workspace.xlings.overrides] is already read. The overrides in tools/mcpp.toml therefore answer openkal-linux's request too, not only tools' own (SPEC-004 §12 item 3, v1.33).
    • Two different answers are refused. Two declarations that override one package with different versions or sources (two members built together, or a member and [workspace.dependencies]) are refused naming both, with the remedy: write them alike, or once in [workspace.dependencies]. Before, the first one read decided, by the order of the walk.

    e2e 1188 holds the three: a root override with a dependency that asks ^1.0.0 of a group member builds and runs with one warning; a member's override under -p builds; two members with differing overrides under --workspace are refused naming both. docs/05 (en, zh) states it.

    For mcpplibs/openkal-image#49: the shape of this report (a version override of a group member, in a selected member or in [workspace.dependencies], with a dependency asking for the member) is the shape e2e 1188 holds; the runner of openkal-image itself was not rebuilt with version overrides here, and its tagged trees remain valid.

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