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

Go build fixes #180

Merged
merged 2 commits into from
May 24, 2024
Merged

Go build fixes #180

merged 2 commits into from
May 24, 2024

Conversation

csweichel
Copy link
Collaborator

Description

This PR makes LEEWAY_WORKSPACE_ROOT available for commands executed during build. This way one can refer to e.g. config files in lint or test commands.

It also fixes a regression for test coverage collection which would affect Go packages referencing other go dependencies, when using Go workspaces.

csweichel added 2 commits May 24, 2024 09:04
allows to reference a golangci-lint config in the linter command
by removing the go build deps in the packaging phase
@@ -1680,6 +1680,7 @@ func executeCommandsForPackage(buildctx *buildContext, p *Package, wd string, co
}

env := append(os.Environ(), p.Environment...)
env = append(env, fmt.Sprintf("LEEWAY_WORKSPACE_ROOT=%s", p.C.W.Origin))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing the coverage LGTM ✔️

Don't understand this change, though.

@csweichel csweichel merged commit b5584c5 into main May 24, 2024
6 checks passed
@csweichel csweichel deleted the cw/fix-go-build branch May 24, 2024 09:13
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 this pull request may close these issues.

2 participants