Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

Build failed with go: no such tool "covdata" during test execution. The Go 1.25.5 toolchain lacks the covdata tool required for coverage testing.

Changes

  • Makefile: Made covdata tool usage conditional in both unit and E2E test targets
    • test target: Checks if covdata tool is available before using coverage flags
      • With covdata: runs tests with full coverage profiling (-coverprofile, -covermode, -coverpkg)
      • Without covdata: runs tests without coverage but still with race detection
    • teste2e-covdata target: Checks if covdata tool is available before attempting E2E coverage
      • With covdata: runs E2E tests with coverage collection using GOCOVERDIR
      • Without covdata: runs E2E tests without coverage

Solution

The fix uses conditional shell logic to detect tool availability:

if $(GO_EXE) tool -n | grep -q covdata; then
    # Run with coverage
else
    # Run without coverage
fi

This ensures the build works with Go 1.25.5 (which currently lacks the covdata tool) while automatically enabling coverage when the tool becomes available in future Go releases.

Testing

  • make test passes successfully with Go 1.25.5
  • make build-linux-amd64 completes without errors
  • ✅ Tests run without coverage when covdata is not available
  • ✅ Maintains forward compatibility for when covdata becomes available
Original prompt

This section details on the original issue you should resolve

<issue_title>Build broken on v1 branch</issue_title>
<issue_description>Build is broken on the v1 branch

# oras.land/oras-go/pkg/context
go: no such tool "covdata"
+ rm -rf .test/
Error: make: *** [Makefile:6: test] Error 1
Error: Process completed with exit code 2.

https://github.com/oras-project/oras-go/actions/runs/21375691308/job/61531155517?pr=1099

It may be related to the pull request oras-project/oras-go#1099 but I doubt it.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 27, 2026 01:23
Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com>
Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com>
Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot we don't want to use an older version of go. Make the build work and include the change in oras-project/oras-go#1099

Copilot AI changed the title [WIP] Fix build issue on v1 branch Jan 27, 2026
Copilot AI requested a review from TerryHowe January 27, 2026 01:27
Co-authored-by: TerryHowe <104113+TerryHowe@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 27, 2026

@copilot we don't want to use an older version of go. Make the build work and include the change in oras-project/oras-go#1099

Fixed in commit 4b6003d. Kept Go 1.25.5 and made covdata tool usage conditional in the Makefile. Tests now run without coverage profiling when the tool is unavailable, but will automatically use coverage when the tool becomes available in future releases.

Copilot AI changed the title Fix build failure by downgrading to Go 1.24 Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants