how can i submit the changes? > how can i submit the changes?

If it's really just this line, you could use GitHub's web interface to edit the file and create a Pull Request from that. Feel free to send a PR, we are happy to review it!
No writable permission for /tmp if /tmp is symbolic link
### Description of the bug:


Hi,

In some cases there is no enough space for /tmp to build big project, usually we will set /tmp as a symbolic link to local path (ex, /tmp -> /home/xxx/tmp)

For bazel build we will have no writable permission for /tmp 
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
clang-17: error: unable to make temporary file: Read-only file system

From the sandbox_debug log we can see the canonical path is remounted as read only.
src/main/tools/linux-sandbox-pid1.cc:311: writable: /tmp
src/main/tools/linux-sandbox-pid1.cc:405: remount ro: /home/xxx/tmp

https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java
430 writableDirs.add(fs.getPath("/tmp"));
So it could be a bug for linux sandbox spaw runner. it can be changed as below
430 writableDirs.add(fs.getPath("/tmp").resolveSymbolicLinks());

Thanks

### Which category does this issue belong to?


Java Rules

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.


set /tmp as a symbolic link and build kernel modules with bazel which need to write files into /tmp directory

### Which operating system are you running Bazel on?


linux

### What is the output of `bazel info release`?


bazel 7.0.0  all pre release

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.


bazel 7.0.0  all preversion dist

### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?


_No response_

### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.


no

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_
src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java
src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java
diff --git a/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java
index 3b2582f8647abc..29d342e14b08b6 100644
--- a/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java
+++ b/src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedSpawnRunner.java
@@ -427,7 +427,7 @@ protected ImmutableSet<Path> getWritableDirs(
     }
     FileSystem fs = sandboxExecRoot.getFileSystem();
     writableDirs.add(fs.getPath("/dev/shm").resolveSymbolicLinks());
-    writableDirs.add(fs.getPath("/tmp"));
+    writableDirs.add(fs.getPath("/tmp").resolveSymbolicLinks());
 
     return writableDirs.build();
   }
