I know the official advice is not to rely on realpath for various good reasons, but is there any other way I can get the path that won’t break when tmpDir gets fixed?
I’m not entirely sure what you are trying to accomplish here. Can you clarify what your end result is?
If you are wanting to “fix” it to do the expected behavior, you may want to copy the implementation of std.testing.tmpDir and update it to respect the variable. I think most other options will basically lead to this point.
Write my tests such that they don’t break when tmpDir starts respecting the local cache directory and someone moves the cache.
you may want to copy the implementation of std.testing.tmpDir and update it to respect the variable. I think most other options will basically lead to this point