Skip to content
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

J2CL leaves a lot of temporary directories (when using long-lived processes) #109

Open
tbroyer opened this issue Jul 28, 2020 · 0 comments

Comments

@tbroyer
Copy link
Contributor

tbroyer commented Jul 28, 2020

I'm sure this has been brought up before, but I can't find anything here, so opening as a tracking issue.

Describe the bug
J2CL tools (GwtIncompatibleStripper, J2clTranspiler, and probably others) create temporary directories where they copy sources / expand source JARs to, and never clean them up.
In case of JVM crash or abrupt termination (SIGKILL), the JVM won't clean them up either;
but probably more importantly, with long-lived processes and many runs (including ibazel with Bazel workers), the number of temporary directories (and their temporary subdirs and files) grow and grow and grow… until eventually the process is terminated.

To Reproduce
Run ibazel and watch your ls -d /tmp/*/j2cl_sources/ |wc -l grow as you edit files and ibazel reruns targets.

The j2cl-maven-plugin's "watch" goal will behave similarly.

As well as Gradle's J2CL plugin, which makes use of workers similar to Bazel (and Gradle also using a daemon outliving the build); exacerbated by Gradle's continuous build (similar to ibazel).

Bazel version
Please include version of Bazel that you are running J2CL with:

$ bazel version
Bazelisk version: v1.5.0
Starting local Bazel server and connecting to it...
Build label: 3.3.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Jun 17 12:55:32 2020 (1592398532)
Build timestamp: 1592398532
Build timestamp as int: 1592398532

Expected behavior
Ideally, the temporary directory should be cleaned up after the tool did its job, without waiting for the JVM shutdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant