Skip to content

Commit b70cf97

Browse files
committed
Use rbs-integrated RDoc (ruby#16940)
Bump rdoc to the rbs-integrated revision and let bundled gem specs always be published under .bundle/specifications/ so RDoc's activation of rbs works during make html. Two issues blocked `make html` after the rdoc bump: 1. tool/lib/bundled_gem.rb routed gemspecs of bundled gems with C extensions into .bundle/gems/<gem>/ instead of .bundle/specifications/. RubyGems looked at the standard location and could not activate rbs as a runtime dependency of rdoc. Drop that branch and always write to .bundle/specifications/; the parallel .bundled.<gem>.gemspec files (consumed only by extmk.rb's gemspec copy rule and outdate-bundled-gems.rb's existence check) are no longer needed. 2. ext/configure-ext.mk was generated before prepare-gems populated .bundle/gems/, so the template's `Dir.glob(".bundle/gems/**/extconf.rb")` found nothing on a clean tree and exts.mk lacked rules for bundled-gem extensions. Add prepare-gems to its prerequisites so the bundled-gem directories exist when the template runs. https://claude.ai/code/session_01YRoRyZPew2LtN6u6BX8bzx
1 parent 1c55ad8 commit b70cf97

5 files changed

Lines changed: 6 additions & 26 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
}

gems/bundled_gems

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ostruct 0.6.3 https://github.com/ruby/ostruct
3737
pstore 0.2.1 https://github.com/ruby/pstore
3838
benchmark 0.5.0 https://github.com/ruby/benchmark
3939
logger 1.7.0 https://github.com/ruby/logger
40-
rdoc 7.2.0 https://github.com/ruby/rdoc bc0baee787609f2205e8f1103f3e1d36b923184a
40+
rdoc 7.2.0 https://github.com/ruby/rdoc 1f93543615928b6d45357432f16ec6006e2d8b1e
4141
win32ole 1.9.3 https://github.com/ruby/win32ole
4242
irb 1.18.0 https://github.com/ruby/irb
4343
reline 0.6.3 https://github.com/ruby/reline

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)