Skip to content

C++ dependency pruning is broken for remote execution on Windows #11765

@buchgr

Description

@buchgr

When using remote execution in Windows Bazel will fail with an error of the type

undeclared inclusion(s) in rule  "@foo//:bar" this rule is missing dependency declarations for the following files included by "external/foo/bar.cc".
  'C:/bot/w/external/foo/bar.h'
  ...

This is because the dependency pruning code [1] scanning the /showParams output makes the incorrect assumption that source and generated files have a parent folder named 'execroot'. The assumption only holds for local execution without sandboxing. However, in remote execution we can't make any assumptions about the absolute location of files. Bazel doesn't know under which directory path an action is executed on a remote system.

[1] https://osscs.corp.google.com/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/cpp/ShowIncludesFilter.java;l=151;drc=0b081d8593d9eeb4e31aceed0b066ce4482ece49

Related #6931

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)area-WindowsWindows-specific issues and feature requestsstaleIssues or PRs that are stale (no activity for 30 days)team-Rules-CPPIssues for C++ rulestype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions