-
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
Windows, Java: non-fatal Java header compilation error while building Bazel #4096
Comments
Error out if the command we try to pass to CreateProcess is longer than the limit. Doing so results in a nicer error message than "The parameter is incorrect" which is confusing. In this commit I also improve the error reporting of CreateProcessWithExplicitHandles. See #4083 See #4096 Change-Id: I00ec52238706fd8140483eddb488c3069eaa7814 PiperOrigin-RevId: 175969789
This is still not fixed, see first message on #4924. I found the culprit:
Solution:
|
This problem isn't specific to Windows, Bazel might trigger it on other platforms too, if the two-tiered spawn's first command is longer than the platform's limit but the second one isn't. |
The failing command is in turbine-failure.txt. Using a parameter file works:
|
I talked with @aehlig and @dslomov about this problem. Here's what we thought out:
@tomlu , WDYT? |
I have a design doc out for review request that would address this, but as
of yet nobody has been looking at it :(
Look at our internal queue. We could promote this document to a public one
with some light scrubbing (eg. project names and benchmarks).
…On Wed, Mar 28, 2018 at 7:00 AM, László Csomor ***@***.***> wrote:
I talked with @aehlig <https://github.com/aehlig> and @dslomov
<https://github.com/dslomov> about this problem. Here's what we thought
out:
- Evaluating the CustomCommandLine to count its length beats the
purpose of using one, and a CountingCustomCommandLine (or its Builder)
would still need to flatten NestedSets. However that is exactly what
SpawnAction.Builder.buildCommandLine() does:
https://github.com/bazelbuild/bazel/blob/73088a8a010232ae540080eacb7815
3612c1ce93/src/main/java/com/google/devtools/build/lib/
analysis/actions/SpawnAction.java#L689
<https://github.com/bazelbuild/bazel/blob/73088a8a010232ae540080eacb78153612c1ce93/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java#L689>
- The ...SpawnRunner objects could provide ground truth of the
platform limitations such as command length limits, but they lack the
ability to turn a specific long command line into a short parameter-file
using one, nor do they know whether the executable supports params files
anyway. Only the ConfiguredTarget creating the Action knows all this.
- Therefore: if the rule anticipates its action exceeding the command
length limit, then let the rule create the action with a fallback command
line that's guaranteed to be short. We already have a similar machinery in
SpawnAction.Builder (see .buildCommandLine() earlier), but we need a
generic, Spawn-level solution. The SpawnRunner would evaluate the main
command line, compare to the limit, and respectively use the main command
line or create a parameter file and use the alternative command line.
- Keeping two command lines in sync is error-prone, let's maybe add a
state-changing method to CustomCommandLine.Builder that says "all
following arguments may go into a params file, and here's the argument to
pass this params file".
@tomlu <https://github.com/tomlu> , WDYT?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4096 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABbnSmlH1vtt5veWJj9-dd2cPUUVNGe1ks5ti21OgaJpZM4Qe4ER>
.
|
Sorry, I can't look at the doc, just don't have the mental bandwidth for it. |
@tomlu's doc looks great to me. What is the priority of this bug? Can we wait for the principled solution? Conditionally creating a params file the way that is currently supported has unacceptable performance overhead. Unconditionally creating a params file would address this bug, but also has performance overhead. |
I don't think it's urgent, because Bazel still builds, but it displays this error message. I guess we can wait |
Deferred params files happened, so this should be easy to fix if it's still happening. We aren't doing the two-tiered spawn thing for header compilation anymore, though, so maybe it's no longer a problem? |
I haven't seen this issue in a long time, maybe it was accidentally fixed. Setting P3. |
Closing the issue since it seems to be fixed. |
Description of the problem / feature request / question:
Java worker fails with "The filename or extension is too long." error, though this doesn't fail the whole build. The path is actually well below 259 characters, so the error message seems to be misguided.
If possible, provide a minimal example to reproduce the problem:
Environment info
Operating System: Windows 10
Bazel version (output of
bazel info release
): 0.7.0, then a dev versionHave you found anything relevant by searching the web?
Found this while attempting to repro #4035
The text was updated successfully, but these errors were encountered: