Try removing building C API specs in CRuby makefiles entirely

* Since it does not work when using some configure options such as:
  .../configure --with-ext=-test-/cxxanyargs,+ --enable-shared
  as the CI does.
* It also duplicates the logic of spec/ruby/optional/capi/spec_helper.rb incorrectly.
  ruby/spec maintainers have no experience and no interest in dealing with these complicated CRuby build system issues.
  We asked help on the CRuby Slack and nobody helped so far.
This commit is contained in:
Benoit Daloze 2025-05-09 21:44:44 +02:00
parent 29be534fad
commit 2a9236366d
Notes: git 2025-05-09 21:22:30 +00:00
2 changed files with 0 additions and 52 deletions

View file

@ -504,26 +504,6 @@ update-deps:
$(GIT) --git-dir=$(GIT_DIR) merge --no-edit --ff-only $(update_deps)
$(GIT) --git-dir=$(GIT_DIR) branch --delete $(update_deps)
# order-only-prerequisites doesn't work for $(RUBYSPEC_CAPIEXT)
# because the same named directory exists in the source tree.
$(RUBYSPEC_CAPIEXT)/%.$(DLEXT): $(srcdir)/$(RUBYSPEC_CAPIEXT)/%.c $(srcdir)/$(RUBYSPEC_CAPIEXT)/rubyspec.h $(RUBY_H_INCLUDES) $(LIBRUBY)
$(ECHO) building $@
$(Q) $(MAKEDIRS) $(@D)
$(Q) $(DLDSHARED) -L. $(XDLDFLAGS) $(XLDFLAGS) $(LDFLAGS) $(INCFLAGS) -I$(EXTOUT)/include $(CPPFLAGS) $(OUTFLAG)$@ $< $(LIBRUBYARG)
ifneq ($(POSTLINK),)
$(Q) $(POSTLINK)
endif
$(Q) $(RMALL) $@.*
RUBYSPEC_CAPIEXT_SO := $(patsubst %.c,$(RUBYSPEC_CAPIEXT)/%.$(DLEXT),$(notdir $(wildcard $(srcdir)/$(RUBYSPEC_CAPIEXT)/*.c)))
rubyspec-capiext: $(RUBYSPEC_CAPIEXT_SO)
@ $(NULLCMD)
ifeq ($(ENABLE_SHARED),yes)
ruby: $(if $(LIBRUBY_SO_UPDATE),$(RUBYSPEC_CAPIEXT_SO))
exts: rubyspec-capiext
endif
spec/%/ spec/%_spec.rb: programs exts PHONY
+$(RUNRUBY) -r./$(arch)-fake $(srcdir)/spec/mspec/bin/mspec-run -B $(srcdir)/spec/default.mspec $(SPECOPTS) $(patsubst %,$(srcdir)/%,$@)

View file

@ -1468,38 +1468,6 @@ loadpath: verconf.h
sed -e '1,/^const char ruby_initial_load_paths/d;/;/,$$d' \
-e '/^^ /!d;s/ *"\\\\0"$$//;s/" *"//g'
RUBYSPEC_CAPIEXT_SRCDIR = $(srcdir)/$(RUBYSPEC_CAPIEXT)
RUBYSPEC_CAPIEXT_DEPS = $(RUBYSPEC_CAPIEXT_SRCDIR)/rubyspec.h $(RUBY_H_INCLUDES) $(LIBRUBY)
RUBYSPEC_CAPIEXT_EXTS =
!if [echo>rubyspec-capiext.mk RUBYSPEC_CAPIEXT_EXTS = \]
!else if [for %I in ($(RUBYSPEC_CAPIEXT_SRCDIR)\*_spec.c) do \
@echo. $$(RUBYSPEC_CAPIEXT)/%~nI.so \>>rubyspec-capiext.mk]
!else if [echo. $$(empty)>>rubyspec-capiext.mk]
!else
! include rubyspec-capiext.mk
! if [del rubyspec-capiext.mk > nul]
! endif
!endif
$(RUBYSPEC_CAPIEXT_EXTS): $(RUBYSPEC_CAPIEXT_DEPS)
rubyspec-capiext: $(RUBYSPEC_CAPIEXT_EXTS)
@ $(NULLCMD)
{$(RUBYSPEC_CAPIEXT_SRCDIR)}.c{$(RUBYSPEC_CAPIEXT)}.so:
$(ECHO) building $(@F)
$(Q)$(MAKEDIRS) $(@D)
$(Q)(echo EXPORTS&&echo Init_$(*F))> $*.def
$(Q)$(LDSHARED) -Fe$(@) -Fo$(*).obj $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) $< $(LIBRUBYARG) -link $(DLDFLAGS) $(XLDFLAGS) $(LIBS) $(LOCAL_LIBS) -implib:$*.lib -pdb:$*.pdb -def:$*.def
!if defined(LDSHARED_0)
$(Q)$(LDSHARED_0)
$(Q)$(LDSHARED_1)
$(Q)$(LDSHARED_2)
!endif
$(Q)$(RM) $*.def $*.exp $*.lib $*.obj $*.pdb
exts: rubyspec-capiext
yesterday:
for /f "usebackq" %H in \
(`$(GIT) -C $(srcdir) log -1 "--before=00:00+0900" "--format=%H"`) do \