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

Fix Gitpod CLI arm builds #20032

merged 1 commit into from
Jul 12, 2024

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Jul 12, 2024

Description

We accidentally changed all builds to build for amd64 and this PR fixes that.

Related Issue(s)

Fixes ENT-325

How to test

wget https://ide.ft-fix-cli-arch.preview.gitpod-dev.com/static/bin/gitpod-cli-darwin-arm64
file gitpod-cli-darwin-arm64

Check it's arm64

/.../gitpod-cli-darwin-arm64: Mach-O 64-bit executable arm64

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@filiptronicek
Copy link
Member Author

filiptronicek commented Jul 12, 2024

/gh run recreate-vm=true

Comment triggered a workflow run

Started workflow run: 9907471768

  • recreate_vm: true

" " +
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.

@filiptronicek filiptronicek self-assigned this Jul 12, 2024
@roboquat roboquat merged commit f51eca5 into main Jul 12, 2024
43 of 46 checks passed
@roboquat roboquat deleted the ft/fix-cli-arch branch July 12, 2024 12:47
@gitpod-io gitpod-io deleted a comment from aristosMiliaressis Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants