Commit 6292c99
committed
Attempt to fix missing class error by not using tree artifacts for bootclasspath
A few times a year across many thousands of builds we encounter a rare
error about the `DumpPlatformClassPath` class being missing. Our Bazel
setup uses dynamic execution, builds without the bytes, remote execution
+ remote caching, and path mapping.
The error we encounter is as follows:
```
Error: Could not find or load main class DumpPlatformClassPath
Caused by: java.lang.ClassNotFoundException: DumpPlatformClassPath
```
I'm guessing that this is happening due to some kind of Bazel bug that
happens with our Bazel setup and tree artifacts, i.e.,
declare_directory.
Best I can tell this is happening because the
`DumpPlatformClassPath.class` file is somehow not materializing
correctly. I'm not 100% confident about that, but it's my leading
hypothesis at this point in time.
This commit changes the actions in `bootclasspath.bzl` to, when
possible, not rely on tree artifacts. Instead, they rely JDK 11+'s
ability to launch single-file programs (introduced in JEP 330). This
avoids the `javac` action and `declare_directory` previously required to
compile `DumpPlatformClassPath`.1 parent 9d6184b commit 6292c99
1 file changed
+38
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
155 | 161 | | |
156 | 162 | | |
157 | 163 | | |
| |||
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
164 | | - | |
165 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
166 | 177 | | |
167 | 178 | | |
168 | 179 | | |
| |||
211 | 222 | | |
212 | 223 | | |
213 | 224 | | |
214 | | - | |
| 225 | + | |
| 226 | + | |
215 | 227 | | |
216 | 228 | | |
217 | 229 | | |
| |||
0 commit comments