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

Ben Gamari pushed to branch ghc-9.10 at Glasgow Haskell Compiler / GHC Commits: 0cdf476d by Matthew Pickering at 2025-04-17T16:35:17-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 (cherry picked from commit 383c01a8928779920b4edea2f9d886ff303b8bd3) - - - - - 1 changed file: - hadrian/bindist/Makefile Changes: ===================================== hadrian/bindist/Makefile ===================================== @@ -168,7 +168,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" ; \ @@ -196,7 +196,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 @@ -212,7 +212,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 '{}' ';'; \ @@ -234,7 +234,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/0cdf476d3878ede6f5cf26a2226e8798... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0cdf476d3878ede6f5cf26a2226e8798... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Ben Gamari (@bgamari)