Giter Club home page Giter Club logo

Comments (11)

imjasonh avatar imjasonh commented on June 26, 2024

@nmittler possibly related to some of your recent go flag changes? Can you take a look?

from ko.

dprotaso avatar dprotaso commented on June 26, 2024

To repro use the env-var

export KO_FLAGS="--platform=linux/amd64"

from ko.

dprotaso avatar dprotaso commented on June 26, 2024

Yeah git bisect shows

2a4c12f410f678ee72c2dcd8036ceb1b9b113c10 is the first bad commit
commit 2a4c12f410f678ee72c2dcd8036ceb1b9b113c10
Author: Nathan Mittler <[email protected]>
Date:   Wed May 15 13:16:12 2024 -0700

    Add global flags and ldflags

    Fixes #1304

 docs/configuration.md                         | 25 ++++++++++++++
 pkg/build/gobuild.go                          | 50 ++++++++++++++++++---------
 pkg/build/gobuild_test.go                     | 49 ++++++++++++++++++++++++++
 pkg/build/options.go                          | 16 +++++++++
 pkg/commands/options/build.go                 | 20 ++++++++---
 pkg/commands/options/build_test.go            | 23 +++++++++---
 pkg/commands/options/testdata/config/.ko.yaml |  5 +++
 pkg/commands/resolver.go                      |  2 ++
 8 files changed, 165 insertions(+), 25 deletions(-)
bisect found first bad commit

from ko.

nmittler avatar nmittler commented on June 26, 2024

hmm ... possibly #1314? In pkg/commands/options/build.go I added v.GetStringSlice("flags"). Not sure if this is interacting with KO_FLAGS?

from ko.

nmittler avatar nmittler commented on June 26, 2024

Actually .. is KO_FLAGS even an environment variable that ko previously supported? Maybe a viper thing?

from ko.

dprotaso avatar dprotaso commented on June 26, 2024

from ko.

nmittler avatar nmittler commented on June 26, 2024

Unfortunately, I'm definitely not a viper expert :). I'm guessing that <EnvPrefix>_FLAGS is a default variable exposed and used by viper, but I don't see it mentioned in the docs. Any links on how this works?

from ko.

dprotaso avatar dprotaso commented on June 26, 2024

Actually sorry I made a mistake - KO_FLAGS is not a ko thing. I guess in your commit you're now reading it for some reason.

from ko.

dprotaso avatar dprotaso commented on June 26, 2024

I guess when you added that GetStringSlice it prepends KO in front of the envvar - https://github.com/ko-build/ko/blame/bb99eccfe235e7b583c857bb1bafbf45f72178d1/pkg/commands/options/build.go#L112

from ko.

dprotaso avatar dprotaso commented on June 26, 2024

maybe you should rename the flag? eg. go_flags or something? Then it can be set using KO_GO_FLAGS likewise with the ldflags- since those are go build specific

from ko.

nmittler avatar nmittler commented on June 26, 2024

@dprotaso yeah, that's was my thought as well. Will send a PR shortly.

from ko.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.