[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Hadrian: fix library install paths in bindist Makefile (#16498)

Marge Bot gitlab at gitlab.haskell.org
Wed Apr 10 03:07:38 UTC 2019



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
fe40ddd9 by Sylvain Henry at 2019-04-09T16:50:15Z
Hadrian: fix library install paths in bindist Makefile (#16498)

GHC now works out-of-the-box (i.e. without any wrapper script) by
assuming that @bin@ and @lib@ directories sit next to each other. In
particular, its RUNPATH uses $ORIGIN-based relative path to find the
libraries.

However, to be good citizens we want to support the case where @bin@ and
@lib@ directories (respectively BINDIR and LIBDIR) don't sit next to
each other or are renamed. To do that the install script simply creates
GHC specific @bin@ and @lib@ siblings directories into:

   LIBDIR/ghc-VERSION/{bin,lib}

Then it installs wrapper scripts into BINDIR that call the appropriate
programs into LIBDIR/ghc-VERSION/bin/.

The issue fixed by this patch is that libraries were not installed into
LIBDIR/ghc-VERSION/lib but directly into LIBDIR.

- - - - -
9acdc4c0 by Ben Gamari at 2019-04-09T16:56:38Z
gitlab: Bump cabal-install version used by Windows builds to 2.4

Hopefully fixes Windows Hadrian build.

- - - - -
a240f145 by Joachim Breitner at 2019-04-10T03:07:30Z
GHC no longer ever defines TABLES_NEXT_TO_CODE on its own

It should be entirely the responsibility of make/Hadrian to ensure that
everything that needs this flag gets it. GHC shouldn't be hardcoded to
assist with bootstrapping since it builds other things besides itself.

Reviewers:

Subscribers: TerrorJack, rwbarton, carter

GHC Trac Issues: #15548 -- progress towards but not fix

Differential Revision: https://phabricator.haskell.org/D5082 -- extract
from that

- - - - -
0f532329 by Ryan Scott at 2019-04-10T03:07:32Z
Use ghc-prim < 0.7, not <= 0.6.1, as upper version bounds

Using `ghc-prim <= 0.6.1` is somewhat dodgy from a PVP point of view,
as it makes it awkward to support new minor releases of `ghc-prim`.
Let's instead use `< 0.7`, which is the idiomatic way of expressing
PVP-compliant upper version bounds.

- - - - -


10 changed files:

- .gitlab-ci.yml
- .gitlab/win32-init.sh
- compiler/main/DynFlags.hs
- compiler/main/SysTools.hs
- ghc/ghc-bin.cabal.in
- hadrian/src/Rules/BinaryDist.hs
- libraries/base/base.cabal
- libraries/ghc-compact/ghc-compact.cabal
- libraries/ghc-heap/ghc-heap.cabal.in
- libraries/integer-gmp/integer-gmp.cabal


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -4,6 +4,10 @@ variables:
   # Commit of ghc/ci-images repository from which to pull Docker images
   DOCKER_REV: cefaee3c742af193e0f7783f87edb0d35374515c
 
+  # Sequential version number capturing the versions of all tools fetched by
+  # .gitlab/win32-init.sh.
+  WINDOWS_TOOLCHAIN_VERSION: 1
+
 before_script:
   - python3 .gitlab/fix-submodules.py
   - git submodule sync --recursive
@@ -525,7 +529,7 @@ validate-x86_64-windows-hadrian:
   variables:
     MSYSTEM: MINGW64
   cache:
-    key: x86_64-windows-hadrian
+    key: "x86_64-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
 
 nightly-i386-windows-hadrian:
   extends: .build-windows-hadrian
@@ -535,7 +539,7 @@ nightly-i386-windows-hadrian:
     variables:
       - $NIGHTLY
   cache:
-    key: i386-windows-hadrian
+    key: "i386-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
 
 .build-windows-make:
   extends: .build-windows
@@ -571,7 +575,7 @@ validate-x86_64-windows:
     MSYSTEM: MINGW64
     CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
   cache:
-    key: x86_64-windows
+    key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
 
 # Normal Windows validate builds are profiled; that won't do for releases.
 release-x86_64-windows:
@@ -592,7 +596,7 @@ release-i386-windows:
     BUILD_FLAVOUR: "perf"
     CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
   cache:
-    key: i386-windows
+    key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
 
 nightly-i386-windows:
   extends: .build-windows-make
@@ -603,7 +607,7 @@ nightly-i386-windows:
     MSYSTEM: MINGW32
     CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
   cache:
-    key: i386-windows
+    key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
 
 ############################################################
 # Cleanup


=====================================
.gitlab/win32-init.sh
=====================================
@@ -27,7 +27,8 @@ if [ ! -e $toolchain/bin/ghc ]; then
 fi
 
 if [ ! -e $toolchain/bin/cabal ]; then
-    curl https://www.haskell.org/cabal/release/cabal-install-2.2.0.0/cabal-install-2.2.0.0-i386-unknown-mingw32.zip > /tmp/cabal.zip
+    url="https://downloads.haskell.org/~cabal/cabal-install-latest/cabal-install-2.4.1.0-x86_64-unknown-mingw32.zip"
+    curl $url > /tmp/cabal.zip
     unzip /tmp/cabal.zip
     mv cabal.exe $toolchain/bin
 fi


=====================================
compiler/main/DynFlags.hs
=====================================
@@ -58,7 +58,7 @@ module DynFlags (
         fFlags, fLangFlags, xFlags,
         wWarningFlags,
         dynFlagDependencies,
-        tablesNextToCode, mkTablesNextToCode,
+        tablesNextToCode,
         makeDynFlagsConsistent,
         shouldUseColor,
         shouldUseHexWordLiterals,


=====================================
compiler/main/SysTools.hs
=====================================
@@ -199,15 +199,9 @@ initSysTools top_dir
        let unreg_gcc_args = if targetUnregisterised
                             then ["-DNO_REGS", "-DUSE_MINIINTERPRETER"]
                             else []
-           -- TABLES_NEXT_TO_CODE affects the info table layout.
-           tntc_gcc_args
-            | mkTablesNextToCode targetUnregisterised
-               = ["-DTABLES_NEXT_TO_CODE"]
-            | otherwise = []
            cpp_args= map Option (words cpp_args_str)
            gcc_args = map Option (words gcc_args_str
-                               ++ unreg_gcc_args
-                               ++ tntc_gcc_args)
+                               ++ unreg_gcc_args)
        ldSupportsCompactUnwind <- getBooleanSetting "ld supports compact unwind"
        ldSupportsBuildId       <- getBooleanSetting "ld supports build-id"
        ldSupportsFilelist      <- getBooleanSetting "ld supports filelist"


=====================================
ghc/ghc-bin.cabal.in
=====================================
@@ -58,7 +58,7 @@ Executable ghc
         Build-depends:
             containers     >= 0.5 && < 0.7,
             deepseq        == 1.4.*,
-            ghc-prim       >= 0.5.0 && <= 0.6.1,
+            ghc-prim       >= 0.5.0 && < 0.7,
             ghci           == @ProjectVersionMunged@,
             haskeline      == 0.7.*,
             time           >= 1.8 && < 1.10,


=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -86,6 +86,12 @@ you can simply do:
   ./configure --prefix=<path> [... other configure options ...]
   make install
 
+In order to support @bin@ and @lib@ directories that don't sit next to each
+other, the install script:
+   * installs programs into @LIBDIR/ghc-VERSION/bin@
+   * installs libraries into @LIBDIR/ghc-VERSION/lib@
+   * installs the wrappers scripts into @BINDIR@ directory
+
 -}
 
 bindistRules :: Rules ()
@@ -268,6 +274,7 @@ bindistMakefile = unlines
     , "install: install_mingw update_package_db"
     , ""
     , "ActualBinsDir=${ghclibdir}/bin"
+    , "ActualLibsDir=${ghclibdir}/lib"
     , "WrapperBinsDir=${bindir}"
     , ""
     , "# We need to install binaries relative to libraries."
@@ -288,10 +295,10 @@ bindistMakefile = unlines
     , ""
     , "LIBRARIES = $(wildcard ./lib/*)"
     , "install_lib:"
-    , "\t at echo \"Copying libraries to $(libdir)\""
-    , "\t$(INSTALL_DIR) \"$(libdir)\""
+    , "\t at echo \"Copying libraries to $(ActualLibsDir)\""
+    , "\t$(INSTALL_DIR) \"$(ActualLibsDir)\""
     , "\tfor i in $(LIBRARIES); do \\"
-    , "\t\tcp -R $$i \"$(libdir)/\"; \\"
+    , "\t\tcp -R $$i \"$(ActualLibsDir)/\"; \\"
     , "\tdone"
     , ""
     , "INCLUDES = $(wildcard ./include/*)"
@@ -317,9 +324,9 @@ bindistMakefile = unlines
     , "\t$(foreach p, $(BINARY_NAMES),\\"
     , "\t\t$(call installscript,$p,$(WrapperBinsDir)/$p," ++
       "$(WrapperBinsDir),$(ActualBinsDir),$(ActualBinsDir)/$p," ++
-      "$(libdir),$(docdir),$(includedir)))"
+      "$(ActualLibsDir),$(docdir),$(includedir)))"
     , ""
-    , "PKG_CONFS = $(wildcard $(libdir)/package.conf.d/*)"
+    , "PKG_CONFS = $(wildcard $(ActualLibsDir)/package.conf.d/*)"
     , "update_package_db:"
     , "\t at echo \"Updating the package DB\""
     , "\t$(foreach p, $(PKG_CONFS),\\"


=====================================
libraries/base/base.cabal
=====================================
@@ -95,7 +95,7 @@ Library
         UnliftedFFITypes
         Unsafe
 
-    build-depends: rts == 1.0, ghc-prim >= 0.5.1.0 && <= 0.6.1
+    build-depends: rts == 1.0, ghc-prim >= 0.5.1.0 && < 0.7
 
     -- sanity-check to ensure exactly one flag is set
     if !((flag(integer-gmp) && !flag(integer-simple)) || (!flag(integer-gmp) && flag(integer-simple)))


=====================================
libraries/ghc-compact/ghc-compact.cabal
=====================================
@@ -36,7 +36,7 @@ library
     UnboxedTuples
     CPP
 
-  build-depends: ghc-prim   >= 0.5.3 && <= 0.6.1,
+  build-depends: ghc-prim   >= 0.5.3 && < 0.7,
                  base       >= 4.9.0 && < 4.14,
                  bytestring >= 0.10.6.0
   ghc-options: -Wall


=====================================
libraries/ghc-heap/ghc-heap.cabal.in
=====================================
@@ -23,7 +23,7 @@ library
   default-language: Haskell2010
 
   build-depends:    base             >= 4.9.0 && < 5.0
-                  , ghc-prim         > 0.2 && <= 0.6.1
+                  , ghc-prim         > 0.2 && < 0.7
                   , rts              == 1.0.*
 
   ghc-options:      -Wall


=====================================
libraries/integer-gmp/integer-gmp.cabal
=====================================
@@ -58,7 +58,7 @@ library
     StandaloneDeriving
     UnboxedTuples
     UnliftedFFITypes
-  build-depends:       ghc-prim >= 0.5.1.0 && <= 0.6.1
+  build-depends:       ghc-prim >= 0.5.1.0 && < 0.7
   hs-source-dirs:      src/
   -- We need to set the unit ID to integer-wired-in
   -- (without a version number) as it's magic.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/8e81d0ca39594f1c9ab1fb00ac80ef6a2cd85cb9...0f53232902b383977541ad6ae0622934329219a7

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/8e81d0ca39594f1c9ab1fb00ac80ef6a2cd85cb9...0f53232902b383977541ad6ae0622934329219a7
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/20190409/8e04ae58/attachment-0001.html>


More information about the ghc-commits mailing list