[Git][ghc/ghc][master] 2 commits: bindists: Check for existence of share folder before trying to copy it.

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed May 22 17:41:40 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
4181aa40 by Andreas Klebinger at 2024-05-22T13:40:42-04:00
bindists: Check for existence of share folder before trying to copy it.

This folder isn't distributed in windows bindists

A lack of doing so resulted us copying loads of files twice.

- - - - -
d216510e by Matthew Pickering at 2024-05-22T13:40:42-04:00
Remove ad-hoc installation of mingw toolchain in relocatable bindists

This reverts 616ac30026e8dd7d2ebb98d92dde071eedf5d951

The choice about whether to install mingw is taken in the installation
makefile.

This is also broken on non-windows systems.

The actual issue was the EnableDistroToolchain variable wasn't declared
in mk/config.mk and therefore the check to install mingw was failing.

- - - - -


3 changed files:

- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- hadrian/src/Rules/BinaryDist.hs


Changes:

=====================================
hadrian/bindist/Makefile
=====================================
@@ -55,10 +55,11 @@ show:
 
 .PHONY: install_extra
 ifeq "$(EnableDistroToolchain)" "NO"
+ifeq "$(Windows_Host)" "YES"
 install_extra: install_mingw
-else
-install_extra:
 endif
+endif
+install_extra:
 
 .PHONY: install_bin
 ifeq "$(RelocatableBuild)" "YES"
@@ -211,10 +212,12 @@ install_docs:
 install_data:
 	@echo "Copying data to $(DESTDIR)share"
 	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
-	cd share; $(FIND) . -type f -exec sh -c \
-		'$(INSTALL_DIR) "$(DESTDIR)$(datadir)/`dirname $$1`" && \
-		$(INSTALL_DATA) "$$1" "$(DESTDIR)$(datadir)/`dirname $$1`"' \
-		sh '{}' ';';
+	if [ -d share ]; then \
+		cd share; $(FIND) . -type f -exec sh -c \
+			'$(INSTALL_DIR) "$(DESTDIR)$(datadir)/`dirname $$1`" && \
+			$(INSTALL_DATA) "$$1" "$(DESTDIR)$(datadir)/`dirname $$1`"' \
+			sh '{}' ';'; \
+	fi
 
 MAN_SECTION := 1
 MAN_PAGES := manpage/ghc.1


=====================================
hadrian/bindist/config.mk.in
=====================================
@@ -133,6 +133,7 @@ INSTALL_DIR     = $(INSTALL) -m 755 -d
 CrossCompiling        = @CrossCompiling@
 CrossCompilePrefix    = @CrossCompilePrefix@
 GhcUnregisterised     = @Unregisterised@
+EnableDistroToolchain = @SettingsUseDistroMINGW@
 
 # The THREADED_RTS requires `BaseReg` to be in a register and the
 # `GhcUnregisterised` mode doesn't allow that.
@@ -226,3 +227,4 @@ SettingsOptCommand = @SettingsOptCommand@
 SettingsLlvmAsCommand = @SettingsLlvmAsCommand@
 SettingsUseDistroMINGW = @SettingsUseDistroMINGW@
 
+


=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -135,8 +135,6 @@ bindistRules = do
         let ghcVersionPretty = "ghc-" ++ version ++ "-" ++ targetPlatform
         let prefix = cwd -/- root -/- "reloc-bindist" -/- ghcVersionPretty
         installTo Relocatable prefix
-        copyDirectory (root -/- "mingw") prefix
-        liftIO $ IO.removeDirectoryRecursive (prefix -/- "lib" -/- "mingw")
 
     phony "install" $ do
         need ["binary-dist-dir"]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c645fe406cd4a3f4c152e51dfbcdeeb5e2930fb1...d216510e43deca5a9a221d2b799face293e38299

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c645fe406cd4a3f4c152e51dfbcdeeb5e2930fb1...d216510e43deca5a9a221d2b799face293e38299
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240522/0f0dd600/attachment-0001.html>


More information about the ghc-commits mailing list