diff options
author | eileencodes <eileencodes@gmail.com> | 2024-05-01 15:17:20 -0400 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-26 19:11:23 +0900 |
commit | 0f9e50b8c5554d5a6a3f19044d0c9e276b7d414b (patch) | |
tree | 4d6a55a477a1f2f305ebaef4ee450190e7274c87 /template | |
parent | 508f3310481c34fe146bcd6775041847d40520c9 (diff) | |
download | ruby-0f9e50b8c5554d5a6a3f19044d0c9e276b7d414b.tar.gz |
Fix macos bug deleting too many files
Since #10209 we've been noticing that on macos after running `make
clean` the `coroutine/arm64/Context.S` file is missing, causing
subsequent make calls to fail because `Context.S` is needed to build
`Context.o`.
The reason this is happening is because macos is case-insensitive so the
`.s` looks for `coroutine/arm64/Context.s` and finds
`coroutine/arm64/Context.s`. This does not happen on linux because the
filesystem is case sensitive.
I attempted to use `find` because it is case sensitive regardless of
filesystem, but it was a lot slower than `rm` since we can't pass
multiple file names the same way to `find`.
Reverting this small part of #10209 fixes the issue for macos and it
wasn't clear that those changes were strictly necessary for the rest of
the PR.
We changed the original code to use `rm` instead of `delete` because it
is not standarized on POSIX.
Diffstat (limited to 'template')
-rw-r--r-- | template/Makefile.in | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/template/Makefile.in b/template/Makefile.in index 813a727cf9..22148e7fea 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -493,9 +493,8 @@ clean-local:: enc/encinit.c enc/encinit.$(OBJEXT) $(pkgconfig_DATA) \ ruby-runner.$(OBJEXT) ruby-runner.h \ || $(NULLCMD) - @$(RM) $(ALLOBJS:.$(OBJEXT)=.bc) - @$(RM) $(ALLOBJS:.$(OBJEXT)=.i) - @$(RM) $(ALLOBJS:.$(OBJEXT)=.s) + $(Q)find . ! -type d \( -name '*.bc' -o -name '*.[is]' \) -exec rm -f {} + || true + distclean-local:: $(Q)$(RM) \ |