-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 for aix ppc64 BE #3549
Comments
Do you have access to such a system and can conform that esbuild can build and run on that system (e.g. installing |
I don't but https://github.com/nodejs/citgm does, maybe they'd be willing to test it, if not a WebAssembly fallback package should presumably work and resolve the issue in the comment I linked to. |
I've asked @abmusse from IBM to take a look. We think it should be okay, based on https://go.dev/doc/install/source#environment listing $GOOS=AIX and $GOARCH=ppc64 as a valid combination but @abmusse will try to verify the tests pass on an AIX system. |
I just published a version of esbuild that works on |
@evanw $ uname -vrs
AIX 2 7
$ npm i esbuild@0.19.10
added 2 packages, and audited 3 packages in 7s
found 0 vulnerabilities
$ npx esbuild --version
0.19.10 |
Can you do the same for os400? It runs PASE so if esbuild runs on AIX it will also run in the pase environment. I do have access to the server |
This issue came about from someone trying to install esbuild using node/npm on aix, which is possible because If you just want to run the esbuild binary executable on os400 (or any other platform that the Go compiler toolchain supports) without using node, then you should already be able to compile esbuild for yourself for that platform. You don't need any changes to esbuild to do that. If you want to use esbuild with node via the package that's published to npm, then it needs to be possible to run npm on that platform (so you can run the installer to download that prebuilt version of esbuild). If this is possible, then I'm assuming that means there's an unofficial build of node/npm for os400 since |
os400 more commonly rreferred to as IBMi has an @ibm-release maintained version of Node that runs in the shell environment and is installed via yum (https://ibmi-oss-docs.readthedocs.io/en/latest/nodejs/README.html) . node -p '[process.platform, os.arch(), os.endianness()]' results in the following -> ['os400','ppc64','BE'] |
Thanks. That should be enough info for me to proceed. |
Wait actually Go doesn't appear to support building for $ go version
go version go1.21.6 linux/amd64
$ GOOS=os400 GOARCH=ppc64 go build ./cmd/esbuild
go: unsupported GOOS/GOARCH pair os400/ppc64
$ go tool dist list | grep os400
(no output) So I'm not able to build esbuild for this OS because Go doesn't support it.
How are you able to build esbuild using these parameters? Do you also have a custom Go compiler? |
I haven't tried any go programs on there personally. I have read that go compiled for aix will run in the PASE environment, but I've never tried it. This particular issue was from me trying to run vite ssr on IBMi. install.js throws the unsupported platform error. This may fix my issue by adding to nodePlatform.ts
PASE on IBMi is a unix shell similar to aix. If I get time tomorrow I may try and fork to test. |
To save you some forking work: I believe the only thing you would need to confirm is whether the binary executable in https://registry.npmjs.org/@esbuild/aix-ppc64/-/android-arm-0.19.11.tgz works correctly on os400 or not. You probably don't need to fork esbuild. I assume that node will run correctly on os400 so you shouldn't need to test that, but I need to know whether the executable will work or not. It may not work correctly (e.g. this issue is open). |
It does not run unfortunately. Due to the mmap pointers. Doesn't look like IBM has any plans on supporting Go either. Thanks for your help with this issue. |
Yes AIX complied go programs won't work properly on IBM i due to many issues including the mmap one you mentioned. For now the best solution would be to run esbuild to bundle your code on another machine then serve the files on your IBM i. |
If Node.js runs on the machine you could always try |
That's what I do now. I was hoping to eventually run ssr on IBMi with esbuild |
I might try that, thanks. |
Yes Node.js is supported on IBM i. I think giving |
Looks like the wasm packages do run on IBMi. I'm using vite so my package.json lists the following overrides for esbuild and rollup.
** update I may need to check some configs with vite. The npm installs work but vite throws an error. |
Interesting, Is there a simple example project that uses esbuild? Would like to use it to test using esbuild-wasm on IBM i. |
I was using @fastify/vite but I think remix with the vite package may be easier to set up to test SSR with vite and is here. I haven't dug into much but it looks like even with the overrides in package.json vite tries to pull esbuild instead of esbuild-wasm. We host a bunch of IBMi servers, so I was going to screw around with it when I got a chance. Probably related to this issue |
Would it make sense to install esbuild-wasm as an optional dep when the os is IBM i (os400)? esbuild/npm/esbuild/package.json Line 20 in 9f9e4f8
Node.js is available and could be used to run the wasm binaries. This would install esbuild-wasm when packages require esbuild e.g. Vite in this case. |
esbuild has WASM fallbacks for certain platforms, for example https://github.com/evanw/esbuild/tree/40711afe0baa545012b813c5c7788225be9ef74c/npm/%40esbuild/android-x64, so that is an option. |
Yes I think having that for IBM i would be good. That way we can fallback to esbuild-wasm when esbuild is installed. Before doing that though are there tests for esbuild-wasm that I can run to verify things are working properly? |
Yes, see Lines 55 to 62 in 40711af
|
I'll see about running the tests and updating with the results! |
I cloned the repo and I tried to run the wasm-tests: node scripts/wasm-tests.js
Error: spawn go ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn go',
path: 'go',
spawnargs: [
'build',
'-o',
'~/esbuild/npm/esbuild-wasm/esbuild.wasm',
'-ldflags=-s -w',
'-trimpath',
'~/esbuild/cmd/esbuild'
],
cmd: 'go build -o ~/esbuild/npm/esbuild-wasm/esbuild.wasm -ldflags=-s -w -trimpath ~/esbuild/cmd/esbuild'
} Looks like that failed trying to build the wasm lib with go. Lines 360 to 363 in 40711af
Lines 129 to 141 in 40711af
We don't have go available to build the wasm lib from. Are there any alternatives of using a pre-built wasm lib? |
@abmusse I got back around to this and set up a test remix app that uses vite. The overrides in package.json does in fact use the wasm version. However, there are other errors showing in the wasm-function:
I don't know that falling back to esbuild-wasm would resolve anything. side note: I hope IBM figures out a way to allow us to run Go on the IBMi platform. |
@abmusse this library https://github.com/onlysumitg/ibmigo/tree/main does run and compile Go on IBMi |
Ah so falling back to esbuild-wasm is still not ideal 😞 |
I'm also having troubles using Vite which is using esbuild dependency on IBM i PASE Environment (os400). When i run this
modify the package.json to use wasm
I'm getting this
which is referencing esbuild/internal/config/globals.go Lines 967 to 969 in 70893e4
Is this also something related to WASM causing the issue?
|
esbuild doesn't support aix ppc64 BE at the moment and it would be great if it did so that projects that use it can be tested on that architecture in Node.js's CITGM setup.
Ref nodejs/citgm#1039 (comment)
The text was updated successfully, but these errors were encountered: