Debian Codegraph @

debian/missing-sources/tempfile/CHANGELOG.md

raw symbols SCIP
1 # Changelog
2
3 ## 3.24.0
4
5 - Actually support WASIp2 without the nightly feature. This library is now feature complete on WASIp2 without any additional feature flags.
6 - Exclude CI scripts from the published crate.
7
8 ## 3.23.0
9
10 - Remove need for the "nightly" feature to compile with "wasip2".
11
12 ## 3.22.0
13
14 - Updated `windows-sys` requirement to allow version 0.61.x
15 - Remove `unstable-windows-keep-open-tempfile` feature.
16
17 ## 3.21.0
18
19 - Updated `windows-sys` requirement to allow version 0.60.x
20
21 ## 3.20.0
22
23 This release mostly unifies the behavior/capabilities around "keeping" temporary files:
24
25 - Rename `Builder::keep(bool)` (via deprecation) to `Builder::disable_cleanup(bool)` to make it clear that behaves differently from `NamedTempFile::keep()`. The former disables automatic cleanup while the latter _consumes_ the `NamedTempFile` object entirely and unsets the "temporary file" attribute (on Windows).
26 - Rename `TempDir::into_path` (via deprecation) to `TempDir::keep` to mirror `NamedTempFile::keep`.
27 - Add `TempDir::disable_cleanup`, `NamedTempFile::disable_cleanup`, and `TempPath::disable_cleanup` making it possible to disable automatic cleanup in-place _after_ creating a temporary file/directory (equivalent to calling `Builder::disable_cleanup` before creating the file/directory).
28
29 Additionally, it adds a few spooled temporary file features:
30 git lo
31 - Add `SpooledTempFile::into_file` for turning a `SpooledTempFile` into a regular unnamed temporary file, writing it to the backing storage ("rolling" it) if it was still stored in-memory.
32 - Add `spooled_tempfile_in` and `SpooledTempFile::new_in` methods for creating spooled temporary files in a specific directory. This makes it possible to choose the backing device for your spooled temporary file which is rather important on Linux where the default temporary directory is likely backed by memory (defeating the entire point of having a spooled temporary file).
33
34 Finally, this release improves documentation, especially the top-level documentation explaining which temporary file type to use.
35
36 **BREAKING** for those with `deny(warnings)`:
37
38 - `Builder::keep` deprecated in favor of `Builder::disable_cleanup`.
39 - `TempDir::into_path` is deprecated in favor of `TempDir::keep`.
40
41 ## 3.19.1
42
43 - Don't unlink temporary files immediately on Windows (fixes #339). Unfortunately, this seemed to corrupt the file object (possibly a Windows kernel bug) in rare cases and isn't strictly speaking necessary.
44
45 ## 3.19.0
46
47 - Remove direct dependency on `cfg-if`. It's still in the tree, but we didn't really need to use it in this crate.
48 - Add an unstable feature (`unstable-windows-keep-open-tempfile`) to test a potential fix to #339.
49
50 ## 3.18.0
51
52 - Update `rustix` to 1.0.0.
53 - Make `NamedTempFile::persist_noclobber` atomic on Apple operating systems. It's now atomic on MacOS, Windows, and Linux (depending on the OS version and filesystem used).
54
55 ## 3.17.1
56
57 - Fix build with `windows-sys` 0.52. Unfortunately, we have no CI for older `windows-sys` versions at the moment...
58
59 ## 3.17.0
60
61 - Make sure to use absolute paths in when creating unnamed temporary files (avoids a small race in the "immediate unlink" logic) and in `Builder::make_in` (when creating temporary files of arbitrary types).
62 - Prevent a theoretical crash that could (maybe) happen when a temporary file is created from a drop function run in a TLS destructor. Nobody has actually reported a case of this happening in practice and I have been unable to create this scenario in a test.
63 - When reseeding with `getrandom`, use platform (e.g., CPU) specific randomness sources where possible.
64 - Clarify some documentation.
65 - Unlink unnamed temporary files on windows _immediately_ when possible instead of waiting for the handle to be closed. We open files with "Unix" semantics, so this is generally possible.
66
67 ## 3.16.0
68
69 - Update `getrandom` to `0.3.0` (thanks to @paolobarbolini).
70 - Allow `windows-sys` versions `0.59.x` in addition to `0.59.0` (thanks @ErichDonGubler).
71 - Improved security documentation (thanks to @n0toose for collaborating with me on this).
72
73 ## 3.15.0
74
75 Re-seed the per-thread RNG from system randomness when we repeatedly fail to create temporary files (#314). This resolves a potential DoS vector (#178) while avoiding `getrandom` in the common case where it's necessary. The feature is optional but enabled by default via the `getrandom` feature.
76
77 For libc-free builds, you'll either need to disable this feature or opt-in to a different [`getrandom` backend](https://github.com/rust-random/getrandom?tab=readme-ov-file#opt-in-backends).
78
79 ## 3.14.0
80
81 - Make the wasip2 target work (requires tempfile's "nightly" feature to be enabled). [#305](https://github.com/Stebalien/tempfile/pull/305).
82 - Allow older windows-sys versions [#304](https://github.com/Stebalien/tempfile/pull/304).
83
84 ## 3.13.0
85
86 - Add `with_suffix` constructors for easily creating new temporary files with a specific suffix (e.g., a specific file extension). Thanks to @Borgerr.
87 - Update dependencies (fastrand & rustix).
88
89 ## 3.12.0
90
91 - Add a `keep(keep: bool)` function to builder that suppresses delete-on-drop behavior (thanks to @RalfJung).
92 - Update `windows-sys` from 0.52 to 0.59.
93
94 ## 3.11.0
95
96 - Add the ability to override the default temporary directory. This API shouldn't be used in general, but there are some cases where it's unavoidable.
97
98 ## 3.10.1
99
100 - Handle potential integer overflows in 32-bit systems when seeking/truncating "spooled" temporary files past 4GiB (2³²).
101 - Handle a theoretical 32-bit overflow when generating a temporary file name larger than 4GiB. Now it'll panic (on allocation failure) rather than silently succeeding due to wraparound.
102
103 Thanks to @stoeckmann for finding and fixing both of these issues.
104
105 ## 3.10.0
106
107 - Drop `redox_syscall` dependency, we now use `rustix` for Redox.
108 - Add `Builder::permissions` for setting the permissions on temporary files and directories (thanks to @Byron).
109 - Update rustix to 0.38.31.
110 - Update fastrand to 2.0.1.
111
112 ## 3.9.0
113
114 - Updates windows-sys to 0.52
115 - Updates minimum rustix version to 0.38.25
116
117 ## 3.8.1
118
119 - Update rustix to fix a potential panic on `persist_noclobber` on android.
120 - Update redox_syscall to 0.4 (on redox).
121 - Fix some docs typos.
122
123 ## 3.8.0
124
125 - Added `with_prefix` and `with_prefix_in` to `TempDir` and `NamedTempFile` to make it easier to create temporary files/directories with nice prefixes.
126 - Misc cleanups.
127
128 ## 3.7.1
129
130 - Tempfile builds on haiku again.
131 - Under the hood, we've switched from the unlinkat/linkat syscalls to the regular unlink/link syscalls where possible.
132
133 ## 3.7.0
134
135 BREAKING: This release updates the MSRV to 1.63. This isn't an API-breaking change (so no major
136 release) but it's still a breaking change for some users.
137
138 - Update fastrand from 1.6 to 2.0
139 - Update rustix to 0.38
140 - Updates the MSRV to 1.63.
141 - Provide AsFd/AsRawFd on wasi.
142
143 ## 3.6.0
144
145 - Update windows-sys to 0.48.
146 - Update rustix min version to 0.37.11
147 - Forward some `NamedTempFile` and `SpooledTempFile` methods to the underlying `File` object for
148 better performance (especially vectorized writes, etc.).
149 - Implement `AsFd` and `AsHandle`.
150 - Misc documentation fixes and code cleanups.
151
152 ## 3.5.0
153
154 - Update rustix from 0.36 to 0.37.1. This makes wasi work on rust stable
155 - Update `windows-sys`, `redox_syscall`
156 - BREAKING: Remove the implementation of `Write for &NamedTempFile<F> where &F: Write`. Unfortunately, this can cause compile issues in unrelated code (https://github.com/Stebalien/tempfile/issues/224).
157
158 ## 3.4.0
159
160 SECURITY: Prior `tempfile` releases depended on `remove_dir_all` version 0.5.0 which was vulnerable to a [TOCTOU race](https://github.com/XAMPPRocky/remove_dir_all/security/advisories/GHSA-mc8h-8q98-g5hr). This same race is present in rust versions prior to 1.58.1.
161
162 Features:
163
164 - Generalized temporary files: `NamedTempFile` can now abstract over different kinds of files (e.g.,
165 unix domain sockets, pipes, etc.):
166 - Add `Builder::make` and `Builder::make_in` for generalized temp file
167 creation.
168 - Add `NamedTempFile::from_parts` to complement `NamedTempFile::into_parts`.
169 - Add generic parameter to `NamedTempFile` to support wrapping non-File types.
170
171 Bug Fixes/Improvements:
172
173 - Don't try to create a temporary file multiple times if the file path has been fully specified by
174 the user (no random characters).
175 - `NamedTempFile::persist_noclobber` is now always atomic on linux when `renameat_with` is
176 supported. Previously, it would first link the new path, then unlink the previous path.
177 - Fix compiler warnings on windows.
178
179 Trivia:
180
181 - Switch from `libc` to `rustix` on wasi/unix. This now makes direct syscalls instead of calling
182 through libc.
183 - Remove `remove_dir_all` dependency. The rust standard library has optimized their internal version
184 significantly.
185 - Switch to official windows-sys windows bindings.
186
187 Breaking:
188
189 - The minimum rust version is now `1.48.0`.
190 - Mark most functions as `must_use`.
191 - Uses direct syscalls on linux by default, instead of libc.
192 - The new type parameter in `NamedTempFile` may lead to type inference issues in some cases.
193
194 ## 3.3.0
195
196 Features:
197
198 - Replace rand with fastrand for a significantly smaller dependency tree. Cryptographic randomness
199 isn't necessary for temporary file names, and isn't all that helpful either.
200 - Add limited WASI support.
201 - Add a function to extract the inner data from a `SpooledTempFile`.
202
203 Bug Fixes:
204
205 - Make it possible to persist unnamed temporary files on linux by removing the `O_EXCL` flag.
206 - Fix redox minimum crate version.
207
208 ## 3.2.0
209
210 Features:
211
212 - Bump rand dependency to `0.8`.
213 - Bump cfg-if dependency to `1.0`
214
215 Other than that, this release mostly includes small cleanups and simplifications.
216
217 Breaking: The minimum rust version is now `1.40.0`.
218
219 ## 3.1.0
220
221 Features:
222
223 - Bump rand dependency to `0.7`.
224
225 Breaking: The minimum rust version is now `1.32.0`.
226
227 ## 3.0.9
228
229 Documentation:
230
231 - Add an example for reopening a named temporary file.
232 - Flesh out the security documentation.
233
234 Features:
235
236 - Introduce an `append` option to the builder.
237 - Errors:
238 - No longer implement the soft-deprecated `description`.
239 - Implement `source` instead of `cause`.
240
241 Breaking: The minimum rust version is now 1.30.
242
243 ## 3.0.8
244
245 This is a bugfix release.
246
247 Fixes:
248
249 - Export `PathPersistError`.
250 - Fix a bug where flushing a `SpooledTempFile` to disk could fail to write part
251 of the file in some rare, yet-to-reproduced cases.
252
253 ## 3.0.7
254
255 Breaking:
256
257 - `Builder::prefix` and `Builder::suffix` now accept a generic `&AsRef<OsStr>`.
258 This could affect type inference.
259 - Temporary files (except unnamed temporary files on Windows and Linux >= 3.11)
260 now use absolute path names. This will break programs that create temporary
261 files relative to their current working directory when they don't have the
262 search permission (x) on some ancestor directory. This is only likely to
263 affect programs with strange chroot-less filesystem sandboxes. If you believe
264 you're affected by this issue, please comment on #40.
265
266 Features:
267
268 - Accept anything implementing `&AsRef<OsStr>` in the builder: &OsStr, &OsString, &Path, etc.
269
270 Fixes:
271
272 - Fix LFS support.
273 - Use absolute paths for named temporary files to guard against changes in the
274 current directory.
275 - Use absolute paths when creating unnamed temporary files on platforms that
276 can't create unlinked or auto-deleted temporary files. This fixes a very
277 unlikely race where the current directory could change while the temporary
278 file is being created.
279
280 Misc:
281
282 - Use modern stdlib features to avoid custom unsafe code. This reduces the
283 number of unsafe blocks from 12 to 4.
284
285 ## 3.0.6
286
287 - Don't hide temporary files on windows, fixing #66 and #69.
288
289 ## 3.0.5
290
291 Features:
292
293 - Added a spooled temporary file implementation. This temporary file variant
294 starts out as an in-memory temporary file but "rolls-over" onto disk when it
295 grows over a specified size (#68).
296 - Errors are now annotated with paths to make debugging easier (#73).
297
298 Misc:
299
300 - The rand version has been bumped to 0.6 (#74).
301
302 Bugs:
303
304 - Tempfile compiles again on Redox (#75).
305
306 ## 3.0.4
307
308 - Now compiles on unsupported platforms.
309
310 ## 3.0.3
311
312 - update rand to 0.5
313
314 ## 3.0.2
315
316 - Actually *delete* temporary files on non-Linux unix systems (thanks to
317 @oliverhenshaw for the fix and a test case).
318
319 ## 3.0.1
320
321 - Restore NamedTempFile::new_in
322
323 ## 3.0.0
324
325 - Adds temporary directory support (@KodrAus)
326 - Allow closing named temporary files without deleting them (@jasonwhite)
327
328 ## 2.2.0
329
330 - Redox Support
331
332 ## 2.1.6
333
334 - Remove build script and bump minimum rustc version to 1.9.0
335
336 ## 2.1.5
337
338 - Don't build platform-specific dependencies on all platforms.
339 - Cleanup some documentation.
340
341 ## 2.1.4
342
343 - Fix crates.io tags. No interesting changes.
344
345 ## 2.1.3
346
347 Export `PersistError`.
348
349 ## 2.1.2
350
351 Add `Read`/`Write`/`Seek` impls on `&NamedTempFile`. This mirrors the
352 implementations on `&File`. One can currently just deref to a `&File` but these
353 implementations are more discoverable.
354
355 ## 2.1.1
356
357 Add LFS Support.
358
359 ## 2.1.0
360
361 - Implement `AsRef<File>` for `NamedTempFile` allowing named temporary files to
362 be borrowed as `File`s.
363 - Add a method to convert a `NamedTempFile` to an unnamed temporary `File`.
364
365 ## 2.0.1
366
367 - Arm bugfix
368
369 ## 2.0.0
370
371 This release replaces `TempFile` with a `tempfile()` function that returns
372 `std::fs::File` objects. These are significantly more useful because most rust
373 libraries expect normal `File` objects.
374
375 To continue supporting shared temporary files, this new version adds a
376 `reopen()` method to `NamedTempFile`.