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

Support Loongarch LE architecture #2373

Merged
merged 6 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ platform-all:
platform-linux-ppc64le \
platform-linux-riscv64 \
platform-linux-s390x \
platform-linux-loong64 \
platform-netbsd \
platform-neutral \
platform-openbsd \
Expand Down Expand Up @@ -339,6 +340,9 @@ platform-linux-riscv64:
platform-linux-s390x:
@$(MAKE) --no-print-directory GOOS=linux GOARCH=s390x NPMDIR=npm/esbuild-linux-s390x platform-unixlike

platform-linux-loong64:
@$(MAKE) --no-print-directory GOOS=linux GOARCH=loong64 NPMDIR=npm/esbuild-linux-loong64 platform-unixlike
Copy link
Owner

@evanw evanw Jul 6, 2022

Choose a reason for hiding this comment

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

  • For now, only Go@1.18.2 and newer suppoort Loongarch.

When I try to run this command, I get this error:

go: unsupported GOOS/GOARCH pair linux/loong64

My go version:

go version go1.18.3 darwin/arm64

That implies that Go 1.18.2 and newer do not support this architecture. This makes sense because it's supposed to only be supported in Go 1.19 and up:

Go 1.19 adds support for the Loongson 64-bit architecture LoongArch on Linux (GOOS=linux, GOARCH=loong64).

See also: #1804


platform-sunos:
@$(MAKE) --no-print-directory GOOS=illumos GOARCH=amd64 NPMDIR=npm/esbuild-sunos-64 platform-unixlike

Expand Down Expand Up @@ -408,7 +412,8 @@ publish-all: check-go-version
publish-linux-arm64 \
publish-linux-mips64le \
publish-linux-ppc64le \
publish-linux-s390x
publish-linux-s390x \
publish-linux-loong64

# Do these last to avoid race conditions
@echo Enter one-time password:
Expand Down Expand Up @@ -476,6 +481,9 @@ publish-linux-riscv64: platform-linux-riscv64
publish-linux-s390x: platform-linux-s390x
test -n "$(OTP)" && cd npm/esbuild-linux-s390x && npm publish --otp="$(OTP)"

publish-linux-loong64: platform-linux-loong64
test -n "$(OTP)" && cd npm/esbuild-linux-loong64 && npm publish --otp="$(OTP)"

publish-sunos: platform-sunos
test -n "$(OTP)" && cd npm/esbuild-sunos-64 && npm publish --otp="$(OTP)"

Expand Down Expand Up @@ -525,6 +533,7 @@ validate-builds:
@$(MAKE) --no-print-directory TARGET=platform-linux-ppc64le PACKAGE=esbuild-linux-ppc64le SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-linux-riscv64 PACKAGE=esbuild-linux-riscv64 SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-linux-s390x PACKAGE=esbuild-linux-s390x SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-linux-loong64 PACKAGE=esbuild-linux-loong64 SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-netbsd PACKAGE=esbuild-netbsd-64 SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-openbsd PACKAGE=esbuild-openbsd-64 SUBPATH=bin/esbuild validate-build
@$(MAKE) --no-print-directory TARGET=platform-sunos PACKAGE=esbuild-sunos-64 SUBPATH=bin/esbuild validate-build
Expand Down Expand Up @@ -553,6 +562,7 @@ clean:
rm -rf npm/esbuild-linux-ppc64le/bin
rm -rf npm/esbuild-linux-riscv64/bin
rm -rf npm/esbuild-linux-s390x/bin
rm -rf npm/esbuild-linux-loong64/bin
rm -rf npm/esbuild-netbsd-64/bin
rm -rf npm/esbuild-openbsd-64/bin
rm -rf npm/esbuild-sunos-64/bin
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/evanw/esbuild

go 1.13

require golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365
require golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365 h1:6wSTsvPddg9gc/mVEEyk9oOAoxn+bT4Z9q1zx+4RwA4=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1 change: 1 addition & 0 deletions lib/npm/node-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const knownUnixlikePackages: Record<string, string> = {
'linux riscv64 LE': 'esbuild-linux-riscv64',
'linux s390x BE': 'esbuild-linux-s390x',
'linux x64 LE': 'esbuild-linux-64',
'linux loong64 LE': 'esbuild-linux-loong64',
'netbsd x64 LE': 'esbuild-netbsd-64',
'openbsd x64 LE': 'esbuild-openbsd-64',
'sunos x64 LE': 'esbuild-sunos-64',
Expand Down
3 changes: 3 additions & 0 deletions npm/esbuild-linux-loong64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# esbuild

This is the Linux Loongarch 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
17 changes: 17 additions & 0 deletions npm/esbuild-linux-loong64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "esbuild-linux-loong64",
Copy link
Owner

Choose a reason for hiding this comment

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

Note that this package name doesn't work because it's already in use, and already has content published to it: https://www.npmjs.com/package/esbuild-linux-loong64. I will have to come up with another package name instead.

Copy link

Choose a reason for hiding this comment

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

Hi,

"esbuild-linux-loong64" sounds like a good name, Whether can contact npmjs/esbuild-linux-loong64 package ,
ask him to help deal with this package

cheers~

Choose a reason for hiding this comment

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

Note that this package name doesn't work because it's already in use, and already has content published to it: https://www.npmjs.com/package/esbuild-linux-loong64. I will have to come up with another package name instead.

I have deleted this package.

"version": "0.14.48",
"description": "The Linux Loongarch 64-bit binary for esbuild, a JavaScript bundler.",
"repository": "https://github.com/evanw/esbuild",
"license": "MIT",
"preferUnplugged": false,
"engines": {
"node": ">=12"
},
"os": [
"linux"
],
"cpu": [
"loong64"
]
}
1 change: 1 addition & 0 deletions npm/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"esbuild-linux-ppc64le": "0.14.48",
"esbuild-linux-riscv64": "0.14.48",
"esbuild-linux-s390x": "0.14.48",
"esbuild-linux-loong64": "0.14.48",
"esbuild-netbsd-64": "0.14.48",
"esbuild-openbsd-64": "0.14.48",
"esbuild-sunos-64": "0.14.48",
Expand Down