Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup invalid dylib id reference on mac #414

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion gem/lib/rb_sys/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def create_rust_makefile(target, &blk)
full_cargo_command = cargo_command(srcdir, builder)

global_rustflags = []
global_rustflags << "--cfg=rb_sys_gem" unless builder.use_cargo_build
# Re-enable if this causes issues, but it should be fine and it prevents unnecessary recompilation
# global_rustflags << "--cfg=rb_sys_gem" unless builder.use_cargo_build
global_rustflags << "--cfg=rb_sys_use_stable_api_compiled_fallback" if builder.use_stable_api_compiled_fallback?

make_install = +<<~MAKE
Expand Down Expand Up @@ -134,6 +135,7 @@ def create_rust_makefile(target, &blk)

install-so: $(DLLIB) #{timestamp_file("sitearchdir")}
\t$(ECHO) installing $(DLLIB) to $(RUBYARCHDIR)
\t#{fixup_libnames}
\t$(Q) $(MAKEDIRS) $(RUBYARCHDIR)
\t$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)

Expand Down Expand Up @@ -278,6 +280,12 @@ def force_install_rust_toolchain?(builder)
find_executable("cargo").nil?
end

def fixup_libnames
return unless find_executable("install_name_tool")

'$(Q) install_name_tool -id "" $(DLLIB)'
end

def if_eq_stmt(a, b)
if $nmake
"!IF #{a.inspect} == #{b.inspect}"
Expand Down
Loading