microsoft / microsoft/vscode-makefile-tools

Variable substitution doesn't work in settings

Open
#343 4 comments 0 reactions 1 assignee View on GitHub

@andreeis is already working on this.

Since Mar 8, 2023.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.