Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .github/actions/setup/directories/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ inputs:
Where binaries and other generated contents go. This will be
created if absent.

make-command:
required: false
type: string
default: 'make'
description: >-
The command of `make`.

makeup:
required: false
type: boolean
Expand Down Expand Up @@ -169,7 +176,7 @@ runs:
shell: bash
id: clean
run: |
echo distclean='make -C ${{ inputs.builddir }} distclean' >> $GITHUB_OUTPUT
echo distclean='cd ${{ inputs.builddir }} && ${{ inputs.make-command }} distclean' >> $GITHUB_OUTPUT
echo remained-files='find ${{ inputs.builddir }} -ls' >> $GITHUB_OUTPUT
[ "${{ inputs.builddir }}" = "${{ inputs.srcdir }}" ] ||
echo final='rmdir ${{ inputs.builddir }}' >> $GITHUB_OUTPUT
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ jobs:
with:
srcdir: src
builddir: build
make-command: nmake
clean: true

- name: Install tools with scoop
run: |
Expand Down
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ clean-capi distclean-capi realclean-capi:

clean-platform distclean-platform realclean-platform:
$(Q) $(RM) $(PLATFORM_D)
-$(Q) $(RMDIR) $(PLATFORM_DIR) 2> $(NULL) || $(NULLCMD)
-$(Q) $(RMDIR) $(PLATFORM_DIR) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD)

RUBYSPEC_CAPIEXT = spec/ruby/optional/capi/ext
RUBYSPEC_CAPIEXT_SRCDIR = $(srcdir)/$(RUBYSPEC_CAPIEXT)
Expand Down
6 changes: 3 additions & 3 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def self.default_command(meth = nil)

unless Bundler.settings[:default_cli_command]
Bundler.ui.info <<-MSG
In the feature version of Bundler, running `bundle` without argument will no longer run `bundle install`.
In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.
Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
If you wish to use feature behavior now with `bundle config set default_cli_command cli_help --global`
or you can continue to use the old behavior with `bundle config set default_cli_command install_or_cli_help --global`.
You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,
or you can continue to use the current behavior with `bundle config set default_cli_command install_or_cli_help --global`.
This message will be removed after a default_cli_command value is set.
MSG
end
Expand Down
4 changes: 2 additions & 2 deletions spec/bundler/bundler/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def out_with_macos_man_workaround
it "tries to installs by default but print help on missing Gemfile" do
bundle "", raise_on_error: false
expect(err).to include("Could not locate Gemfile")
expect(out).to include("In the feature version of Bundler")
expect(out).to include("In a future version of Bundler")

expect(out).to include("Bundler version #{Bundler::VERSION}").
and include("\n\nBundler commands:\n\n").
Expand All @@ -102,7 +102,7 @@ def out_with_macos_man_workaround
it "runs bundle install when default_cli_command set to install" do
bundle "config set default_cli_command install_or_cli_help"
bundle "", raise_on_error: false
expect(out).to_not include("In the feature version of Bundler")
expect(out).to_not include("In a future version of Bundler")
expect(err).to include("Could not locate Gemfile")
end
end
Expand Down
63 changes: 50 additions & 13 deletions win32/Makefile.sub
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ PWD = $(MAKEDIR)
empty =
tooldir = $(srcdir)/tool

PROMPT = +$$S

MAKEFLAGS = l$(MAKEFLAGS)

