Skip to content

Runfiles tree is not recreated when value of --enable_runfiles changes #9150

@brandjon

Description

@brandjon

Or more precisely, the old tree persists even when the target is built with --enable_runfiles=false. This causes observable semantic differences when the artifact is sensitive to how the runfiles tree is laid out (or whether it exists at all).

Minimal repro:

# pkg/BUILD
cc_binary(
    name = "blah",
    srcs = ["blah.cc"],
)
// pkg/blah.cc
#include <stdio.h>

int main(int argc, char** argv) {
    printf("Hello, world!\n");
    return 0;
}
$ bazel clean
...
$ bazel run //pkg:blah
...
$ ls bazel-bin/pkg/blah.runfiles
__main__  MANIFEST

$ bazel run //pkg:blah --enable_runfiles=false
...
$ ls bazel-bin/pkg/blah.runfiles
__main__  MANIFEST

$ bazel clean
...
$ bazel run //pkg:blah --enable_runfiles=false
...
$ ls bazel-bin/pkg/blah.runfiles
MANIFEST

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)not staleIssues or PRs that are inactive but not considered staleteam-Rules-ServerIssues for serverside rules included with Bazeltype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions