canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.63k stars 635 forks source link

Google Closure Compiler on Mac with M3 chip #4146 Running Multipass #3403

Closed ssg3d closed 6 months ago

ssg3d commented 6 months ago

I have also filed the same issue here https://github.com/google/closure-compiler/issues/4146.

I use Multipass to run an Ubuntu 22.04 VM on the Mac with an Apple M3 Pro chip. From within my Ubuntu VM, I install the Google Closure Compiler by sudo npm install -g google-closure-compiler. It gets installed, but running it does nothing. e.g., invoking google-closure-compiler without any params should make it read the stdin, but it simply exits. Any other argument like google-closure-compiler abc xyz also exits without any errors reported.

If this is not a Multipass issue, apologies in advance and please reject this issue.

sharder996 commented 6 months ago

Hey @ssg3d, since you're on a M3 try installing 1.13.1. There were some issues with QEMU that should be fixed. It doesn't seem like that is the issue here, but it's good to try. Since you don't have any logs or error message, I can't say what this might be otherwise. I'm going to close this issue, but if you find a problem with Multipass, feel free to reopen or create a new issue.

For the record, I tried installing google-closure-compiler using on a vm with Linux host and had no issues like you described.

ssg3d commented 6 months ago

Hi @sharder996, thanks for the help.

I installed 1.13.1, but still have the same issue: calling google-closure-compiler does nothing. Checking multipass version in Mac terminal:

me@mymachine ~ % multipass --version
multipass   1.13.1+mac
multipassd  1.13.1+mac

Also, note that while inside the ubuntu instance terminal, I installed the closure compiler using sudo npm install -g google-closure-compiler, and that my node version is v20.11.0 and npm version is 10.4.0.

sharder996 commented 6 months ago

Try sudo apt install default-jre and then try invoking google-closure-compiler.

sharder996 commented 6 months ago

I did some more investigation and a teammate found what most likely is the problem. The issue seems to be coming from the arm64 version of google-closure-compiler. Its calling java jar /usr/local/lib/node_modules/google-closure-compiler/node_modules/google-closure-compiler-java/compiler.jar and since the java runtime environment doesn't exist in the base image, nothing happens. I'd recommend filing a bug at https://github.com/google/closure-compiler-npm.

ssg3d commented 6 months ago

Thanks @sharder996 for the analysis. Filed https://github.com/google/closure-compiler-npm/issues/301.

ssg3d commented 6 months ago

Try sudo apt install default-jre and then try invoking google-closure-compiler.

Thank you @sharder996, it works after installing default-jre.