Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions defs/gmake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,21 @@ $(srcdir)/gems/%.gem:
extract-gems: | $(patsubst %,$(srcdir)/.bundle/gems/%,$(bundled-gems))
extract-gems: | $(call foreach-bundled-gems-rev,bundled-gem-extracted)

# Docs targets call $(RDOC) -> tool/rdoc-srcdir, which loads rdoc/rdoc and
# activates its `add_dependency 'rbs', '>= 4.0.0'`. Activation requires
# the bundled rbs gem to be discoverable and its C extension built. The
# existing per-bundled-gem Makefile generated by ext/extmk.rb does both
# (extension build + copy of .bundled.rbs-*.gemspec into
# .bundle/specifications/), but only if ext/configure-ext.mk has seen
# `.bundle/gems/` populated when its template's
# `Dir.glob(".bundle/gems/**/extconf.rb")` runs. On a clean tree
# prepare-gems may not have run yet, so make the dep explicit for the
# docs goals. Other targets are left alone so a plain `make` doesn't
# reach for prepare-gems -> update-gems (network).
ifneq ($(filter rdoc rdoc:% html html-server rdoc-coverage undocumented docs install install-all install-doc install-html install-rdoc reinstall,$(MAKECMDGOALS)),)
ext/configure-ext.mk: $(HAVE_BASERUBY:yes=prepare-gems)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Run prepare-gems when RDOC_DEPENDS is empty

When the docs workflow invokes make XRUBY=ruby RDOC_DEPENDS= RBCONFIG=update-rbconfig ... rdoc-coverage/html (checked in .github/workflows/check_misc.yml), the html and rdoc-coverage targets no longer depend on main/srcs-doc, so ext/configure-ext.mk is not requested at all. Adding prepare-gems only as a prerequisite of ext/configure-ext.mk therefore never runs in that CI path, leaving a clean tree able to load rdoc/rdoc before the bundled rbs gem is extracted and built—the failure this change is meant to fix still occurs for the documented workflow.

Useful? React with 👍 / 👎.

endif

$(srcdir)/.bundle/gems/%: $(srcdir)/gems/%.gem | .bundle/gems
$(ECHO) Extracting bundle gem $*...
$(Q) $(BASERUBY) -C "$(srcdir)" \
Expand Down
7 changes: 4 additions & 3 deletions tool/update-deps
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,13 @@ def read_make_deps(cwd)
next if /libyjit.o\z/ =~ target.to_s # skip YJIT Rust object (no corresponding C source)
next if /libzjit.o\z/ =~ target.to_s # skip ZJIT Rust object (no corresponding C source)
next if /target\/release\/libruby.o\z/ =~ target.to_s # skip YJIT+ZJIT Rust object (no corresponding C source)
next if /\.bundle\// =~ target.to_s
next if /\A\./ =~ target.to_s # skip rules such as ".c.o"
#p [curdir, target, deps]
dir = curdir || dirstack.last
dependencies[dir + target] ||= []
dependencies[dir + target] |= deps.map {|dep| dir + dep }
key = dir + target
next if /\.bundle\// =~ key.to_s # bundled gem extensions manage their own depend files
dependencies[key] ||= []
dependencies[key] |= deps.map {|dep| dir + dep }
elsif data_base_end
curdir = nil
elsif directory_leave
Expand Down
Loading