Skip to content

Run w/ Coverage is broken #1958

@MahdiBM

Description

@MahdiBM

Describe the bug

The extension expects .build/debug/codecov/default.profdata, but only produces .build/debug/codecov/*.profraw files when you use Run w/ Coverage.

This error is thrown right after each Run w/ Coverage:

Error: ENOENT: no such file or directory, open '.../swift-endpoint/.build/debug/codecov/default.profdata'

I worked around it like so:

while true; do 
  profraw=$(ls .../swift-endpoint/.build/debug/codecov/*.profraw 2>/dev/null | head -n1) 
  if [[ -n "$profraw" ]]; then
    ln -sf "$profraw" .../swift-endpoint/.build/debug/codecov/default.profdata 
  fi 
done

Creates a symlink from the produced *.profraw file to the default.profdata file as soon as the *.profraw is created.
Then when the extension looks for the default.profdata it does actually find it.

With this, things seem to be back to normal, which means it's just the extension looking for the wrong file.

To Reproduce
Use Run w/ Coverage.

Expected behavior
A clear and concise description of what you expected to happen.

Environment

  • OS: macOS 26.1
  • Swift version: 6.2.1
  • Visual Studio Code version:
  • vscode-swift version: 2.14.0

Diagnostics Bundle
The diagnostics bundle can help determine the root cause of bugs much quicker. To share this information execute the >Swift: Capture Diagnostics Bundle command and attach the archive to the bug report.

Select the "Minimal" bundle to only share the Swift extension's log and your configured swift. settings. Select the "Full" bundle if you're comfortable sharing the SourceKit-LSP diagnostic bundle and LLDB-DAP logs, which may contain source code

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Unscreened

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions