Skip to content

Commit

Permalink
Honor --nobuild_runfile_links for non-tests, and propagate it to the
Browse files Browse the repository at this point in the history
host configuration.

I think the comment I'm deleting is misleading.  PAR file construction
already has special handling of the input manifest, and host tools do
get their runfiles when executed remotely.  They don't get them for
local execution, but users who care about that don't need to pass the
non-default --nobuild_runfile_links option.

RELNOTES: None.
PiperOrigin-RevId: 165535870
  • Loading branch information
Googler authored and iirina committed Aug 17, 2017
1 parent 5e65c98 commit ab38960
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1521,25 +1521,7 @@ public boolean isTestTarget() {
* false if it should just create the manifest.
*/
public boolean shouldCreateRunfilesSymlinks() {
// TODO(bazel-team): Ideally we wouldn't need such logic, and we'd
// always use the BuildConfiguration#buildRunfiles() to determine
// whether to build the runfiles. The problem is that certain build
// steps actually consume their runfiles. These include:
// a. par files consumes the runfiles directory
// We should modify autopar to take a list of files instead.
// of the runfiles directory.
// b. host tools could potentially use data files, but currently don't
// (they're run from the execution root, not a runfiles tree).
// Currently hostConfiguration.buildRunfiles() returns true.
if (isTestTarget()) {
// Tests are only executed during testing (duh),
// and their runfiles are generated lazily on local
// execution (see LocalTestStrategy). Therefore, it
// is safe not to build their runfiles.
return getConfiguration().buildRunfiles();
} else {
return true;
}
return getConfiguration().buildRunfiles();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,10 +1062,7 @@ public FragmentOptions getHost(boolean fallback) {
}

// === Runfiles ===
// Ideally we could force this the other way, and skip runfiles construction
// for host tools which are never run locally, but that's probably a very
// small optimization.
host.buildRunfiles = true;
host.buildRunfiles = buildRunfiles;

// === Linkstamping ===
// Disable all link stamping for the host configuration, to improve action
Expand Down

0 comments on commit ab38960

Please sign in to comment.