forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid globbing jdk home with symlinks (pantsbuild#8484)
### Problem When looking for certain jars under jdk home for rsc compile, globbing could fail due to having symlinks under jdk home, which is a common pattern on linux machines. ``` # ls -l java-8-openjdk-amd64 total 20 lrwxrwxrwx 1 root root 22 Oct 12 03:37 ASSEMBLY_EXCEPTION -> jre/ASSEMBLY_EXCEPTION drwxr-xr-x 2 root root 4096 Oct 12 03:37 bin lrwxrwxrwx 1 root root 41 Oct 12 03:37 docs -> ../../../share/doc/openjdk-8-jre-headless drwxr-xr-x 3 root root 4096 Oct 12 03:37 include drwxr-xr-x 5 root root 4096 Oct 12 03:37 jre drwxr-xr-x 3 root root 4096 Oct 12 03:37 lib drwxr-xr-x 4 root root 4096 Oct 12 03:37 man lrwxrwxrwx 1 root root 20 Oct 12 03:37 src.zip -> ../openjdk-8/src.zip lrwxrwxrwx 1 root root 22 Oct 12 03:37 THIRD_PARTY_README -> jre/THIRD_PARTY_README ``` which causes error like: ``` [3/5] Compiling 1 mixed source in 1 target (examples/src/scala/org/pantsbuild/example/hello/welcome:welcome). 03:08:26 00:03 [compile] rsc(examples/src/scala/org/pantsbuild/example/hello/welcome:welcome) failed: Error expanding globs: Failed to scan directory "/usr/lib/jvm/java-8-openjdk-amd64/": No such file or directory (os error 2) Traceback: File "/root/workspace/pants/src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py", line 281, in worker work() File "/root/workspace/pants/src/python/pants/backend/jvm/tasks/jvm_compile/execution_graph.py", line 42, in __call__ self.fn() ``` ### Solution Snapshot the jars directly from their parent dir instead of jdk home. #### Behavior change Before the snapshot looks like: ``` $ ~/cheatsheet/fs_util_dir '7d534b1fcfd6ce15bd658cf94f414dd2314469595b73cef13bad0a84e1a0fc93' 155 jre/lib/jce.jar jre/lib/rt.jar lib/dt.jar lib/tools.jar ``` After ``` $ ~/cheatsheet/fs_util_dir 'a9d1e0a80d593344229960a9650256477209d2098a4701316c90d823fc58bccd' 334 dt.jar jce.jar rt.jar tools.jar ``` So the jars are placed at the top level. ### Result ``` ./pants --compile-rsc-worker-count=8 --process-execution-local-parallelism=8 --compile-rsc-execution-strategy=hermetic --no-compile-rsc-incremental --compile-rsc-workflow=rsc-and-zinc --cache-compile-rsc-ignore compile examples/src/scala/org/pantsbuild/example/hello/exe ``` on linux no longer errors out. Fixes pantsbuild#8460
- Loading branch information
1 parent
00c4f8c
commit 4c72cfd
Showing
3 changed files
with
61 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters