-
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: CreateProcess(): The parameter is incorrect (due to long argument list) #4083
Comments
Thanks for reporting this bug! |
I noticed it while trying to get my Windows build of Bazel to run too, I think during some test coverage stuff (I haven't looked too closely yet.) |
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
In 0.8.0 the error message now looks like:
|
0.8.0 doesn't yet contain https://github.com/Androbin/bazel/commit/b110dfb5cca8961051426e669566cc3aeeac55ee . We also need your PR (#4088) with the Java-side changes, so the Java code won't even attempt to create a process if it knows the cmdline is too long. I figured that one situation where Bazel produces this error is with Java header compilation. Bazel tries to compile all headers in one action, passing all files as arguments. If that fails, Bazel just retries using parameter files. That's why the error is non-fatal, see issue #4096. |
Dropping to P2, because Bazel still displays error messages making this a problem with usability, the errors are benign so Bazel is usable. |
I think this is a duplicate of #4096. |
Description of the problem:
When the total length of the arguments + executable (+ null terminator etc.) exceeds 32,767 Bazel fails ungracefully with the error
It would be nice if this had a better error message, at least.
Generally this is pretty worrying because Bazel seems to like creating very large argument lists and this definitely something Bazel can just "fix" :) I've been able to solve my specific case with param files but I think there should be an error message so folks know what's up.
Minimal reproduction:
In
foo.bzl
:In a
BUILD
:Changing 32760 to something lower (e.g. 32759) causes the build to fail for legitimate reasons.
bazel info release
): release 0.7.0Have you found anything relevant by searching the web?
The following issues may be related. They both contain the same error message (
CreateProcess(): The parameter is incorrect
) and the one's log showed what appeared to be a 51k long process creation.Anything else, information or logs or outputs that would be helpful?
CreateProcess
which documents the 32,767 restrictionThe text was updated successfully, but these errors were encountered: