This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 07 Apr, 2020 1 commit
  2. 22 Feb, 2020 1 commit
  3. 27 Nov, 2019 1 commit
    • Herbert Valerio Riedel's avatar
      Implement {cmm.asm}-{options,sources} for real · a41ce05a
      Herbert Valerio Riedel authored
      While those buildinfo fields were added to the parser some time
      ago via 57d7f28e and
      4a287659 that work was never completed
      by implementing the necessary build/sdist logic in Cabal.
      
      This commit remedies this oversight by implementing and wiring up the
      missing build logic.
      
      *WARNING* this commit is still very WIP; ASM works mostly; C--
                support is still incomplete
      a41ce05a
  4. 06 Jun, 2019 1 commit
    • Ben Gamari's avatar
      Simple.SrcDist: Fix search for DistPref · 51ca6f8c
      Ben Gamari authored
      Previously we would look at directly at the sDistDistPref flag. However,
      this may not be set, resulting in #6068. We should rather be using
      findDistPrefOrDefault to find the DistPref directory.
      51ca6f8c
  5. 08 May, 2019 1 commit
    • Oleg Grenrus's avatar
      Add autogen-includes field · 7e27ae7c
      Oleg Grenrus authored
      autogen-includes aren't searched nor packages by `sdist`.
      
      This is relatively small code patch, but there are
      - change in file-format
      - short documentation of the field
      - `cabal check`
      - test-suite noise due new field in `BuildInfo`
      7e27ae7c
  6. 03 May, 2019 1 commit
  7. 18 Sep, 2018 1 commit
    • Oleg Grenrus's avatar
      Remove Text from D.Simple · 91b55168
      Oleg Grenrus authored
      - Add Parsec/Pretty CompilerId instances
      - Fix Parsec PackageIdentifier instance (hopefully it wasn't used for
        anything important)
      91b55168
  8. 09 Jul, 2018 1 commit
    • quasicomputational's avatar
      Make cabal check warn about missing directories in globs · 6c1342a3
      quasicomputational authored
      This also significantly improves the error when trying to refer to
      missing directories, hopefully making it clear that it's coming from
      Cabal. #5318 and snowleopard/hadrian#634 are two bugs which manifested
      as Cabal trying to glob in a non-existent directory and both took some
      debugging because of the obscurity of the error.
      6c1342a3
  9. 08 Jul, 2018 1 commit
    • quasicomputational's avatar
      Make Setup.hs configure more CWD-independent. · a31ab06a
      quasicomputational authored
      Previously, we were checking the package with a hard-coded root
      directory of ".". This was not a problem before, but with #5372 we
      have started to expand globs while checking packages, which breaks if
      the CWD is not the directory containing the `.cabal` file and causes
      snowleopard/hadrian#634.
      
      Luckily, this is an easy fix: the correct directory is easy to
      determine. Writing a test and making sure it's tickling the failing
      case took longer than writing the fix!
      
      "." is hard-coded as the root directory passed to `checkPackageFiles`
      in a few other places, but those are (a) non-trivial to test, and (b)
      already in places that have other assumptions about their CWD, so I
      have simply documented the CWD requirement for those.
      a31ab06a
  10. 28 Jun, 2018 1 commit
    • quasicomputational's avatar
      Remove matchFileGlob. · 2b7be354
      quasicomputational authored
      This was only a convenience function, but its use could obscure how it
      is introducing a dependency on the CWD. By removing it, the "."
      argument to `matchDirFileGlob` is explicit.
      
      Any external code using `matchFileGlob` would have needed to be
      changed as #5284 changed its signature and the module it lives in; it
      is not much more of a burden to switch to `matchDirFileGlob` at the
      same time.
      2b7be354
  11. 16 Jun, 2018 1 commit
    • quasicomputational's avatar
      Allow globs to match against a suffix of a file's extensions · e4294f31
      quasicomputational authored
      This has the effect of allowing a glob `*.html` to match the file
      `foo.en.html`. For compatibility, this is only allowed with
      `cabal-version: 3.0` or later; for earlier spec versions, a warning
      will be generated by `cabal check` if there are files affected by this
      change in behaviour.
      
      Fixes #5057. Fixes #784. Closes #5061.
      e4294f31
  12. 25 May, 2018 1 commit
  13. 19 May, 2018 1 commit
    • quasicomputational's avatar
      Don't break when data-dir is null. · d0c3defe
      quasicomputational authored
      PR #5284 changed things around, and now matchDirFileGlob will break if
      it's passed a null directory, which happens to be the default value
      for data-dir. Its call sites have been fixed to check for this and to
      substitute '.' for an empty path, which is the desired behaviour; in
      addition, matchDirFileGlob itself will now warn about this if it's
      detected, so that new broken call sites can't sneak in.
      
      Fixes #5318.
      d0c3defe
  14. 08 May, 2018 1 commit
    • quasicomputational's avatar
      Allow ** wildcards in globs. · 5e83ef26
      quasicomputational authored
      These are inspired by a plan described in a comment in #2522, and only
      implement a quite limited form of recursive matching: only a single **
      wildcard is accepted, it must be the final directory, and, if a **
      wildcard is present, the file name must include a wildcard.
      
      Or-patterns are not implemented, for simplicity.
      
      Closes #3178, #2030.
      5e83ef26
  15. 04 May, 2017 1 commit
  16. 19 Feb, 2017 1 commit
  17. 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
  18. 18 Oct, 2016 1 commit
  19. 06 Oct, 2016 1 commit
    • Edward Z. Yang's avatar
      Include signatures in SrcDist · 42af3567
      Edward Z. Yang authored
      Count signatures as modules that we have to find, and when searching for
      modules, look for .hsig or .lhsig files (in addition to the usual .hs
      .lhs files)
      42af3567
  20. 28 Sep, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Make `Version` type opaque (#3905) · bb2026c4
      Herbert Valerio Riedel authored
      Similiar to dabd9d98 which made
      `PackageName` opaque, this makes `Distribution.Version.Version` opaque.
      
      The most common version numbers occuring on Hackage are 3- and
      4-part versions. This results in significant Heap overhead due to
      `Data.Version`'s inefficient internal representation.
      
      So like the `PackageName` commit, this commit is a preparatory commit to
      pave the way for replacing `Version`'s internal representation by a
      representation with a memory footprint which can be an order of
      magnitude smaller.
      
      Finally, this also adds a new functor-like convenience function
      
          alterVersion :: ([Int] -> [Int]) -> Version -> Version
      
      for modifying the version number components.
      bb2026c4
  21. 22 Sep, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Update default-language & avoid default-extensions (#3880) · f87738df
      Herbert Valerio Riedel authored
      This upgrades the `default-language: Haskell98` to `Haskell2010`
      and removes `default-extensions: RankNTypes, FlexibleContexts`
      in favor of adding `LANGUAGE` pragmas where needed.
      
      Moroever, this also drops `LANGUAGE` pragmas which have become redundant
      due to `Haskell2010` (specifically, `EmptyDataDecls`,
      `ForeignFunctionInterface` and `PatternGuards`)
      
      Finally, an `other-extensions` specification is put in place for the
      `Cabal` library component.
      
      This helps loading up files directly in GHCi, such as e.g. `ghci Setup.hs`
      without having to specify `-X...` flags.
      f87738df
  22. 11 Sep, 2016 1 commit
  23. 09 Sep, 2016 1 commit
  24. 08 Sep, 2016 1 commit
    • Edward Z. Yang's avatar
      Provide useful call-stacks over all IO code. · 48a0d6ce
      Edward Z. Yang authored
      
      
      The key idea is that we define:
      
          type IO a = HasCallStack => Prelude.IO a
      
      and voila, call stacks are maintained across all IO!  You can
      look at the stacks using -v"debug +callstack".
      
      There are a number of IO functions for which the call stack is
      never used.  They are explicitly annotated using NoCallStackIO.
      Maybe some day they will use call stacks and we can change their
      types.  Similarly, there are a number of functions which do
      have type IO, but then suppress the redundant constraint error
      using "_ = callStack". Maybe some day we will attach call
      stacks to the exceptions we throw.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      48a0d6ce
  25. 06 Sep, 2016 1 commit
  26. 11 Aug, 2016 1 commit
    • fmaste's avatar
      Add new 'autogen-modules' field · c0108673
      fmaste authored
      Modules that are built automatically at setup, like Paths_PACKAGENAME or others created with a build-type custom, appear on 'other-modules' for the Library, Executable, Test-Suite or Benchmark stanzas or also on 'exposed-modules' for libraries but are not really on the package when distributed. This makes commands like sdist fail because the file is not found, so with this new field modules that appear there are treated the same way as Paths_PACKAGENAME was and there is no need to create complex build hooks.
      Just add the module names on 'other-modules' and 'exposed-modules' as always and on the new 'autogen-modules' besides.
      c0108673
  27. 26 Jul, 2016 2 commits
  28. 22 Jul, 2016 1 commit
  29. 29 Mar, 2016 2 commits
    • Edward Z. Yang's avatar
      Per-component cabal_macros.h (#1893) and install paths · 90e908b8
      Edward Z. Yang authored
      
      
      This commit is a number of refactorings that I needed to do
      while fixing bugs with internal libraries support.
      
      - With internal libraries, it becomes especially clear that
        cabal_macros.h and Paths_foo.hs need to be done per-component.
        It is done!
      
        This change breaks BC in an important way: the preprocessor
        interface now takes a ComponentLocalBuildInfo along with the
        BuildInfo and LocalBuildInfo.  This means that if you implemented
        a custom preprocessor, or called 'preprocessComponent' in a custom
        Setup, you will have to make sure you pass the right
        ComponentLocalBuildInfo.  Some sub-notes:
      
          - While I was mucking about cabal_macros.h, I updated it to have
            two new macros: CURRENT_COMPONENT_ID (an alias for
            CURRENT_PACKAGE_KEY, but using modern terminology) and
            LOCAL_COMPONENT_ID (which refers to the public library; we use
            this in Cabal's test suite but it's unclear what the general
            utility of this is.  See the TODO.)
      
          - checkForeignDeps has a hack where we hardcode the
            cabal_macros.h of the main library.  If we did the foreign dep
            check for every component individually that would be better,
            but I didn't want to roll it into this patch.
      
      - The other piece I needed for internal libraries was per-component
        install directories; otherwise, internal libraries clobber each
        other.  absoluteInstallDirs now takes a ComponentId, which is used
        to determine what '$libname' expands to.  Generally, InstallPaths
        must be computed per component, c.f. #2836.  We're not TRULY
        per-component install paths, since some files are installed for
        the "per-package" InstallPaths (the one we computed for the
        library as a whole), but for libraries we have to compute
        InstallPaths for each one.
      
          - While doing this, ComponentLocalBuildInfo grew a new
            'componentId' field for non-library things.  This lets us
            treat InstallPaths expansion uniformly.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      90e908b8
    • Edward Z. Yang's avatar
      Implement "convenience libraries", fixes #269. · 2040c1c9
      Edward Z. Yang authored
      
      
      Convenience libraries are package-private libraries
      that can be used as part of executables, libraries, etc
      without being exposed to the external world.  Private
      libraries are signified using the
      
          library foo
      
      stanza.  Within a Cabal package, the name convenience library
      shadows the conventional meaning of package name in
      build-depends, so that references to "foo" do not indicate
      foo in Hackage, but the convenience library defined in the
      same package. (So, don't shadow Hackage packages!)
      
      This commit implements convenience libraries such that they
      ARE installed the package database (this prevents us from
      having to special case dynamically linked executables);
      in GHC 7.10 and later they are installed under the same
      package name as the package that contained them, but have
      a distinct "component ID" (one pay off of making the distinction
      between component IDs and installed package IDs.)
      
      There is a "default" library which is identified by the fact
      that its library name coincides with the package name.  There
      are some new convenience functions to permit referencing this.
      
      There are a few latent bugs in this commit which are fixed
      in later commits in this patchset.  (Those bugfixes required
      a bit of refactoring, so it's clearer if they're not
      with this patch.)
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      2040c1c9
  30. 30 Jan, 2016 1 commit
  31. 25 Jan, 2016 1 commit
  32. 08 Jan, 2016 1 commit
    • Edward Z. Yang's avatar
      Remove same-package import lists, fixes #2835. · 639cd007
      Edward Z. Yang authored
      
      
      Instead of qualifying, in some cases I just added an extra
      'hiding' pragma to squelch errors.  Common conflicts
      (just grep for hiding):
      
          - Flag
              - Distribution.Simple.Compiler
              - Distribution.PackageDescription
              - Distribution.Simple.Setup
          - installedComponentId
              - Distribution.Package
              - Distribution.InstalledPackageInfo
          - doesFileExist
              - Distribution.PackageDescription.Check
          - instantiatedWith
              - I renamed the field in InstalledPackageInfo.  But
                it's probably going away with Backpack bits; I
                migth just excise it soon.
          - absoluteInstallDirs and substPathTemplate
              - Distribution.Simple.InstallDirs
              - Distribution.Simple.LocalBuildInfo
      
      I fixed some shadowing errors by renaming local variables in some cases.
      Common shadowings (we should perhaps consider not using these as
      method/field names):
      
          - freeVars
          - components
          - noVersion
          - verbosity
          - get
          - description
          - name
      
      Some data structures were moved around (IPIConvert and ABIHash)
      to make it easier to handle import lists.
      
      Some functions in Utils could be turned into reexports of standard
      library functions.
      
      No explicit imports were removed from non-Cabal imports.  These
      imports help maintain warning cleanliness across versions of GHC,
      so I don't recommend removing them.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      639cd007
  33. 31 May, 2015 1 commit
  34. 04 Mar, 2015 1 commit
  35. 10 Dec, 2014 2 commits
  36. 30 Oct, 2014 1 commit
  37. 25 Sep, 2014 1 commit