ci: Avoid OpenWatcom linker temp file collisions
When wlink
needs to spill into a temporary file, code in spillio.c
checks environment variables WLINKTMP
, TMP
, and TMPDIR
to get a
directory for temporary files. It searches for a name WLK02112.xx*
that doesn't exist, where *
starts at a
and increments. Then it
opens the file with the chosen name. This can race among concurrent
wlink
invocations that may all chose the same name before opening,
and causes errors like:
Error! E3008: cannot open C:\...\Temp\WLK02112.xxa : Permission denied
Since wmake
does not run parallel jobs, this normally isn't a problem.
However, our test suite runs multiple tests in parallel. Each test has
its own wmake
invocation, and therefore can run wlink
concurrently.
Set WLINKTMP=.
in the environment to tell each wlink
to place
temporary files in its own working directory, which will be different
for each separate wmake
invocation in our test suite.
See this code in the Open Watcom V2 Fork for the temp directory selection and temp file name race.