Skip to content

A host tool's sub-build resolves its own toolchain, not the one its key records, so a workspace pinned to one LLVM installs a second #710

Description

@speak-agent

Observed

GalTranslPP's workspace root states [toolchain] windows = "llvm@22.1.8", and every member builds with it. Two members take executables through tool edges (tools = ["Updater"], tools = ["runtime_stage"]). On a fresh runner, the sub-build of each tool reports:

    Building host tool updater:Updater from updater v3.1.1 (once per package source and host toolchain)
   First run no toolchain configured — installing llvm@20.1.7 as default
    Resolved llvm@20.1.7 → @mcpp/registry/data/xpkgs/xim-x-llvm/20.1.7/bin/clang++.exe

(mcpp emit build-database, mcpp 2026.9.26.2, Sunrisepeak/GalTranslPP run 36260450278.)

Consequences:

  1. A project pinned to one LLVM installs a second one, and compiles a second std module, before its first build. This is part of the 4.8 minutes that a first emit takes.
  2. The tool-store key does not describe the binary it stores. The key records the consumer's host toolchain (key.compilerIdentity from hostTc, src/build/prepare.cppm near line 10324). The sub-build does not receive a toolchain (sub.tool_chain holds the chain of tool names) and resolves its own.

Request

The sub-build of a host tool compiles with the host toolchain that its key records, which is the one the consumer resolved for build.mcpp. If that is not wanted, the key should record the toolchain that the sub-build actually used.

Activity

  1. added 2 commits that reference this issue on Sep 27, 2026
  2. speak-agent commented on Sep 27, 2026

    @speak-agent
    MemberAuthor

    Fixed in mcpp 2026.9.27.1 (#719, merged as b439fd9), released on GitHub and mirrored to GitCode (xlings-res/mcpp), and published in the xim index (openxlings/xim-pkgindex#894).

    Verified after the release with the published binary inside an xlings subos sandbox (xlings subos use eco-0927 --sandbox --cmd ...), mcpp configured for the CN mirror in a fresh MCPP_HOME:

    • e2e 804_a_path_host_tool_builds_with_its_chosen_toolchain (new): a path host-tool package with no toolchain of its own is built by the consumer's build-program compiler (llvm 22.1.8 while the global default is gcc), and one that names gcc 16.1.0 is built by it. PASS; the first criterion fails on 2026.9.26.2. The member case keeps its unit test.
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