You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A refused in-memory compilation with -working-directory leaves the process in that directory #267
A compilation to memory takes a single compilation job. With -working-directory <dir> and arguments that give more than one job, such as a source without -c or -S, the compilation is refused, and the process is left in <dir>. The behaviour is inherited: before #262, every compilation with -working-directory left the process there. compileToModule (#265) has it too.
Observed
A temporary unit test, on macOS arm64 with LLVM 20.1.2. unit.c is in <project>, the process is elsewhere, and the test reads the process's working directory after the call:
Since #262, the process moves only for a compilation with a job that runs as a program of its own, such as the link these arguments ask for, and it moves before the jobs are checked: set_current_path at compiler.cpp L1418-L1427, then validateJobPlan at L1432, which refuses more than one job for an output in memory. No job has run by then.
Before #262, the driver moved the process as it built the compilation, whatever its jobs.
Consequence
A host that compiles to memory from several threads does not expect a compilation that runs no job to move the process. Other compilations of the process then resolve relative paths of the process's own, such as a relative -working-directory, from <dir>.
The CoreTrace stack analyzer always adds -c or -S to its commands, so its compilations have a single job.
Possible fix
Check the job plan before the process moves, so that a compilation refused for its jobs leaves the process where it is.
Found by
The integration of #262 into #265, while checking compileToModule with -working-directory. This is apart from #264, where a compilation goes on after a driver error.
Activity