Skip to content

A path package's host-tool key covers the consumer nested in its tree, so the tool is rebuilt after the consumer's own build #705

Description

@speak-agent

Observation

The host-tool store keys a path package by tool_store::tree_stamp: the relative path, size and modification time of every regular file under the package root, excluding target/, .git, .mcpp and compile_commands.json (modules/buildmcpp/src/tool_store.cppm). When the consumer lies inside that tree, the stamp covers the consumer's own files. The layout is common: a plugin package's test fixtures, or a monorepo whose tool package sits at the root with the applications below it. Each file the consumer's build writes outside its target/ changes the key, and the next planned build rebuilds the tool.

Measured on 2026.9.26.2 with mcpp-plugins 0.13.0's tests/vcpkg-consumer, which depends on plugins = { path = "../.." } and uses the host tool mcpp-deps:

  1. mcpp build builds plugins:mcpp-deps, and the prepare action installs into tests/vcpkg-consumer/vcpkg_installed/.
  2. mcpp build again: on Windows and macOS the build is planned, the tree stamp now includes vcpkg_installed/, and the tool is rebuilt. The rebuilt binary is an input of the prepare action, so the installation runs again. On Linux the fast path skips planning. After touch build.mcpp it does the same.

Consequence

A build with nothing changed rebuilds the host tool and re-runs every action that names the tool as an input. On a vcpkg installation the cost is minutes.

Proposed behaviour

The stamp covers the package's sources, not the consumer's. Either rule removes the effect:

  1. Skip a directory below the root that holds its own mcpp.toml. Such a directory is another package, as it already is for source globbing.
  2. Stamp only what the package's manifest declares: the sources of the selected features and targets, the manifest, and build.mcpp.

mcpp-plugins 0.13.0 places the fixtures' installations under target/ in the meantime.

Activity

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