microsoft / microsoft/vscode-makefile-tools
Variable substitution doesn't work in settings
@andreeis is already working on this.
Since Mar 8, 2023.
- Dominant language
- TypeScript
- Stars
- 242
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
I have a simple, straightforward Makefile that is located in ${workspaceFolder}/cpp/Makefile. If I use an absolute path in the JSON settings for this extension, the extension loads correctly; if I use the ${workspaceFolder} variable, or if I do not include makefile.makeDirectory or makefile.makefilePath, the extension fails.
To be more precise, this works:
{
"makefile.makeDirectory": "/path/to/my/workspace/cpp"
}
and this works:
{
"makefile.makefilePath": "/path/to/my/workspace/cpp/Makefile"
}
But this crashes, with the message Makefile entry point not found:
{
"makefile.makeDirectory": "${workspaceFolder}/cpp"
}
and this crashes, with the same message:
{
"makefile.makefilePath": "${workspaceFolder}/cpp/Makefile"
}
Likewise, if I omit both settings entirely, I also get Makefile entry point not found.
This is my first time using this extension, but I've been coding C++ and writing Makefiles for decades, and this specific Makefile has worked just fine in this project at the command-line for a long time: I was mostly trying to get this extension working to help my colleagues, and I was puzzled as to why it crashed on a simple, clean Makefile the moment I installed the extension. It took some significant Googling and guesswork to figure out how to fix this issue, and sadly, absolute paths are not portable: We can't commit absolute paths in settings.json since not all of our computers have the same directory structure, which makes this extension effectively unusable for our team.
I tested this under VSCode 1.68.1, running under Windows, with the project in WSL2 running Ubuntu 22.04, with GNU Make 4.3, and the Makefile Tools extension is v0.5.0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.