| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
PrimaryStorage::clean_dir relies on being able to classify temporary
files from the filename.
|
| |
|
|
|
| |
Using the FMT macro explicitly makes invalid format message
constructions compile-time errors instead of run-time errors.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[1] added a suitable file extension to the temporary file used for
capturing the preprocessed output by creating a hard link. This fails
when the temporary directory is on a file system that doesn't support
hard links.
Fix this by making it possible to pass a suffix to TemporaryFile and
passing the proper cpp suffix for the tmp stdout file instead of
creating a hard link as an alias.
[1]: 4da9f2b474b7ee39cd54ab4261f90936f3c944ec
Closes #1079.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Windows, multiple ccache process could race each other to create,
rename and delete temporary files, because they would attempt to
generate the same sequence of temporary file names
(`tmp.cpp_stdout.iG2Kb7`, `tmp.cpp_stdout.P1kAlM`,
`tmp.cpp_stdout.FzP5tM`, ...).
This is because ccache used mingw-w64's [implementation of mkstemp][1],
which uses `rand()` to generate temporary file names, and ccache was
never seeding the thread-local PRNG used by `rand()`.
Replace ccache's use of `mkstemp()` on Windows with an implementation
based on OpenBSD. This allows us to sidestep mingw-w64's problematic
implementation, and allows us to build using MSVC again. (MSVC's C
standard library does not provide `mkstemp()`.)
Example errors:
- Some ccache process is in the process of deleting a temporary file:
ccache: error: Failed to create temporary file for C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.FzP5tM: Access is denied.
- Some ccache process has destination file open, so it can't be overwritten:
ccache: error: failed to rename C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.iG2Kb7 to C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.iG2Kb7.ii: Access is denied.
- Source file has been deleted by some other ccache process:
ccache: error: failed to rename C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.P1kAlM to C:\Users\someuser/.ccache/tmp/tmp.cpp_stdout.P1kAlM.ii: The system cannot find the file specified.
[1]: https://github.com/mirror/mingw-w64/blob/v8.0.0/mingw-w64-crt/misc/mkstemp.c
|
| |
|
|
|
|
|
| |
Hopefully mkstemp is available on all systems we want to support these
days.
As mentioned in #703.
|
| | |
|
| |
|
|
|
| |
This makes the naming more consistent with the other exception classes
(Error and Failure).
|
| | |
|
| |
|
|
|
| |
I think that this improves code readability since it’s more clear what
the code flow is.
|
| | |
|
| | |
|
| | |
|
| | |
|
|
|
In addition to improving code clarity, this fixes a bug where the
fallback code for “-fdiagnostics-color” tried to operate on a closed
file descriptor.
|