summaryrefslogtreecommitdiff
path: root/hadrian/bindist
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2020-01-17 11:15:26 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-09 02:54:28 -0500
commit3ae83da13f03d22a4d810b5d9c0f37f818cb6a00 (patch)
tree5b96251bc82f06fb42dfe5208800368db5e6e845 /hadrian/bindist
parenta906595f060b9c038332f16adaf664eeb1d50f2e (diff)
downloadhaskell-3ae83da13f03d22a4d810b5d9c0f37f818cb6a00.tar.gz
hadrian: Windows fixes (bindists, CI)
This commit implements a few Windows-specific fixes which get us from a CI job that can't even get as far as starting the testsuite driver, to a state where we can run the entire testssuite (but have test failures to fix). - Don't forget about a potential extension for the haddock program, when preparing the bindist. - Build the timeout program, used by the testsuite driver on Windows in place of the Python script used elsewhere, using the boot compiler. We could alternatively build it with the compiler that we're going to test but this would be a lot more tedious to write. - Implement a wrapper-script less installation procedure for Windows, in `hadrian/bindist/Makefile. - Make dependencies a bit more accurate in the aforementioned Makefile. - Update Windows/Hadrian CI job accordingly. This patch fixes #17486.
Diffstat (limited to 'hadrian/bindist')
-rw-r--r--hadrian/bindist/Makefile39
1 files changed, 25 insertions, 14 deletions
diff --git a/hadrian/bindist/Makefile b/hadrian/bindist/Makefile
index 79f9a9f2f2..d043cf2425 100644
--- a/hadrian/bindist/Makefile
+++ b/hadrian/bindist/Makefile
@@ -71,23 +71,38 @@ endef
.PHONY: install
-install: install_lib install_bin install_includes
-install: install_docs install_wrappers install_ghci
-install: install_mingw update_package_db
+
+ifeq "$(TargetOS_CPP)" "mingw32"
+install_bin: install_mingw install_bin_direct
+else
+install_bin: install_bin_libdir install_wrappers
+endif
+
+install: install_bin install_lib install_includes
+install: install_docs install_ghci update_package_db
ActualBinsDir=${ghclibdir}/bin
+ifeq "$(TargetOS_CPP)" "mingw32"
+ActualLibsDir=${ghclibdir}
+else
ActualLibsDir=${ghclibdir}/lib
+endif
WrapperBinsDir=${bindir}
# We need to install binaries relative to libraries.
BINARIES = $(wildcard ./bin/*)
-install_bin:
+install_bin_libdir:
@echo "Copying binaries to $(ActualBinsDir)"
$(INSTALL_DIR) "$(ActualBinsDir)"
for i in $(BINARIES); do \
cp -R $$i "$(ActualBinsDir)"; \
done
+install_bin_direct:
+ @echo "Copying binaries to $(WrapperBinsDir)"
+ $(INSTALL_DIR) "$(WrapperBinsDir)"
+ cp ./bin/* "$(WrapperBinsDir)/"
+
install_ghci:
@echo "Copying and installing ghci"
$(CREATE_SCRIPT) '$(WrapperBinsDir)/ghci'
@@ -105,7 +120,7 @@ install_lib:
INCLUDES = $(wildcard ./include/*)
install_includes:
- @echo "Copying libraries to $(includedir)"
+ @echo "Copying include files to $(includedir)"
$(INSTALL_DIR) "$(includedir)"
for i in $(INCLUDES); do \
cp -R $$i "$(includedir)/"; \
@@ -113,34 +128,30 @@ install_includes:
DOCS = $(wildcard ./docs/*)
install_docs:
- @echo "Copying libraries to $(docdir)"
+ @echo "Copying docs to $(docdir)"
$(INSTALL_DIR) "$(docdir)"
for i in $(DOCS); do \
cp -R $$i "$(docdir)/"; \
done
BINARY_NAMES=$(shell ls ./wrappers/)
-install_wrappers:
- @echo "Installing Wrapper scripts"
+install_wrappers: install_bin_libdir
+ @echo "Installing wrapper scripts"
$(INSTALL_DIR) "$(WrapperBinsDir)"
$(foreach p, $(BINARY_NAMES),\
$(call installscript,$p,$(WrapperBinsDir)/$p,$(WrapperBinsDir),$(ActualBinsDir),$(ActualBinsDir)/$p,$(ActualLibsDir),$(docdir),$(includedir)))
PKG_CONFS = $(shell find "$(ActualLibsDir)/package.conf.d" -name '*.conf' | sed 's: :xxx:g')
-update_package_db:
+update_package_db: install_bin install_lib
@echo "$(PKG_CONFS)"
@echo "Updating the package DB"
$(foreach p, $(PKG_CONFS),\
$(call patchpackageconf,$(shell echo $(notdir $p) | sed 's/-\([0-9]*[0-9]\.\)*conf//g'),$(shell echo "$p" | sed 's:xxx: :g'),$(docdir),$(shell realpath --relative-to="$(libdir)" "$(docdir)")))
'$(WrapperBinsDir)/ghc-pkg' recache
-# The 'foreach' that copies the mingw directory will only trigger a copy
-# when the wildcard matches, therefore only on Windows.
-MINGW = $(wildcard ./mingw)
install_mingw:
@echo "Installing MingGW"
$(INSTALL_DIR) "$(prefix)/mingw"
- $(foreach d, $(MINGW),\
- cp -R ./mingw "$(prefix)")
+ cp -R ./mingw "$(prefix)"
# END INSTALL
# ----------------------------------------------------------------------