Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an option for go flags in go/build pipeline #474

Open
developer-guy opened this issue May 29, 2023 · 1 comment · May be fixed by #821
Open

add an option for go flags in go/build pipeline #474

developer-guy opened this issue May 29, 2023 · 1 comment · May be fixed by #821

Comments

@developer-guy
Copy link
Contributor

We (w/@Dentrax) thought that if people want to add additional flags for the Go build, we should provide an option for this in the melange go/build pipeline, but there is no option for that yet.

AFAIK, there is an environment variable called GOFLAGS on go side that lets you specify the build arguments without editing the command itself but I'm not sure it would work if we set this in build process, if so, please feel free to close this issue.

Final implementation would be something like the following:

  - uses: go/build
    with:
      modroot: cluster-autoscaler
      packages: .
      output: cluster-autoscaler
      ldflags: -s -w
      flags: -mod=vendor <-- additional option for setting Go build flags.
@debasishbsws
Copy link
Member

Yes, we can specify the GOFLAGS env var and it will pass it as a flag in every build command. But, I think will not work here as go/build is in a different pipeline and we can not carry forward exported env vars in the previous runs.

And this additional flags could be a list that we ca pass into the command

@debasishbsws debasishbsws linked a pull request Nov 6, 2023 that will close this issue
4 tasks
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 a pull request may close this issue.

2 participants