This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 28 Oct, 2016 1 commit
    • Edsko de Vries's avatar
      Add support for foreign libraries. · 382143aa
      Edsko de Vries authored
      A stanza for a platform library looks something like
      
          platform-library test-package
            type:                native-shared
      
            if os(Windows)
              options: standalone
              mod-def-file: TestPackage.def
      
            other-modules:       MyPlatformLib.Hello
                                 MyPlatformLib.SomeBindings
            build-depends:       base >=4.7 && <4.9
            hs-source-dirs:      src
            c-sources:           csrc/MyPlatformLibWrapper.c
            default-language:    Haskell2010
      
      where native-shared means that we want to build a native shared library
      (.so on Linux, .dylib on OSX, .dll on Windows). The parser also
      recognizes native-static but this is not currently supported anywhere.
      The standalone option means that the we merge all library dependencies
      into the dynamic library (i.e., ghc options -shared -static), rather
      than make the created dynamic library just record its dependencies (ghc
      options -shared -dynamic); it is currently compulsory on Windows and
      unsupported anywhere else. The mod-def-file can be used to specify a
      module definition file, and is also Windows specific.
      
      There is a bit of refactoring in Build: gbuild is the old buildOrReplExe
      and now deals with both executables and platform libraries.
      382143aa
  2. 27 Oct, 2016 4 commits
  3. 26 Oct, 2016 23 commits
  4. 25 Oct, 2016 3 commits
    • Edward Z. Yang's avatar
      Drop version check when resolving package names. · af24cefe
      Edward Z. Yang authored
      
      
      In #4017, hvr reported that when he used --allow-older/--allow-newer,
      there was an assert failure in toConfiguredComponent.  Indeed
      the problem was that toConfiguredComponent was testing version
      ranges of build-depends to determine which package to select, but
      there was no satisfying one (since the build-depends field had
      not been updated.)
      
      After thinking about this for a bit, it seemed a bit bogus for
      us to be doing another version check at this late phase; we
      already picked dependencies earlier in the configuration process.
      So I decided to drop it.
      
      To drop it, however, I needed to remove support for a feature (discussed
      in #4020), which uses version ranges to disambiguate whether or not a
      dependency is on an external package or an internal package.  This
      feature doesn't seem to be very useful.  If someone asks, I'll
      check on Hackage to see if anyone is using it.
      
      Also added some useful extra debug info.
      
      Fixes #4020 and #4017
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      af24cefe
    • Edward Z. Yang's avatar
      Don't use installedPkgs for internal library library dirs. · a1107e21
      Edward Z. Yang authored
      In 1.24, installedPkgs contained only references to the external package
      database, not any internal libraries. In particular, when we built a
      dynamically linked executable, installedPkgs did NOT have a reference to
      the internal library; instead, depLibraryPaths has a special case
      (hasInternalDeps) to add the final libdir to the RPATH.
      
      In HEAD, after 0d15edef
      
      , we started adding internal libraries (with the
      INPLACE registrations) to installedPkgs to fix #2971.  But depLibraryPaths
      was not updated, which means that the inplace registrations got picked
      up and added to the RPATH, resulting in bad temporary directories
      showing up in RPATHs.
      
      In this commit, we just filter out internal entries from installedPkgs
      and compute the library dirs for them from scratch (this code already
      existed, so no loss!)
      
      Fixes #4025.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      a1107e21
    • Edward Z. Yang's avatar
      Force gen-extra-source-files to use pre-installed library. · c8ac9dac
      Edward Z. Yang authored
      
      
      Without a package qualified import, runhaskell will attempt to
      load all of Cabal from source, because the files happen to
      be named in the same way as the import requests.  That leads
      to very slow runtimes.
      
      Fixes #4007.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      c8ac9dac
  5. 24 Oct, 2016 1 commit
  6. 23 Oct, 2016 1 commit
    • Erik de Castro Lopo's avatar
      Fix CPP usage · d916298f
      Erik de Castro Lopo authored
      The code had a mixtire of `#ifdef mingw32_HOST_OS` and `#if`. The later
      works but is not really correct. GHC HEAD has just got a new warning flag
      `-Wcpp-undef` which will warn on `#if` used with an undefined identifier.
      Since we want to turn that on in the GHC build system we need to fix cabal
      first.
      d916298f
  7. 21 Oct, 2016 3 commits
  8. 20 Oct, 2016 3 commits
    • Edward Z. Yang's avatar
      Only consider dependencies in closure when computing -I on hsc2hs · b736896a
      Edward Z. Yang authored
      
      
      Previously, we unconditionally blasted in all packages, even
      if our component didn't actually depend on them.
      This fixes #2971.
      
      Also, added a test T2971a which is the opposite problem; previously
      we didn't bring in include-dirs from internal libraries.  That
      was fixed by the previous commit.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      b736896a
    • Edward Z. Yang's avatar
      0d15edef
    • Christiaan Baaij's avatar
      Add `--dynlibdir` · d2da6558
      Christiaan Baaij authored
      `--dynlibdir` indicates the directory in which dynamic libraries
      are installed. By default this setting is equal to:
      
      `$libdir/$abi`
      
      The static libraries will still end up in:
      
      `$libdir/$libsubdir`
      
      With `$libsubdir/$abi` as the default directory for dynamic
      libraries, dynamic libraries will by default end up in a
      single shared directory (per package database). This has the
      potential to reduce start-up times for dynamically linked
      executable as only one RPATH per package database will be
      needed.
      
      This commit uses the functionality defined in
      
      https://phabricator.haskell.org/D2611
      
      to tell GHC's > 8.0.1 package database that dynamic libraries
      are copied to the directories mentioned in the
      
      `dynamic-library-dirs`
      
      field.
      d2da6558
  9. 19 Oct, 2016 1 commit