[Git][ghc/ghc][wip/bindist-install] 2 commits: hadrian: Fix bindist installation on Darwin

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Aug 8 18:28:17 UTC 2022



Ben Gamari pushed to branch wip/bindist-install at Glasgow Haskell Compiler / GHC


Commits:
e7189622 by Ben Gamari at 2022-08-08T14:28:12-04:00
hadrian: Fix bindist installation on Darwin

It turns out that `cp -P` on Darwin does not always copy a symlink as
a symlink. In order to get these semantics one must pass `-RP`. It's not
entirely clear whether this is valid under POSIX, but it is nevertheless
what Apple does.

- - - - -
bec49e59 by Ben Gamari at 2022-08-08T14:28:12-04:00
gitlab-ci: Don't use coreutils on Darwin

In general we want to ensure that the tested environment is as similar
as possible to the environment the user will use. In the case of Darwin,
this means we want to use the system's BSD command-line utilities, not
coreutils.

This would have caught #21974.

- - - - -


3 changed files:

- .gitlab/darwin/toolchain.nix
- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in


Changes:

=====================================
.gitlab/darwin/toolchain.nix
=====================================
@@ -85,7 +85,6 @@ pkgs.writeTextFile {
     export PATH
     PATH="${pkgs.autoconf}/bin:$PATH"
     PATH="${pkgs.automake}/bin:$PATH"
-    PATH="${pkgs.coreutils}/bin:$PATH"
     export FONTCONFIG_FILE=${fonts}
     export XELATEX="${ourtexlive}/bin/xelatex"
     export MAKEINDEX="${ourtexlive}/bin/makeindex"


=====================================
hadrian/bindist/Makefile
=====================================
@@ -39,11 +39,11 @@ endif
 # of program names. For hadrian build this will work as programs have a
 # consistent naming procedure.
 define installscript
-	echo "installscript $1 -> $2"
+	@echo "$1 installed to $2";
 	@if [ -L 'wrappers/$1' ]; then                \
-		$(CP) -P 'wrappers/$1' '$2' ;             \
-	else								          \
-		rm -f '$2' && 		                      \
+		$(CP) -RP 'wrappers/$1' '$2' ;            \
+	else                                          \
+		rm -f '$2' &&                             \
 		$(CREATE_SCRIPT) '$2' &&                  \
 		echo "#!$(SHELL)" >>  '$2'  &&            \
 		echo "exedir=\"$4\"" >> '$2'  &&          \
@@ -57,7 +57,6 @@ define installscript
 		cat 'wrappers/$1' >> '$2'  &&             \
 		$(EXECUTABLE_FILE) '$2' ;                 \
 	fi
-	@echo "$1 installed to $2"
 endef
 
 # patchpackageconf


=====================================
hadrian/bindist/config.mk.in
=====================================
@@ -103,6 +103,8 @@ LN_S            = @LN_S@
 MV              = mv
 SED             = @SedCmd@
 SHELL           = @SHELL@
+RANLIB_CMD      = @RanlibCmd@
+STRIP_CMD       = @StripCmd@
 
 #
 # Invocations of `install' for different classes



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/db6501e91553278ff80889fedf17dff1f2b6c957...bec49e598bf1498ea1d5db66af8bef94e9caa448

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/db6501e91553278ff80889fedf17dff1f2b6c957...bec49e598bf1498ea1d5db66af8bef94e9caa448
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/20220808/f434405e/attachment-0001.html>


More information about the ghc-commits mailing list