Shopify / Shopify/shopify-api-ruby
oj dependency breaks support for JRuby
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 484
- PR merge metrics
- No merged PRs in 30d
Description
Issue summary
Before opening this issue, I have:
- Upgraded to the latest version of the package
shopify_apiversion:- Ruby version:
- Operating system:
[ ] Setlog_level: :debugin my configuration, if applicable- Found a reliable way to reproduce the problem that indicates it's a problem with the package
- Looked for similar issues in this repository
[ ] Checked that this isn't an issue with a Shopify API- If it is, please create a post in the Shopify community forums or report it to Shopify Partner Support
Expected behavior
The gem should install.
Actual behavior
The gem does not install because the oj dependency requires C extension support.
Steps to reproduce the problem
- Run
gem install shopify_apion JRuby
Debug logs
$ gem install shopify_api
Fetching oj-3.17.6.gem
Fetching shopify_api-16.3.0.gem
Fetching sorbet-runtime-0.6.13466.gem
Fetching openssl-4.0.2-java.gem
Fetching hash_diff-1.1.1.gem
Fetching httparty-0.24.2.gem
Successfully installed sorbet-runtime-0.6.13466
Successfully installed openssl-4.0.2-java
Building native extensions. This could take a while...
ERROR: Error installing shopify_api:
ERROR: Failed to build gem native extension.
current directory: /Users/headius/work/jruby/lib/ruby/gems/shared/gems/oj-3.17.6/ext/oj
The dependency on oj is both problematic and unnecessary; the json library has been greatly optimized over the past couple of years, and there's little reason to depend upon an external library anymore. Further, json also includes optimized support for JRuby.
I suggest removing the oj dependency and just using json.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported gem install shopify_api failure on JRuby and locate the project's oj dependency declaration and JSON usage. Confirm the dependency change preserves the existing behavior by running the available test suite and verifying that the gem installs successfully on JRuby.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json, ruby
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100