Allow installing in folder with space in name#11590
Conversation
make install4f5dc36 to
cce0f57
Compare
|
This seems correct to me, but I'd like @dra27's review, please.
|
dra27
left a comment
There was a problem hiding this comment.
The fix to man/Makefile is clearly correct (thanks!)
Other changes we've been making have been trying to move away from using shell constructs and the dancing with bash-isms, not to mention having to worry about locales at all, makes me very nervous about the other change. We have been stung - at considerable loss of time both to the original reporter and to those who had to reproduce and fix it - by the vagaries of shell commands being sensitive to user locales, and GNU make (like ISO C!) has the benefit of being evaluated in the C locale.
The test can fairly easily be kept in make, just by taking advantage of make -C <dir> -f <Makefile> to do the change of directory. I tested the idea in dra27@83b1238 which works both on Windows and macOS (I installing this over the top of a 4.12 installation). The crux of it is that the install:: target becomes:
.PHONY: install
# Ensure any pre-4.13 lowercased artefacts are removed on macOS and Windows
install::
@$(MAKE) -C '$(INSTALL_LIBDIR)' -f '$(realpath Makefile.check-stale)' \
EXT=.cmi \
'ARTEFACTS=$(wildcard stdlib__*.cmi)' \
'INSTALL_LIBDIR=$(INSTALL_LIBDIR)'which makes a recursive call in the target directory and the GNU make definition for $(stale) is expanded into MAkefile.check-stale as:
INSTALLED_ARTEFACTS = $(notdir $(wildcard stdlib__*$(EXT)))
STALE_ARTEFACTS = $(filter-out $(ARTEFACTS), $(INSTALLED_ARTEFACTS))
endifand now $(STALE_ARTEFACTS) will be non-empty if any files with the old casing are found. The "trick" is that using -C avoids the need for specifying paths with spaces in them inside a Makefile (which is impossible)
|
Ok so you want I commit your code with you as co-author ? |
|
If you're happy with that commit, sure - the main thing is that I think the check should be done using GNU make rather than using the shell, I just didn't want to suggest that before being sure that the solution actually worked (which is why I wrote the commit!) |
|
EXT=.cmi instead of .cm* is it for a reason ? Inlining it in the wildcard should be fine ? |
As in https://github.com/ocaml/ocaml/pull/10301/files#r746338143 🙂 |
|
A yes. Thx for reminder (it has been more than one year). |
Co-authored-by: David Allsopp <david.allsopp@metastack.com> Signed-off-by: Et7f3 <cadeaudeelie@gmail.com>
|
Since A |
|
Sorry for the delay getting back to you, @Et7f3 - there's consensus that we can take an even simpler route with |
|
CI is green |
Changes
Outdated
|
|
||
| ### Build system: | ||
| - #11590: Allow installing to a destination path containing spaces. | ||
| - #11590: Delete the check for mis-cased artefacts |
There was a problem hiding this comment.
I don't think change is necessary - the PR still primarily allows installation to a destination path containing spaces!
There was a problem hiding this comment.
Ok old commit 6ed82b5 I just reverted Changes
6ed82b5 to
f459b70
Compare
dra27
left a comment
There was a problem hiding this comment.
Good to go with CI, thanks!
Thanks for your patience with this one - I’m reasonably confident that the next ones won’t take quite so much “to and fro” 🙂
|
Is there any chance this could be backported to the 4.14 and 5.0 branches? |
|
Certainly fine for the |
|
We have found a version that test and doesn't fail with space in path. Do you want I restore it ? |
|
No, it's OK, thanks - we certainly won't back-port a fix we didn't merge! @Octachron - can I manually push the |
|
The |
- fix(build): Repair make install (in man/Makefile)
- fix(build): Repair make install (in man/Makefile)
|
Pushed to both, thanks! |
- fix(build): Repair make install (in man/Makefile)
- fix(build): Repair make install (in man/Makefile)
Hello,
As part of split of #10727 here a first step.
https://github.com/ocaml/ocaml/pull/10727/files#r748650610 comment associated.
This allow to install man page and be able to see it:
check-stale allow finer message. So it it a improvement on itself and it works with space in path.