Skip to content

Commit d28ed47

Browse files
committed
Make bundled-gem extensions available to make html
After the rdoc bump in b5e6e0a, `tool/rdoc-srcdir` activates rdoc which declares `add_dependency 'rbs', '>= 4.0.0'`. Two issues blocked that activation on a clean tree: 1. tool/lib/bundled_gem.rb wrote gemspecs for C-extension bundled gems into .bundle/gems/<gem>/ instead of .bundle/specifications/, so RubyGems could not find rbs. Drop the branch and always publish to specifications/; the parallel .bundled.<gem>.gemspec files were only consumed by ext/extmk.rb's gemspec-copy rule and outdate-bundled-gems.rb's existence check, both removed here. 2. ext/configure-ext.mk was generated before prepare-gems populated .bundle/gems/, so template/configure-ext.mk.tmpl's `Dir.glob(".bundle/gems/**/extconf.rb")` found nothing and exts.mk lacked rules for bundled-gem extensions; rbs never compiled and RubyGems skipped its spec with "Ignoring rbs-4.0.2 because its extensions are not built." Add prepare-gems to configure-ext.mk's prerequisites. https://claude.ai/code/session_01YRoRyZPew2LtN6u6BX8bzx
1 parent b5e6e0a commit d28ed47

4 files changed

Lines changed: 5 additions & 25 deletions

File tree

common.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ $(EXTS_MK): ext/configure-ext.mk $(srcdir)/template/exts.mk.tmpl \
346346
$(srcdir)/template/exts.mk.tmpl --gnumake=$(gnumake) --configure-exts=ext/configure-ext.mk
347347

348348
ext/configure-ext.mk: $(PREP) all-incs $(MKFILES) $(RBCONFIG) $(LIBRUBY) \
349-
$(srcdir)/template/configure-ext.mk.tmpl update-default-gemspecs
349+
$(srcdir)/template/configure-ext.mk.tmpl update-default-gemspecs \
350+
$(HAVE_BASERUBY:yes=prepare-gems)
350351
$(ECHO) generating makefiles $@
351352
$(Q)$(MAKEDIRS) $(@D)
352353
$(Q)$(MINIRUBY) $(tooldir)/generic_erb.rb -o $@ -c \

ext/extmk.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -601,19 +601,6 @@ def create_makefile(*args, &block)
601601
clean-build_complete:
602602
-$(Q)$(RM) $(build_complete)
603603
604-
install: gemspec
605-
clean: clean-gemspec
606-
607-
gemspec = $(TARGET_TOPDIR)/specifications/$(gem).gemspec
608-
$(gemspec): $(gem_srcdir)/.bundled.$(gem).gemspec
609-
$(Q) $(MAKEDIRS) $(@D)
610-
$(Q) $(COPY) $(gem_srcdir)/.bundled.$(gem).gemspec $@
611-
612-
gemspec: $(gemspec)
613-
614-
clean-gemspec:
615-
-$(Q)$(RM) $(gemspec)
616-
617604
LN_S = #{config_string('LN_S')}
618605
CP_R = #{config_string('CP')} -r
619606
}

tool/lib/bundled_gem.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,8 @@ def prepare_test(spec, dir = ".")
7474
Gem.ensure_gem_subdirectories(dir)
7575
gem_dir = File.join(dir, "gems", target)
7676
yield gem_dir
77-
spec_dir = spec.extensions.empty? ? "specifications" : File.join("gems", target)
78-
if spec.extensions.empty?
79-
spec.dependencies.reject! {|dep| DEFAULT_GEMS_DEPENDENCIES.include?(dep.name)}
80-
end
81-
File.binwrite(File.join(dir, spec_dir, "#{target}.gemspec"), spec.to_ruby)
82-
unless spec.extensions.empty?
83-
spec.dependencies.clear
84-
File.binwrite(File.join(dir, spec_dir, ".bundled.#{target}.gemspec"), spec.to_ruby)
85-
end
77+
spec.dependencies.reject! {|dep| DEFAULT_GEMS_DEPENDENCIES.include?(dep.name)}
78+
File.binwrite(File.join(dir, "specifications", "#{target}.gemspec"), spec.to_ruby)
8679
if spec.bindir and spec.executables
8780
bindir = File.join(dir, "bin")
8881
Dir.mkdir(bindir) rescue nil

tool/outdate-bundled-gems.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ def each_directory
160160

161161
curdir.glob(".bundle/gems/*/") do |dir|
162162
base = File.basename(dir)
163-
unless curdir.exist?(".bundle/specifications/#{base}.gemspec") or
164-
curdir.exist?("#{dir}/.bundled.#{base}.gemspec")
163+
unless curdir.exist?(".bundle/specifications/#{base}.gemspec")
165164
curdir.rmdir(dir)
166165
end
167166
end

0 commit comments

Comments
 (0)