Skip to content

Conversation

@notnmeyer
Copy link
Owner

local builds worked but the goreleaser builds didn't work for me on macos,

 ➜ dist/daylog-cli_darwin_amd64_v1/daylog copy
panic: clipboard: cannot use when CGO_ENABLED=0

goroutine 1 [running]:
golang.design/x/clipboard.write(...)
        /Users/nate/go/pkg/mod/golang.design/x/clipboard@v0.7.0/clipboard_nocgo.go:21
golang.design/x/clipboard.Write(0x4addae0?, {0x4313d8d?, 0x4?, 0x4321ec6?})
        /Users/nate/go/pkg/mod/golang.design/x/clipboard@v0.7.0/clipboard.go:138 +0x7f
github.com/notnmeyer/daylog-cli/cmd.copy(...)
        /Users/nate/code/daylog-cli/cmd/copy.go:41
github.com/notnmeyer/daylog-cli/cmd.init.func1(0xc001bc6100?, {0x4addae0?, 0x4?, 0x4313d95?})
        /Users/nate/code/daylog-cli/cmd/copy.go:27 +0xfc
github.com/spf13/cobra.(*Command).execute(0x4a81fe0, {0x4addae0, 0x0, 0x0})
        /Users/nate/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0xabb
github.com/spf13/cobra.(*Command).ExecuteC(0x4a82b60)
        /Users/nate/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x44f
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/nate/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/notnmeyer/daylog-cli/cmd.Execute({0x44f2b28?, 0x0?}, {0x44f3320?, 0xc000002380?})
        /Users/nate/code/daylog-cli/cmd/root.go:55 +0x6b
main.main()
        /Users/nate/code/daylog-cli/main.go:8 +0x2f

@notnmeyer notnmeyer requested a review from Copilot June 13, 2025 05:46
Copy link
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 the explicit CGO_ENABLED=0 setting so that cgo-dependent functionality (e.g., clipboard) works on macOS, and adds the binary field to name the output artifact.

  • Drop CGO_ENABLED=0 to enable cgo support for clipboard operations
  • Add binary: daylog to specify the output binary name in Goreleaser
Comments suppressed due to low confidence (2)

.goreleaser.yaml:8

  • [nitpick] Removing the CGO_DISABLED flag globally may lead to cross-compilation issues on non-macOS hosts. Consider splitting the build into separate entries or using conditional env interpolation so only the macOS build enables CGO.
-      - CGO_ENABLED=0

.goreleaser.yaml:11

  • [nitpick] It may help future maintainers to add a brief comment above binary: daylog explaining that this field sets the output artifact name.
binary: daylog

@notnmeyer notnmeyer merged commit af7ded6 into main Jun 13, 2025
1 check passed
@notnmeyer notnmeyer deleted the fix/copy-command-cgo-issues branch June 13, 2025 05:47
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.

2 participants