!ifndef MFLAGS
MFLAGS=-l
!endif
Expand Down Expand Up @@ -117,7 +121,7 @@ IFCHANGE = $(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat
RM = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat
RM1 = del
RMDIR = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
RMDIRS = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
RMDIRS = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat -p
RMALL = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat -f -r
MAKEDIRS = $(COMSPEC) /E:ON /C $(srcdir:/=\)\win32\makedirs.bat
TOUCH = $(BASERUBY) -run -e touch --
Expand Down Expand Up @@ -435,6 +439,7 @@ EXTSTATIC =

OBJEXT = obj
ASMEXT = asm
DLEXT = so

INSTALLED_LIST= .installed.list

Expand Down Expand Up @@ -872,7 +877,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
#define THREAD_IMPL_H "$(THREAD_IMPL_H)"
#define THREAD_IMPL_SRC "$(THREAD_IMPL_SRC)"
#define LOAD_RELATIVE 1
#define DLEXT ".so"
#define DLEXT ".$(DLEXT)"
!if "$(libdir_basename)" != "lib"
#define LIBDIR_BASENAME "$(libdir_basename)"
!endif
Expand Down Expand Up @@ -967,7 +972,7 @@ s,@LN_S@,$(LN_S),;t t
s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t
s,@RM@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat,;t t
s,@RMDIR@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,:t t
s,@RMDIRS@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,;t t
s,@RMDIRS@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat -p,;t t
s,@RMALL@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat -f -r,:t t
s,@MAKEDIRS@,$$(COMSPEC) /E:ON /C $$(top_srcdir:/=\)\win32\makedirs.bat,;t t
s,@LIBOBJS@,$(LIBOBJS),;t t
Expand All @@ -985,7 +990,7 @@ s,@STATIC@,$(STATIC),;t t
s,@CCDLFLAGS@,,;t t
s,@LDSHARED@,$(LDSHARED),;t t
s,@SOEXT@,dll,;t t
s,@DLEXT@,so,;t t
s,@DLEXT@,$(DLEXT),;t t
s,@LIBEXT@,lib,;t t
s,@STRIP@,$(STRIP),;t t
s,@ENCSTATIC@,$(ENCSTATIC),;t t
Expand Down Expand Up @@ -1165,14 +1170,44 @@ clean-local::
$(Q)$(RM) $(WINMAINOBJ) ext\extinit.c ext\extinit.$(OBJEXT) ext\vc*.pdb miniruby.lib
$(Q)$(RM) $(RUBY_INSTALL_NAME).res $(RUBYW_INSTALL_NAME).res $(RUBY_SO_NAME).res
$(Q)$(RM) miniruby.rc $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc
$(Q)$(RM) *.map *.pdb *.ilk *.exp $(RUBYDEF) ext\ripper\y.output
$(Q)$(RM) *.map *.pdb *.ilk *.exp *.dll $(RUBYDEF) ext\ripper\y.output

clean-local:: clean-prism

clean-prism:
@for /R $(PRISM_BUILD_DIR:/=\) %I in (.time) do @(del /q %I && $(RMDIRS) %~pI) 2> nul || $(NULLCMD)

distclean-local::
$(Q)$(RM) ext\config.cache $(RBCONFIG:/=\) $(CONFIG_H:/=\)
$(Q)$(RM) ext\config.cache $(RBCONFIG:/=\) $(CONFIG_H:/=\) miniprelude.c
-$(Q)$(RM) $(INSTALLED_LIST:/=\) $(arch_hdrdir:/=\)\ruby\config.h verconf.h
-$(Q)$(RMDIRS) $(arch_hdrdir:/=\)\ruby
-$(Q)$(RMDIR) win32

distclean-local:: clean-srcs-local
distclean-ext:: clean-srcs-ext

distclean-local:: distclean-prism

distclean-prism: clean-prism
!if "$(srcdir)" != "."
$(Q)for %I in ( \
$(PRISM_SRCDIR:/=\)\templates\ext\prism\*.c.erb \
$(PRISM_SRCDIR:/=\)\templates\include\prism\*.h.erb \
$(PRISM_SRCDIR:/=\)\templates\src\*.c.erb \
) do $(Q)(del /q prism\%~nI 2> nul || $(NULLCMD))
$(Q)for /D %I in (prism\*) do $(Q)$(RMDIRS) %I
$(Q)$(RMDIRS) prism
!endif

realclean-prism: distclean-prism
!if "$(srcdir)" == "."
$(Q)for %I in ( \
$(PRISM_SRCDIR:/=\)\templates\ext\prism\*.c.erb \
$(PRISM_SRCDIR:/=\)\templates\include\prism\*.h.erb \
$(PRISM_SRCDIR:/=\)\templates\src\*.c.erb \
) do $(Q)(del /q $(PRISM_SRCDIR:/=\)\%~nI 2> nul || $(NULLCMD))
!endif

.bundle/clean:: .bundle/clean.sub
.bundle/distclean:: .bundle/distclean.sub
.bundle/realclean:: .bundle/realclean.sub
Expand All @@ -1182,7 +1217,7 @@ distclean-local::
.bundle/realclean.sub:: ext/realclean.mk

ext/clean.mk ext/distclean.mk ext/realclean.mk::
$(Q)if exist $(EXTS_MK) $(MAKE) -k -f $(EXTS_MK) top_srcdir=$(srcdir) $(*F)
$(Q)if exist $(EXTS_MK) $(MAKE) $(MFLAGS) -k -f $(EXTS_MK) top_srcdir=$(srcdir) $(*F)

ext/clean.sub ext/distclean.sub ext/realclean.sub \
.bundle/clean.sub .bundle/distclean.sub .bundle/realclean.sub::
Expand All @@ -1192,16 +1227,18 @@ ext/clean.sub ext/distclean.sub ext/realclean.sub \
call set n=%I && \
call set n=%n:%CD%\$(@D)\=% && \
call set n=%n:\.=% && \
call echo $(@F)ing %n:\=/% & \
$(MAKE) $(MFLAGS) $(@F) & \
call echo $(@F:.sub=)ing %n:\=/% & \
$(MAKE) $(MFLAGS) $(@F:.sub=) & \
cd %CD% & \
$(RMDIRS) %I \
))) || @
))) || $(NULLCMD)

