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] Go builder improvements #9576

Merged
merged 98 commits into from
Mar 16, 2023
Merged

[go] Go builder improvements #9576

merged 98 commits into from
Mar 16, 2023

Conversation

cb1kenobi
Copy link
Contributor

@cb1kenobi cb1kenobi commented Feb 28, 2023

This PR fixes a handful of Go builder issues all related to the selected Golang version being used to build the function:

  • go.mod version ignored for vc build and vc dev, uses system PATH version only
  • vc dev fails if go.mod does not exist
  • If the analyze bin doesn’t exist, downloads golang into .vercel/cache/golang instead of a global shared dir
  • When running vc dev, doesn’t reuse go build code/common settings
  • go tidy fails when go.mod set to 1.19 or 1.20, but 1.18 or older is installed
  • vc build builds wrong arch on Apple Silicon/arm64
  • vc build on Windows doesn't properly resolve "builds" in vercel.json due to posix separator issue
  • vc build on Windows fails with package <pkg/name> is not in GOROOT due to posix separator issue
  • Removed actions/setup-go from all test workflows

I added a test that tests the go tidy issue.

@cb1kenobi cb1kenobi added area: go semver: patch PR contains bug fixes labels Feb 28, 2023
@cb1kenobi cb1kenobi self-assigned this Feb 28, 2023
@vedantmgoyal9
Copy link
Contributor

A kind request to merge this PR soon, so that I can proceed with my project. The issue, which this PR addresses, has blocked my project's deployment for the past 1½ months.

/cc @EndangeredMassa @TooTallNate @styfle @cb1kenobi @Ethan-Arrowood

@TooTallNate
Copy link
Member

@vedantmgoyal2009 FYI, you can already use this update in a Vercel deployment by setting environment variable VERCEL_CLI_VERSION with value https://vercel-git-chrisbarber-go-dev.vercel.sh/tarballs/vercel.tgz.

@TeddyRistainoi
Copy link

This pull request fixes multiple issues related to the Go builder, including problems with version selection, module management, Apple Silicon builds, and Windows compatibility.

@TooTallNate TooTallNate added the pr: automerge Automatically merge the PR when checks pass label Mar 16, 2023
@kodiakhq kodiakhq bot merged commit 0dd3711 into main Mar 16, 2023
@kodiakhq kodiakhq bot deleted the chrisbarber/go-dev branch March 16, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: go pr: automerge Automatically merge the PR when checks pass semver: patch PR contains bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants