-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remote strategy doesn't incorporate runfiles as inputs #1593
Comments
Inspecting in a debugger, the runfiles are attached to the action as a "middleman" artifact. This, in turn, is happening because |
Looks like there was an incriminating bazel/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java Line 578 in 740b768
// TODO(bazel-team): Make sure middleman "virtual" artifact data is properly processed. That |
Wait a minute. We're just computing a hash; we don't need to expand the middlemen. We can use their original value. I'll pull together a PR |
//cc @dslomov Can you review this change? |
Fixes bazelbuild#1593 Change-Id: I18b659da5abc79f7c7aa58afd10ebe565e1479e5
Closing because there's a commit that references this bug. Please reopen if this isn't fixed. |
I don't think this is fixed. I can't find the commit that references this bug. Moreover, the latest master still expands the input file artifacts before computing the cumulative input digest and consequently fails to consider the runfiles middleman. |
The commit is linked just above my comment, hash 6734f43. |
That's a fork of Bazel, not the canonical repo.
…On Tue, Jan 17, 2017, at 07:56, Ulf Adams wrote:
The commit is linked just above my comment, hash 6734f43.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#1593 (comment)
|
Doh! |
@ulfjack is this the right category? |
Let me put it under service APIs, which is marginally better. |
I have some changes in flight to prepare for open sourcing the code we're using internally to handle runfiles. |
…ategies This new class is a combination of SpawnHelper and our internal code; the plan is to migrate all spawn strategies to the new class. The strict flag should be enabled by default, but that's a breaking change, so we need to do it later. - Use it in SandboxStrategy. - Add ActionInput.getExecPath to return a PathFragment; this avoids lots of back and forth between path fragments and strings. This is a step towards #1593. -- PiperOrigin-RevId: 150427021 MOS_MIGRATED_REVID=150427021
Add preconditions to enforce this and remove some now unnecessary code. A small step towards #1593. -- PiperOrigin-RevId: 150625693 MOS_MIGRATED_REVID=150625693
Update some callers to use getExecPath, which generally results in less intermediate garbage generation (almost all callers need a PathFragment, not a String). Another small step towards #1593. -- PiperOrigin-RevId: 150631279 MOS_MIGRATED_REVID=150631279
…ategies This new class is a combination of SpawnHelper and our internal code; the plan is to migrate all spawn strategies to the new class. The strict flag should be enabled by default, but that's a breaking change, so we need to do it later. - Use it in SandboxStrategy. - Add ActionInput.getExecPath to return a PathFragment; this avoids lots of back and forth between path fragments and strings. This is a step towards #1593. The previous attempt was missing a one-line patch in StandaloneTestStrategy, which broke all tests with sandboxing. StandaloneTestStrategy was fixed in a separate change, so this should be safe now. -- PiperOrigin-RevId: 150733457 MOS_MIGRATED_REVID=150733457
Fixes bazelbuild#1593 Change-Id: I18b659da5abc79f7c7aa58afd10ebe565e1479e5
Consider this repository https://github.com/dfabulich/remote-cache-key-runfiles
The repository has an empty
WORKSPACE
and a trivialsh_binary
,cp.sh
, designed to copy its runfile (calledrunfile
) to a parameterized destination.cp runfile $1
The
runfile
is just a text file containing the number0
.The
BUILD
file declarescp.sh
as ash_binary
with therunfile
in itsdata
, and declares agenrule
calledx
that runscp.sh
to generate an output file,out.txt
.If you run
bazel build :x && more bazel-genfiles/out.txt
you'll see that it has copied the runfile tobazel-genfiles/out.txt
and the output is0
. If you change the runfile to contain the number1
theout.txt
file will change when you re-run the build as expected.Now set the
runfile
back to0
, launch a Hazelcast server, and run the build like this:You'll correctly see the output is
0
. Now change the runfile contents to1
and run the build again.Expected: When the runfile contents change, the cache should be invalidated and the output should be regenerated as
1
Actual: The old cached output is reused and the output remains
0
full console output
The text was updated successfully, but these errors were encountered: