[Git][ghc/ghc][master] bindist: Use complete relative paths when cding to directories

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Jun 22 14:43:15 UTC 2024



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


Commits:
383c01a8 by Matthew Pickering at 2024-06-22T10:42:08-04:00
bindist: Use complete relative paths when cding to directories

If a user has configured CDPATH on their system then `cd lib` may change
into an unexpected directory during the installation process.

If you write `cd ./lib` then it will not consult `CDPATH` to determine
what you mean.

I have added a check on ghcup-ci to verify that the bindist installation
works in this situation.

Fixes #24951

- - - - -


1 changed file:

- hadrian/bindist/Makefile


Changes:

=====================================
hadrian/bindist/Makefile
=====================================
@@ -169,7 +169,7 @@ install_lib: lib/settings
 	$(INSTALL_DIR) "$(DESTDIR)$(ActualLibsDir)"
 
 	@dest="$(DESTDIR)$(ActualLibsDir)"; \
-	cd lib; \
+	cd ./lib; \
 	for i in `$(FIND) . -type f`; do \
 		dir="`dirname $$i`" ; \
 		$(INSTALL_DIR) "$$dest/$$dir" ; \
@@ -197,7 +197,7 @@ install_docs:
 	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
 
 	if [ -d doc ]; then \
-		cd doc; $(FIND) . -type f -exec sh -c \
+		cd ./doc; $(FIND) . -type f -exec sh -c \
 			'$(INSTALL_DIR) "$(DESTDIR)$(docdir)/`dirname $$1`" && $(INSTALL_DATA) "$$1" "$(DESTDIR)$(docdir)/`dirname $$1`"' \
 			sh '{}' ';'; \
 	fi
@@ -213,7 +213,7 @@ install_data:
 	@echo "Copying data to $(DESTDIR)share"
 	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
 	if [ -d share ]; then \
-		cd share; $(FIND) . -type f -exec sh -c \
+		cd ./share; $(FIND) . -type f -exec sh -c \
 			'$(INSTALL_DIR) "$(DESTDIR)$(datadir)/`dirname $$1`" && \
 			$(INSTALL_DATA) "$$1" "$(DESTDIR)$(datadir)/`dirname $$1`"' \
 			sh '{}' ';'; \
@@ -235,7 +235,7 @@ export SHELL
 install_wrappers: install_bin_libdir install_hsc2hs_wrapper
 	@echo "Installing wrapper scripts"
 	$(INSTALL_DIR) "$(DESTDIR)$(WrapperBinsDir)"
-	for p in `cd wrappers; $(FIND) . ! -type d`; do \
+	for p in `cd ./wrappers; $(FIND) . ! -type d`; do \
 	    mk/install_script.sh "$$p" "$(DESTDIR)/$(WrapperBinsDir)/$$p" "$(WrapperBinsDir)" "$(ActualBinsDir)" "$(ActualBinsDir)/$$p" "$(ActualLibsDir)" "$(docdir)" "$(includedir)"; \
 	done
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/383c01a8928779920b4edea2f9d886ff303b8bd3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/383c01a8928779920b4edea2f9d886ff303b8bd3
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/20240622/8114351b/attachment-0001.html>


More information about the ghc-commits mailing list