Whilst working on #34007, a new issue was revealed where tests touching /tmp (via shared test infra which sets up a temp directory) fail, due to /tmp not being writable.
The existing libraries code uses the TMPDIR env var if it exists, and falls back to /tmp - and helpfully, this is valid on the tvOS simulator, just not on physical devices.
This will be addressed in #57508 as well, since the issues are related (and the proposed fix to this issue depends on the fix to #34007)