[commit: ghc] master: build system: Persist CrossCompiling in binary distributions (a7eeb60)

git at git.haskell.org git at git.haskell.org
Sun Feb 26 21:18:36 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a7eeb607e62bb360327d834fc6dd5ea6195ae825/ghc

>---------------------------------------------------------------

commit a7eeb607e62bb360327d834fc6dd5ea6195ae825
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Sun Feb 26 15:32:59 2017 -0500

    build system: Persist CrossCompiling in binary distributions
    
    The build system uses the CrossCompiling variable to decide whether or
    not we should build various packages that must be built using the
    compiler.  Consequently, it is important that we persist its value in
    the binary distribution so we know during `make install` not to go
    looking for files that would have been built for these packages. Failing
    to do this causes #13325.
    
    Test Plan: Cross compile, `make binary-dist`, and try installing the
    binary distribution on the target
    
    Reviewers: hvr, austin, trofi, rwbarton
    
    Reviewed By: trofi, rwbarton
    
    Subscribers: carter, trofi, rwbarton, erikd, thomie, snowleopard, davean
    
    Differential Revision: https://phabricator.haskell.org/D3187


>---------------------------------------------------------------

a7eeb607e62bb360327d834fc6dd5ea6195ae825
 ghc.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/ghc.mk b/ghc.mk
index 19b0e49..b2888c0 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -1073,6 +1073,17 @@ endif
 
 BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
 
+# Note [Persist CrossCompiling in binary distributions]
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# The build system uses the CrossCompiling variable to decide whether or not we
+# should build various packages that must be built using the compiler.
+# Consequently, it is important that we persist its value in the binary
+# distribution so we know during `make install` not to go looking for files that
+# would have been built for these packages. Failing to do this causes #13325.
+#
+# See Note [No stage2 packages when CrossCompiling or Stage1Only].
+
 unix-binary-dist-prep:
 	$(call removeTrees,bindistprep/)
 	"$(MKDIRHIER)" $(BIN_DIST_PREP_DIR)
@@ -1083,6 +1094,8 @@ unix-binary-dist-prep:
 	echo "BUILD_MAN          = $(BUILD_MAN)"          >> $(BIN_DIST_MK)
 	echo "override ghc-cabal_INPLACE = utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" >> $(BIN_DIST_MK)
 	echo "UseSystemLibFFI    = $(UseSystemLibFFI)"    >> $(BIN_DIST_MK)
+# See Note [Persist CrossCompiling in binary distributions]
+	echo "CrossCompiling     = $(CrossCompiling)"     >> $(BIN_DIST_MK)
 	cd $(BIN_DIST_PREP_DIR) && autoreconf
 	$(call removeFiles,$(BIN_DIST_PREP_TAR))
 # h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
@@ -1484,6 +1497,11 @@ endif
 #    [5]. Therefore in this case we also have to exclude the stage2 packages
 #    from the build.
 #
+# Because we omit certain packages from the build when CrossCompiling=YES,
+# it is important that we remember the value of CrossCompiling in binary
+# distributions that we produce. See Note [Persist CrossCompiling in binary
+# distributions].
+#
 #  [1] find utils -name ghc.mk | xargs grep -l 'build-prog.*,2'
 #
 #  [2]



More information about the ghc-commits mailing list