carvel-dev / kwt

Kubernetes Workstation Tools CLI
Apache License 2.0
157 stars 12 forks source link

feat: support arm64 #35

Closed vangie closed 12 months ago

vangie commented 1 year ago
  1. Compile arm64 binaries
  2. Migrating from dep to go module
  3. upgrade golang.org/x/crypto to v0.7.0 for go1.20.2
vangie commented 1 year ago

The change looks good. For all the other tools on the Carvel suite we are trying to keep the vendor folder present so that when you download the git repo you will get all the needed dependencies. Another thing that I noticed was that when I run build locally using go 1.20 I got a diff on

diff --git a/pkg/kwt/cmd/core/strings_single_line_value.go b/pkg/kwt/cmd/core/strings_single_line_value.go
index c3af264..ca6ee35 100644
--- a/pkg/kwt/cmd/core/strings_single_line_value.go
+++ b/pkg/kwt/cmd/core/strings_single_line_value.go
@@ -10,7 +10,9 @@ type ValueStringsSingleLine struct {
        S []string
 }

-func NewValueStringsSingleLine(s []string) ValueStringsSingleLine { return ValueStringsSingleLine{S: s} }
+func NewValueStringsSingleLine(s []string) ValueStringsSingleLine {
+       return ValueStringsSingleLine{S: s}
+}

 func (t ValueStringsSingleLine) String() string       { return strings.Join(t.S, ", ") }
 func (t ValueStringsSingleLine) Value() uitable.Value { return t }
diff --git a/pkg/kwt/net/forwarder/linux_orig_dst_resolver_linux.go b/pkg/kwt/net/forwarder/linux_orig_dst_resolver_linux.go
index ac5109d..d695be8 100644
--- a/pkg/kwt/net/forwarder/linux_orig_dst_resolver_linux.go
+++ b/pkg/kwt/net/forwarder/linux_orig_dst_resolver_linux.go
@@ -1,3 +1,4 @@
+//go:build linux
 // +build linux

 package forwarder
diff --git a/pkg/kwt/net/forwarder/linux_orig_dst_resolver_other.go b/pkg/kwt/net/forwarder/linux_orig_dst_resolver_other.go
index d41a49a..bd1e3c0 100644
--- a/pkg/kwt/net/forwarder/linux_orig_dst_resolver_other.go
+++ b/pkg/kwt/net/forwarder/linux_orig_dst_resolver_other.go
@@ -1,3 +1,4 @@
+//go:build !linux
 // +build !linux

 package forwarder

Do you mind doing that change?

@joaopapereira What command can I run to reproduce this diff problem?I understand that I have not changed these files, your local prettifer or lint plugin caused?

joaopapereira commented 1 year ago

@vangie sorry for the late reply but I was out. This is what I did:

git fetch origin pull/35/head:arm-pr
git checkout arm-pr
./hack/build.sh

and this is the output I get:

$ ./hack/build.sh
+ go fmt ./cmd/... ./pkg/... ./test/...
pkg/kwt/cmd/core/strings_single_line_value.go
pkg/kwt/net/forwarder/linux_orig_dst_resolver_linux.go
pkg/kwt/net/forwarder/linux_orig_dst_resolver_other.go
+ go build ./cmd/...
# golang.org/x/text/unicode/bidi
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:9:7: UnicodeVersion redeclared in this block
    vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:8:7: other declaration of UnicodeVersion
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:13:5: xorMasks redeclared in this block
    vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:12:5: other declaration of xorMasks
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:20:20: method bidiTrie.lookup already declared at vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:19:20
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:82:20: method bidiTrie.lookupUnsafe already declared at vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:81:20
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:105:20: method bidiTrie.lookupString already declared at vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:104:20
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:167:20: method bidiTrie.lookupStringUnsafe already declared at vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:166:20
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:188:6: bidiTrie redeclared in this block
    vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:187:6: other declaration of bidiTrie
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:190:6: newBidiTrie redeclared in this block
    vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:189:6: other declaration of newBidiTrie
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:204:5: bidiValues redeclared in this block
    vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:203:5: other declaration of bidiValues
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:1835:5: bidiIndex redeclared in this block
    vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go:1698:5: other declaration of bidiIndex
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go:167:20: too many errors
# golang.org/x/net/http2/hpack
vendor/golang.org/x/net/http2/hpack/tables.go:129:5: staticTable redeclared in this block
    vendor/golang.org/x/net/http2/hpack/static_table.go:6:5: other declaration of staticTable
# golang.org/x/sys/unix
vendor/golang.org/x/sys/unix/fcntl_darwin.go:10:6: FcntlInt redeclared in this block
    vendor/golang.org/x/sys/unix/fcntl.go:16:6: other declaration of FcntlInt
