Skip to content

A build with no edit after an edit of a one-file module compiles a transitive importer (clang) #1015

Done

Description

@speak-agent

A build with no edit after an edit of a one-file module compiles a unit the previous build did not: the transitive importer.

Measured with mcpp 2026.11.22.1 and clang 23.1.3 (.agents/docs/2026-11-26-clang-bmi-cutoff-and-private-fragment-refinement-design.md §2.5); not measured again on 2026.11.26.1.

Project: c is one file (bodies in the interface), imported by b, imported by main.

Build c b main
after an edit of a function body of c (same length) compiled compiled not compiled
the next build, no edit not compiled not compiled compiled
the next two builds, no edit not compiled not compiled not compiled

b's BMI is byte-identical after c's BMI changes, so keep-bmi stops the cascade at the direct importer in the first build. main is then compiled in the next build. A build with no edit is expected to compile nothing.

The cause is not established. A guess: main's object depends on c's BMI, which is replaced during the first build, and main was judged up to date when that build was planned.

To check: mcpp build --verbose after each step above, listing the compiled units; the build record (MCPP_BUILD_RECORD) counts them.

Activity

  1. speak-agent commented on Nov 27, 2026

    @speak-agent
    MemberAuthor

    Fixed in mcpp 2026.11.27.1 (#1023). Under clang the depfile names a BMI by the absolute -fprebuilt-module-path, while the graph names it by its relative path, so ninja held two nodes for one file. The edge that writes a BMI now declares the absolute spelling as an implicit output. After an edit of c, the next build compiles c, b and main, and a build with no edit compiles nothing (e2e 1176, SPEC-018 §1 item 6).

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