You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had no issues getting my Rust extension working locally, but one of the issues I ran into was using the cross-compile action. Once I got the build working, the resulting gem packages were built with the precompiled binary in a path like lib/my_gem/3.0/my_gem.bundle. This is incompatible with the extconf.rb generated by Bundler. The local build generates lib/my_gem/my_gem.bundle.
# lib/my_gem/extconf.rb as generated by Bundler# frozen_string_literal: truerequire_relative"my_gem/version"require_relative"my_gem/my_gem"moduleMyGemclassError < StandardError;endend
# lib/my_gem/extconf.rb# frozen_string_literal: truerequire_relative"my_gem/version"# Tries to require the extension for the given Ruby version firstbeginRUBY_VERSION =~ /(\d+\.\d+)/require"my_gem/#{Regexp.last_match(1)}/my_gem"rescueLoadErrorrequire_relative"my_gem/my_gem"endmoduleMyGemclassError < StandardError;endend
EDIT: Looks like specifying a single Ruby version target gets you the standard my_gem/my_gem.bundle, multiple gets you the subdirectories. Understandable, but worth mentioning.
The text was updated successfully, but these errors were encountered:
I had no issues getting my Rust extension working locally, but one of the issues I ran into was using the cross-compile action. Once I got the build working, the resulting gem packages were built with the precompiled binary in a path like
lib/my_gem/3.0/my_gem.bundle
. This is incompatible with theextconf.rb
generated by Bundler. The local build generateslib/my_gem/my_gem.bundle
.I saw that
wasmtime
seemed to have the same problem, and they fixed it like so:EDIT: Looks like specifying a single Ruby version target gets you the standard
my_gem/my_gem.bundle
, multiple gets you the subdirectories. Understandable, but worth mentioning.The text was updated successfully, but these errors were encountered: