Skip to content

Commit

Permalink
fix #3802: update go 1.20.12 => 1.22.4
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Jun 26, 2024
1 parent ac54f06 commit 8b5249d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.20.12
go-version: 1.22.4
id: go

- name: Setup Node.js environment
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.20.12
go-version: 1.22.4
id: go

- name: Setup Node.js environment
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.20.12
go-version: 1.22.4
id: go

- name: Setup Node.js environment
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.20.12
go-version: 1.22.4
id: go

# Make sure esbuild works with old versions of Deno. Note: It's important
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.20.12
go-version: 1.22.4
id: go

- name: Validation checks
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## Unreleased

* Drop support for older versions of Windows ([#3802](https://github.com/evanw/esbuild/issues/3802))

This release drops support for the following operating systems:

* Windows 7
* Windows 8
* Windows Server 2008
* Windows Server 2012

This is because the Go programming language dropped support for these operating system versions in [Go 1.21](https://go.dev/doc/go1.21#windows), and this release updates esbuild from Go 1.20 to Go 1.22.

Note that this only affects the binary esbuild executables that are published to the `esbuild` npm package. It's still possible to compile esbuild's source code for these older operating systems. If you need to, you can compile esbuild for yourself using an older version of the Go compiler (before Go version 1.21). That might look something like this:

```
git clone https://github.com/evanw/esbuild.git
cd esbuild
go build ./cmd/esbuild
./esbuild.exe --version
```
## 0.21.5
* Fix `Symbol.metadata` on classes without a class decorator ([#3781](https://github.com/evanw/esbuild/issues/3781))
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test-all:
@$(MAKE) --no-print-directory -j6 test-common test-deno ts-type-tests test-wasm-node test-wasm-browser lib-typecheck test-yarnpnp

check-go-version:
@go version | grep ' go1\.20\.12 ' || (echo 'Please install Go version 1.20.12' && false)
@go version | grep ' go1\.22\.4 ' || (echo 'Please install Go version 1.22.4' && false)

# Note: Don't add "-race" here by default. The Go race detector is currently
# only supported on the following configurations:
Expand Down
10 changes: 10 additions & 0 deletions npm/esbuild-wasm/bin/esbuild
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ for (let key in process.env) {
}
}

console.error('globalThis.crypto', globalThis.crypto)
console.error('globalThis.crypto.getRandomValues', globalThis.crypto && globalThis.crypto.getRandomValues)
try {
console.error("require('crypto')", require('crypto'))
} catch (err) {
console.error("require('crypto')", err)
}

/*
// Node v19 introduced "globalThis.crypto" https://github.com/nodejs/node/pull/44897.
// This broke Go's WebAssembly shim: https://github.com/golang/go/issues/56860.
// Hack around this breakage by resetting "globalThis.crypto" to "writable".
Expand All @@ -96,6 +105,7 @@ Object.defineProperty(globalThis, 'crypto', {
writable: true,
configurable: true,
});
*/

process.argv.splice(2, 0, esbuild_wasm);
wrapper(module_.createRequire(wasm_exec_node), Object.assign(Object.create(WebAssembly), { instantiate }));

0 comments on commit 8b5249d

Please sign in to comment.