diff --git a/CHANGELOG.md b/CHANGELOG.md index 551a880855..39a2936583 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Bug Fixes: - Fix Windows backslash handling in token splitting to preserve trailing backslashes before whitespace. This caused "Compile Active File" with MSVC + Ninja Multi-Config to merge adjacent flags (e.g., `/Fd\ /FS`) into a single malformed argument. [#4902](https://github.com/microsoft/vscode-cmake-tools/issues/4902) - Fix kit detection returning "unknown vendor" when using clang-cl compiler. [#4638](https://github.com/microsoft/vscode-cmake-tools/issues/4638) - Update testing framework to fix bugs when running tests of CMake Tools without a reliable internet connection. [#4891](https://github.com/microsoft/vscode-cmake-tools/pull/4891) [@cwalther](https://github.com/cwalther) +- Fix GNU LD diagnostic regex incorrectly matching CMake status lines (e.g., Zephyr build output) as linker errors in the Problems panel. [#4910](https://github.com/microsoft/vscode-cmake-tools/issues/4910) - Fix “Make it easier for a new developer of CMake Tools to run tests” on Windows. [#4932](https://github.com/microsoft/vscode-cmake-tools/pull/4932) [@cwalther](https://github.com/cwalther) ## 1.23.52 diff --git a/src/diagnostics/gnu-ld.ts b/src/diagnostics/gnu-ld.ts index 3cc896aa13..8f6068a993 100644 --- a/src/diagnostics/gnu-ld.ts +++ b/src/diagnostics/gnu-ld.ts @@ -9,23 +9,23 @@ import { oneLess, RawDiagnostic, RawDiagnosticParser, RawRelated, FeedLineResult // Patterns to identify and capture GNU linker diagnostic messages const regexPatterns: RegexPattern[] = [ { // path/to/ld[.exe]:[ ]path/to/file:line: severity: message - regexPattern: /^(?:.*ld(?:\.exe)?:)(?:\s*)?(.+):(\d+):\s+(?:fatal )?(\w+):\s+(.+)/, + regexPattern: /^(?:(?:.*[/\\])?ld(?:\.exe)?:)(?:\s*)?(.+):(\d+):\s+(?:fatal )?(\w+):\s+(.+)/, matchTypes: [MatchType.Full, MatchType.File, MatchType.Line, MatchType.Severity, MatchType.Message] }, { // path/to/ld[.exe]:[ ]path/to/file.obj:path/to/file:line: message - regexPattern: /^(?:.*ld(?:\.exe)?\:)(?:\s*)(?:.+?\.obj:)(.+?):(\d+):\s+(.+)/, + regexPattern: /^(?:(?:.*[/\\])?ld(?:\.exe)?\:)(?:\s*)(?:.+?\.obj:)(.+?):(\d+):\s+(.+)/, matchTypes: [MatchType.Full, MatchType.File, MatchType.Line, MatchType.Message] }, { // path/to/ld[.exe]:[ ]path/to/file:line: message - regexPattern: /^(?:.*ld(?:\.exe)?\:)(?:\s*)?(.+):(\d+):\s+(.+)/, + regexPattern: /^(?:(?:.*[/\\])?ld(?:\.exe)?\:)(?:\s*)?(.+):(\d+):\s+(.+)/, matchTypes: [MatchType.Full, MatchType.File, MatchType.Line, MatchType.Message] }, { // path/to/ld[.exe]: severity: message - regexPattern: /^(.*ld(?:\.exe)?):\s+(?:fatal )?(\w+):\s+(.+)/, + regexPattern: /^((?:.*[/\\])?ld(?:\.exe)?):\s+(?:fatal )?(\w+):\s+(.+)/, matchTypes: [MatchType.Full, MatchType.File, MatchType.Severity, MatchType.Message] }, { // path/to/ld[.exe]: message (without trailing colon) - regexPattern: /^(.*ld(?:\.exe)?):\s+(.+)(? { expect(build_consumer.compilers.gnuld.diagnostics).to.have.length(0); expect(build_consumer.compilers.gnuld.diagnostics).to.have.length(0); }); + test('No linker error on Zephyr build status line "-- Zephyr version: ..." (issue #4910)', () => { + const lines = ['-- Zephyr version: 4.3.0 (/path/to/zephyr), build: v4.3.0']; + feedLines(build_consumer, [], lines); + expect(build_consumer.compilers.gnuld.diagnostics).to.have.length(0); + expect(build_consumer.compilers.gcc.diagnostics).to.have.length(0); + }); + test('No linker error on generic CMake status lines containing "build:" (issue #4910)', () => { + const lines = ['-- Some tool version: 1.0 (/path/to/tool), build: v1.0']; + feedLines(build_consumer, [], lines); + expect(build_consumer.compilers.gnuld.diagnostics).to.have.length(0); + expect(build_consumer.compilers.gcc.diagnostics).to.have.length(0); + }); test('Parsing GHS Diagnostics', () => { const lines = [ '"C:\\path\\source\\debug\\debug.c", line 631 (col. 3): warning #68-D: integer conversion resulted in a change of sign'