Skip to content

Commit 757b359

Browse files
authored
Merge pull request #786 from ascopes/task/document-windows-path-length
At the time of writing, two OpenJDK bugs exist that cause us hassle o…
2 parents 46c8c05 + c98f0af commit 757b359

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

protobuf-maven-plugin/src/site/markdown/known-issues.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,37 @@ If you have found a problem. Please [raise an issue on GitHub](https://github.co
1010
Note that any issues fixed in newer versions of both this software and other pieces of software
1111
will not be documented here. Please ensure you are using the latest version of dependencies and
1212
plugins where possible prior to raising an issue.
13+
14+
---
15+
16+
## Windows path length issues
17+
18+
Microsoft Windows historically enforces that executables do not have an absolute path that is
19+
more than 260 characters in size. This has been lifted for Windows 11 but requires JDK changes
20+
to be compatible, and at the time of writing, this has not been implemented.
21+
22+
For users, this means that running builds within overly nested hierarchies, or using very long
23+
directory names on Windows may result in builds failing. This generally looks like the following
24+
error:
25+
26+
```text
27+
java.io.IOException: Cannot run program "C:\some\very\long\path\to\a\script-or-executable.exe": CreateProcess error=2, The system cannot find the file specified
28+
```
29+
30+
At the time of writing, the only real workaround for this is to use a shorter absolute path, which
31+
means moving your build nearer to the root directory of your drive you are building from
32+
(e.g. `C:\`).
33+
34+
See:
35+
36+
- [(OpenJDK Bug) JDK-8315405 - Can't start process in directory with very long path](https://bugs.openjdk.org/browse/JDK-8315405)
37+
- [(OpenJDK Bug) JDK-8348664 - Enable long path support in manifest for java.exe and javaw.exe on Windows](https://bugs.openjdk.org/browse/JDK-8348664)
38+
- [(Microsoft) Maximum File Path Limitation](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry)
39+
- [(Microsoft) CreateProcessW function (processthreadsapi.h)](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw)
40+
41+
If this blocks you, please mention it on the first bug to help bring further attention to it.
42+
43+
In the meantime, any further bugs relating to this on the `protobuf-maven-plugin` will not be fixed
44+
unless a suitable workaround is available.
45+
46+
This does **not** affect users on Linux or macOS.

0 commit comments

Comments
 (0)