Skip to content

Commit 4ebc1a2

Browse files
committed
Scope prepare-gems dep to docs goals only
Per @chatgpt-codex-connector review on #4: making ext/configure-ext.mk unconditionally depend on prepare-gems meant plain \`make\`/\`main\` builds would chain into update-gems, which fetches bundled-gem archives over the network. That breaks offline builds on a fresh checkout and mutates the source tree in a way unrelated to the requested target. Move the dep to defs/gmake.mk under a MAKECMDGOALS filter for the docs targets (rdoc, rdoc:%, html, html-server, rdoc-coverage), which are the only ones whose recipes need bundled-gem extensions activatable. Plain \`make\` no longer pulls the prepare-gems chain. Verified: - \`make -n html\` shows "Extracting bundle gem ..." lines - \`make -n\` (plain) shows no extraction or download - \`rm -rf .bundle && make html\` still completes (13895 items) https://claude.ai/code/session_01YRoRyZPew2LtN6u6BX8bzx
1 parent 1662ca0 commit 4ebc1a2

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

common.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ $(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 \
350-
$(HAVE_BASERUBY:yes=prepare-gems)
349+
$(srcdir)/template/configure-ext.mk.tmpl update-default-gemspecs
351350
$(ECHO) generating makefiles $@
352351
$(Q)$(MAKEDIRS) $(@D)
353352
$(Q)$(MINIRUBY) $(tooldir)/generic_erb.rb -o $@ -c \

defs/gmake.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,15 @@ $(srcdir)/gems/%.gem:
358358
extract-gems: | $(patsubst %,$(srcdir)/.bundle/gems/%,$(bundled-gems))
359359
extract-gems: | $(call foreach-bundled-gems-rev,bundled-gem-extracted)
360360

361+
# When building docs, ensure bundled gems are extracted before
362+
# ext/configure-ext.mk is generated, since its template enumerates
363+
# bundled-gem extensions via Dir.glob(".bundle/gems/**/extconf.rb").
364+
# Scoped to docs goals so plain `make` doesn't reach for the network
365+
# via prepare-gems -> update-gems on a fresh checkout.
366+
ifneq ($(filter rdoc rdoc\:% html html-server rdoc-coverage,$(MAKECMDGOALS)),)
367+
ext/configure-ext.mk: $(HAVE_BASERUBY:yes=prepare-gems)
368+
endif
369+
361370
$(srcdir)/.bundle/gems/%: $(srcdir)/gems/%.gem | .bundle/gems
362371
$(ECHO) Extracting bundle gem $*...
363372
$(Q) $(BASERUBY) -C "$(srcdir)" \

0 commit comments

Comments
 (0)