microsoft / vscode-makefile-tools

MAKE integration in Visual Studio Code
Other
194 stars 58 forks source link

parseCompilerArgsScriptFile logic is racy #516

Closed drok closed 9 months ago

drok commented 11 months ago

In parser.ts, a temporary file is generated with a hardcoded name (/tmp/parseCompilerArgs.sh).

If that file happens to already exist, or another vscode instance is writing/deleting it at about the same time, then the instance which expects it to be there may face an unexpected condition. The file may not be there, or its contents may not be as expected. It is generated with the following script fragment, which also references issue #149 as a motivation.

https://github.com/microsoft/vscode-makefile-tools/blob/cef4a663bfb6ae2f68ba4271655a4f854c1b4fa1/src/parser.ts#L451-L477

Instead of relying on a hardcoded filename, the needed script should be shipped with the extension, and called as needed. There is no need for this file to be temporary, nor for logic that generates it when needed, nor logic that deletes it.

This is a separate issue from #149 because whether this tooling script is necessary or not is distinct from how it is delivered.

Manifested in #475

gcampbell-msft commented 11 months ago

@drok Thanks for the suggestion! We will take a look at our soonest availability.

github-actions[bot] commented 9 months ago

:tada: This issue has now been fixed and is now available in the latest release! :tada: