Skip to content

Conversation

@notnmeyer
Copy link
Owner

turns out the clipboard package i was using required cgo. local builds on my mac worked fine, but ci builds on Ubuntu were broken. i quickly despised having to sort out the build crap for something so simple. this swaps the package for a home-rolled exec to pbcopy.

only supports mac for now, but there were wayland issues on linux already anyway.

@notnmeyer notnmeyer self-assigned this Jun 18, 2025
@notnmeyer notnmeyer requested a review from Copilot June 18, 2025 16:00
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 replaces the external clipboard package (which required cgo) with a mac-only pbcopy wrapper and updates build tasks accordingly.

  • Adds a dependency on the deps task before building.
  • Removes golang.design/x/clipboard (and related indirect packages) from go.mod.
  • Implements a custom pbcopy command in cmd/copy.go for macOS only.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
tasks.toml Adds deps = [["deps"]] to ensure dependency tasks run
go.mod Removes the clipboard package and other unused modules
cmd/copy.go Removes clipboard import and adds pbcopy exec wrapper
Comments suppressed due to low confidence (2)

cmd/copy.go:47

  • [nitpick] Using copy as a function name shadows the Go built-in copy function. Consider renaming it to something more descriptive like copyToClipboard.
func copy(content []byte) error {

cmd/copy.go:58

  • The new pbcopy implementation isn't covered by automated tests. Consider adding a test that mocks exec.Command, or abstracting the exec call to verify behavior without spawning a real process.
func pbcopy(content []byte) error {

@notnmeyer notnmeyer enabled auto-merge (squash) June 18, 2025 16:03
@notnmeyer notnmeyer merged commit 0168e73 into main Jun 18, 2025
1 check passed
@notnmeyer notnmeyer deleted the chore/copy-without-external-deps branch June 18, 2025 16:04
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