Skip to content

Commit

Permalink
chore: upgrade to go 1.22 (#993)
Browse files Browse the repository at this point in the history
* allow manually running tests

* update js imports for wasm

* test with go 1.22

* build releases with go 1.22

* add changeset

* create snapshot releases using go 1.22

* update Contributing.md: 1.19 is no longer the requirement

* Update go.mod
  • Loading branch information
lilnasy authored Apr 2, 2024
1 parent c307b73 commit 17f8932
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-rockets-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/compiler': minor
---

The WASM binaries for the compiler are now built using Go 1.22.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Test

on:
workflow_dispatch:
push:
branches: ['main', 'next']
pull_request:
Expand All @@ -21,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.22

- name: Test
run: go test -v -timeout 30s ./internal/...
Expand All @@ -38,7 +39,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.22

- name: Set up PNPM
uses: pnpm/action-setup@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.22

- name: Set up PNPM
uses: pnpm/action-setup@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.22

- name: Setup PNPM
uses: pnpm/action-setup@v3
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Contributions are welcome to the Go compiler!

### Go

[Go][go] `1.19.x` is needed to work with this repo. On Macs, installing via [Homebrew][homebrew] is recommended: `brew install go`. For Windows & Linux, you can [follow Go’s installation guide][go] if you don’t have your own preferred method of package installation.
[Go][go] `1.20+` is needed to work with this repo. On Macs, installing via [Homebrew][homebrew] is recommended: `brew install go`. For Windows & Linux, you can [follow Go’s installation guide][go] if you don’t have your own preferred method of package installation.

If you use VS Code as your primary editor, installing the [Go extension][go-vscode] is highly recommended.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/withastro/compiler

go 1.19
go 1.20

require (
github.com/google/go-cmp v0.5.9
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/src/browser/wasm_exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default class Go {

const timeOrigin = Date.now() - performance.now();
this.importObject = {
go: {
gojs: {
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/src/node/wasm_exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default class Go {

const timeOrigin = Date.now() - performance.now();
this.importObject = {
go: {
gojs: {
// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)
// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported
// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).
Expand Down

0 comments on commit 17f8932

Please sign in to comment.