Skip to content

Commit

Permalink
fix(ko): Do not add -trimpath when debugging
Browse files Browse the repository at this point in the history
`ko` adds the `-trimpath` flag to `go build` by default, as this aids in
achieving reproducible builds.

The `-trimpath` flag removes file system paths from the resulting
binary, and this makes interactive debugging more difficult.

This change instructs `ko` to _not_ add the `-trimpath` flag when users
run `skaffold debug` with the `ko` builder.

Bumps the `ko` version to pick up the `Trimpath` build option.

Also, simplifies the `ko` example config since it's no longer necessary
to add a non-empty `flags` field to `skaffold.yaml` to allow for
interactive debugging.

Fixes: GoogleContainerTools#6843
Tracking: GoogleContainerTools#6041
  • Loading branch information
halvards committed Nov 17, 2021
1 parent 9f56bbd commit 0e7b030
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 50 deletions.
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/AlecAivazis/survey/v2 v2.2.15
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.20.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.20.0
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/ahmetalpbalkan/dlog v0.0.0-20170105205344-4fb5f8204f26 // indirect
github.com/ahmetb/dlog v0.0.0-20170105205344-4fb5f8204f26
github.com/aws/aws-sdk-go v1.36.30 // indirect
Expand All @@ -38,7 +38,7 @@ require (
github.com/buildpacks/lifecycle v0.10.2
github.com/buildpacks/pack v0.18.1
github.com/cenkalti/backoff/v4 v4.1.1
github.com/docker/cli v20.10.7+incompatible
github.com/docker/cli v20.10.10+incompatible
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v20.10.10+incompatible
github.com/docker/go-connections v0.4.0
Expand All @@ -50,11 +50,11 @@ require (
github.com/golang/protobuf v1.5.2
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.6
github.com/google/go-containerregistry v0.6.0
github.com/google/go-containerregistry v0.7.0
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20210216200643-d81088d9983e // indirect
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/ko v0.9.4-0.20211102213605-98211906053b
github.com/google/ko v0.9.4-0.20211117220415-2fbc9089eb17
github.com/google/uuid v1.3.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0
github.com/heroku/color v0.0.6
Expand Down Expand Up @@ -90,14 +90,14 @@ require (
go.opentelemetry.io/otel/sdk/metric v0.20.0
go.opentelemetry.io/otel/trace v0.20.0
golang.org/x/mod v0.4.2
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
golang.org/x/tools v0.1.7
google.golang.org/api v0.57.0
google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e
google.golang.org/grpc v1.41.0
google.golang.org/genproto v0.0.0-20211111162719-482062a4217b
google.golang.org/grpc v1.42.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
Expand Down
Loading

0 comments on commit 0e7b030

Please sign in to comment.