vendor/golang.org/x/sys/unix/fcntl_darwin.go:15:6: FcntlFlock redeclared in this block
    vendor/golang.org/x/sys/unix/fcntl.go:26:6: other declaration of FcntlFlock
vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go:15:6: cmsgAlignOf redeclared in this block
    vendor/golang.org/x/sys/unix/sockcmsg_unix.go:14:6: other declaration of cmsgAlignOf
vendor/golang.org/x/sys/unix/syscall_bsd.go:66:6: ReadDirent redeclared in this block
    vendor/golang.org/x/sys/unix/readdirent_getdirentries.go:13:6: other declaration of ReadDirent
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:380:6: ptrace redeclared in this block
    vendor/golang.org/x/sys/unix/ptrace_darwin.go:12:6: other declaration of ptrace
vendor/golang.org/x/sys/unix/sysvshm_unix_other.go:12:36: undefined: SysvShmDesc
vendor/golang.org/x/sys/unix/fdset.go:12:14: undefined: NFDBITS
vendor/golang.org/x/sys/unix/fdset.go:17:14: undefined: NFDBITS
vendor/golang.org/x/sys/unix/fdset.go:22:21: undefined: NFDBITS
vendor/golang.org/x/sys/unix/ptrace_darwin.go:13:9: undefined: ptrace1
vendor/golang.org/x/sys/unix/ptrace_darwin.go:13:9: too many errors
# golang.org/x/text/unicode/norm
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:12:2: Version redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:9:2: other declaration of Version
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:18:2: MaxTransformChunkSize redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:15:2: other declaration of MaxTransformChunkSize
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:21:5: ccc redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:18:5: other declaration of ccc
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:32:2: firstMulti redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:29:2: other declaration of firstMulti
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:33:2: firstCCC redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:30:2: other declaration of firstCCC
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:34:2: endMulti redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:31:2: other declaration of endMulti
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:35:2: firstLeadingCCC redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:32:2: other declaration of firstLeadingCCC
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:36:2: firstCCCZeroExcept redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:33:2: other declaration of firstCCCZeroExcept
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:37:2: firstStarterWithNLead redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:34:2: other declaration of firstStarterWithNLead
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:38:2: lastDecomp redeclared in this block
    vendor/golang.org/x/text/unicode/norm/tables10.0.0.go:35:2: other declaration of lastDecomp
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go:38:2: too many errors
# github.com/golang/protobuf/proto
vendor/github.com/golang/protobuf/proto/decode.go:57:6: DecodeVarint redeclared in this block
    vendor/github.com/golang/protobuf/proto/buffer.go:39:6: other declaration of DecodeVarint
vendor/github.com/golang/protobuf/proto/deprecated.go:24:2: ErrInternalBadWireType redeclared in this block
    vendor/github.com/golang/protobuf/proto/decode.go:49:5: other declaration of ErrInternalBadWireType
vendor/github.com/golang/protobuf/proto/encode.go:71:2: ErrNil redeclared in this block
    vendor/github.com/golang/protobuf/proto/deprecated.go:18:2: other declaration of ErrNil
vendor/github.com/golang/protobuf/proto/encode.go:75:2: ErrTooLarge redeclared in this block
    vendor/github.com/golang/protobuf/proto/deprecated.go:21:2: other declaration of ErrTooLarge
vendor/github.com/golang/protobuf/proto/encode.go:90:6: EncodeVarint redeclared in this block
    vendor/github.com/golang/protobuf/proto/buffer.go:26:6: other declaration of EncodeVarint
vendor/github.com/golang/protobuf/proto/encode.go:116:6: SizeVarint redeclared in this block
    vendor/github.com/golang/protobuf/proto/buffer.go:32:6: other declaration of SizeVarint
vendor/github.com/golang/protobuf/proto/lib.go:288:6: Stats redeclared in this block
    vendor/github.com/golang/protobuf/proto/deprecated.go:28:6: other declaration of Stats
vendor/github.com/golang/protobuf/proto/lib.go:304:6: GetStats redeclared in this block
    vendor/github.com/golang/protobuf/proto/deprecated.go:31:6: other declaration of GetStats
vendor/github.com/golang/protobuf/proto/lib.go:311:6: Buffer redeclared in this block
    vendor/github.com/golang/protobuf/proto/buffer.go:49:6: other declaration of Buffer
vendor/github.com/golang/protobuf/proto/lib.go:320:6: NewBuffer redeclared in this block
    vendor/github.com/golang/protobuf/proto/buffer.go:57:6: other declaration of NewBuffer
vendor/github.com/golang/protobuf/proto/lib.go:320:6: too many errors