Skip to content

Conversation

asodja
Copy link
Member

@asodja asodja commented Dec 20, 2024

Relates to #31394

@asodja asodja self-assigned this Dec 20, 2024
@asodja asodja added a:feature A new functionality in:daemon labels Dec 20, 2024
@asodja asodja force-pushed the asodja/unix-domain-sockets branch from b330a46 to 0a3f978 Compare December 20, 2024 15:26
Comment on lines +176 to +181
// TODO: Where to put domain sockets? If we put them in gradleUserHomeDir, we can get
// java.net.SocketException: Unix domain path too long
File unixDomainSocketsDir = new File("/tmp/gradle");
Copy link
Member

@octylFractal octylFractal Dec 20, 2024

Choose a reason for hiding this comment

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

I'm unsure where macOS expects them, but the Linux standard is to put these things in $XDG_RUNTIME_DIR or failing that $TMPDIR.

Looking at https://github.com/dirs-dev/directories-jvm/blob/main/src/main/java/dev/dirs/ProjectDirectories.java#L237, it seems like there's no equivalent directory for macOS/Windows.

So I think using $XDG_RUNTIME_DIR/gradle on Linux if possible, and using the actual temporary directory ${java.io.tmpdir}/gradle otherwise, would be the best option.