Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'Build and Debug Active File' race condition with EngineLogs #6304

Merged
merged 3 commits into from
Oct 14, 2020

Conversation

WardenGnaw
Copy link
Member

If users use 'Build and Debug Active File' with "engineLogging", the resolveDebugConfigurations will quickly switch to the output window and ${fileBasenameNoExtension} will resolve to something similar to ./extension-output-#5.

This may be a bug with VS Code determining the output window to be a file, but this will unblock users who need to enable engine logging for this scenario.

Example broken task.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++ - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: g++ build active file",
            "miDebuggerPath": "/usr/bin/gdb",
            "logging": {
                "engineLogging": true
            }
        }
    ]
}

Will result in:

g++: error: extension-output-#5: No such file or directory
g++: fatal error: no input files
compilation terminated.
The terminal process "/bin/bash '-c', '/usr/bin/g++ -g extension-output-#5 -o ./extension-output-#5'" failed to launch (exit code: 1).

If users use 'Build and Debug Active File' with "engineLogging", the resolveDebugConfigurations will quickly switch to the output window and `${fileBasenameNoExtension}` will resolve to something similar to `./extension-output-#5`.

This may be a bug with VS Code determining the output window to be a file, but this will unblock users who need to enable engine logging for this scenario.
@WardenGnaw WardenGnaw added bug debugger tasks/build/debug An issue relating to tasks.json (e.g. build issues) labels Oct 13, 2020
@WardenGnaw WardenGnaw self-assigned this Oct 13, 2020
@WardenGnaw
Copy link
Member Author

VS Code Issue: microsoft/vscode#108619

@WardenGnaw WardenGnaw merged commit 9dfb2c6 into master Oct 14, 2020
@sean-mcmanus sean-mcmanus deleted the dev/waan/fixExtensionOutput5Error branch October 15, 2020 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger tasks/build/debug An issue relating to tasks.json (e.g. build issues)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants