oj dependency breaks support for JRuby

Open
#1,461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
67/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
json, ruby
Domain
build-system

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.

Description

devtools-gardener

Issue summary

Before opening this issue, I have:

  • Upgraded to the latest version of the package
    • shopify_api version:
    • Ruby version:
    • Operating system:
  • [ ] Set log_level: :debug in 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

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

  1. Run gem install shopify_api on 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.

Dominant language
Ruby
Stars
1.1k
Forks
484
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Shopify/shopify-api-ruby

All issues in Shopify/shopify-api-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.