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

Add support for arm64 on Linux #70

Closed
3 tasks done
maatthc opened this issue Nov 5, 2021 · 13 comments · Fixed by #100
Closed
3 tasks done

Add support for arm64 on Linux #70

maatthc opened this issue Nov 5, 2021 · 13 comments · Fixed by #100

Comments

@maatthc
Copy link

maatthc commented Nov 5, 2021

Pre issue-raising checklist

I have already (please mark the applicable with an x):

  • Upgraded to the latest version of the relevant libraries
  • Checked to see if the issue has already been raised
  • Created an executable example that demonstrates the issue using either:

Software versions

  • OS: aarch64 aarch64 aarch64 GNU/Linux

Expected behaviour

Would be nice to have support to aarch64 as Amazon and Oracle Cloud have good offers for instances on this platform.

Actual behaviour

Available executable are not compatible with ARM.

Steps to reproduce

Try to run any of the released packages on Arm-based AWS Graviton2 processors on EC2.

Relevent log files

Please ensure you set logging to DEBUG and attach any relevant log files here (or link from a gist).

@bethesque
Copy link
Member

Which part of the ruby standalone are you interested in using? eg. the pact broker CLI, or the pact mock service/verifier.

@maatthc
Copy link
Author

maatthc commented Nov 5, 2021

The ideal would be to have support to everything.

@bethesque
Copy link
Member

The reason I ask is that the mock service and verifier are being replaced in each of the languages by a shared rust lib, so the "pact" commands in the standalone are pretty much legacy now. The pact-broker CLI commands have their own docker image. So it would help to know which parts of the standalone you're using, and for which language, because they'll need to be solved differently.

@p0deje
Copy link

p0deje commented Nov 12, 2021

It would be nice to at least be able to install pact-node on Linux arm64 so that the images could be used on M1.

Right now it's impossible to build a Docker image for any JavaScript application that uses pact-node on newer MacBooks with M1 processors:

 => ERROR [builder 7/9] RUN yarn install  31.5s
...
#17 27.28 [5/5] Building fresh packages...
#17 30.20 error /app/node_modules/@pact-foundation/pact-node: Command failed.
#17 30.20 Exit code: 1
#17 30.20 Command: node postinstall.js
#17 30.20 Arguments:
#17 30.20 Directory: /app/node_modules/@pact-foundation/pact-node
#17 30.20 Output:
#17 30.20 /app/node_modules/@pact-foundation/pact-node/standalone/install.js:42
#17 30.20     throw new Error(chalk_1.default.red("Error while installing binary: " + msg));
#17 30.20     ^
#17 30.20
#17 30.20 Error: Error while installing binary: Cannot find binary for platform 'linux' with architecture 'arm64'.
#17 30.20     at throwError (/app/node_modules/@pact-foundation/pact-node/standalone/install.js:42:11)
#17 30.20     at getBinaryEntry (/app/node_modules/@pact-foundation/pact-node/standalone/install.js:290:11)
#17 30.20     at setup (/app/node_modules/@pact-foundation/pact-node/standalone/install.js:294:17)
#17 30.20     at /app/node_modules/@pact-foundation/pact-node/standalone/install.js:327:12
#17 30.20     at Object.<anonymous> (/app/node_modules/@pact-foundation/pact-node/postinstall.js:3:1)
#17 30.20     at Module._compile (internal/modules/cjs/loader.js:999:30)
#17 30.20     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
#17 30.20     at Module.load (internal/modules/cjs/loader.js:863:32)
#17 30.20     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
#17 30.20     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
#17 30.20     at internal/main/run_main_module.js:17:47
#17 30.20 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@bethesque
Copy link
Member

Travelling Ruby (what we use to package up the pact-ruby-standalone) is not being maintained any more, and is unlikely to ever be supported for M1. We're transitioning all the pact clients away from that and onto a shared rust library. The Rust library will be supported on M1 (but I don't know the timing on this). @mefellows and @TimothyJones might be able to add more information about this.

I believe theres is a work around for the M1 issue however, as one of my colleagues is currently running the standalone on her M1. Try searching in the pact-js issues or asking in the #pact-js Slack channel.

@mefellows
Copy link
Member

mefellows commented Nov 13, 2021

To run on node, you need to install it and run through Rosetta mode.

@mefellows
Copy link
Member

mefellows commented Nov 13, 2021

For "everything" support it will unlikely be possible via the standalone, as the maintainer of that library has basically stated they will no longer be adding major updates.

You could install the bits you need via rubygems or we could add arm support to the docker image (ruby itself can run on arm, so we'd just need to build an arm image).

@timReynolds
Copy link

For those trying to build an image which includes pact on M1 Macs you specify the platform;

docker build --platform linux/amd64  .

Solution is outline in detail here.

@SanjayaKumarSahoo
Copy link

Are we going to fix this issue, we are looking at this as urgent. Any help on this would be appreciable.

@TimothyJones
Copy link

Does the docker command that Tim linked above not work for you? What problems are you encountering?

@YOU54F
Copy link
Member

YOU54F commented Apr 18, 2023

☝🏾 to that linked issue, I have got some very alpha arm64 osx and linux standalone packages you can trial

https://github.com/YOU54F/pact-ruby-standalone/releases/tag/v3.1.2.2-alpha

Note these aren't official builds so your mileage might vary and you shouldn't rely on them at the moment until we get some feedback

Direct Download

curl -fsSL https://raw.githubusercontent.com/you54f/pact-ruby-standalone/ruby_3.2.2_upgrade/install.sh | bash

wget -q https://raw.githubusercontent.com/you54f/pact-ruby-standalone/ruby_3.2.2_upgrade/install.sh -O- | bash

Script here

https://github.com/YOU54F/pact-ruby-standalone/blob/ruby_3.2.2_upgrade/install.sh

HomeBrew

https://github.com/you54f/homebrew-pact-ruby-standalone

brew tap you54f/pact-ruby-standalone
brew install pact-ruby-standalone

FlatPak

https://github.com/YOU54F/flatpak

Scoop

scoop bucket add pact https://github.com/you54f/scoop
scoop install pact

https://github.com/YOU54F/scoop

## Choco

choco install pact --version=0.0.1

https://github.com/YOU54F/choco

@YOU54F
Copy link
Member

YOU54F commented Apr 18, 2023

Are we going to fix this issue, we are looking at this as urgent. Any help on this would be appreciable.

@SanjayaKumarSahoo what functionality are you requiring from the standalone package, that isn't available in other means?

Same question for @maatthc - you say support everything - we will do that in Rust, where it suits, but we need to know what in particular is of use to you currently in the Ruby package, that isn't in the Rust package.

Most of the functionality is available via other means, cross compiled for additional platforms (and rust makes it very easy to support new ones), the ruby packaging system in general doesn't lend itself well for the platforms/archs we now want to cover (there are lots more people working on the rust cross compiling that those working on packaging ruby apps standalone, x-platform)

@YOU54F
Copy link
Member

YOU54F commented Apr 29, 2023

You want it?

You got it!

See https://github.com/pact-foundation/pact-ruby-standalone/releases/tag/v2.0.0

Now, just don't break it 😂

@YOU54F YOU54F closed this as completed Apr 29, 2023
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.

8 participants