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 ESBuild For aarch64 Android 64bit #803

Closed
theaungmyatmoe opened this issue Feb 13, 2021 · 14 comments
Closed

Support ESBuild For aarch64 Android 64bit #803

theaungmyatmoe opened this issue Feb 13, 2021 · 14 comments

Comments

@theaungmyatmoe
Copy link

theaungmyatmoe commented Feb 13, 2021

Go Working On Android aarch64 architect.

https://github.com/golang/go/issues/38485#issuecomment-747633830

Sound like ESbuild should support aarch64(64bit).

Errors

> esbuild@0.8.44 postinstall /data/data/com.termux/files/home/esbuild-demo/node_modules/esbuild
> node install.js

Unsupported platform: android arm64 LE
npm WARN esbuild-demo@1.0.0 No description
npm WARN esbuild-demo@1.0.0 No repository field.

Development Environment

➜  ~ uname -a
Linux localhost 4.14.117-perf+ #2 SMP PREEMPT Tue Jan 19 17:24:32 CST 2021 aarch64 Android

Related issue
I am finding the issue for esbuild for 64 bit.
What i found is that esbuild is support for 32bit system. #550

aef0e44

@evanw
Copy link
Owner

evanw commented Feb 13, 2021

Both arm32 and arm64 are supported, but on Linux. I believe the issue is that you are trying to run esbuild on Android which is not yet supported.

You should be able to build esbuild for Android by installing Go, cloning this repo, and running this command:

GOOS="android" GOARCH="arm64" go build "-ldflags=-s -w" -o ./esbuild ./cmd/esbuild

From there you should be able to copy the ./esbuild binary over to your Android device (if you're not compiling it on Android itself) and then run this command on your Android device to verify that the compiled executable is working:

./esbuild --version

Does esbuild successfully print out the version when you follow those instructions?

@theaungmyatmoe
Copy link
Author

theaungmyatmoe commented Feb 13, 2021

Ok,I I have been built this repo and it working now.

make

is working as well like

GOOS="android" GOARCH="arm64" go build "-ldflags=-s -w" -o ./esbuild ./cmd/esbuild

@theaungmyatmoe
Copy link
Author

When I test this , it is not working for non-root user.
I am trying to give permission like chmod -R 777 project-dir not working.
It should work for non-root user.

> error: Cannot read directory "../../../../../..": permission denied

1 error

@evanw
Copy link
Owner

evanw commented Feb 13, 2021

Are you saying that running the command ./esbuild --version gives the permission denied error?

@theaungmyatmoe
Copy link
Author

theaungmyatmoe commented Feb 13, 2021

No sorry,
./esbuild test.js
Get access denied error.
Just watching the version of esbuild was not not give me error.

@evanw
Copy link
Owner

evanw commented Feb 14, 2021

The path resolver in esbuild currently assumes that it can traverse from the root directory to the current directory. I'm not a Unix permissions expert but I believe if that's not the case you'll get an EACCES permission denied error like this. If Android's file system permissions don't let you list the contents of one of the parent directories, then perhaps esbuild won't work on Android.

@theaungmyatmoe
Copy link
Author

In Android , root permission is need to find /.
By rooting the device , we can get the standard directory like /,/etc and etc.
If not we cannot access to the /.
So , directory permission is denied.
Eesbuild is search / directory to start.
So, esbuild is not work for non-root-user devices.
So,I cann solve by rooting to my device.
Rooting to my device is not necessary,if I rooted to device warranty is broken.
I think ESbuild should do in the current directory instead of start searching from /.

@samuelmtimbo
Copy link

I am sorry for reopening this, but I recently tried to setup an Android phone for Web Development with esbuild and got this same error, however, I was able to build esbuild from source directly on Android with no problem using the recommended script:

git clone --depth 1 --branch v0.9.6 https://github.com/evanw/esbuild.git
cd esbuild
go build ./cmd/esbuild

I am not sure if I am bringing new light to the matter.

esbuild has become a key piece in my development setup (thank you!), but since I am not able to install it normally via npm/yarn on Android, I am forced to run additional AD HOC steps (like building and copying it to node_modules/esbuild/bin).

Is it possible to include support for "android arm64 LE" on the normal npm/yarn installation flow?

@evanw
Copy link
Owner

evanw commented Mar 24, 2021

Yes this is now unblocked because #938 has since been fixed. It should now be possible to ship an Android build. I'll do this in an upcoming release.

@evanw evanw reopened this Mar 24, 2021
@evanw evanw closed this as completed in 3da3361 Mar 24, 2021
@mutheusalmeida
Copy link

Is there already a solution for that?

@evanw
Copy link
Owner

evanw commented Aug 17, 2021

Is there already a solution for that?

What do you mean? A solution for what? Support for ARM 64-bit Android was released a while ago in version 0.9.7.

@mutheusalmeida
Copy link

I'm still getting the same error

@mutheusalmeida
Copy link

Is there already a solution for that?

What do you mean? A solution for what? Support for ARM 64-bit Android was released a while ago in version 0.9.7.

What about the support for ARM 32-bit?

@theaungmyatmoe
Copy link
Author

Is there already a solution for that?

Yes it is working in aarch64android device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants