Skip to content

Commit

Permalink
Ensure installed stdlib artefacts have correct case (#10301)
Browse files Browse the repository at this point in the history
* Ensure installed stdlib artefacts have correct case

* Abort install if stale artefacts found
  • Loading branch information
dra27 committed Apr 20, 2021
1 parent d50339d commit 2a969c0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Changes
Expand Up @@ -133,11 +133,12 @@ Working version
(Gabriel Scherer, review by Nicolás Ojeda Bär, Alain Frisch, Xavier Leroy,
Daniel Bünzli and Stephen Dolan)

* #10169, #10270: Use capitalized module names in the Standard Library prefixing
scheme to match Dune, e.g. Stdlib__String instead of Stdlib__string. This is a
breaking change only to code which attempted to use the internal names before.
The Standard Library generated by the Dune rules is now equivalent to the main
build (the Dune rules still do not generate a distributable compiler).
* #10169, #10270, #10301: Use capitalized module names in the Standard Library
prefixing scheme to match Dune, e.g. Stdlib__String instead of Stdlib__string.
This is a breaking change only to code which attempted to use the internal
names before. The Standard Library generated by the Dune rules is now
equivalent to the main build (the Dune rules still do not generate a
distributable compiler).
(David Allsopp and Mark Shinwell, review by Gabriel Scherer)

### Other libraries:
Expand Down
22 changes: 21 additions & 1 deletion stdlib/Makefile
Expand Up @@ -56,6 +56,16 @@ allopt: stdlib.cmxa std_exit.cmx
opt.opt: allopt

.PHONY: install
# Ensure any pre-4.13 lowercased artefacts are removed on macOS and Windows
install::
stale="$(filter-out $(notdir $(wildcard stdlib__*.cmi)), \
$(notdir $(wildcard $(INSTALL_LIBDIR)/stdlib__*.cmi)))"; \
if test -n "$$stale" ; then \
echo "$(INSTALL_LIBDIR) contains stale stdlib artefacts"; \
echo "Please rm $(INSTALL_LIBDIR)/stdlib__*.cm* and re-run make install"; \
exit 1; \
fi

install::
$(INSTALL_DATA) \
stdlib.cma std_exit.cmo *.cmi camlheader_ur \
Expand All @@ -81,7 +91,17 @@ endif
installopt: installopt-default

.PHONY: installopt-default
installopt-default:
# Ensure any pre-4.13 lowercased artefacts are removed on macOS and Windows
installopt-default::
stale="$(filter-out $(notdir $(wildcard stdlib__*.cmx)), \
$(notdir $(wildcard $(INSTALL_LIBDIR)/stdlib__*.cmx)))"; \
if test -n "$$stale" ; then \
echo "$(INSTALL_LIBDIR) contains stale stdlib artefacts"; \
echo "Please rm $(INSTALL_LIBDIR)/stdlib__*.cmx and re-run make install"; \
exit 1; \
fi

installopt-default::
$(INSTALL_DATA) \
stdlib.cmxa stdlib.$(A) std_exit.$(O) *.cmx \
"$(INSTALL_LIBDIR)"
Expand Down

0 comments on commit 2a969c0

Please sign in to comment.