Skip to content

Fix Gitpod CLI arm builds #20032

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

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions components/local-app/BUILD.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ const generatePackage = function (goos, goarch, binaryName, mainFile) {
buildCommand: [
"sh",
"-c",
'go build -trimpath -ldflags "-X github.com/gitpod-io/local-app/pkg/constants.GitCommit=${__git_commit} -X github.com/gitpod-io/local-app/pkg/constants.BuildTime=$(date +%s)" -o ' +
binaryName +
" " +
mainFile,
// We need to set GOARCH explicitly here because the `defaultVariant` in `WORKSPACE.yaml` overrides it for the workspace
`GOARCH=${goarch} go build -trimpath -ldflags "-X github.com/gitpod-io/local-app/pkg/constants.GitCommit=\${__git_commit} -X github.com/gitpod-io/local-app/pkg/constants.BuildTime=\$(date +%s)" -o ${binaryName} ${mainFile}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this the same with env line above?

        env: ["GOOS=" + goos, "GOARCH=" + goarch, "CGO_ENABLED=0"],

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if I follow exactly, but inlining the env variable here means it's out of reach for leeway to change, so we don't have to worry about it being overridden. The other vars can be kept because we don't override them anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, you mean the bug is caused by env defined in current leeway build will be overridden by what's defined in WORKSPACE.yaml

It's a weird behavior, maybe worth create an issue on leeway as well? not sure if it's designed by that

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the argument can be made that variants should override environment variables, although I agree it makes more sense that packages would take precedence. We should still merge this, but perhaps if it gets fixed in leeway we can revert it.

Copy link
Member Author

@filiptronicek filiptronicek Jul 12, 2024

Choose a reason for hiding this comment

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

],
},
binaryName,
Expand Down
Loading