Skip to content

Break logger↔timeutil import cycle causing CGO/fuzz workflow failures#34584

Merged
pelikhan merged 2 commits into
mainfrom
copilot/cgo-fuzz-workflow-failure
May 25, 2026
Merged

Break logger↔timeutil import cycle causing CGO/fuzz workflow failures#34584
pelikhan merged 2 commits into
mainfrom
copilot/cgo-fuzz-workflow-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

CGO workflow run #7726 failed across multiple jobs (build, test, fuzz, security, cross-platform builds) due to a Go import cycle rooted in pkg/timeutil/format.go. The cycle was pkg/logger -> pkg/timeutil -> pkg/logger, blocking package compilation and all dependent jobs.

  • Root cause

    • pkg/timeutil/format.go imported pkg/logger and instantiated a package logger solely for a debug line in FormatDurationNs.
  • Change made

    • Removed the pkg/logger import from pkg/timeutil/format.go.
    • Removed the timeutilLog variable and the debug Printf call in the non-positive-duration branch of FormatDurationNs.
    • Preserved function behavior (ns <= 0 still returns "—").
  • Impact

    • Eliminates the compile-time import cycle at the source.
    • Unblocks all jobs that compile or test packages depending on pkg/logger/pkg/timeutil (including fuzz matrices).
func FormatDurationNs(ns int64) string {
	if ns <= 0 {
		return "—"
	}
	d := time.Duration(ns)
	return d.Round(time.Second).String()
}

Copilot AI changed the title [WIP] Fix workflow failure on main for fuzz job Break logger↔timeutil import cycle causing CGO/fuzz workflow failures May 25, 2026
Copilot AI requested a review from pelikhan May 25, 2026 05:42
@pelikhan pelikhan marked this pull request as ready for review May 25, 2026 14:13
Copilot AI review requested due to automatic review settings May 25, 2026 14:13
@pelikhan pelikhan merged commit 90dd6cc into main May 25, 2026
@pelikhan pelikhan deleted the copilot/cgo-fuzz-workflow-failure branch May 25, 2026 14:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes a pkg/logger dependency from pkg/timeutil to break a Go import cycle (logger → timeutil → logger) that was preventing compilation and causing CGO/test/fuzz workflows to fail.

Changes:

  • Removed pkg/logger import and the timeutilLog package-level logger from pkg/timeutil/format.go.
  • Removed the debug Printf in FormatDurationNs while preserving behavior for ns <= 0 (still returns "—").
Show a summary per file
File Description
pkg/timeutil/format.go Drops logger usage to eliminate the logger↔timeutil import cycle while keeping FormatDurationNs output unchanged.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CGO][FUZZ] Workflow failure on main - Run #7726

3 participants