Skip to content

Commit

Permalink
Use enumeration for Darwin, which requires CGO when building.
Browse files Browse the repository at this point in the history
- Tkeyclient does not support building static binaries for Darwin, it
  requires CGO to enable enumeration of connected serial devices. In the
  short term we enable CGO for Darwin before we can find another
  reliable solution. See issue #13.
  • Loading branch information
dehanj committed Jun 27, 2024
1 parent 52f44a8 commit b60934d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 105 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
shasum = sha512sum
CGO = 0

.PHONY: all
all: tkey-verification

# .PHONY to let go-build handle deps and rebuilds
.PHONY: tkey-verification
tkey-verification:
cp -af vendor-signing-pubkeys.txt ./cmd/tkey-verification/vendor-signing-pubkeys.txt
CGO_ENABLED=0 go build -trimpath -buildvcs=false ./cmd/tkey-verification
CGO_ENABLED=$(CGO) go build -trimpath -buildvcs=false ./cmd/tkey-verification
./tkey-verification --version

.PHONY: podman
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ require (
github.com/spf13/pflag v1.0.5
github.com/tillitis/tkeyclient v1.0.0
github.com/tillitis/tkeysign v1.0.0
go.bug.st/serial v1.6.2
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/creack/goselect v0.1.2 // indirect
go.bug.st/serial v1.6.2 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/sys v0.19.0 // indirect
)
3 changes: 1 addition & 2 deletions internal/tkey/tkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"os"
"os/signal"

"github.com/tillitis/tkey-verification/internal/util"
"github.com/tillitis/tkeyclient"
"github.com/tillitis/tkeysign"
)
Expand Down Expand Up @@ -66,7 +65,7 @@ func NewTKey(devPath string, verbose bool) (*TKey, error) {
}

if devPath == "" {
devPath, err = util.DetectSerialPort(true)
devPath, err = tkeyclient.DetectSerialPort(true)
if err != nil {
return nil, ErrNoDevice
}
Expand Down
21 changes: 0 additions & 21 deletions internal/util/ports_darwin.go

This file was deleted.

79 changes: 0 additions & 79 deletions internal/util/ports_linuxwindows.go

This file was deleted.

0 comments on commit b60934d

Please sign in to comment.