Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(files): Writing new files works across devices
`persist` of `tempfile` does not work across device boundaries, so if the device backing the temporary directory is e.g. `tmpfs`, then `persist` fails. It actually had no useful benefit, so we can just remove it and write to the destination directly. Reproduced bug and confirmed fix on a Debian machine with: ```console $ sudo mkdir -p /path/to/temp_dir $ sudo mount -t tmpfs -o size=100m tmpfs /path/to/temp_dir $ sudo mount | rg 'temp' tmpfs on /path/to/temp_dir type tmpfs (rw,relatime,size=102400k,inode64) $ export TMPDIR=/path/to/temp_dir $ cargo run -- --python class a whatever ``` `TMPDIR` env var is respected by `tempfile`. The above `cargo run` fails without this patch. (There is an end-to-end test for file writing, but that has never failed for some reason... seems like none of my machines (including Ubuntu 24) or CI exhibited the issue). Closes #145
- Loading branch information