elm-format icon indicating copy to clipboard operation
elm-format copied to clipboard

No binaries are available for your platform: linux-arm64

Open os6sense opened this issue 2 years ago • 1 comments

Attempting to install and build on a linux based container on an M1 using 0.8.5:

       → error /app/node_modules/elm-format: Command failed.
       → Exit code: 1
       → Command: binwrap-install
       → Arguments: 
       → Directory: /app/node_modules/elm-format
       → Output:
       → /app/node_modules/binwrap/install.js:18
       →     throw new Error("No binaries are available for your platform: " + buildId);
       →     ^
       → 
       → Error: No binaries are available for your platform: linux-arm64
       →     at install (/app/node_modules/binwrap/install.js:18:11)
       →     at Object.install (/app/node_modules/binwrap/index.js:14:14)
       →     at Object.<anonymous> (/app/node_modules/binwrap/bin/binwrap-install:18:9)
       →     at Module._compile (node:internal/modules/cjs/loader:1103:14)
       →     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
       →     at Module.load (node:internal/modules/cjs/loader:981:32)
       →     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
       →     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
       →     at node:internal/main/run_main_module:17:47
       → info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

This is a slightly different scenario over running this on darwin-arm64 since here I'm attempting to build and run in a container.

os6sense avatar Apr 14 '22 19:04 os6sense

I have the same problem

Zeneixe avatar May 26 '22 10:05 Zeneixe

I'm trying to get linux-arm64 binaries build for the next release. Can anyone test running the aarch64 binary here: https://elm-format.avh4.net/manual/0.8.5-424-g9e071c6f/ and see if it works in the Linux ARM64 environment that they need it for?

avh4 avatar Feb 24 '23 06:02 avh4

Can anyone test running the aarch64 binary here:

Seems to be working well for me.

(I'm on M1 Mac using Docker Desktop and a linux container.)

$ uname -a
Linux 7bed0a212d7c 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

jsynacek avatar Feb 24 '23 12:02 jsynacek

Fixed in https://github.com/avh4/elm-format/pull/798 The next release (0.8.6) will include official linux-aarch64 static binaries.

Thanks @jsynacek for testing!

avh4 avatar Feb 25 '23 01:02 avh4

With the latest release, I still get the error... Maybe the problem is that the code checks for linux-arm64 while the binary is marked as linux-aarch64 ? This architecture check feels a bit redundant to say the least. It's just elm tooling that has this problem, I haven't run into anything like that with other npm packages. Why would elm tooling care about the architecture, anyway? The binaries work, though.

jsynacek avatar Mar 02 '23 19:03 jsynacek

This works for me, on Linux 712344e8f084 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 GNU/Linux:

npm install --save-dev elm-tooling
npx elm-tooling init
npx elm-tooling install
./node_modules/.bin/elm-format

You need elm-tooling >= 1.13.0.

This also works for me:

npm install --save-dev elm-format
./node_modules/.bin/elm-format

Is it one of those that you're having problems with?

avh4 avatar Mar 02 '23 19:03 avh4

@jsynacek You can see the values that Node.js uses for the architecture here: https://nodejs.org/api/process.html#processarch

You can run this to see what the values are for your platform: node -p '[process.platform, process.arch]'

elm-tooling (and the [email protected] npm package) checks the os+architecture because different compiled binaries only work on certain os+arch combinations. For example, a Windows binary does not work on Linux. A Linux x86_64 (x64 using Node.js’ values) binary does not work on Linux aarch64 (arm64 using Node.js’ values).

Most npm packages are written in JavaScript (an interpreted language), so they don’t need to think about architectures. elm-format is written in Haskell (a compiled language), and elm-tooling and the [email protected] npm package only distribute pre-compiled executables.

Also, next time, it’d be very helpful if you posted the error message you got from the get go.

Edit: Looks like me and @avh4 replied at the same time :)

lydell avatar Mar 02 '23 19:03 lydell

Ok, I created a minimal package.json with the following content and it works for me:

{
    "name": "test-app",
    "version": "1.0.0",
    "devDependencies": {
      "elm-format": "^0.8.6",
      "elm-tooling": "^1.13.0",
      "elm": "0.19.1-4"
    }
}

So I guess there must be something else in the real package.json that keeps dragging in the old dependencies.

Also, next time, it’d be very helpful if you posted the error message you got from the get go.

Sorry about not being clearer. When I wrote "With the latest release, I still get the error...", for some reason I thought it was clear that "the error" was the original error from the description.

Anyway, thank you all for the help and for the new release!

jsynacek avatar Mar 03 '23 07:03 jsynacek