ext/distclean ext/realclean .bundle/distclean .bundle/realclean::
$(Q)cd $(@D) 2>nul && (for /R $(EXTS) %I in (exts.mk*) \
do $(Q)(del %I & rmdir %~dpI)) || @
-$(Q)rmdir $(@D) 2> nul || @
$(Q)(for /D /R $(@D) %I in (.) do $(Q)$(RMDIRS) %I) || $(NULLCMD)

.bundle/distclean .bundle/realclean::
$(Q)for /D %I in ($(@D)\*) do $(Q)$(RMDIRS) %I || $(NULLCMD)
-$(Q)rmdir $(@D) 2> nul || $(NULLCMD)

.bundle/realclean::
@$(RMALL) $(tooldir)/bunlder/*.lock $(srcdir)/.bundle
Expand Down
68 changes: 57 additions & 11 deletions win32/rm.bat
Original file line number Diff line number Diff line change
@@ -1,18 +1,64 @@
@echo off
@setlocal EnableExtensions DisableDelayedExpansion || exit /b -1

set prog=%~n0
set dryrun=
set recursive=
set debug=
set error=0
set parent=

:optloop
if "%1" == "-f" shift
if "%1" == "-r" (shift & set "recursive=1" & goto :optloop)
if "%1" == "--debug" (shift & set PROMPT=$E[34m+$E[m$S & echo on & goto :optloop)
if "%1" == "-n" (shift & set "dryrun=%1" & goto :optloop)
if "%1" == "-r" (shift & set "recursive=%1" & goto :optloop)
if "%1" == "--debug" (shift & set "debug=%1" & set PROMPT=$E[34m+$E[m$S & echo on & goto :optloop)
:begin
if "%1" == "" goto :end
set p=%1
set p=%p:/=\%
if exist "%p%" del /q "%p%" > nul
if "%recursive%" == "1" for /D %%I in (%p%) do (
rd /s /q %%I
)
shift
if "%1" == "" goto :EOF
set p=%1
shift
set p=%p:/=\%
call :remove %p%
goto :begin
:end

:remove
setlocal

::- Split %1 by '?' and '*', wildcard characters
for /f "usebackq delims=?* tokens=1*" %%I in ('%1') do (set "par=%%I" & set "sub=%%J")
if "%sub%" == "" goto :remove_plain
if "%sub:\=%" == "%sub%" goto :remove_plain
::- Extract the first wildcard
set "q=%1"
call set "q=%%q:%par%=%%"
set q=%q:~0,1%

::- `delims` chars at the beginning are removed in `for`
if "%sub:~0,1%" == "\" (
set "sub=%sub:~1%"
set "par=%par%%q%"
) else (
for /f "usebackq delims=\\ tokens=1*" %%I in ('%sub%') do (set "par=%par%%q%%%I" & set "sub=%%J")
)

::- Recursive search
for /d %%D in (%par%) do (
call :remove %sub% %2%%D\
)
goto :remove_end
:remove_plain
set p=%2%1
if not exist "%1" goto :remove_end
if not "%dryrun%" == "" (
echo Removing %p:\=/%
goto :remove_end
)
::- Try `rd` first for symlink to a directory; `del` attemps to remove all
::- files under the target directory, instead of the symlink itself.
(rd /q "%p%" || del /q "%p%") 2> nul && goto :remove_end

if "%recursive%" == "-r" for /D %%I in (%p%) do (
rd /s /q %%I || call set error=%%ERRORLEVEL%%
)
:remove_end
endlocal & set "error=%error%" & goto :EOF
6 changes: 5 additions & 1 deletion win32/rmdirs.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
@echo off
@setlocal EnableExtensions DisableDelayedExpansion || exit /b -1
if "%1" == "-p" shift
set parents=1
:optloop
if "%1" == "--debug" (shift & set PROMPT=$E[34m+$E[m$S & echo on & goto :optloop)
if "%1" == "-p" (shift & (set parents=1) & goto :optloop)
:begin
if "%1" == "" goto :end
set dir=%1
Expand All @@ -12,6 +15,7 @@ if "%1" == "" goto :end
if "%dir%" == "." goto :begin
if "%dir%" == ".." goto :begin
rd "%dir%" 2> nul || goto :begin
if "%parents%" == "" goto :begin
:trim_sep
if not /%dir:~-1%/ == /\/ goto :trim_base
set dir=%dir:~0,-1%
Expand Down