summaryrefslogtreecommitdiff
path: root/libraries/integer-gmp
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@fb.com>2018-04-07 13:32:47 -0400
committerBen Gamari <ben@smart-cactus.org>2018-04-10 11:36:00 -0400
commit2534164aefd346c7c51b70e8e8c49aa881dd9f85 (patch)
treee97064090d49c1a214a9486549309c95ca54fb05 /libraries/integer-gmp
parent81e7980a015795209f8edbf298761df9c749a4b3 (diff)
downloadhaskell-2534164aefd346c7c51b70e8e8c49aa881dd9f85.tar.gz
Move gmp/config.mk.in to config.mk.in, fix #14972
Here's how the rube goldberg machine triggered the old bug: 1. If you have a file gmp/config.mk.in, then Cabal will create a generated file in $DIST/build/gmp/config.mk 2. When you attempt to load inplace integer-gmp via GHCi, it will ask gcc (aka clang on OS X) for the file name of 'gmp', with base directory set to $DIST/build 3. There is a folder named 'gmp', and so this folder is returned as the 'library' for gmp 4. GHCi loadArchive chokes to death trying to open a library that is actually a folder This patch solves the problem by breaking the chain at (1): if we don't put config.mk in a folder named gmp, NO PROBLEM. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: validate Reviewers: angerman, hvr, bgamari Reviewed By: angerman Subscribers: erikd, thomie, carter GHC Trac Issues: #14972 Differential Revision: https://phabricator.haskell.org/D4552
Diffstat (limited to 'libraries/integer-gmp')
-rw-r--r--libraries/integer-gmp/config.mk.in (renamed from libraries/integer-gmp/gmp/config.mk.in)4
-rw-r--r--libraries/integer-gmp/configure.ac2
-rw-r--r--libraries/integer-gmp/gmp/ghc.mk5
-rw-r--r--libraries/integer-gmp/integer-gmp.cabal7
4 files changed, 12 insertions, 6 deletions
diff --git a/libraries/integer-gmp/gmp/config.mk.in b/libraries/integer-gmp/config.mk.in
index 93a4f5369b..b66f94c5ad 100644
--- a/libraries/integer-gmp/gmp/config.mk.in
+++ b/libraries/integer-gmp/config.mk.in
@@ -1,3 +1,7 @@
+# NB: This file lives in the top-level integer-gmp folder, and not in
+# the gmp subfolder, because of #14972, where we MUST NOT create a
+# folder named 'gmp' in dist/build/
+
ifeq "$(HaveLibGmp)" ""
HaveLibGmp = @HaveLibGmp@
endif
diff --git a/libraries/integer-gmp/configure.ac b/libraries/integer-gmp/configure.ac
index 3aebeba5d5..1ccd48e698 100644
--- a/libraries/integer-gmp/configure.ac
+++ b/libraries/integer-gmp/configure.ac
@@ -106,7 +106,7 @@ AC_SUBST(GhcGmpVerMj)
AC_SUBST(GhcGmpVerMi)
AC_SUBST(GhcGmpVerPl)
-AC_CONFIG_FILES([integer-gmp.buildinfo gmp/config.mk include/HsIntegerGmp.h])
+AC_CONFIG_FILES([integer-gmp.buildinfo config.mk include/HsIntegerGmp.h])
dnl--------------------------------------------------------------------
dnl * Generate output files
diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk
index f18e27d1bb..2a9f3ebfc0 100644
--- a/libraries/integer-gmp/gmp/ghc.mk
+++ b/libraries/integer-gmp/gmp/ghc.mk
@@ -27,7 +27,6 @@ endif
ifneq "$(NO_CLEAN_GMP)" "YES"
$(eval $(call clean-target,gmp,,\
libraries/integer-gmp/include/ghc-gmp.h \
- libraries/integer-gmp/gmp/config.mk \
libraries/integer-gmp/gmp/libgmp.a \
libraries/integer-gmp/gmp/gmp.h \
libraries/integer-gmp/gmp/gmpbuild \
@@ -53,10 +52,10 @@ endif
ifeq "$(phase)" "final"
ifneq "$(CLEANING)" "YES"
-# Hack. The file gmp/config.mk doesn't exist yet after running ./configure in
+# Hack. The file config.mk doesn't exist yet after running ./configure in
# the toplevel (ghc) directory. To let some toplevel make commands such as
# sdist go through, right after ./configure, don't consider this an error.
--include libraries/integer-gmp/dist-install/build/gmp/config.mk
+-include libraries/integer-gmp/dist-install/build/config.mk
endif
gmp_CC_OPTS += $(addprefix -I,$(GMP_INCLUDE_DIRS))
diff --git a/libraries/integer-gmp/integer-gmp.cabal b/libraries/integer-gmp/integer-gmp.cabal
index 6edacea79c..d2f6e3cedf 100644
--- a/libraries/integer-gmp/integer-gmp.cabal
+++ b/libraries/integer-gmp/integer-gmp.cabal
@@ -26,16 +26,19 @@ extra-source-files:
config.sub
configure
configure.ac
- gmp/config.mk.in
+ config.mk.in
include/HsIntegerGmp.h.in
install-sh
integer-gmp.buildinfo.in
+-- NB: Many of these tmp files no longer ever actually get plopped in
+-- the root directory post Cabal 2.4, thanks to a change that causes
+-- autoconf/configure to get run inside the dist directory.
extra-tmp-files:
autom4te.cache
config.log
config.status
- gmp/config.mk
+ config.mk
integer-gmp.buildinfo
include/HsIntegerGmp.h