Skip to content

Don't output temporary directories#107

Merged
jadenPete merged 1 commit into
lucid-masterfrom
jpeterson-removes-tmp-as-an-output
Apr 6, 2026
Merged

Don't output temporary directories#107
jadenPete merged 1 commit into
lucid-masterfrom
jpeterson-removes-tmp-as-an-output

Conversation

@jadenPete
Copy link
Copy Markdown

Previously, the Scala rules declared temporary directories via ctx.actions.declare_directory and outputted these directories. My guess is that we did this either to get Bazel not to complain about them being unused or for debugging purposes.

This is unnecessary (and actually slower in the context of remote execution), so this commit updates the simple rules to use mktemp -d and the persistent worker-backed rules to use the sandbox directory as a temporary directory.

Copy link
Copy Markdown

@jjudd jjudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. I have a small request about creation of the temp directory in the worker. Other than that, it LGTM.

Comment thread rules/private/phases/phase_bootstrap_compile.bzl
Comment thread src/main/scala/higherkindness/rules_scala/workers/zinc/compile/ZincRunner.scala Outdated
Comment thread src/main/scala/higherkindness/rules_scala/workers/zinc/doc/DocRunner.scala Outdated
Comment thread src/main/scala/higherkindness/rules_scala/workers/zinc/compile/ZincRunner.scala Outdated
@jadenPete jadenPete force-pushed the jpeterson-removes-tmp-as-an-output branch from 942bd51 to 589c0d4 Compare April 3, 2026 18:16
Previously, the Scala rules declared temporary directories via
`ctx.actions.declare_directory` and outputted these directories. My
guess is that we did this either to get Bazel not to complain about them
being unused or for debugging purposes.

This is unnecessary (and actually slower in the context of
remote execution), so this commit updates the simple rules to use
`mktemp -d` and the persistent worker-backed rules to use the
sandbox directory as a temporary directory.
@jadenPete jadenPete force-pushed the jpeterson-removes-tmp-as-an-output branch from 589c0d4 to 1d8e15e Compare April 3, 2026 18:41
@jadenPete jadenPete merged commit d380dbc into lucid-master Apr 6, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants