RevenueCat / purchases-kmp

RevenueCat SDK for Kotlin Multiplatform
MIT License
99 stars 3 forks source link

Attempts to fix ffi by downgrading to 1.16.3. #234

Closed JayShortway closed 1 month ago

JayShortway commented 1 month ago

Bug

We've been getting this error on CircleCI:

Your bundle is locked to ffi (1.17.0-arm64-darwin) from rubygems repository https://rubygems.org/ or installed locally, but that version can no longer be found in that source. That means the author of ffi (1.17.0-arm64-darwin) has removed it. You'll need to update your bundle to a version other than ffi (1.17.0-arm64-darwin) that hasn't been removed in order to install.

Cause

However, 1.17.0 is the latest version at the time of writing. Others have similar issues, e.g. see: https://github.com/ffi/ffi/issues/1105. It is mentioned in that thread that the platform specification in Gemfile.lock causes the issue. In our case, it also seems likely that the platform specification causes issues, as the error mentions darwin, but the CIrcleCI job runs in a Docker container.

Fix

The implemented fix is to downgrade to the version we use in purchases-ios: 1.16.3. (1.17.0 is the first version to introduce per-platform binaries.)

Alternative fix (not in this PR)

This fix is not in this PR, but documented in case the implemented fix doesn't work. In that case, we can try this next.

  1. Remove the any ffi lines from the original Gemfile.lock, except lines declaring a transitive dependency.
  2. Add force_ruby_platform to the Gemfile.
  3. Run bundle install.