Skip to content

Work around XCode 14 issue with oj-introspect

Tan Le requested to merge workaround-oj-introspect-compilation-xcode-14 into main

What does this merge request do and why?

This MR adds a workaround for oj-introspect compile error with XCode 14.

Log output
❯ gem install oj-introspect -v 0.7.0
Building native extensions. This could take a while...
ERROR:  Error installing oj-introspect:
        ERROR: Failed to build gem native extension.

    current directory: /Users/tanle/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/oj-introspect-0.7.0/ext/oj-introspect
/Users/tanle/.asdf/installs/ruby/2.7.5/bin/ruby -I /Users/tanle/.asdf/installs/ruby/2.7.5/lib/ruby/site_ruby/2.7.0 extconf.rb
creating Makefile

current directory: /Users/tanle/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/oj-introspect-0.7.0/ext/oj-introspect
make DESTDIR\= sitearchdir\=./.gem.20221110-61802-1e0d94h sitelibdir\=./.gem.20221110-61802-1e0d94h clean

current directory: /Users/tanle/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/oj-introspect-0.7.0/ext/oj-introspect
make DESTDIR\= sitearchdir\=./.gem.20221110-61802-1e0d94h sitelibdir\=./.gem.20221110-61802-1e0d94h
compiling introspect.c
linking shared-object oj/introspect/introspect_ext.bundle
Undefined symbols for architecture arm64:
  "_oj_init_usual", referenced from:
      _rb_new_introspect_parser in introspect.o
  "_oj_parser_new", referenced from:
      _rb_new_introspect_parser in introspect.o
  "_oj_parser_set_option", referenced from:
      _rb_new_introspect_parser in introspect.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:262: introspect_ext.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/tanle/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/gems/oj-introspect-0.7.0 for inspection.
Results logged to /Users/tanle/.asdf/installs/ruby/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-22/2.7.0/oj-introspect-0.7.0/gem_make.out

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Tan Le

Merge request reports