Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. Sep 01, 2024
  2. Aug 31, 2024
  3. Aug 29, 2024
    • Matthew Pickering's avatar
      Add test for --working-dir and hsc2s · addcd41c
      Matthew Pickering authored
      Before the previous patches this test failed because an incorrect path
      was passed to hsc2hs (a preprocessor), it now succeeds :)
      addcd41c
    • Matthew Pickering's avatar
      Test --working-dir in the testsuite · ff7b4c10
      Matthew Pickering authored
      When testing `./Setup` only, when `withDirectory` is used, instead of
      changing into that directory when invoking processes, we now use the
      `--working-dir` flag and keep a fixed CWD.
      
      This will therefore passively test that `--working-dir` is working
      
      In addition, it makes it possible to test things easily such as
      `--working-dir` with a relative path as an argument. `cabal-install`
      will only invoke `--working-dir` with an absolute path and hence is
      isolated from any double interpretation issues.
      
      Testing against these double interpretation issues is very important as
      it also prevents over-interpretation of relative paths into absolute
      paths. Passing absolute paths to tools such as hsc2hs can lead to the
      build directory leaking into an interface file which leads to
      non-reproducible results.
      ff7b4c10
    • Matthew Pickering's avatar
      Remove last uses of runDbProgram · 0c817876
      Matthew Pickering authored
      runDbProgram doesn't take into account the working directory (so will
      normally produce incorrect results when used in `Cabal`). This replaces
      the last uses which weren't found by testing, they were found by
      grepping.
      0c817876
    • Matthew Pickering's avatar
    • Matthew Pickering's avatar
      Introduce AbsolutePath to symbolic path abstraction · 027bddfc
      Matthew Pickering authored
      There are a few places where paths are known to be absolute. This
      enforces that in the type system by introducing a simple wrapper to
      `Distribution.Utils.Path`.
      
      ```
      newtype AbsolutePath (to :: FileOrDir) = AbsolutePath (forall from . SymbolicPath from to)
      ```
      
      The nice thing about this abstraction is when when a path is unwrapped,
      due to the universally quantified `from` type, the resulting
      `SymbolicPath` can be used with any API which expects a path to point
      `from` a specific directory.
      027bddfc
    • Matthew Pickering's avatar
      Replace FilePath in PackageDB with SymbolicPath in Cabal · 90fbf086
      Matthew Pickering authored
      This refactoring enforces a simple property
      
      * We use symbolic paths in Cabal in order to represent that paths to
        package databases. These paths is relative to the package root.
      * We use normal filepaths in cabal-install to represent the path to a
        package database. These are relative to the current working directory.
      
      Paths are explicitly converted from one type to the other at the
      interface of `cabal-install` and `Cabal`, see `setupHsConfigureArgs` for
      where this happens.
      
      In order to achieve this `PackageDB` is abstracted over what the type of
      filepaths a specific package db points to.
      
      ```
      type PackageDBX fp = ... | SpecificPackageDB fp | ...
      ```
      
      If you are using the Cabal library then you probably want to migrate to
      use `PackageDBCWD` and `PackageDBStackCWD`.
      
      ```
      type PackageDBCWD = PackageDBX FilePath
      type PackageDBStackCWD = [PackageDBCWD]
      ```
      
      Then at the point where you call commands in the `Cabal` library convert
      these paths into paths relative to the root of the relevant package.
      The easiest way to do this is convert any paths into an absolute path.
      
      This patch fixes a double interpretation issue when the `--working-dir`
      option was used and package db paths were offset incorrectly.
      90fbf086
    • Matthew Pickering's avatar
      Interpret argument to `--gen-pkg-config` relative to `--working-dir` · 08f028fb
      Matthew Pickering authored
      This fixes the --gen-pkg-config to use the symbolic path abstraction, in
      turn this ensures that we interpret the path appropiately when
      `--working-dir` is also set.
      08f028fb
    • Matthew Pickering's avatar
      clean: Fix usage of flags vs flags' · 31f96d5e
      Matthew Pickering authored
      This fixes a simple oversight where the flags were passed without
      updating the `--working-dir` argument appropiately.
      31f96d5e
    • Matthew Pickering's avatar
      Fix Cabal macro bound in test · a22fc082
      Matthew Pickering authored
      It is only on Cabal 3.13 that the symbolic path abstraction was
      introduced.
      
      On CI we only test with Cabal master so the incorrect bound wasn't
      picked up.
      a22fc082
  4. Aug 28, 2024
  5. Aug 27, 2024
    • mergify[bot]'s avatar
      Merge pull request #10285 from haskell/wip/hackage-tests-fix · 1ff41e8f
      mergify[bot] authored
      ci: Fix --index-state for hackage roundtrip tests
      1ff41e8f
    • Matthew Pickering's avatar
      ci: Fix --index-state for hackage roundtrip tests · 31507b1f
      Matthew Pickering authored
      As a principle, tests which are required for CI to pass should be
      reproducible and not depending on external resources changes or being
      modified. The hackage tests currently violate this by depending on the
      latest index state from hackage. This is problematic because until the
      test is fixed all merges into master are blocked. Even though the
      patches in question have nothing to do with the test.
      
      It would be more suitable for a nightly job to run on the latest index
      and for normal CI to run with a fixed index which is updated
      periodically in a controlled manner.
      
      Fixes #10284
      31507b1f
    • Matthew Pickering's avatar
      hackage-tests: Add --index-state argument to fix the cabal files · 8e4d1678
      Matthew Pickering authored
      We need to fix the index-state we test against so a new bad cabal file
      doesn't take down the CI for everyone.
      
      Towards #10284
      8e4d1678
  6. Aug 26, 2024
  7. Aug 25, 2024
  8. Aug 24, 2024
  9. Aug 23, 2024
  10. Aug 22, 2024
  11. Aug 20, 2024
Loading