From fc4dac7942f923816bc51918a2390c66656ad2bd Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Tue, 17 Sep 2024 18:57:08 +0100 Subject: [PATCH] Invoke `POSTLINK` script in mkmf to support codesign on macos (#423) --- examples/rust_reverse/ext/rust_reverse/Cargo.toml | 3 +++ gem/lib/rb_sys/mkmf.rb | 2 ++ 2 files changed, 5 insertions(+) diff --git a/examples/rust_reverse/ext/rust_reverse/Cargo.toml b/examples/rust_reverse/ext/rust_reverse/Cargo.toml index 080afca8..60f3d0b2 100644 --- a/examples/rust_reverse/ext/rust_reverse/Cargo.toml +++ b/examples/rust_reverse/ext/rust_reverse/Cargo.toml @@ -16,3 +16,6 @@ crate-type = ["cdylib"] default = ["stable-api-compiled-testing"] test-feature = [] stable-api-compiled-testing = ["rb-sys/stable-api-compiled-testing"] + +[profile.release] +debug = true diff --git a/gem/lib/rb_sys/mkmf.rb b/gem/lib/rb_sys/mkmf.rb index c340d061..c2bb0997 100644 --- a/gem/lib/rb_sys/mkmf.rb +++ b/gem/lib/rb_sys/mkmf.rb @@ -102,6 +102,7 @@ def create_rust_makefile(target, &blk) RUSTLIBDIR = $(RB_SYS_FULL_TARGET_DIR)/$(RB_SYS_CARGO_PROFILE_DIR) RUSTLIB = $(RUSTLIBDIR)/$(SOEXT_PREFIX)$(TARGET_NAME).$(SOEXT) TIMESTAMP_DIR = . + POSTLINK = #{RbConfig::CONFIG["POSTLINK"] || "$(ECHO) skipping postlink (not found)"} CLEANOBJS = $(RUSTLIBDIR) $(RB_SYS_BUILD_DIR) CLEANLIBS = $(DLLIB) $(RUSTLIB) @@ -132,6 +133,7 @@ def create_rust_makefile(target, &blk) $(DLLIB): $(RUSTLIB) \t$(Q) $(COPY) "$(RUSTLIB)" $@ + \t$(Q) $(POSTLINK) install-so: $(DLLIB) #{timestamp_file("sitearchdir")} \t$(ECHO) installing $(DLLIB) to $(RUBYARCHDIR)