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 x86_64-linux as a supported platform #565

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Add x86_64-linux as a supported platform #565

merged 1 commit into from
Mar 19, 2024

Conversation

george-ma
Copy link
Contributor

@george-ma george-ma commented Mar 15, 2024

What are you trying to accomplish?

Follow up to: #563
We’re encountering a platform incompatibility error when deploying on Shipit. Its platform is x86_64-linux while our bundle currently supports arm64-darwin-22 only.

Shipit deployment error in question
$ bundle install --frozen --jobs 4 --path /app/data/bundler --retry 2
pid: 30136
[DEPRECATED] The `--frozen` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local frozen 'true'`, and stop using this flag
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '/app/data/bundler'`, and stop using this flag
Your bundle only supports platforms ["arm64-darwin-22"] but your local platform
is x86_64-linux. Add the current platform to the lockfile with
`bundle lock --add-platform x86_64-linux` and try again.

What approach did you choose and why?

I went with the approach of running bundle lock --add-platform x86_64-linux as it was what was suggested from the shipit deployment error log. This added the x86_64-linux line to the Gemfile.lock which was seems to be fairly common in other public libraries under shopify:

@george-ma george-ma requested a review from kirs March 15, 2024 19:26
Copy link

@lastgabs lastgabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@george-ma can you please edit your commit message and your PR description to explain what is breaking without this line and why it's being added please?

@george-ma
Copy link
Contributor Author

george-ma commented Mar 15, 2024

EDIT: updated the original PR description

Adding this here as an additional thought as Gabi had linked me an example of a repo which
only had ruby listed under "platforms"

PLATFORMS
  ruby

this approach could potentially work too (ruby: Indicates that the gems are compatible with a standard Ruby platform) but as we wish to have the Gemfile.lock matching the behaviour of our local dev environment, I believe the current implementation of including both PLATFORMS individually is better as it matches the dev environment more closely- running bundle install is what added the arm64-darwin-22 line in #563

PLATFORMS
  arm64-darwin-22
  x86_64-linux

@george-ma george-ma requested a review from lastgabs March 15, 2024 21:24
@bettymakes
Copy link

bettymakes commented Mar 15, 2024

@george-ma The details you expanded on in the comment are useful in the PR description itself. How about restructuring your description using some headings to help better communicate the problem you're solving and the approach you're taking? You can elaborate on alternative approaches in the description too.

Suggested headings as helpful prompts:

  • What problem are you solving?
  • What approach did you choose and why?

(And also transfer that context in the commit message)

@george-ma george-ma force-pushed the add-x86_64-linux branch 2 times, most recently from f931b55 to a754b07 Compare March 15, 2024 23:15
Follow up to: #563
We’re encountering a platform incompatibility error when deploying on Shipit. Its platform is `x86_64-linux` while our bundle currently supports `arm64-darwin-22` only.

<details><summary>Shipit deployment error in question</summary>

```shell
$ bundle install --frozen --jobs 4 --path /app/data/bundler --retry 2
pid: 30136
[DEPRECATED] The `--frozen` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local frozen 'true'`, and stop using this flag
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '/app/data/bundler'`, and stop using this flag
Your bundle only supports platforms ["arm64-darwin-22"] but your local platform
is x86_64-linux. Add the current platform to the lockfile with
`bundle lock --add-platform x86_64-linux` and try again.
```

</details>

I went with the approach of running `bundle lock --add-platform x86_64-linux` as it was what was suggested from the shipit deployment error log. This added the `x86_64-linux` line to the `Gemfile.lock` which was seems to be fairly common in other public libraries under shopify:
  - https://github.com/Shopify/packwerk/blob/main/Gemfile.lock#L181-L185
  - https://github.com/Shopify/rbi/blob/236708902ab30eb23a335221e9a708e8d9b1eb44/Gemfile.lock#L86-L90
  - https://github.com/Shopify/oktakit/blob/17d5feb907c6a43f98bf8d5e543e12d1e4456baf/Gemfile.lock#L65-L68
@kirs
Copy link
Contributor

kirs commented Mar 19, 2024

this is blocking gem release: https://shipit.shopify.io/shopify/identity_cache/rubygems/deploys/2532515

I'm going to ship it.

@kirs kirs merged commit 9f636a9 into main Mar 19, 2024
5 checks passed
@kirs kirs deleted the add-x86_64-linux branch March 19, 2024 00:59
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 this pull request may close these issues.

None yet

4 participants