Skip to content

Transitive data dependencies trigger rebuilds #3609

@max-heller

Description

@max-heller

It appears that changes to data dependencies causes rebuilds of targets that depend on targets with the direct data dependencies. For example, a library bar with data = ["foo"] does not rebuild when foo changes, but a binary depending on bar does.

Reproduction steps using the attached repo:

  1. bazel build //... to hydrate cache

  2. bazel build //... --subcommands (should see no subcommands)

  3. Edit data_dep.txt

  4. bazel build //... --subcommands

    SUBCOMMAND: # //:bin_depending_on_lib_with_data_dep [action 'Compiling Rust bin bin_depending_on_lib_with_data_dep (1 files)', configuration: 7f8856bb0405540c89cb61a09c1d0562ac1a95a54b0f8a7e6cabe690edf58098, execution platform: @@platforms//host:host, mnemonic: Rustc]
    

data-rebuild-repro.zip (credit to @ograff)

Possibly related:

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