Skip to content

fix(logging): support stderr redirection on Darwin - #448

Merged
Nitin Jamadagni (NitinJamadagni) merged 1 commit into
mainfrom
edwinouko/fix-darwin-stderr-redirect
Aug 7, 2026
Merged

fix(logging): support stderr redirection on Darwin#448
Nitin Jamadagni (NitinJamadagni) merged 1 commit into
mainfrom
edwinouko/fix-darwin-stderr-redirect

Conversation

@oukoedwin

Copy link
Copy Markdown
Contributor

Summary

Add a Darwin implementation of RedirectStdErr using syscall.Dup2 .

Why this is needed

loggingRedirect.go  is compiled on macOS and calls RedirectStdErr, but that function was previously implemented only for Linux and Windows. Any Darwin build that imports pkg/logging therefore fails with:
undefined: RedirectStdErr

This issue affects Darwin consumers whenever pkg/logging enters their build graph. Adding the platform-specific implementation restores macOS compilation.

Darwin supports Dup2, rather than the Linux implementation’s Dup3, so it requires a platform-specific implementation.

Validation

  •  go test ./pkg/logging 
  • go test ./pkg/... 
  • Cross-compiled pkg/logging for darwin/amd64
  • Cross-compiled pkg/logging for darwin/arm64 

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 65184d9f-5f8d-463e-a86f-247cfcc5761c
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@oukoedwin

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@oukoedwin

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@NitinJamadagni
Nitin Jamadagni (NitinJamadagni) merged commit e742364 into main Aug 7, 2026
7 checks passed
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.

4 participants