phoenixframework / esbuild

An installer for esbuild
MIT License
271 stars 38 forks source link

Can you please add armv7a to supported archs #43

Closed ewildgoose closed 2 years ago

ewildgoose commented 2 years ago

Hi, can you please add "armv7a" to your list of supported archs. This is the arch I need for my IMX7 arm 32bit board, which happens to be running a musl toolchain

The following patch works for me:

--- lib/esbuild.ex.orig
+++ lib/esbuild.ex
@@ -239,6 +239,7 @@
           # TODO: remove when we require OTP 24
           "arm" when osname == :darwin -> "darwin-arm64"
           "arm" -> "#{osname}-arm"
+          "armv7a" -> "#{osname}-arm"
           "armv7l" -> "#{osname}-arm"
           _ -> raise "esbuild is not available for architecture: #{arch_str}"
         end

Without this I see the error:

** (Mix) Could not start application esbuild: exited in: Esbuild.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (RuntimeError) esbuild is not available for architecture: armv7a-unknown-linux-musleabihf
            (esbuild 0.4.0) lib/esbuild.ex:243: Esbuild.target/0
            (esbuild 0.4.0) lib/esbuild.ex:128: Esbuild.bin_path/0
            (esbuild 0.4.0) lib/esbuild.ex:145: Esbuild.bin_version/0
            (esbuild 0.4.0) lib/esbuild.ex:75: Esbuild.start/2
            (kernel 8.2) application_master.erl:293: :application_master.start_it_old/4
josevalim commented 2 years ago

Please send a PR! :)

josevalim commented 2 years ago

Sorry, I went ahead and pushed something because I figured we should add a catch-all instead. :)

ewildgoose commented 2 years ago

Oh nice. I like your solution better!

Thanks. OK, noted for next time. I thought that a one liner was easier inline. Will always send a PR in future. Apologies and thanks for the pointer - appreciated!