stack 2.11.1 → 2.13.1
raw patch · 176 files changed
+11895/−9625 lines, 176 filesdep +aeson-warning-parserdep +companiondep +cryptondep −annotated-wl-pprintdep −casa-typesdep −colourdep ~QuickCheckdep ~Win32dep ~arraysetup-changedbinary-added
Dependencies added: aeson-warning-parser, companion, crypton, ghc-boot
Dependencies removed: annotated-wl-pprint, casa-types, colour, cryptonite, cryptonite-conduit, deepseq, hackage-security, hashable, mintty, mono-traversable, network-uri, persistent-template, primitive, retry, semigroups, smallcheck, streaming-commons, text-metrics, th-reify-many, tls, typed-process, unicode-transforms, unliftio, zip-archive
Dependency ranges changed: QuickCheck, Win32, array, async, attoparsec, base64-bytestring, bytestring, casa-client, conduit, conduit-extra, containers, directory, echo, exceptions, extra, file-embed, filelock, filepath, generic-deriving, githash, hpack, hpc, hspec, http-client, http-client-tls, http-conduit, http-download, http-types, memory, microlens, mtl, mustache, neat-interpolation, open-browser, optparse-applicative, optparse-generic, optparse-simple, pantry, path, path-io, persistent-sqlite, pretty, project-template, random, raw-strings-qq, rio-prettyprint, split, stm, tar, template-haskell, text, time, transformers, unix-compat, unordered-containers, vector, yaml, zlib
Files
- CONTRIBUTING.md +166/−20
- ChangeLog.md +145/−50
- Setup.hs +14/−12
- app/Main.hs +12/−0
- cabal.config +206/−0
- cabal.project +40/−0
- doc/CONTRIBUTING.md +166/−20
- doc/ChangeLog.md +145/−50
- doc/GUIDE.md +12/−12
- doc/README.md +15/−19
- doc/Stack_and_VS_Code.md +3/−3
- doc/build_command.md +51/−18
- doc/coverage.md +0/−162
- doc/custom_snapshot.md +19/−19
- doc/dependency_visualization.md +0/−103
- doc/dev_containers.md +177/−0
- doc/developing_on_windows.md +14/−8
- doc/dot_command.md +2/−2
- doc/faq.md +4/−18
- doc/global_flags.md +28/−6
- doc/glossary.md +2/−2
- doc/hoogle_command.md +24/−1
- doc/hpc_command.md +16/−11
- doc/ide_command.md +22/−7
- doc/install_and_upgrade.md +67/−45
- doc/list_command.md +25/−22
- doc/ls_command.md +7/−4
- doc/nix_integration.md +12/−0
- doc/pantry.md +13/−0
- doc/script_command.md +95/−11
- doc/scripts.md +10/−10
- doc/setup_command.md +11/−6
- doc/stack_yaml_vs_cabal_package_file.md +2/−2
- doc/templates_command.md +2/−2
- doc/uninstall_command.md +3/−3
- doc/upgrade_command.md +1/−1
- doc/yaml_configuration.md +192/−70
- src/Control/Concurrent/Execute.hs +92/−65
- src/GHC/Utils/GhcPkg/Main/Compat.hs +613/−0
- src/Network/HTTP/StackClient.hs +5/−1
- src/Options/Applicative/Complicated.hs +4/−18
- src/Stack.hs +138/−0
- src/Stack/Build.hs +4/−4
- src/Stack/Build/ConstructPlan.hs +92/−64
- src/Stack/Build/Execute.hs +71/−147
- src/Stack/Build/Source.hs +16/−20
- src/Stack/BuildInfo.hs +89/−0
- src/Stack/CLI.hs +700/−0
- src/Stack/ComponentFile.hs +60/−35
- src/Stack/Config.hs +25/−6
- src/Stack/Config/Build.hs +4/−3
- src/Stack/Config/ConfigureScript.hs +105/−0
- src/Stack/ConfigCmd.hs +1/−1
- src/Stack/Constants.hs +54/−8
- src/Stack/Constants/Config.hs +88/−77
- src/Stack/Coverage.hs +67/−63
- src/Stack/Docker.hs +13/−6
- src/Stack/Exec.hs +1/−1
- src/Stack/GhcPkg.hs +45/−9
- src/Stack/Hoogle.hs +27/−20
- src/Stack/IDE.hs +24/−10
- src/Stack/Init.hs +4/−4
- src/Stack/Internal/BuildInfo.hs +0/−25
- src/Stack/List.hs +31/−21
- src/Stack/Lock.hs +5/−6
- src/Stack/Ls.hs +1/−1
- src/Stack/Options/BuildMonoidParser.hs +9/−1
- src/Stack/Options/Completion.hs +4/−4
- src/Stack/Options/GlobalParser.hs +5/−0
- src/Stack/Options/SetupParser.hs +1/−1
- src/Stack/Package.hs +4/−1
- src/Stack/PackageFile.hs +6/−1
- src/Stack/Prelude.hs +25/−35
- src/Stack/SDist.hs +191/−151
- src/Stack/Script.hs +2/−1
- src/Stack/Setup.hs +341/−172
- src/Stack/Storage/Project.hs +3/−3
- src/Stack/Storage/User.hs +3/−3
- src/Stack/Templates.hs +2/−2
- src/Stack/Types/AllowNewerDeps.hs +1/−1
- src/Stack/Types/ApplyGhcOptions.hs +1/−1
- src/Stack/Types/ApplyProgOptions.hs +1/−1
- src/Stack/Types/Build/Exception.hs +196/−146
- src/Stack/Types/BuildOpts.hs +39/−4
- src/Stack/Types/CabalConfigKey.hs +2/−2
- src/Stack/Types/Casa.hs +57/−0
- src/Stack/Types/ColorWhen.hs +1/−1
- src/Stack/Types/CompilerBuild.hs +2/−2
- src/Stack/Types/CompilerPaths.hs +4/−0
- src/Stack/Types/Config.hs +3/−0
- src/Stack/Types/ConfigMonoid.hs +15/−6
- src/Stack/Types/Curator.hs +3/−4
- src/Stack/Types/Docker.hs +70/−60
- src/Stack/Types/DownloadInfo.hs +4/−3
- src/Stack/Types/DumpLogs.hs +1/−2
- src/Stack/Types/EnvConfig.hs +2/−0
- src/Stack/Types/FileDigestCache.hs +27/−0
- src/Stack/Types/GHCDownloadInfo.hs +3/−4
- src/Stack/Types/GHCVariant.hs +1/−1
- src/Stack/Types/GhcOptionKey.hs +1/−2
- src/Stack/Types/GhcOptions.hs +1/−1
- src/Stack/Types/GhcPkgId.hs +1/−2
- src/Stack/Types/GlobalOpts.hs +3/−0
- src/Stack/Types/GlobalOptsMonoid.hs +3/−0
- src/Stack/Types/Nix.hs +3/−4
- src/Stack/Types/Project.hs +1/−1
- src/Stack/Types/ProjectAndConfigMonoid.hs +5/−4
- src/Stack/Types/ProjectConfig.hs +7/−0
- src/Stack/Types/PvpBounds.hs +2/−3
- src/Stack/Types/Resolver.hs +3/−2
- src/Stack/Types/SCM.hs +1/−1
- src/Stack/Types/SetupInfo.hs +5/−4
- src/Stack/Types/SourceMap.hs +18/−9
- src/Stack/Types/Storage.hs +1/−1
- src/Stack/Types/Version.hs +2/−2
- src/Stack/Types/VersionedDownloadInfo.hs +3/−4
- src/Stack/Uninstall.hs +31/−30
- src/Stack/Upgrade.hs +8/−6
- src/main/BuildInfo.hs +0/−81
- src/main/Main.hs +0/−136
- src/main/Stack/CLI.hs +0/−684
- src/test/Spec.hs +0/−2
- src/test/Stack/ArgsSpec.hs +0/−174
- src/test/Stack/Build/ExecuteSpec.hs +0/−15
- src/test/Stack/Build/TargetSpec.hs +0/−33
- src/test/Stack/Config/DockerSpec.hs +0/−29
- src/test/Stack/ConfigSpec.hs +0/−259
- src/test/Stack/DotSpec.hs +0/−134
- src/test/Stack/Ghci/ScriptSpec.hs +0/−65
- src/test/Stack/GhciSpec.hs +0/−309
- src/test/Stack/LockSpec.hs +0/−166
- src/test/Stack/NixSpec.hs +0/−113
- src/test/Stack/PackageDumpSpec.hs +0/−284
- src/test/Stack/Types/TemplateNameSpec.hs +0/−52
- src/test/Stack/Untar/test1.tar.gz binary
- src/test/Stack/Untar/test2.tar.gz binary
- src/test/Stack/UploadSpec.hs +0/−51
- src/test/unix/Stack/Ghci/FakePaths.hs +0/−8
- src/test/windows/Stack/Ghci/FakePaths.hs +0/−8
- src/unix/Stack/Constants/UsrLibDirs.hs +7/−1
- src/unix/System/Permissions.hs +11/−5
- src/windows/Stack/Constants/UsrLibDirs.hs +7/−1
- src/windows/System/Permissions.hs +10/−5
- src/windows/System/Terminal.hs +1/−1
- stack.cabal +292/−362
- stack.yaml +23/−28
- test/integration/IntegrationSpec.hs +0/−270
- test/integration/lib/StackTest.hs +0/−396
- test/package-dump/ghc-7.10.txt +0/−1188
- test/package-dump/ghc-7.8.4-osx.txt +0/−67
- test/package-dump/ghc-7.8.txt +0/−1529
- test/package-dump/ghc-head.txt +0/−1146
- tests/integration/IntegrationSpec.hs +273/−0
- tests/integration/lib/StackTest.hs +409/−0
- tests/unit/Spec.hs +2/−0
- tests/unit/Stack/ArgsSpec.hs +174/−0
- tests/unit/Stack/Build/ExecuteSpec.hs +15/−0
- tests/unit/Stack/Build/TargetSpec.hs +33/−0
- tests/unit/Stack/Config/DockerSpec.hs +29/−0
- tests/unit/Stack/ConfigSpec.hs +259/−0
- tests/unit/Stack/DotSpec.hs +134/−0
- tests/unit/Stack/Ghci/ScriptSpec.hs +65/−0
- tests/unit/Stack/GhciSpec.hs +309/−0
- tests/unit/Stack/LockSpec.hs +166/−0
- tests/unit/Stack/NixSpec.hs +113/−0
- tests/unit/Stack/PackageDumpSpec.hs +284/−0
- tests/unit/Stack/Types/TemplateNameSpec.hs +52/−0
- tests/unit/Stack/Untar/test1.tar.gz binary
- tests/unit/Stack/Untar/test2.tar.gz binary
- tests/unit/Stack/UploadSpec.hs +51/−0
- tests/unit/package-dump/ghc-7.10.txt +1188/−0
- tests/unit/package-dump/ghc-7.8.4-osx.txt +67/−0
- tests/unit/package-dump/ghc-7.8.txt +1529/−0
- tests/unit/package-dump/ghc-head.txt +1146/−0
- tests/unit/unix/Stack/Ghci/FakePaths.hs +8/−0
- tests/unit/windows/Stack/Ghci/FakePaths.hs +8/−0
@@ -212,7 +212,7 @@ ## Error messages Stack catches exceptions thrown by its dependencies or by Stack itself in -`Main.main`. In addition to exceptions that halt Stack's execution, Stack logs +`Stack.main`. In addition to exceptions that halt Stack's execution, Stack logs certain other matters as 'errors'. To support the Haskell Foundation's @@ -285,19 +285,21 @@ Stack aims to depend on well-known packages. The specific versions on which it depends at any time are specified by `package.yaml` and `stack.yaml`. It does not aim to be compatible with more than one version of the `Cabal` package at -any time. At the time of writing (March 2023) the package versions are primarily -ones in Stackage snapshot LTS Haskell 20.13 (for GHC 9.2.7), together with -extra-dep `Cabal-3.8.1.0`. +any time. At the time of writing (August 2023) the package versions are +primarily ones in Stackage snapshot LTS Haskell 21.8 (for GHC 9.4.5), together +with extra-deps to depend on the latest versions of `ansi-terminal`, `crypton` +(instead of `cryptonite`), `hpack`, `pantry` and `tar-conduit`. A Stack executable makes use of Cabal (the library) through a small 'Setup' executable that it compiles from Haskell source code. The executable compiles that code with a dependency on the version of Cabal that ships with the specified GHC compiler. Each release of Stack will aim to support all versions of GHC and the Cabal package in Stackage snapshots published within seven years -of the release. For example, snapshot LTS Haskell 7.0, published on -14 September 2016, was the first LTS Haskell snapshot to provide GHC 8.0.1 which -comes with `Cabal-1.24.0.0`. Until, at least, 13 September 2023, Stack releases -would aim to support the immediate predecessor, GHC 7.10.3 and `Cabal-1.22.5.0`. +of the release. For example, snapshot LTS Haskell 8.0, published on +12 February 2017, was the first LTS Haskell snapshot to provide GHC 8.0.2 which +comes with `base-4.9.1.0` and `Cabal-1.24.2.0`. Until, at least, +13 February 2024, Stack releases would aim to support the immediate +predecessor, GHC 8.0.1 and `base-4.9.0.0` and `Cabal-1.24.0.0`. When a version of the Stack executable actually ceases to support a version of GHC and `Cabal`, that should be recorded in Stack's @@ -392,14 +394,15 @@ ## Testing -The Stack code has both unit tests and integration tests. Integration tests can -be found in the -[test/integration](https://github.com/commercialhaskell/stack/tree/master/test/integration) -folder and unit tests, in the -[src/test](https://github.com/commercialhaskell/stack/tree/master/src/test) -folder. Tests are written using the [Hspec](https://hspec.github.io/) framework. -In order to run the full test suite, you can simply command: +The Stack code has both unit tests and integration tests. +### Working with Unit Tests + +Unit tests can be found in the +[tests/unit](https://github.com/commercialhaskell/stack/tree/master/tests/unit) +directory. Tests are written using the [Hspec](https://hspec.github.io/) +framework. In order to run the full test suite, you can simply command: + ~~~text stack test ~~~ @@ -410,18 +413,17 @@ to specify which module you'd specifically like to run to get quick feedback. A description of this follows below. -### Working with Unit Tests If you would like to run the unit tests on their own, you can command: ~~~text -stack test stack:stack-test +stack test stack:stack-unit-test ~~~ Running an individual module works with a command like this: ~~~text -stack test stack:stack-test --ta "-m <PATTERN>" +stack test stack:stack-unit-test --ta "-m <PATTERN>" ~~~ Where `<PATTERN>` is the name of the module without `Spec.hs`. @@ -429,7 +431,7 @@ You may also load tests into GHCi and run them with these command: ~~~text -stack ghci stack:stack-test --only-main +stack ghci stack:stack-unit-test --only-main # GHCi starting up output ... > :main -m "<PATTERN>" ~~~ @@ -438,6 +440,10 @@ ### Working with Integration Tests +Integration tests can be found in the +[tests/integration](https://github.com/commercialhaskell/stack/tree/master/tests/integration) +folder. + Running the integration tests is a little involved, you'll need to command: ~~~text @@ -466,7 +472,7 @@ [test/integration/tests/](https://github.com/commercialhaskell/stack/tree/master/test/integration/tests) directory. -You can disable a few integration tests through the -n option : +You can disable a few integration tests through the -n option : ~~~text stack build --flag stack:integration-tests stack --exec "stack-integration-test -n <PATTERN1> -n <PATTERN2>" @@ -561,6 +567,146 @@ Stan is a Haskell static analysis tool. As of 29 August 2022, it does not support GHC >= 9.0.1 and Stack is built with GHC >= 9.2.4. Consequently, this workflow does not run. Its intent is to apply Stan to Stack. + +## Haskell Language Server + +You may be using [Visual Studio Code](https://code.visualstudio.com/) (VS Code) +with its +[Haskell extension](https://marketplace.visualstudio.com/items?itemName=haskell.haskell), +which is powered by the +[Haskell Language Server](https://github.com/haskell/haskell-language-server) +(HLS). + +Stack can be built with Stack (which is recommended) or with Cabal (the tool). + +=== "Stack" + + If you use Stack to build Stack, command `stack ghci` in the root directory + of the Stack project should work as expected, if you have first commanded + `stack build` once. `stack build` causes Cabal (the library) to create the + automatically generated module `Stack_build`. + + If `ghc` is not on your PATH, then Haskell Language Server may report the + following error about `Stack.Constants.ghcShowOptionsOutput`: + ~~~text + • Exception when trying to run compile-time code: + ghc: readCreateProcess: does not exist (No such file or directory) + Code: (TH.runIO (readProcess "ghc" ["--show-options"] "") + >>= TH.lift . lines) + • In the untyped splice: + $(TH.runIO (readProcess "ghc" ["--show-options"] "") >>= TH.lift + . lines) + ~~~ + + `ghc` should be on the PATH if you run VS Code itself in the Stack + environment: + ~~~text + stack exec -- code . + ~~~ + + The following [cradle (`hie.yaml`)](https://github.com/haskell/hie-bios) + should suffice to configure Haskell Language Server (HLS) explicitly for + `./Setup.hs` and each of the buildable components in Stack's Cabal file: + ~~~yaml + cradle: + multi: + - path: "./Setup.hs" + config: + cradle: + direct: + arguments: [] + - path: "./" + config: + cradle: + stack: + - path: "./src" + component: "stack:lib" + - path: "./app" + component: "stack:exe:stack" + - path: "./tests/integration" + component: "stack:exe:stack-integration-test" + - path: "./tests/unit" + component: "stack:test:stack-unit-test" + ~~~ + +=== "Cabal (the tool)" + + If you use Cabal (the tool) to build Stack, command `cabal repl` in the root + directory of the Stack project should work as expected, if you have GHC and + (on Windows) MSYS2 on the PATH. Stack's custom `./Setup.hs` causes + `cabal repl` to cause Cabal (the library) to create the automatically + generated module `Stack_build`. + + If `ghc` is not on your PATH, then Haskell Language Server may report the + following error about `Stack.Constants.ghcShowOptionsOutput`: + ~~~text + • Exception when trying to run compile-time code: + ghc: readCreateProcess: does not exist (No such file or directory) + Code: (TH.runIO (readProcess "ghc" ["--show-options"] "") + >>= TH.lift . lines) + • In the untyped splice: + $(TH.runIO (readProcess "ghc" ["--show-options"] "") >>= TH.lift + . lines) + ~~~ + + `ghc` and (on Windows) MSYS2 should be on the PATH if you run commands + (including `cabal`) in the Stack environment: + ~~~text + stack exec --no-ghc-package-path -- cabal repl + ~~~ + + or + ~~~text + stack exec --no-ghc-package-path -- code . + ~~~ + + Use of GHC's environment variable `GHC_PACKAGE_PATH` is not compatible with + Cabal (the tool). That is why the `--no-ghc-package-path` flag must be + specified with `stack exec` when relying on Cabal (the tool). + + The following [cradle (`hie.yaml`)](https://github.com/haskell/hie-bios) + should suffice to configure Haskell Language Server (HLS) explicitly for + `./Setup.hs` and each of the buildable components in Stack's Cabal file: + ~~~yaml + cradle: + multi: + - path: "./Setup.hs" + config: + cradle: + direct: + arguments: [] + - path: "./" + config: + cradle: + cabal: + - path: "./src" + component: "lib:stack" + - path: "./app" + component: "exe:stack" + - path: "./tests/integration" + component: "exe:stack-integration-test" + - path: "./tests/unit" + component: "test:stack-unit-test" + ~~~ + +A cradle is not committed to Stack's repository because it imposes a choice of +build tool. + +## Dev Containers + +A [Development Container](https://containers.dev) (or Dev Container for short) +allows you to use a container as a full‑featured development environment. + +You can run Dev Containers locally/remotely (with VS Code), or create a +[Codespace](https://github.com/features/codespaces) for a branch in a +repository to develop online. + +Stack's default Dev Container is intended for use with its default +project‑level configuration (`stack.yaml`). But there are also Dev Containers +for the experimental project‑level configurations. + +For further information, see the documentation for +[Dev Containers](dev_containers.md). ## Slack channel
@@ -1,5 +1,83 @@ # Changelog +## v2.13.1 - 2023-09-29 + +Release notes: + +* Further to the release notes for Stack 2.3.1, the `-static` suffix has been + removed from the statically linked Linux/x86_64 binaries. +* The binaries for Linux/Aarch64 are now statically linked. +* Binaries are now provided for macOS/AArch64. + +**Changes since v2.11.1:** + +Behavior changes: + +* Build artefacts are placed in `.stack-work/dist/<platform>/<GHC_version>` + (hashed to a shorter path on Windows), rather than + `.stack-work/dist/<platform>/<Cabal_version>`. This allows build artifacts to + be distinguished by GHC version. +* By default, the `stack build` progress bar is capped to a length equal to the + terminal width. +* When building GHC from source, Stack no longer uses Hadrian's deprecated + `--configure`\\`-c` flag and, instead, seeks to run GHC's Python `boot` and + sh `configure` scripts, and ensure that the `happy` and `alex` executables are + on the PATH. +* When auto-detecting `--ghc-build` on Linux, the `musl` GHC build only is + considered a possible GHC build if `libc.musl-x86_64.so.1` is found in `\lib` + or `\lib64`. +* No longer supports Cabal versions older than `1.24.0.0`. This means projects + using snapshots earlier than `lts-7.0` or `nightly-2016-05-26` will no longer + build. +* When unregistering many packages in a single step, Stack can now do that + efficiently. Stack no longer uses GHC-supplied `ghc-pkg unregister` (which is, + currently, slower). +* `stack hpc report`, `stack list`, `stack templates` and `stack uninstall` + output their information to the standard output stream rather than to the + standard error stream. Logging is still to the standard error stream. +* `stack upgrade` no longer assumes that binary upgrade is not supported on a + AArch64 machine architecture. + +Other enhancements: + +* Bump to Hpack 0.36.0. +* Depend on `pantry-0.9.2`, for support for long filenames and directory names + in archives created by `git archive`. +* Avoid the duplicate resolving of usage files when parsing `*.hi` files into a + set of modules and a collection of resolved usage files. See + [#6123](https://github.com/commercialhaskell/stack/pull/6123). +* Add composable component type flags `--exes`, `--tests` and `--benchmarks` to + Stack's `ide targets` command, to list only those components. +* `stack --verbose` excludes lengthy information about build plan construction + in the debug output by default. The new `stack --[no-]plan-in-log` flag + enables or disables the inclusion of the information in the debug output. +* In YAML configuration files, the `casa` key is introduced, which takes + precedence over the existing `casa-repo-prefix` key. The latter is deprecated. + The new key also allows Stack's use of a Casa (content-addressable storage + archive) server to be disabled and the maximum number of keys per request to + be configured. The defaults are unchanged. +* Add option `--progress-bar=<format>` to Stack's `build` command to configure + the format of the progress bar, where `<format>` is one of `none`, + `count-only` (only the package count), `capped` (capped to a length equal to + the terminal width) and `full` (the previous format). + +Bug fixes: + +* Restore `stack sdist --pvp-bounds lower` (broken with Stack 2.9.1). +* Restore building of Stack with Cabal flag `disable-git-info` (broken with + Stack 2.11.1). +* With `stack hoogle`, avoid the message + `Minimum version is hoogle-5.0. Found acceptable hoogle-<x.y.z> in your index, requiring its installation.` + when a `hoogle` executable has already been found on the `PATH`. +* Stack's sanity check on a selected GHC now passes GHC flag + `-hide-all-packages`, stopping GHC from looking for a package environment in + default locations. +* Restore Stack script files without extensions (broken with Stack 2.11.1). +* Restore message suffix `due to warnings` with `dump-logs: warning` (broken + with Stack 2.11.1). +* On Windows, the `local-programs-path` directory can now be on a different + drive to the system temporary directory and MSYS2 will still be installed. + ## v2.11.1 - 2023-05-18 **Changes since v2.9.3:** @@ -66,6 +144,17 @@ * The warning that sublibrary dependency is not supported is no longer triggered by internal libraries. +## v2.9.3.1 - 2023-06-22 + +Hackage-only release of the `stack` package: + +* Supports building against snapshot Stackage LTS Haskell 21.0 (GHC 9.4.5), + without extra deps. +* Supports build with `persistent-2.14.5.0`, using CPP directives. +* Supports build with `unix-compat-0.7`, by removing reliance on the module + `System.PosixCompat.User` removed in that package. +* Includes `cabal.project` and `cabal.config` files in the package. + ## v2.9.3 - 2022-12-16 **Changes since v2.9.1:** @@ -87,7 +176,7 @@ [Haskell Error Index](https://errors.haskell.org/) initiative, all Stack error messages generated by Stack itself begin with an unique code in the form `[S-nnnn]`, where `nnnn` is a four-digit number. -* Test suite executables that seek input on the standard input channel (`stdin`) +* Test suite executables that seek input on the standard input stream (`stdin`) will not throw an exception. Previously, they would thow an exception, consistent with Cabal's 'exitcode-stdio-1.0' test suite interface specification. Pass the flag `--no-tests-allow-stdin` to `stack build` to @@ -131,7 +220,14 @@ * After an upgrade from an earlier version of Stack, on first use only, Stack 2.9.1 may warn that it had trouble loading the CompilerPaths cache. +* The support from the Stack team for binary releases now includes Linux/AArch64 + and is limited to: + * Linux 64-bit/x86_64 (statically linked) + * Linux AArch64 (dynamically linked) + * macOS x86_64 + * Windows 64-bit/x86_64 + Behavior changes: * `stack build --coverage` will generate a unified coverage report, even if @@ -296,8 +392,8 @@ Bug fixes: -* `stack new` now supports branches other than `master` as default for - GitHub repositories. See +* `stack new` now supports branches other than `master` as default for GitHub + repositories. See [#5422](https://github.com/commercialhaskell/stack/issues/5422) * Ignore all errors from `hi-file-parser`. See @@ -333,8 +429,8 @@ Behavior changes: -* File watching now takes into account specified targets, old behavior could - be restored using the new flag `--watch-all` +* File watching now takes into account specified targets, old behavior could be + restored using the new flag `--watch-all` [#5310](https://github.com/commercialhaskell/stack/issues/5310) Other enhancements: @@ -371,8 +467,8 @@ Bug fixes: * When using the `STACK_YAML` env var with Docker, make the path absolute. -* Fix the problem of `stack repl foo:test:bar` failing without a project - build before that. See +* Fix the problem of `stack repl foo:test:bar` failing without a project build + before that. See [#5213](https://github.com/commercialhaskell/stack/issues/5213) * Fix `stack sdist` introducing unnecessary sublibrary syntax when using pvp-bounds. See @@ -385,35 +481,36 @@ * We have reduced the number of platforms that we support with binary releases. The reason behind this is that we've been slowed down in our release process until now with issues trying to build binaries for less common platforms. In - order to make sure we can address issues more quickly (like supporting new - GHC versions), we're limiting support from the Stack team to: + order to make sure we can address issues more quickly (like supporting new GHC + versions), we're limiting support from the Stack team to: - * Linux 64-bit (static) - * macOS - * Windows 64-bit + * Linux 64-bit/x86_64 (statically linked) + * macOS x86_64 + * Windows 64-bit/x86_64 - If others want to provide additional binaries, we will definitely be happy - for the support. But since our CI system is currently able to produce these - three bindists only, that's what we will be providing with the next release. + If others want to provide additional binaries, we will definitely be happy for + the support. But since our CI system is currently able to produce these three + bindists only, that's what we will be providing with the next release. -* Since we no longer have dynamically linked Linux binaries, we are removing - removing the `-static` suffix from the static Linux binaries. If you have - scripts to download the latest stable Linux binary, update them to use +* Since we no longer have dynamically linked Linux binaries, we are removing the + `-static` suffix from the static Linux/x86_64 binaries. If you have scripts to + download the latest stable Linux/x86_64 binary, update them to use `linux-x86_64` instead of `linux-x86_64-static` (if you are already using the - former, nothing needs to change). For this release, both are supported, but + former, nothing needs to change). For this release, both are supported, but the next release will no longer have the `-static` variant. -* We are also deprecating the download links at https://stackage.org/stack. - See this page for the current installation instructions: +* We are also deprecating the download links at https://stackage.org/stack. See + this page for the current installation instructions: https://docs.haskellstack.org/en/stable/install_and_upgrade/. -* These are the canonical locations to download the latest stable binaries - from, and will continue to be supported going forward: +* These are the canonical locations to download the latest stable binaries from, + and will continue to be supported going forward: - * Linux 64-bit (static): + * Linux 64-bit/x86_64 (static): https://get.haskellstack.org/stable/linux-x86_64.tar.gz - * macOS: https://get.haskellstack.org/stable/osx-x86_64.tar.gz - * Windows 64-bit: https://get.haskellstack.org/stable/windows-x86_64.zip + * macOS x86_64: https://get.haskellstack.org/stable/osx-x86_64.tar.gz + * Windows 64-bit/x86_64: + https://get.haskellstack.org/stable/windows-x86_64.zip As always, binaries for specific versions are available from the GitHub releases: https://github.com/commercialhaskell/stack/releases. @@ -459,11 +556,11 @@ Other enhancements: -* Add `build-output-timestamps` flag in yaml. Setting it to true - prefixes each build log output line with a timestamp. +* Add `build-output-timestamps` flag in yaml. Setting it to true prefixes each + build log output line with a timestamp. -* Show warning about `local-programs-path` with spaces on windows - when running scripts. See +* Show warning about `local-programs-path` with spaces on windows when running + scripts. See [#5013](https://github.com/commercialhaskell/stack/pull/5013) * Add `ls dependencies json` which will print dependencies as JSON. @@ -525,8 +622,8 @@ Behavior changes: -* Disable WAL mode for SQLite3 databases, to improve compatibility with - some platforms and filesystems. See +* Disable WAL mode for SQLite3 databases, to improve compatibility with some + platforms and filesystems. See [#4876](https://github.com/commercialhaskell/stack/issues/4876). * By default, do not perform expiry checks in Hackage Security. See @@ -534,13 +631,12 @@ Other enhancements: -* Do not rerun expected test failures. This is mostly a change that - will only affect the Stackage Curator use case, but there is now an - additional message letting the user know when a previously-failed - test case is being rerun. +* Do not rerun expected test failures. This is mostly a change that will only + affect the Stackage Curator use case, but there is now an additional message + letting the user know when a previously-failed test case is being rerun. -* Move configure information for local packages back to .stack-work to - improve caching. See +* Move configure information for local packages back to .stack-work to improve + caching. See [#4893](https://github.com/commercialhaskell/stack/issues/4893). Bug fixes: @@ -559,12 +655,12 @@ avoiding a SIGTERM screwing up GHC installation. See [#4888](https://github.com/commercialhaskell/stack/issues/4888). -* Use package complete locations from lock files when resolving dependencies - in `extra-deps`. See +* Use package complete locations from lock files when resolving dependencies in + `extra-deps`. See [#4887](https://github.com/commercialhaskell/stack/issues/4887). -* Set the `HASKELL_DIST_DIR` environment to a proper package dist - directory so `doctest` is able to load modules autogenerated by Cabal. +* Set the `HASKELL_DIST_DIR` environment to a proper package dist directory so + `doctest` is able to load modules autogenerated by Cabal. * Expose package library when running tests. @@ -586,11 +682,11 @@ basis on individual packages (see [#4860](https://github.com/commercialhaskell/stack/issues/4860)) -If building a `stack` executable for distribution, please download the -source code from https://github.com/commercialhaskell/stack/releases/tag/v2.1.1 -and build it using Stack itself in order to ensure identical behaviour -to official binaries. This package on Hackage is provided for convenience -and bootstrapping purposes. +If building a `stack` executable for distribution, please download the source +code from https://github.com/commercialhaskell/stack/releases/tag/v2.1.1 and +build it using Stack itself in order to ensure identical behaviour to official +binaries. This package on Hackage is provided for convenience and bootstrapping +purposes. ## v2.1.1 - 2019-06-13 @@ -608,9 +704,8 @@ Major changes: -* Switch over to pantry for managing packages. This is a major change - to Stack's internals, and affects user-visible behavior in a few - places. Some highlights: +* Switch over to pantry for managing packages. This is a major change to Stack's + internals, and affects user-visible behavior in a few places. Some highlights: * Drop support for multiple package indices and legacy `00-index.tar` style indices. See [#4137](https://github.com/commercialhaskell/stack/issues/4137).
@@ -1,15 +1,11 @@-{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-} - module Main ( main ) where -import Data.List ( nub, sortBy ) -import Data.Ord ( comparing ) +import Data.List ( nub, sortOn ) import Distribution.InstalledPackageInfo ( sourcePackageId, installedUnitId ) -import Distribution.Package - ( PackageId, UnitId, packageVersion, packageName ) +import Distribution.Package ( UnitId, packageVersion, packageName ) import Distribution.PackageDescription ( PackageDescription (), Executable (..) ) import Distribution.Pretty ( prettyShow ) @@ -23,10 +19,10 @@ import Distribution.Simple.PackageIndex ( allPackages, dependencyClosure ) import Distribution.Simple.Setup - ( BuildFlags (buildVerbosity), fromFlag ) + ( BuildFlags (..), ReplFlags (..), fromFlag ) import Distribution.Simple.Utils ( rewriteFileEx, createDirectoryIfMissingVerbose ) -import Distribution.Types.PackageName ( PackageName, unPackageName ) +import Distribution.Types.PackageName ( unPackageName ) import Distribution.Types.UnqualComponentName ( unUnqualComponentName ) import Distribution.Verbosity ( Verbosity, normal ) @@ -35,8 +31,14 @@ main :: IO () main = defaultMainWithHooks simpleUserHooks { buildHook = \pkg lbi hooks flags -> do - generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi - buildHook simpleUserHooks pkg lbi hooks flags + generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi + buildHook simpleUserHooks pkg lbi hooks flags + -- The 'cabal repl' hook corresponds to the 'cabal build' hook and is added + -- because, with a Cabal-based cradle, Haskell Language Server makes use of + -- 'cabal repl'. + , replHook = \pkg lbi hooks flags args -> do + generateBuildModule (fromFlag (replVerbosity flags)) pkg lbi + replHook simpleUserHooks pkg lbi hooks flags args } generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO () @@ -51,11 +53,11 @@ , " ) where" , "" , "deps :: [String]" - , "deps = " ++ (show $ formatdeps (transDeps libcfg clbi)) + , "deps = " ++ show (formatdeps (transDeps libcfg clbi)) ] where exeName' = unUnqualComponentName . exeName - formatdeps = map formatone . sortBy (comparing unPackageName') + formatdeps = map formatone . sortOn unPackageName' formatone p = unPackageName' p ++ "-" ++ prettyShow (packageVersion p) unPackageName' = unPackageName . packageName transDeps xs ys =
@@ -0,0 +1,12 @@+{-# LANGUAGE NoImplicitPrelude #-} + +module Main + ( main + ) where + +import RIO ( IO ) +import qualified Stack + +-- | The entry point for the Stack executable. +main :: IO () +main = Stack.main
@@ -0,0 +1,206 @@+constraints: + , Cabal ==3.8.1.0 + , Cabal-syntax ==3.8.1.0 + , Glob ==0.10.2 + , OneTuple ==0.4.1.1 + , QuickCheck ==2.14.3 + , StateVar ==1.2.2 + , Win32 ==2.12.0.1 + , aeson ==2.1.2.1 + , aeson-warning-parser ==0.1.0 + , annotated-wl-pprint ==0.7.0 + , ansi-terminal ==1.0 + , ansi-terminal-types ==0.11.5 + , appar ==0.1.8 + , array ==0.5.4.0 + , asn1-encoding ==0.9.6 + , asn1-parse ==0.9.5 + , asn1-types ==0.3.4 + , assoc ==1.1 + , async ==2.2.4 + , attoparsec ==0.14.4 + , attoparsec-aeson ==2.1.0.0 + , attoparsec-iso8601 ==1.1.0.0 + , auto-update ==0.1.6 + , base ==4.17.2.0 + , base-compat ==0.12.3 + , base-compat-batteries ==0.12.3 + , base-orphans ==0.9.0 + , base16-bytestring ==1.0.2.0 + , base64-bytestring ==1.2.1.0 + , basement ==0.0.16 + , bifunctors ==5.5.15 + , binary ==0.8.9.1 + , bitvec ==1.1.5.0 + , blaze-builder ==0.4.2.3 + , blaze-html ==0.9.1.2 + , blaze-markup ==0.8.2.8 + , byteorder ==1.0.4 + , bytestring ==0.11.5.2 + , casa-client ==0.0.2 + , casa-types ==0.0.2 + , case-insensitive ==1.2.1.0 + , cereal ==0.5.8.3 + , clock ==0.8.4 + , cmdargs ==0.10.22 + , colour ==2.3.6 + , comonad ==5.0.8 + , companion ==0.1.0 + , conduit ==1.3.5 + , conduit-combinators ==1.3.0 + , conduit-extra ==1.3.6 + , containers ==0.6.7 + , contravariant ==1.5.5 + , cookie ==0.4.6 + , cryptohash-sha256 ==0.11.102.1 + , crypton ==0.33 + , crypton-conduit ==0.2.3 + , crypton-connection ==0.3.1 + , crypton-x509 ==1.7.6 + , crypton-x509-store ==1.6.9 + , crypton-x509-system ==1.6.7 + , crypton-x509-validation ==1.6.12 + , data-default-class ==0.1.2.0 + , data-fix ==0.3.2 + , deepseq ==1.4.8.0 + , digest ==0.0.1.7 + , directory ==1.3.7.1 + , distributive ==0.6.2.1 + , dlist ==1.0 + , easy-file ==0.2.5 + , echo ==0.1.4 + , ed25519 ==0.0.5.0 + , exceptions ==0.10.5 + , extra ==1.7.14 + , fast-logger ==3.2.2 + , file-embed ==0.0.15.0 + , filelock ==0.1.1.7 + , filepath ==1.4.2.2 + , foldable1-classes-compat ==0.1 + , fsnotify ==0.4.1.0 + , generic-deriving ==1.14.5 + , generically ==0.1.1 + , ghc-bignum ==1.3 + , ghc-boot ==9.4.7 + , ghc-boot-th ==9.4.7 + , ghc-prim ==0.9.1 + , githash ==0.1.7.0 + , hackage-security ==0.6.2.3 + , hashable ==1.4.3.0 + , hi-file-parser ==0.1.4.0 + , hinotify ==0.4.1 + , hourglass ==0.2.12 + , hpack ==0.36.0 + , hpc ==0.6.1.0 + , http-api-data ==0.5 + , http-client ==0.7.14 + , http-client-tls ==0.3.6.3 + , http-conduit ==2.3.8.1 + , http-download ==0.2.1.0 + , http-types ==0.12.3 + , indexed-traversable ==0.1.2.1 + , indexed-traversable-instances ==0.1.1.2 + , infer-license ==0.2.0 + , integer-gmp ==1.1 + , integer-logarithms ==1.0.3.1 + , iproute ==1.7.12 + , libyaml ==0.1.2 + , lift-type ==0.1.1.1 + , lifted-base ==0.2.3.12 + , lukko ==0.1.1.3 + , megaparsec ==9.3.1 + , memory ==0.18.0 + , microlens ==0.4.13.1 + , microlens-mtl ==0.2.0.3 + , microlens-th ==0.4.3.14 + , mime-types ==0.1.1.0 + , mintty ==0.1.4 + , monad-control ==1.0.3.1 + , monad-logger ==0.3.40 + , monad-loops ==0.4.3 + , mono-traversable ==1.0.15.3 + , mtl ==2.2.2 + , mtl-compat ==0.2.2 + , mustache ==2.4.2 + , neat-interpolation ==0.5.1.3 + , network ==3.1.4.0 + , network-uri ==2.6.4.2 + , old-locale ==1.0.0.7 + , old-time ==1.1.0.3 + , open-browser ==0.2.1.0 + , optparse-applicative ==0.18.1.0 + , optparse-simple ==0.1.1.4 + , pantry ==0.9.2 + , parsec ==3.1.16.1 + , parser-combinators ==1.3.0 + , path ==0.9.2 + , path-io ==1.8.1 + , path-pieces ==0.2.1 + , pem ==0.2.4 + , persistent ==2.14.5.2 + , persistent-sqlite ==2.13.1.1 + , persistent-template ==2.12.0.0 + , pretty ==1.1.3.6 + , prettyprinter ==1.7.1 + , prettyprinter-ansi-terminal ==1.1.3 + , primitive ==0.8.0.0 + , process ==1.6.17.0 + , project-template ==0.2.1.0 + , random ==1.2.1.1 + , resource-pool ==0.4.0.0 + , resourcet ==1.2.6 + , retry ==0.9.3.1 + , rio ==0.1.22.0 + , rio-orphans ==0.1.2.0 + , rio-prettyprint ==0.1.7.0 + , rts ==1.0.2 + , safe ==0.3.19 + , safe-exceptions ==0.1.7.4 + , scientific ==0.3.7.0 + , semialign ==1.3 + , semigroupoids ==5.3.7 + , silently ==1.2.5.3 + , socks ==0.6.1 + , split ==0.2.3.5 + , splitmix ==0.1.0.4 + , stack ==2.13.1 + , static-bytes ==0.1.0 + , stm ==2.5.1.0 + , stm-chans ==3.0.0.9 + , streaming-commons ==0.2.2.6 + , strict ==0.5 + , tagged ==0.8.7 + , tar ==0.5.1.1 + , tar-conduit ==0.4.0 + , template-haskell ==2.19.0.0 + , temporary ==1.3 + , text ==2.0.2 + , text-metrics ==0.3.2 + , text-short ==0.1.5 + , th-abstraction ==0.4.5.0 + , th-compat ==0.1.4 + , th-lift ==0.8.4 + , th-lift-instances ==0.1.20 + , these ==1.2 + , time ==1.12.2 + , time-compat ==1.9.6.1 + , tls ==1.9.0 + , transformers ==0.5.6.2 + , transformers-base ==0.4.6 + , transformers-compat ==0.7.2 + , typed-process ==0.2.11.0 + , unix ==2.7.3 + , unix-compat ==0.7 + , unix-time ==0.4.11 + , unliftio ==0.2.25.0 + , unliftio-core ==0.2.1.0 + , unordered-containers ==0.2.19.1 + , uuid-types ==1.0.5 + , vault ==0.3.1.5 + , vector ==0.13.0.0 + , vector-algorithms ==0.9.0.1 + , vector-stream ==0.1.0.0 + , witherable ==0.4.2 + , yaml ==0.11.11.2 + , zip-archive ==0.4.3 + , zlib ==0.6.3.0
@@ -0,0 +1,40 @@+-- This file is a configuration file for Cabal (the tool). It is provided to +-- assist some users of that tool to develop Stack. For information about +-- `cabal.project` files, see: +-- https://cabal.readthedocs.io/en/stable/cabal-project.html. +-- +-- For information about possible limitations of the `cabal.config` files +-- corresponding to Stackage package sets that are made available by Stackage +-- see: https://github.com/fpco/stackage-server/issues/232. +-- +-- `import:` is only available to users of Cabal (the tool) >= 3.8.1.0. +-- +-- The constraints in file `cabal.config` can be obtained by commanding: +-- +-- > stack ls dependencies cabal > cabal.config +-- +-- However, be aware that, in respect of the `unix` package or the `Win32` +-- package (that may come with GHC, depending on the operating system): +-- +-- * on Windows, the Stack project does not depend on `unix` but depends on +-- `Win32`; and +-- +-- * on non-Windows operating systems, the Stack project does not depend on +-- `Win32` but depends on `unix`. +-- +-- The command above will add one of the two packages to `cabal.config` but omit +-- the other. A comprehensive `cabal.config` will need to be created by editing +-- the command's output. +-- +-- Also be aware that there may be other packages required only on non-Windows +-- systems. For example, the `hinotify` package. +-- +-- Be sure to set `with-compiler: ghc-x.y.z` below to the version of GHC that is +-- specified by the snapshot specifed in Stack's project-level YAML +-- configuration file (`stack.yaml`). The relevant version of GHC can be +-- confirmed by reviewing the snapshot on Stackage. For example, at: +-- https://www.stackage.org/lts-21.13/cabal.config. +-- +with-compiler: ghc-9.4.7 +import: cabal.config +packages: .
@@ -212,7 +212,7 @@ ## Error messages Stack catches exceptions thrown by its dependencies or by Stack itself in -`Main.main`. In addition to exceptions that halt Stack's execution, Stack logs +`Stack.main`. In addition to exceptions that halt Stack's execution, Stack logs certain other matters as 'errors'. To support the Haskell Foundation's @@ -285,19 +285,21 @@ Stack aims to depend on well-known packages. The specific versions on which it depends at any time are specified by `package.yaml` and `stack.yaml`. It does not aim to be compatible with more than one version of the `Cabal` package at -any time. At the time of writing (March 2023) the package versions are primarily -ones in Stackage snapshot LTS Haskell 20.13 (for GHC 9.2.7), together with -extra-dep `Cabal-3.8.1.0`. +any time. At the time of writing (August 2023) the package versions are +primarily ones in Stackage snapshot LTS Haskell 21.8 (for GHC 9.4.5), together +with extra-deps to depend on the latest versions of `ansi-terminal`, `crypton` +(instead of `cryptonite`), `hpack`, `pantry` and `tar-conduit`. A Stack executable makes use of Cabal (the library) through a small 'Setup' executable that it compiles from Haskell source code. The executable compiles that code with a dependency on the version of Cabal that ships with the specified GHC compiler. Each release of Stack will aim to support all versions of GHC and the Cabal package in Stackage snapshots published within seven years -of the release. For example, snapshot LTS Haskell 7.0, published on -14 September 2016, was the first LTS Haskell snapshot to provide GHC 8.0.1 which -comes with `Cabal-1.24.0.0`. Until, at least, 13 September 2023, Stack releases -would aim to support the immediate predecessor, GHC 7.10.3 and `Cabal-1.22.5.0`. +of the release. For example, snapshot LTS Haskell 8.0, published on +12 February 2017, was the first LTS Haskell snapshot to provide GHC 8.0.2 which +comes with `base-4.9.1.0` and `Cabal-1.24.2.0`. Until, at least, +13 February 2024, Stack releases would aim to support the immediate +predecessor, GHC 8.0.1 and `base-4.9.0.0` and `Cabal-1.24.0.0`. When a version of the Stack executable actually ceases to support a version of GHC and `Cabal`, that should be recorded in Stack's @@ -392,14 +394,15 @@ ## Testing -The Stack code has both unit tests and integration tests. Integration tests can -be found in the -[test/integration](https://github.com/commercialhaskell/stack/tree/master/test/integration) -folder and unit tests, in the -[src/test](https://github.com/commercialhaskell/stack/tree/master/src/test) -folder. Tests are written using the [Hspec](https://hspec.github.io/) framework. -In order to run the full test suite, you can simply command: +The Stack code has both unit tests and integration tests. +### Working with Unit Tests + +Unit tests can be found in the +[tests/unit](https://github.com/commercialhaskell/stack/tree/master/tests/unit) +directory. Tests are written using the [Hspec](https://hspec.github.io/) +framework. In order to run the full test suite, you can simply command: + ~~~text stack test ~~~ @@ -410,18 +413,17 @@ to specify which module you'd specifically like to run to get quick feedback. A description of this follows below. -### Working with Unit Tests If you would like to run the unit tests on their own, you can command: ~~~text -stack test stack:stack-test +stack test stack:stack-unit-test ~~~ Running an individual module works with a command like this: ~~~text -stack test stack:stack-test --ta "-m <PATTERN>" +stack test stack:stack-unit-test --ta "-m <PATTERN>" ~~~ Where `<PATTERN>` is the name of the module without `Spec.hs`. @@ -429,7 +431,7 @@ You may also load tests into GHCi and run them with these command: ~~~text -stack ghci stack:stack-test --only-main +stack ghci stack:stack-unit-test --only-main # GHCi starting up output ... > :main -m "<PATTERN>" ~~~ @@ -438,6 +440,10 @@ ### Working with Integration Tests +Integration tests can be found in the +[tests/integration](https://github.com/commercialhaskell/stack/tree/master/tests/integration) +folder. + Running the integration tests is a little involved, you'll need to command: ~~~text @@ -466,7 +472,7 @@ [test/integration/tests/](https://github.com/commercialhaskell/stack/tree/master/test/integration/tests) directory. -You can disable a few integration tests through the -n option : +You can disable a few integration tests through the -n option : ~~~text stack build --flag stack:integration-tests stack --exec "stack-integration-test -n <PATTERN1> -n <PATTERN2>" @@ -561,6 +567,146 @@ Stan is a Haskell static analysis tool. As of 29 August 2022, it does not support GHC >= 9.0.1 and Stack is built with GHC >= 9.2.4. Consequently, this workflow does not run. Its intent is to apply Stan to Stack. + +## Haskell Language Server + +You may be using [Visual Studio Code](https://code.visualstudio.com/) (VS Code) +with its +[Haskell extension](https://marketplace.visualstudio.com/items?itemName=haskell.haskell), +which is powered by the +[Haskell Language Server](https://github.com/haskell/haskell-language-server) +(HLS). + +Stack can be built with Stack (which is recommended) or with Cabal (the tool). + +=== "Stack" + + If you use Stack to build Stack, command `stack ghci` in the root directory + of the Stack project should work as expected, if you have first commanded + `stack build` once. `stack build` causes Cabal (the library) to create the + automatically generated module `Stack_build`. + + If `ghc` is not on your PATH, then Haskell Language Server may report the + following error about `Stack.Constants.ghcShowOptionsOutput`: + ~~~text + • Exception when trying to run compile-time code: + ghc: readCreateProcess: does not exist (No such file or directory) + Code: (TH.runIO (readProcess "ghc" ["--show-options"] "") + >>= TH.lift . lines) + • In the untyped splice: + $(TH.runIO (readProcess "ghc" ["--show-options"] "") >>= TH.lift + . lines) + ~~~ + + `ghc` should be on the PATH if you run VS Code itself in the Stack + environment: + ~~~text + stack exec -- code . + ~~~ + + The following [cradle (`hie.yaml`)](https://github.com/haskell/hie-bios) + should suffice to configure Haskell Language Server (HLS) explicitly for + `./Setup.hs` and each of the buildable components in Stack's Cabal file: + ~~~yaml + cradle: + multi: + - path: "./Setup.hs" + config: + cradle: + direct: + arguments: [] + - path: "./" + config: + cradle: + stack: + - path: "./src" + component: "stack:lib" + - path: "./app" + component: "stack:exe:stack" + - path: "./tests/integration" + component: "stack:exe:stack-integration-test" + - path: "./tests/unit" + component: "stack:test:stack-unit-test" + ~~~ + +=== "Cabal (the tool)" + + If you use Cabal (the tool) to build Stack, command `cabal repl` in the root + directory of the Stack project should work as expected, if you have GHC and + (on Windows) MSYS2 on the PATH. Stack's custom `./Setup.hs` causes + `cabal repl` to cause Cabal (the library) to create the automatically + generated module `Stack_build`. + + If `ghc` is not on your PATH, then Haskell Language Server may report the + following error about `Stack.Constants.ghcShowOptionsOutput`: + ~~~text + • Exception when trying to run compile-time code: + ghc: readCreateProcess: does not exist (No such file or directory) + Code: (TH.runIO (readProcess "ghc" ["--show-options"] "") + >>= TH.lift . lines) + • In the untyped splice: + $(TH.runIO (readProcess "ghc" ["--show-options"] "") >>= TH.lift + . lines) + ~~~ + + `ghc` and (on Windows) MSYS2 should be on the PATH if you run commands + (including `cabal`) in the Stack environment: + ~~~text + stack exec --no-ghc-package-path -- cabal repl + ~~~ + + or + ~~~text + stack exec --no-ghc-package-path -- code . + ~~~ + + Use of GHC's environment variable `GHC_PACKAGE_PATH` is not compatible with + Cabal (the tool). That is why the `--no-ghc-package-path` flag must be + specified with `stack exec` when relying on Cabal (the tool). + + The following [cradle (`hie.yaml`)](https://github.com/haskell/hie-bios) + should suffice to configure Haskell Language Server (HLS) explicitly for + `./Setup.hs` and each of the buildable components in Stack's Cabal file: + ~~~yaml + cradle: + multi: + - path: "./Setup.hs" + config: + cradle: + direct: + arguments: [] + - path: "./" + config: + cradle: + cabal: + - path: "./src" + component: "lib:stack" + - path: "./app" + component: "exe:stack" + - path: "./tests/integration" + component: "exe:stack-integration-test" + - path: "./tests/unit" + component: "test:stack-unit-test" + ~~~ + +A cradle is not committed to Stack's repository because it imposes a choice of +build tool. + +## Dev Containers + +A [Development Container](https://containers.dev) (or Dev Container for short) +allows you to use a container as a full‑featured development environment. + +You can run Dev Containers locally/remotely (with VS Code), or create a +[Codespace](https://github.com/features/codespaces) for a branch in a +repository to develop online. + +Stack's default Dev Container is intended for use with its default +project‑level configuration (`stack.yaml`). But there are also Dev Containers +for the experimental project‑level configurations. + +For further information, see the documentation for +[Dev Containers](dev_containers.md). ## Slack channel
@@ -1,5 +1,83 @@ # Changelog +## v2.13.1 - 2023-09-29 + +Release notes: + +* Further to the release notes for Stack 2.3.1, the `-static` suffix has been + removed from the statically linked Linux/x86_64 binaries. +* The binaries for Linux/Aarch64 are now statically linked. +* Binaries are now provided for macOS/AArch64. + +**Changes since v2.11.1:** + +Behavior changes: + +* Build artefacts are placed in `.stack-work/dist/<platform>/<GHC_version>` + (hashed to a shorter path on Windows), rather than + `.stack-work/dist/<platform>/<Cabal_version>`. This allows build artifacts to + be distinguished by GHC version. +* By default, the `stack build` progress bar is capped to a length equal to the + terminal width. +* When building GHC from source, Stack no longer uses Hadrian's deprecated + `--configure`\\`-c` flag and, instead, seeks to run GHC's Python `boot` and + sh `configure` scripts, and ensure that the `happy` and `alex` executables are + on the PATH. +* When auto-detecting `--ghc-build` on Linux, the `musl` GHC build only is + considered a possible GHC build if `libc.musl-x86_64.so.1` is found in `\lib` + or `\lib64`. +* No longer supports Cabal versions older than `1.24.0.0`. This means projects + using snapshots earlier than `lts-7.0` or `nightly-2016-05-26` will no longer + build. +* When unregistering many packages in a single step, Stack can now do that + efficiently. Stack no longer uses GHC-supplied `ghc-pkg unregister` (which is, + currently, slower). +* `stack hpc report`, `stack list`, `stack templates` and `stack uninstall` + output their information to the standard output stream rather than to the + standard error stream. Logging is still to the standard error stream. +* `stack upgrade` no longer assumes that binary upgrade is not supported on a + AArch64 machine architecture. + +Other enhancements: + +* Bump to Hpack 0.36.0. +* Depend on `pantry-0.9.2`, for support for long filenames and directory names + in archives created by `git archive`. +* Avoid the duplicate resolving of usage files when parsing `*.hi` files into a + set of modules and a collection of resolved usage files. See + [#6123](https://github.com/commercialhaskell/stack/pull/6123). +* Add composable component type flags `--exes`, `--tests` and `--benchmarks` to + Stack's `ide targets` command, to list only those components. +* `stack --verbose` excludes lengthy information about build plan construction + in the debug output by default. The new `stack --[no-]plan-in-log` flag + enables or disables the inclusion of the information in the debug output. +* In YAML configuration files, the `casa` key is introduced, which takes + precedence over the existing `casa-repo-prefix` key. The latter is deprecated. + The new key also allows Stack's use of a Casa (content-addressable storage + archive) server to be disabled and the maximum number of keys per request to + be configured. The defaults are unchanged. +* Add option `--progress-bar=<format>` to Stack's `build` command to configure + the format of the progress bar, where `<format>` is one of `none`, + `count-only` (only the package count), `capped` (capped to a length equal to + the terminal width) and `full` (the previous format). + +Bug fixes: + +* Restore `stack sdist --pvp-bounds lower` (broken with Stack 2.9.1). +* Restore building of Stack with Cabal flag `disable-git-info` (broken with + Stack 2.11.1). +* With `stack hoogle`, avoid the message + `Minimum version is hoogle-5.0. Found acceptable hoogle-<x.y.z> in your index, requiring its installation.` + when a `hoogle` executable has already been found on the `PATH`. +* Stack's sanity check on a selected GHC now passes GHC flag + `-hide-all-packages`, stopping GHC from looking for a package environment in + default locations. +* Restore Stack script files without extensions (broken with Stack 2.11.1). +* Restore message suffix `due to warnings` with `dump-logs: warning` (broken + with Stack 2.11.1). +* On Windows, the `local-programs-path` directory can now be on a different + drive to the system temporary directory and MSYS2 will still be installed. + ## v2.11.1 - 2023-05-18 **Changes since v2.9.3:** @@ -66,6 +144,17 @@ * The warning that sublibrary dependency is not supported is no longer triggered by internal libraries. +## v2.9.3.1 - 2023-06-22 + +Hackage-only release of the `stack` package: + +* Supports building against snapshot Stackage LTS Haskell 21.0 (GHC 9.4.5), + without extra deps. +* Supports build with `persistent-2.14.5.0`, using CPP directives. +* Supports build with `unix-compat-0.7`, by removing reliance on the module + `System.PosixCompat.User` removed in that package. +* Includes `cabal.project` and `cabal.config` files in the package. + ## v2.9.3 - 2022-12-16 **Changes since v2.9.1:** @@ -87,7 +176,7 @@ [Haskell Error Index](https://errors.haskell.org/) initiative, all Stack error messages generated by Stack itself begin with an unique code in the form `[S-nnnn]`, where `nnnn` is a four-digit number. -* Test suite executables that seek input on the standard input channel (`stdin`) +* Test suite executables that seek input on the standard input stream (`stdin`) will not throw an exception. Previously, they would thow an exception, consistent with Cabal's 'exitcode-stdio-1.0' test suite interface specification. Pass the flag `--no-tests-allow-stdin` to `stack build` to @@ -131,7 +220,14 @@ * After an upgrade from an earlier version of Stack, on first use only, Stack 2.9.1 may warn that it had trouble loading the CompilerPaths cache. +* The support from the Stack team for binary releases now includes Linux/AArch64 + and is limited to: + * Linux 64-bit/x86_64 (statically linked) + * Linux AArch64 (dynamically linked) + * macOS x86_64 + * Windows 64-bit/x86_64 + Behavior changes: * `stack build --coverage` will generate a unified coverage report, even if @@ -296,8 +392,8 @@ Bug fixes: -* `stack new` now supports branches other than `master` as default for - GitHub repositories. See +* `stack new` now supports branches other than `master` as default for GitHub + repositories. See [#5422](https://github.com/commercialhaskell/stack/issues/5422) * Ignore all errors from `hi-file-parser`. See @@ -333,8 +429,8 @@ Behavior changes: -* File watching now takes into account specified targets, old behavior could - be restored using the new flag `--watch-all` +* File watching now takes into account specified targets, old behavior could be + restored using the new flag `--watch-all` [#5310](https://github.com/commercialhaskell/stack/issues/5310) Other enhancements: @@ -371,8 +467,8 @@ Bug fixes: * When using the `STACK_YAML` env var with Docker, make the path absolute. -* Fix the problem of `stack repl foo:test:bar` failing without a project - build before that. See +* Fix the problem of `stack repl foo:test:bar` failing without a project build + before that. See [#5213](https://github.com/commercialhaskell/stack/issues/5213) * Fix `stack sdist` introducing unnecessary sublibrary syntax when using pvp-bounds. See @@ -385,35 +481,36 @@ * We have reduced the number of platforms that we support with binary releases. The reason behind this is that we've been slowed down in our release process until now with issues trying to build binaries for less common platforms. In - order to make sure we can address issues more quickly (like supporting new - GHC versions), we're limiting support from the Stack team to: + order to make sure we can address issues more quickly (like supporting new GHC + versions), we're limiting support from the Stack team to: - * Linux 64-bit (static) - * macOS - * Windows 64-bit + * Linux 64-bit/x86_64 (statically linked) + * macOS x86_64 + * Windows 64-bit/x86_64 - If others want to provide additional binaries, we will definitely be happy - for the support. But since our CI system is currently able to produce these - three bindists only, that's what we will be providing with the next release. + If others want to provide additional binaries, we will definitely be happy for + the support. But since our CI system is currently able to produce these three + bindists only, that's what we will be providing with the next release. -* Since we no longer have dynamically linked Linux binaries, we are removing - removing the `-static` suffix from the static Linux binaries. If you have - scripts to download the latest stable Linux binary, update them to use +* Since we no longer have dynamically linked Linux binaries, we are removing the + `-static` suffix from the static Linux/x86_64 binaries. If you have scripts to + download the latest stable Linux/x86_64 binary, update them to use `linux-x86_64` instead of `linux-x86_64-static` (if you are already using the - former, nothing needs to change). For this release, both are supported, but + former, nothing needs to change). For this release, both are supported, but the next release will no longer have the `-static` variant. -* We are also deprecating the download links at https://stackage.org/stack. - See this page for the current installation instructions: +* We are also deprecating the download links at https://stackage.org/stack. See + this page for the current installation instructions: https://docs.haskellstack.org/en/stable/install_and_upgrade/. -* These are the canonical locations to download the latest stable binaries - from, and will continue to be supported going forward: +* These are the canonical locations to download the latest stable binaries from, + and will continue to be supported going forward: - * Linux 64-bit (static): + * Linux 64-bit/x86_64 (static): https://get.haskellstack.org/stable/linux-x86_64.tar.gz - * macOS: https://get.haskellstack.org/stable/osx-x86_64.tar.gz - * Windows 64-bit: https://get.haskellstack.org/stable/windows-x86_64.zip + * macOS x86_64: https://get.haskellstack.org/stable/osx-x86_64.tar.gz + * Windows 64-bit/x86_64: + https://get.haskellstack.org/stable/windows-x86_64.zip As always, binaries for specific versions are available from the GitHub releases: https://github.com/commercialhaskell/stack/releases. @@ -459,11 +556,11 @@ Other enhancements: -* Add `build-output-timestamps` flag in yaml. Setting it to true - prefixes each build log output line with a timestamp. +* Add `build-output-timestamps` flag in yaml. Setting it to true prefixes each + build log output line with a timestamp. -* Show warning about `local-programs-path` with spaces on windows - when running scripts. See +* Show warning about `local-programs-path` with spaces on windows when running + scripts. See [#5013](https://github.com/commercialhaskell/stack/pull/5013) * Add `ls dependencies json` which will print dependencies as JSON. @@ -525,8 +622,8 @@ Behavior changes: -* Disable WAL mode for SQLite3 databases, to improve compatibility with - some platforms and filesystems. See +* Disable WAL mode for SQLite3 databases, to improve compatibility with some + platforms and filesystems. See [#4876](https://github.com/commercialhaskell/stack/issues/4876). * By default, do not perform expiry checks in Hackage Security. See @@ -534,13 +631,12 @@ Other enhancements: -* Do not rerun expected test failures. This is mostly a change that - will only affect the Stackage Curator use case, but there is now an - additional message letting the user know when a previously-failed - test case is being rerun. +* Do not rerun expected test failures. This is mostly a change that will only + affect the Stackage Curator use case, but there is now an additional message + letting the user know when a previously-failed test case is being rerun. -* Move configure information for local packages back to .stack-work to - improve caching. See +* Move configure information for local packages back to .stack-work to improve + caching. See [#4893](https://github.com/commercialhaskell/stack/issues/4893). Bug fixes: @@ -559,12 +655,12 @@ avoiding a SIGTERM screwing up GHC installation. See [#4888](https://github.com/commercialhaskell/stack/issues/4888). -* Use package complete locations from lock files when resolving dependencies - in `extra-deps`. See +* Use package complete locations from lock files when resolving dependencies in + `extra-deps`. See [#4887](https://github.com/commercialhaskell/stack/issues/4887). -* Set the `HASKELL_DIST_DIR` environment to a proper package dist - directory so `doctest` is able to load modules autogenerated by Cabal. +* Set the `HASKELL_DIST_DIR` environment to a proper package dist directory so + `doctest` is able to load modules autogenerated by Cabal. * Expose package library when running tests. @@ -586,11 +682,11 @@ basis on individual packages (see [#4860](https://github.com/commercialhaskell/stack/issues/4860)) -If building a `stack` executable for distribution, please download the -source code from https://github.com/commercialhaskell/stack/releases/tag/v2.1.1 -and build it using Stack itself in order to ensure identical behaviour -to official binaries. This package on Hackage is provided for convenience -and bootstrapping purposes. +If building a `stack` executable for distribution, please download the source +code from https://github.com/commercialhaskell/stack/releases/tag/v2.1.1 and +build it using Stack itself in order to ensure identical behaviour to official +binaries. This package on Hackage is provided for convenience and bootstrapping +purposes. ## v2.1.1 - 2019-06-13 @@ -608,9 +704,8 @@ Major changes: -* Switch over to pantry for managing packages. This is a major change - to Stack's internals, and affects user-visible behavior in a few - places. Some highlights: +* Switch over to pantry for managing packages. This is a major change to Stack's + internals, and affects user-visible behavior in a few places. Some highlights: * Drop support for multiple package indices and legacy `00-index.tar` style indices. See [#4137](https://github.com/commercialhaskell/stack/issues/4137).
@@ -248,15 +248,15 @@ ~~~yaml resolver: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/19.yaml + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/8.yaml packages: - . ~~~ The value of the `resolver` key tells Stack *how* to build your package: which GHC version to use, versions of package dependencies, and so on. Our value here -says to use [LTS Haskell 20.19](https://www.stackage.org/lts-20.19), which -implies GHC 9.2.7 (which is why `stack build` installs that version of GHC if it +says to use [LTS Haskell 21.13](https://www.stackage.org/lts-21.13), which +implies GHC 9.4.7 (which is why `stack build` installs that version of GHC if it is not already available to Stack). There are a number of values you can use for `resolver`, which we'll cover later. @@ -503,7 +503,7 @@ a bit of information about it at [https://www.stackage.org/lts](https://www.stackage.org/lts), including: -* The appropriate resolver value (`resolver: lts-20.19`, as is currently the +* The appropriate resolver value (`resolver: lts-21.13`, as is currently the latest LTS) * The GHC version used * A full list of all packages available in this snapshot @@ -522,16 +522,16 @@ ## Resolvers and changing your compiler version -Let's explore package sets a bit further. Instead of `lts-20.19`, let's change +Let's explore package sets a bit further. Instead of `lts-21.13`, let's change our `stack.yaml` file to use the [latest nightly](https://www.stackage.org/nightly). Right now, this is currently -2023-05-05 - please see the resolver from the link above to get the latest. +2023-09-24 - please see the resolver from the link above to get the latest. Then, commanding `stack build` again will produce: ~~~text stack build -# Downloaded nightly-2023-05-05 build plan. +# Downloaded nightly-2023-09-24 build plan. # build output ... ~~~ @@ -539,15 +539,15 @@ Continuous Integration (CI) setting, like on Travis. For example, command: ~~~text -stack --resolver lts-18.28 build -# Downloaded lts-18.28 build plan. +stack --resolver lts-20.26 build +# Downloaded lts-20.26 build plan. # build output ... ~~~ When passed on the command line, you also get some additional "short-cut" versions of resolvers: `--resolver nightly` will use the newest Nightly resolver -available, `--resolver lts` will use the newest LTS, and `--resolver lts-20` -will use the newest LTS in the 20.x series. The reason these are only available +available, `--resolver lts` will use the newest LTS, and `--resolver lts-21` +will use the newest LTS in the 21.x series. The reason these are only available on the command line and not in your `stack.yaml` file is that using them: 1. Will slow down your build (since Stack then needs to download information on @@ -1340,7 +1340,7 @@ ~~~text Run from outside a project, using implicit global project config -Using latest snapshot resolver: lts-20.19 +Using latest snapshot resolver: lts-21.13 Writing global (non-project-specific) config file to: /home/michael/.stack/global/stack.yaml Note: You can change the snapshot via the resolver field there. I installed the stm package via --package stm
@@ -93,13 +93,7 @@ M2 chip. These chips use an architecture known as ARM64 or AArch64. For Mac computers with Apple silicon, the easiest way to install Stack - directly (rather than use GHCup) is to obtain the 'unofficial' - `osx-aarch64` binary distribution released by the GHCup developers and - copy it to a location on the PATH. `*.tar.gz` archive files containing - those binary distributions are available at the directories here: - [:material-cloud-download-outline:](https://downloads.haskell.org/ghcup/unofficial-bindists/stack/). - - It is still possible to use the commands: + directly (rather than use GHCup) is to command: ~~~text curl -sSL https://get.haskellstack.org/ | sh @@ -111,25 +105,27 @@ wget -qO- https://get.haskellstack.org/ | sh ~~~ - However, those commands will download and install the version of Stack - for Intel-based Mac computers. Mac computers with Apple silicon will - use Apple's - [Rosetta 2 application](https://support.apple.com/en-gb/HT211861) to - use that version of Stack. - - Apple's Terminal application will not detect automatically that Rosetta - has not yet been installed. Rosetta can be manually installed by - commanding: + !!! note - ~~~text - softwareupdate --install-rosetta - ~~~ + The script at [get.haskellstack.org](https://get.haskellstack.org/) + will ask for root access using `sudo`. It needs such access in order + to use your platform's package manager to install dependencies and + to install to `/usr/local/bin`. If you prefer more control, follow + the manual installation instructions in the + [install and upgrade guide](install_and_upgrade.md). === "Windows" On 64-bit Windows, the easiest way to install Stack directly (rather than use GHCup) is to download and install the [Windows installer](https://get.haskellstack.org/stable/windows-x86_64-installer.exe). + + !!! warning + + The Windows installer for Stack 2.9.1, 2.9.3 and 2.11.1 (current) (only) + will replace the user `PATH` environment variable (rather than append to + it) if a 1024 character limit is exceeded. If the content of your + existing user `PATH` is long, preserve it before running the installer. !!! note
@@ -75,9 +75,9 @@ For this workaround to work, each time that a resolver is used that references a different version of GHC, then GHCup must be used to install it (if GHCup has -not already installed that version). For example, to use `resolver: lts-20.19` -(GHC 9.2.7), the command `ghcup install ghc 9.2.7` must have been used to -install GHC 9.2.7. That may be a minor inconvenience for some people, as one the +not already installed that version). For example, to use `resolver: lts-21.13` +(GHC 9.4.7), the command `ghcup install ghc 9.4.7` must have been used to +install GHC 9.4.7. That may be a minor inconvenience for some people, as one the primary benefits of Stack over other Haskell build tools has been that Stack automatically ensures that the necessary version of GHC is available.
@@ -85,13 +85,27 @@ of the test suite and benchmark components, respectively, are selected to be built. - Stackage snapshots do not include directly GHC boot packages (packages that - come with GHC and are included in GHC's global package database). For - example, if `Cabal` is not a local package or an extra dep, then - `stack build Cabal` will specify the latest version of that package in the + If *package* is a GHC boot package (packages that come with GHC and are + included in GHC's global package database), the behaviour can be complex. + If the boot package has not been 'replaced', then `stack build` will, + effectively, do nothing. However, if the boot package has been 'replaced' + then `stack build` will specify the latest version of that package in the package index, which may differ from the version provided by the version of - GHC specified by the snapshot. + GHC specified by the snapshot. A boot package will be treated as 'replaced' + if the package is included directly in the Stackage snapshot or it depends + on a package included directly in the snapshot. Stackage snapshots do not + include directly most boot packages but some snapshots may include directly + some boot packages. In particular, some snapshots include directly `Win32` + (which is a boot package on Windows) while others do not. For example, if + `Cabal` (a boot package) is not a local package or an extra dep, then + `stack build Cabal` with Stackage snapshot LTS Haskell 20.25 will: + * on Windows, try to build the latest version of `Cabal` in the package + index (because that snapshot includes `Win32` directly, and `Cabal` + depends on `Win32` and so is treated as 'replaced'); and + * on non-Windows, effectively, do nothing (because `Cabal` is not + 'replaced'). + * *package identifier*, e.g. `stack build foobar-1.2.3`, is usually used to include specific package versions from the package index. @@ -144,8 +158,8 @@ `stack build` with no targets specified will build all local packages. -Command `stack ide targets` to get a list of the available targets in your -project. +For further information about available targets, see the +[`stack ide targets` command](ide_command.md). ## Controlling what gets built @@ -184,7 +198,7 @@ command line only) with: ~~~text -stack build --flag *:[-]<flag)name> +stack build --flag *:[-]<flag_name> ~~~ !!! note @@ -315,6 +329,8 @@ ### `--watch-all` flag +[:octicons-tag-24: 2.5.1](https://github.com/commercialhaskell/stack/releases/tag/v2.5.1) + Pass the flag to rebuild your project every time any local file changes (from project packages or from local dependencies). See also the `--file-watch` flag. @@ -539,17 +555,20 @@ `stack build <package_name>`). * **One target package:** The build output for the target package is sent to the - console as it happens. + standard error stream of the console as it happens. * **More than one target package:** The build output from GHC (as opposed to from Stack) for each target package is sent to a log file for that package, - unless an error occurs. At the end of the build, the location of the directory - containing the log files is reported. To also output the contents of the log - files to the console at the end of the build, use Stack's `dump-logs` option. - For further information about that option, see the + unless an error occurs that prevents that. If color in output is in use, there + will be two files, one with extension `.log` without color codes and one with + extension `.log-color` with color codes. At the end of the build, the location + of the directory containing the log files is reported. To also output the + contents of the log files to the standard error output stream of the console + at the end of the build, use Stack's `dump-logs` option. For further + information about that option, see the [YAML configuration](yaml_configuration.md#dump-logs) documentation. The - default `dump-logs` mode is to output the contents of the log files that are - warnings. + default `dump-logs` mode is to output the contents of any log files that + include GHC warnings. ### `--[no]-open` flag @@ -566,6 +585,20 @@ Set the flag to enable fetching packages necessary for the build immediately. This can be useful with `stack build --dry-run`. +### `--progress-bar` option + +[:octicons-tag-24: 2.13.1](https://github.com/commercialhaskell/stack/releases/tag/v2.13.1) + +Default: `capped` + +`stack build --progress-bar <format>` sets the format of the progress bar, where +`<format>` is one of `none` (no bar), `count-only` (only the package count is +displayed), `capped` (the bar showing package builds in progress is capped to a +length equal to the terminal width), and `full` (the bar is uncapped). On +terminals where 'backspace' has no effect if the cursor is in the first column, +bars longer than the terminal width will not be 'sticky' at the bottom of the +screen. + ### `--tests-allow-stdin` flag [:octicons-tag-24: 2.9.3](https://github.com/commercialhaskell/stack/releases/tag/v2.9.3) @@ -575,10 +608,10 @@ Cabal defines a test suite interface ['exitcode-stdio-1.0'](https://hackage.haskell.org/package/Cabal-syntax-3.8.1.0/docs/Distribution-Types-TestSuiteInterface.html#v:TestSuiteExeV1.0) where the test suite takes the form of an executable and the executable takes -nothing on the standard input channel (`stdin`). Pass this flag to override that -specification and allow the executable to receive input on that channel. If you +nothing on the standard input stream (`stdin`). Pass this flag to override that +specification and allow the executable to receive input on that stream. If you pass `--no-tests-allow-stdin` and the executable seeks input on the standard -input channel, an exception will be thown. +input stream, an exception will be thown. ## Examples
@@ -1,162 +0,0 @@-<div class="hidden-warning"><a href="https://docs.haskellstack.org/"><img src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack/doc/img/hidden-warning.svg"></a></div> - -# The `stack hpc` commands - -~~~text -stack hpc COMMAND - -Available commands: - report Generate unified HPC coverage report from tix files - and project targets -~~~ - -Code coverage is a measure of the degree to which the source code of a program -is executed when a test suite is run. -[Haskell Program Coverage (HPC)](https://ku-fpg.github.io/software/hpc/) is a -code coverage tool for Haskell that is provided with GHC. Code coverage is -enabled by passing the flag `--coverage` to `stack build`. - -`stack hpc` provides commands specific to HPC. Command `stack hpc` for the -available commands. - -The following refers to the local HPC root directory. Its location can be -obtained by command: - -~~~text -stack path --local-hpc-root -~~~ - -## The `stack hpc report` command - -~~~text -stack hpc report [TARGET_OR_TIX] [--all] [--destdir DIR] [--open] -~~~ - -The `stack hpc report` command generates a report for a selection of targets and -`.tix` files. - -Pass the flag `--all` for a report that uses all stored results. - -Pass the flag --open` to open the HTML report in your browser. - -## The `extra-tix-files` directory - -During the execution of the build, you can place additional tix files in the -`extra-tix-files` subdirectory in the local HPC root directory, in order for -them to be included in the unified report. A couple caveats: - -1. These tix files must be generated by executables that are built against the - exact same library versions. Also note that, on subsequent builds with - coverage, the local HPC root directory will be recursively deleted. It - just stores the most recent coverage data. - -2. These tix files will not be considered by `stack hpc report` unless listed - explicitly by file name. - -## Examples - -If we have three different packages with test suites, packages `A`, `B`, and -`C`, the default unified report will have coverage from all three. If we want a -unified report with just two, we can instead command: - -~~~text -stack hpc report A B -~~~ - -This will output a textual report for the combined coverage from `A` and `B`'s -test suites, along with a path to the HTML for the report. - -This command also supports taking extra `.tix` files. If you've also built an -executable, against exactly the same library versions of `A`, `B`, and `C`, then -you could command the following: - -~~~text -stack exec -- an-exe -stack hpc report A B C an-exe.tix -~~~ - -or, equivalently: - -~~~text -stack exec -- an-exe -stack hpc report --all an-exe.tix -~~~ - -This report will consider all test results as well as the newly generated -`an-exe.tix` file. - -## Usage - -`stack test --coverage` is quite streamlined for the following use-case: - -1. You have test suites which exercise your local packages. - -2. These test suites link against your library, rather than building the - library directly. Coverage information is only given for libraries, ignoring - the modules which get compiled directly into your executable. A common case - where this doesn't happen is when your test suite and library both have - something like `hs-source-dirs: src/`. In this case, when building your test - suite you may also be compiling your library, instead of just linking - against it. - -When your project has these properties, you will get the following: - -1. Textual coverage reports in the build output. - -2. A unified textual and HTML report, considering the coverage on all local - libraries, based on all of the tests that were run. - -3. An index of all generated HTML reports, in `index.html` in the local - HPC root directory. - -## Implementation details - -Most users can get away with just understanding the above documentation. -However, advanced users may want to understand exactly how `--coverage` works: - -1. The GHC option `-fhpc` gets passed to all local packages. This tells GHC to - output executables that track coverage information and output them to `.tix` - files. `the-exe-name.tix` files will get written to the working directory of - the executable. - - When switching on this flag, it will usually cause all local packages to be - rebuilt (see issue - [#1940](https://github.com/commercialhaskell/stack/issues/1940)). - -2. Before the build runs with `--coverage`, the contents of the local HPC root - directory gets deleted. This prevents old reports from getting mixed - with new reports. If you want to preserve report information from multiple - runs, copy the contents of this path to a new directory. - -3. Before a test run, if a `test-name.tix` file exists in the package directory, - it will be deleted. - -4. After a test run, it will expect a `test-name.tix` file to exist. This file - will then get loaded, modified, and outputted to - `pkg-name/test-name/test-name.tix` in the local HPC root directory. - - The `.tix` file gets modified to remove coverage file that isn't associated - with a library. So, this means that you won't get coverage information for - the modules compiled in the `executable` or `test-suite` stanza of your Cabal - file. This makes it possible to directly union multiple `*.tix` files from - different executables (assuming they are using the exact same versions of the - local packages). - - If there is enough popular demand, it may be possible in the future to give - coverage information for modules that are compiled directly into the - executable. See issue - [#1359](https://github.com/commercialhaskell/stack/issues/1359). - -5. Once we have a `.tix` file for a test, we also generate a textual and HTML - report for it. The textual report is sent to the terminal. The index of the - test-specific HTML report is available `pkg-name/test-name/index.html` in the - local HPC root directory. - -6. After the build completes, if there are multiple output `*.tix` files, they - get combined into a unified report. The index of this report will be - available at `combined/all/index.html` in the local HPC root directory. - -7. Finally, an index of the resulting coverage reports is generated. It links to - the individual coverage reports (one for each test-suite), as well as the - unified report. This index is available at `index.html` in the local HPC root - directory.
@@ -17,8 +17,8 @@ snapshot specification. ~~~yaml -resolver: lts-20.19 # Inherits GHC version and package set -compiler: ghc-9.6.1 # Overwrites GHC version in the resolver, optional +resolver: lts-21.13 # Inherits GHC version and package set +compiler: ghc-9.6.2 # Overwrites GHC version in the resolver, optional # Additional packages, follows extra-deps syntax packages: @@ -61,35 +61,35 @@ ### Overriding the compiler -The following snapshot specification will be identical to `lts-20.19`, but instead -use `ghc-9.2.6` instead of `ghc-9.2.7`: +The following snapshot specification will be identical to `lts-21.13`, but +instead use `ghc-9.4.5` instead of `ghc-9.4.7`: ~~~yaml -resolver: lts-20.19 -compiler: ghc-9.2.6 +resolver: lts-21.13 +compiler: ghc-9.4.5 ~~~ ### Dropping packages -The following snapshot specification will be identical to `lts-20.19`, but without -the `text` package in our snapshot. Removing this package will cause all the -packages that depend on `text` to be unbuildable, but they will still be present -in the snapshot. +The following snapshot specification will be identical to `lts-21.13`, but +without the `text` package in our snapshot. Removing this package will cause all +the packages that depend on `text` to be unbuildable, but they will still be +present in the snapshot. ~~~yaml -resolver: lts-20.19 +resolver: lts-21.13 drop-packages: - text ~~~ ### Hiding packages -The following snapshot specification will be identical to `lts-20.19`, but the +The following snapshot specification will be identical to `lts-21.13`, but the `text` package will be hidden when registering. This will affect, for example, the import parser in the script command. ~~~yaml -resolver: lts-20.19 +resolver: lts-21.13 hidden: - text ~~~ @@ -99,13 +99,13 @@ In order to specify GHC options for a package, you use the same syntax as the [ghc-options](yaml_configuration.md#ghc-options) key for build configuration. -The following snapshot specification will be identical to `lts-20.19`, but +The following snapshot specification will be identical to `lts-21.13`, but provides `-O1` as a ghc-option for `text`: ~~~yaml -resolver: lts-20.19 +resolver: lts-21.13 packages: -- text-1.2.5.0 +- text-2.0.2 ghc-options: text: -O1 ~~~ @@ -122,13 +122,13 @@ In order to specify Cabal flags for a package, you use the same syntax as the [flags](yaml_configuration.md#flags) key for build configuration. The -following snapshot specification will be identical to `lts-20.19`, but +following snapshot specification will be identical to `lts-21.13`, but it enables the `developer` Cabal flag: ~~~yaml -resolver: lts-20.19 +resolver: lts-21.13 packages: -- text-1.2.5.0 +- text-2.0.2 flags: text: developer: true
@@ -1,103 +0,0 @@-<div class="hidden-warning"><a href="https://docs.haskellstack.org/"><img src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack/doc/img/hidden-warning.svg"></a></div> - -# The `stack dot` command - -~~~text -stack dot [--[no-]external] [--[no-]include-base] [--depth DEPTH] - [--prune PACKAGES] [TARGET] [--flag PACKAGE:[-]FLAG] - [--test] [--bench] [--global-hints] -~~~ - -A package and its dependencies and the direct dependency relationships between -them form a directed graph. [Graphviz](https://www.graphviz.org/) is open source -software that visualises graphs. It provides the DOT language for defining -graphs and the `dot` executable for drawing directed graphs. Graphviz is -available to [download](https://www.graphviz.org/download/) for Linux, Windows, -macOS and FreeBSD. - -`stack dot` produces output, to the standard output channel, in the DOT language -to represent the relationships between your packages and their dependencies. - -By default: - -* external dependencies are excluded from the output. Pass the flag - `--external` to include external dependencies; -* the `base` package and its dependencies are included in the output. Pass the - flag `--no-include-base` to exclude `base` and its dependencies; -* there is no limit to the depth of the resolution of dependencies. Pass the - `--depth <depth>` option to limit the depth; -* all relevant packages are included in the output. Pass the - `--prude <packages>` option to exclude the specified packages, where - `<packages>` is a list of package names separated by commas; -* all packages in the project are included in the output. However, the target - for the command can be specified as an argument. It uses the same format - as the [`stack build` command](build_command.md); -* test components of the packages in the project are excluded from the output. - Pass the flag `--test` to include test components; and -* benchmark components of the packages in the project are excluded from the - output. Pass the flag `--bench` to include benchmark components.git p - -Pass the option `--flag <package_name>:<flag_name>` or -`--flag <package_name>:-<flag_name>` to set or unset a Cabal flag. This -option can be specified multiple times. - -Pass the flag `--global-hints` to use a hint file for global packages. If a hint -file is used, GHC does not need to be installed. - -## Examples - -The following examples are based on a version of the -[`wreq` package](https://hackage.haskell.org/package/wreq). In each case, the -output from `stack dot` is piped as an input into Graphviz's `dot` executable, -and `dot` produces output in the form of a PNG file named `wreq.png`. - -* A simple example: - - ~~~text - stack dot | dot -Tpng -o wreq.png - ~~~ - - [](https://cloud.githubusercontent.com/assets/591567/8478591/ae10a418-20d2-11e5-8945-55246dcfac62.png) - -* Include external dependencies: - - ~~~text - stack dot --external | dot -Tpng -o wreq.png - ~~~ - - [](https://cloud.githubusercontent.com/assets/591567/8478621/d247247e-20d2-11e5-993d-79096e382abd.png) - -* Include external dependencies, limit the depth and save the output from - `stack dot` as an intermediate file (`wreq.dot`). - - ~~~text - stack dot --external --depth 1 > wreq.dot - dot -Tpng -o wreq.png wreq.dot - ~~~ - -* Include external dependencies, exclude `base` and limit the depth: - - ~~~text - stack dot --no-include-base --external --depth 1 | dot -Tpng -o wreq.png - ~~~ - - [](https://cloud.githubusercontent.com/assets/591567/8484310/45b399a0-20f7-11e5-8068-031c2b352961.png) - -* Include external dependencies and prune `base` and other packages: - - ~~~text - stack dot --external --prune base,lens,wreq-examples,http-client,aeson,tls,http-client-tls,exceptions | dot -Tpng -o wreq.png - ~~~ - - [](https://cloud.githubusercontent.com/assets/591567/8478768/adbad280-20d3-11e5-9992-914dc24fe569.png) - -* Include external dependencies, prune `base` and other packages, and use a - different Graphviz executable to draw the graph: - - Graphviz's `twopi` executable draws graphs in a radial layout. - - ~~~text - stack dot --external --prune base,lens,wreq-examples,http-client,aeson,tls,http-client-tls,exceptions | twopi -Groot=wreq -Goverlap=false -Tpng -o wreq.png - ~~~ - - [](https://cloud.githubusercontent.com/assets/591567/8495538/9fae1184-216e-11e5-9931-99e6147f8aed.png)
@@ -0,0 +1,177 @@+<div class="hidden-warning"><a href="https://docs.haskellstack.org/"><img src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack/doc/img/hidden-warning.svg"></a></div> + +# Dev Containers + +A *container* refers to an isolated area of memory where application software +and some drivers execute. A [Development Container](https://containers.dev) (or +Dev Container for short) allows a container to be used as a full‑featured +development environment. + +Stack provides the following Dev Containers: + +* a default Dev Container, intended for use with Stack's project‑level + configuration (`stack.yaml`); and +* alternative Dev Containers, intended for use with Stack's experimental + project‑level configurations (in anticipation of building Stack with more + recent versions of GHC). + +Stack's Dev Containers provide the following tools: + +1. The + [Haskell Toolchain](https://www.haskell.org/ghcup/install/#supported-tools) + ([GHC](https://www.haskell.org/ghc), Stack, + [Cabal (the tool)](https://cabal.readthedocs.io) and + [HLS](https://haskell-language-server.readthedocs.io)) +2. [Git](https://git-scm.com) +3. [HLint](https://hackage.haskell.org/package/hlint) +4. [yamllint](https://yamllint.readthedocs.io) +5. [ShellCheck](https://www.shellcheck.net) +6. [hadolint](https://github.com/hadolint/hadolint) + +The tools in the Haskell Toolchain are installed at `/usr/local/bin`. HLS is +provided in the default Dev Container only. + +!!! info + + The PATH is + `$HOME/.cabal/bin:$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin`. + Consequently, executables installed with Cabal (the tool) (at + `$HOME/.cabal/bin`) or Stack or Pip (at `$HOME/.local/bin`) take precedence + over the same executable installed at `/usr/local/sbin`, `/usr/local/bin`, + etc. + +[VS Code](https://code.visualstudio.com) is used as IDE, with the following +extensions pre‑installed: + +* [Haskell](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) + (Default Dev Container only) +* [GitHub Pull Requests and Issues](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) +* [GitLens — Git supercharged](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) + * Pinned to version 11.7.0 due to unsolicited AI content in recent versions +* [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph) +* [ShellCheck](https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck) +* [hadolint](https://marketplace.visualstudio.com/items?itemName=exiasr.hadolint) +* [Resource Monitor](https://marketplace.visualstudio.com/items?itemName=mutantdino.resourcemonitor) + +## Parent images + +Stack's Dev Containers are derived from Docker images that are used to build the +*statically linked* Linux/x86_64 and Linux/AArch64 binary distributions of +Stack. + +These Docker images are multi-architecture (`linux/amd64`, `linux/arm64/v8`) +*ghc‑musl* images. They are based on Alpine Linux (that is +[musl libc](https://musl.libc.org) and [BusyBox](https://www.busybox.net)). + +The images contain *unofficial* binary distributions of GHC 9.4.7 and 9.6.2 +(that is, ones not released by the GHC developers). That is because: + +1. the official GHC 9.6.2 binary distributions for Alpine Linux/x86_64 have + known bugs; and +2. there are no official binary distributions for Alpine Linux/AArch64. + +Stack's global configuration (`/etc/stack/config.yaml`) sets `system-ghc: true` +and `install-ghc: false`. That ensures that only the GHC available in the Dev +Containers is used. + +## Usage + +You can run Dev Containers locally/remotely with VS Code, or create a +[GitHub Codespace](https://github.com/features/codespaces) for a branch in a +repository to develop online. + +=== "VS Code" + + Follow the instructions at + [Developing inside a Container](https://code.visualstudio.com/docs/devcontainers/containers). + +=== "GitHub Codespaces" + + For use with GitHub Codespaces, follow the instructions at + [Creating a codespace for a repository](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository#creating-a-codespace-for-a-repository). + +### Persistence + +Data in the following locations is persisted: + +1. The user's home directory (`/home/vscode` or, for the root user, `/root`). + Use with Docker/Podman in *rootless mode*. +2. The Dev Container's workspace (`/workspaces`) + +This is accomplished via either a *volume* or *bind mount* (or *loop device* +on Codespaces) and is preconfigured. + +!!! info + + The VS Code Command Palette command + ['Codespaces: Full Rebuild Container'](https://docs.github.com/en/codespaces/developing-in-codespaces/rebuilding-the-container-in-a-codespace#rebuilding-a-container) + resets the home directory. This is never necessary unless you want exactly + that. + +## Build Stack + +Stack can be built with Stack (which is recommended) or with Cabal (the tool). + +=== "Stack" + + Command <nobr>`stack build`</nobr> to build the `stack` executable. + + Append <nobr>`--flag=stack:static`</nobr> to build a *statically linked* + `stack` executable that can run on any Linux machine of the same + architecture. + + Append <nobr>`--stack-yaml stack-ghc-$GHC_VERSION.yaml`</nobr> if you want + to use an experimental project‑level configuration with the appropriate Dev + Container. + +=== "Cabal (the tool)" + + !!! info + + Default Dev Container only. + + Command <nobr>`cabal build`</nobr> to build the `stack` executable. + + Append <nobr>`--flag=static`</nobr> to build a *statically linked* `stack` + executable that can run on any Linux machine of the same architecture. + +## Haskell Language Server (HLS) + +The +[Haskell Language Server](https://github.com/haskell/haskell-language-server) +and the +[Haskell extension](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) +are only available in the default Dev Container. In order to use the Haskell +extension, you must first configure the project for the build tool of your +choice. + +<!-- +**Stack** + +Place the cradle ([hie.yaml](assets/cradles/stack/hie.yaml)) for Stack in the +root of the workspace: `cp -f .devcontainer/assets/cradles/stack/hie.yaml .` + +**Cabal** + +Place the cradle ([hie.yaml](assets/cradles/cabal/hie.yaml)) for Cabal in the +root of the workspace: `cp -f .devcontainer/assets/cradles/cabal/hie.yaml .` +--> + +See the documentation at +[Contributing: Haskell Language Server](CONTRIBUTING.md#haskell-language-server) +for cradles (`hie.yaml` files) that should suffice to configure the HLS +explicitly for `./Setup.hs` and each of the buildable components in Stack's +Cabal file. + +### Haskell extension + +Choose `Manually via PATH` when asked the following question: + +<img width="520" alt="Manage HLS" src="https://cdn.jsdelivr.net/gh/commercialhaskell/stack@master/doc/img/manageHLS.png"> + +## Issues + +If there is a problem with a Dev Container, please +[open an issue](https://github.com/benz0li/ghc-musl/issues/new) at its +[parent images](#parent-images)' repository at +[https://github.com/benz0li/ghc-musl](https://github.com/benz0li/ghc-musl).
@@ -14,11 +14,16 @@ `stack exec -- <program_name>`. Executables and libraries can be installed with the MSYS2 package manager -`pacman`. All tools can be found in the -[package list](https://github.com/msys2/msys2/wiki/Packages). A [list of -commands](https://github.com/msys2/msys2/wiki/Using-packages) that work with -`pacman` is also available. Just remember that `pacman` — like all other -tools — should be started with `stack exec -- pacman`. +`pacman`. All tools can be found in the [index](https://packages.msys2.org) to +MSYS2 packages. A [guide](https://www.msys2.org/docs/package-management/) to +package management with `pacman` is also available. `pacman` — like all +other tools in the Stack environment — should be started with +`stack exec -- pacman`. Help about `pacman` commands (operations) can be +obtained by `stack exec -- pacman --help`. Help about a specific `pacman` +operation can be obtained by using `--help` (or `-h`) with an operation. For +example, help about the operation `--sync` (or `-S`) can be obtained with +`stack exec -- pacman --sync --help` or, equivalently, +`stack exec -- pacman -Sh`. Command `stack path --bin-path` to see the PATH in the Stack environment. On Windows, it includes the `\mingw64\bin`, `\usr\bin` and `\usr\local\bin` @@ -27,13 +32,14 @@ it outside of the Stack environment, you will need to ensure copies of those files are on the PATH. +## Updating the Stack-supplied MSYS2 ## + The Stack-supplied MSYS2 can itself be updated with the Stack-supplied `pacman`. -See the MSYS2 guide -['III. Updating packages'](https://www.msys2.org/wiki/MSYS2-installation/). If +See the MSYS2 guide [Updating MSYS2](https://www.msys2.org/docs/updating/). If the Stack-supplied `pacman` has a version that is 5.0.1.6403 or greater (see `stack exec -- pacman --version`) then the command to update is simply: - stack exec -- pacman -Syuu + stack exec -- pacman -Suy This command may need to be run more than once, until everything is reported by `pacman` as 'up to date' and 'nothing to do'.
@@ -15,7 +15,7 @@ available to [download](https://www.graphviz.org/download/) for Linux, Windows, macOS and FreeBSD. -`stack dot` produces output, to the standard output channel, in the DOT language +`stack dot` produces output, to the standard output stream, in the DOT language to represent the relationships between your packages and their dependencies. By default: @@ -27,7 +27,7 @@ * there is no limit to the depth of the resolution of dependencies. Pass the `--depth <depth>` option to limit the depth; * all relevant packages are included in the output. Pass the - `--prude <packages>` option to exclude the specified packages, where + `--prune <packages>` option to exclude the specified packages, where `<packages>` is a list of package names separated by commas; * all packages in the project are included in the output. However, the target for the command can be specified as an argument. It uses the same format
@@ -9,7 +9,7 @@ ## What version of GHC is used when I run something like `stack ghci`? The version of GHC, as well as which packages can be installed, are specified by -the _resolver_. This may be something like `lts-20.19`, which is from +the _resolver_. This may be something like `lts-21.13`, which is from [Stackage](https://www.stackage.org/). The [user's guide](GUIDE.md) discusses the resolver in more detail. @@ -76,11 +76,11 @@ value in your `stack.yaml` file, e.g.: ~~~yaml -resolver: lts-20.19 +resolver: lts-21.13 packages: - . extra-deps: -- text-2.0.2 +- text-2.0.2@rev:1 ~~~ ## I need to use a package (or version of a package) that is not available on Hackage, what should I do? @@ -91,7 +91,7 @@ directory where your `stack.yaml` file lives, e.g. ~~~yaml -resolver: lts-20.19 +resolver: lts-21.13 packages: - . extra-deps: @@ -238,12 +238,6 @@ See issue [#420](https://github.com/commercialhaskell/stack/issues/420) for a detailed discussion of Stack's behavior when `system-ghc` is enabled. -## How do I upgrade to GHC 7.10.2 with stack? - -If you already have a prior version of GHC use -`stack --resolver ghc-7.10 setup --reinstall`. -If you don't have any GHC installed, you can skip the `--reinstall`. - ## How do I get extra build tools? Stack will automatically install build tools required by your packages or their @@ -534,14 +528,6 @@ [#1161](https://github.com/commercialhaskell/stack/issues/1161#issuecomment-186690904)). ## <a name="usr-bin-ar-permission-denied"></a>Why do I get a `/usr/bin/ar: permission denied` error? - -If you are on OS X 10.11 ("El Capitan") or later, GHC 7.8.4 is incompatible with -System Integrity Protection (a.k.a. "rootless") (see issue -[#563](https://github.com/commercialhaskell/stack/issues/563)). GHC 7.10.2 -includes a fix, so this only affects users of GHC 7.8.4. If you cannot upgrade -to GHC 7.10.2, you can work around it by -[disabling System Integrity Protection](http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/). -**WARNING: Disabling SIP will severely reduce the security of your system, so only do this if absolutely necessary!** ## Why is the `--` argument separator ignored in Windows PowerShell
@@ -87,8 +87,8 @@ ## `--hpack-numeric-version` flag Pass the flag `--hpack-numeric-version` to cause Stack to report the numeric -version of its built-in Hpack library to standard output (e.g. `0.35.0`) and -quit. +version of its built-in Hpack library to the standard output stream (e.g. +`0.35.0`) and quit. ## `--[no-]install-ghc` flag @@ -101,10 +101,22 @@ ## `--jobs` or `-j` option Pass the option `--jobs <number_of_jobs>` to specify the number of concurrent -jobs to run. For further information, see the documentation for the -corresponding non-project specific configuration -[option](yaml_configuration.md#jobs). +jobs (Stack actions during building) to run. +When [building GHC from source](yaml_configuration.md#building-ghc-from-source), +specifies the `-j[<n>]` flag of GHC's Hadrian build system. + +By default, Stack specifies a number of concurrent jobs equal to the number of +CPUs (cores) that the machine has. In some circumstances, that default can cause +some machines to run out of memory during building. If those circumstances +arise, specify `--jobs 1`. + +This configuration option is distinct from GHC's own `-j[<n>]` flag, which +relates to parallel compilation of modules within a package. + +For further information, see the documentation for the corresponding non-project +specific configuration option: [`jobs`](yaml_configuration.md#jobs). + ## `--local-bin-path` option Pass the option `--local-bin-path <directory>` to set the target directory for @@ -146,7 +158,17 @@ ## `--numeric-version` flag Pass the flag `--numeric-version` to cause Stack to report its numeric version -to standard output (e.g. `2.9.1`) and quit. +to the standard output stream (e.g. `2.9.1`) and quit. + +## `--[no-]plan-in-log` flag + +[:octicons-tag-24: 2.13.1](https://github.com/commercialhaskell/stack/releases/tag/v2.13.1) + +Default: Disabled + +Enables/disables the logging of build plan construction in debug output. +Information about the build plan construction can be lengthy. If you do not need +it, it is best omitted from the debug output. ## `--resolver` option
@@ -14,7 +14,7 @@ |`config.yaml` |A global and non-project-specific configuration file used by Stack.| |Docker |A [platform](https://www.docker.com/) for developing, shipping, and running applications. It can package and run an application in a loosely isolated environment called a _container_.| |Emacs |[GNU Emacs](https://www.gnu.org/software/emacs/), an extensible, customisable text editor.| -|extra-deps |Packages in addition to those in a snapshot, named after a key used in `stack.yaml` files.| +|extra-deps |Packages (one version of each) that add to, or amend, those specified in a snapshot. Named after a key used in `stack.yaml` files.| |FreeBSD |A Unix-like operating system. | |GCC |The [GNU Compiler Collection](https://gcc.gnu.org/) or its executable `gcc`.| |GHC |The [Glasgow Haskell Compiler](https://www.haskell.org/ghc/).| @@ -43,7 +43,7 @@ |REPL |An interactive (run-eval-print loop) programming environment.| |resolver |A synonym for snapshot. | |`Setup.hs` |A project-specific file used by Cabal to perform setup tasks.| -|snapshot |A snapshot defines a GHC version, a set of packages, and build flags or other settings.| +|snapshot |A snapshot defines a GHC version, a set of packages (one version of each), and build flags or other settings.| |Stack |The Haskell Tool Stack project or its executable `stack`. | |`stack.yaml` |A project-level configuration file used by Stack, which may also contain non-project-specific options.| |Stackage |A [distribution](https://www.stackage.org/) of compatible Haskell packages.|
@@ -7,4 +7,27 @@ [--[no-]setup] [--rebuild] [--server] ~~~ -Hoogle is a Haskell API search engine. `stack hoogle` runs Hoogle. +Hoogle is a Haskell API search engine. `stack hoogle` runs Hoogle. Stack needs +Hoogle version 5 or greater. + +Stack will use a Hoogle database (`database.hoo`) specific to the project's +source map and the version of GHC, located in a subdirectory of subdirectory +`hoogle` of Stack's work directory for the project. + +By default: + +* if a `hoogle` executable is found on the `PATH`, Stack will try to use it. + Otherwise, Stack will try to identify an executable as a build target. If + the Hoogle database does not exist, Stack will generate it with + `hoogle generate --local`. `hoogle generate --local` queries `ghc-pkg` and + generates links for all packages which have documentation and Hoogle input + files (`*.txt`) generated. Pass the flag `--no-setup` to skip such setup; + +* the existing Hoogle database is used. Pass the flag `--rebuild` to trigger + the generation of a new Hoogle database (generated as above); and + +* `hoogle` is passed the specified arguments (if any). The arguments are + usually the subject of the search. Pass the flag `--server` to first pass + `server --local --port 8080` before those arguments. + `hoogle server --local --port 8080` starts a local Hoogle web server, using + port 8080, that allows the following of `file://` links.
@@ -37,7 +37,7 @@ Pass the flag `--all` for a report that uses all stored results. -Pass the flag --open` to open the HTML report in your browser. +Pass the flag `--open` to open the HTML report in your browser. ## The `extra-tix-files` directory @@ -63,8 +63,9 @@ stack hpc report A B ~~~ -This will output a textual report for the combined coverage from `A` and `B`'s -test suites, along with a path to the HTML for the report. +This will output to the standard output stream a summary report for the combined +coverage from `A` and `B`'s test suites. It will also log the path to the HTML +for the corresponding full report. This command also supports taking extra `.tix` files. If you've also built an executable, against exactly the same library versions of `A`, `B`, and `C`, then @@ -101,13 +102,17 @@ When your project has these properties, you will get the following: -1. Textual coverage reports in the build output. +1. Summary coverage reports, sent to the standard output stream in the build + output, and a log of the paths to the HTML for the corresponding full + reports. -2. A unified textual and HTML report, considering the coverage on all local - libraries, based on all of the tests that were run. +2. A summary unified report, sent to the standard output stream, and a log of + the path to the HTML for the corresponding full report. These reports + consider the coverage on all local libraries, based on all of the tests that + were run. 3. An index of all generated HTML reports, in `index.html` in the local - HPC root directory. + HPC root directory, and a log of the path to the HTML for that index. ## Implementation details @@ -147,10 +152,10 @@ executable. See issue [#1359](https://github.com/commercialhaskell/stack/issues/1359). -5. Once we have a `.tix` file for a test, we also generate a textual and HTML - report for it. The textual report is sent to the terminal. The index of the - test-specific HTML report is available `pkg-name/test-name/index.html` in the - local HPC root directory. +5. Once we have a `.tix` file for a test, we also generate a summary report and + a corresponding full report using HTML. The summary report is sent to the + standard output stream. The index of the test-specific HTML report is + available at `pkg-name/test-name/index.html` in the local HPC root directory. 6. After the build completes, if there are multiple output `*.tix` files, they get combined into a unified report. The index of this report will be
@@ -24,21 +24,23 @@ By default: -* its output is sent to the standard error channel. Pass the flag `--stdout` to - change to the standard output channel; and +* its output is sent to the standard error stream. Pass the flag `--stdout` to + change to the standard output stream; and * the output is the package name (without its version). Pass the flag `--cabal-files` to change to the full path to the package's Cabal file. ## The `stack ide targets` command ~~~text -stack ide targets [--stdout] +stack ide targets [--exes] [--tests] [--benchmarks] [--stdout] ~~~ -`stack ide targets` lists all available Stack targets. +`stack ide targets` lists all available Stack targets. Alternatively, pass one +or more of the flags `--exes`, `--tests` and `--benchmarks` to list only targets +of those component types. -By default, its output is sent to the standard error channel. Pass the flag -`--stdout` to change to the standard output channel. +By default, its output is sent to the standard error stream. Pass the flag +`--stdout` to change to the standard output stream. For example, for the Stack project itself, command: @@ -53,5 +55,18 @@ stack:lib stack:exe:stack stack:exe:stack-integration-test -stack:test:stack-test +stack:test:stack-unit-test +~~~ + +or command: + +~~~text +stack ide targets --exes +~~~ + +and the output is: + +~~~text +stack:exe:stack +stack:exe:stack-integration-test ~~~
@@ -240,6 +240,10 @@ === "macOS" + Most users of Stack on macOS will also have up to date tools for software + development (see [Xcode Command Line Tools](#xcode-command-line-tools) + below). + From late 2020, Apple began a transition from Mac computers with Intel processors (Intel-based Mac) to [Mac computers with Apple silicon](https://support.apple.com/en-gb/HT211814). @@ -291,19 +295,8 @@ Mac computers with Apple silicon have an M1, M1 Pro, M1 Max, M1 Ultra or M2 chip. These chips use an architecture known as ARM64 or AArch64. - The Stack repository uses GitHub-hosted runners to create binary - distributions for macOS. GitHub-hosted runners are not expected to be - available for macOS on Apple silicon until July to September 2023. - - Consequently, for Mac computers with Apple silicon, the easiest way to - install Stack directly (rather than use GHCup) is to obtain the - 'unofficial' `osx-aarch64` binary distribution released by the GHCup - developers and copy it to a location on the PATH. `*.tar.gz` archive - files containing those binary distributions are available at the - directories here: - [:material-cloud-download-outline:](https://downloads.haskell.org/ghcup/unofficial-bindists/stack/). - - It is still possible to use the commands: + For Mac computers with Apple silicon, the easiest way to install Stack + directly (rather than use GHCup) is to command: ~~~text curl -sSL https://get.haskellstack.org/ | sh @@ -315,19 +308,13 @@ wget -qO- https://get.haskellstack.org/ | sh ~~~ - However, those commands will download and install the version of Stack - for Intel-based Mac computers. Mac computers with Apple silicon will - use Apple's - [Rosetta 2 application](https://support.apple.com/en-gb/HT211861) to - use that version of Stack. - - Apple's Terminal application will not detect automatically that Rosetta - has not yet been installed. Rosetta can be manually installed by - commanding: + !!! note - ~~~text - softwareupdate --install-rosetta - ~~~ + The script at [get.haskellstack.org](https://get.haskellstack.org/) + will ask for root access using `sudo`. It needs such access in order + to use your platform's package manager to install dependencies and + to install to `/usr/local/bin`. If you prefer more control, follow + the manual installation instructions below. The installation of Stack or some packages (e.g. `network`) requiring C source compilation might fail with `configure: error: C compiler cannot @@ -356,6 +343,18 @@ compile x86-64 objects and attempt to link them with existing ARM64 libraries, resulting in the error above. + ### Manual download + + * Click + [:material-cloud-download-outline:](https://get.haskellstack.org/stable/osx-aarch64.tar.gz) + to download an archive file with the latest release for AArch64 + architectures. + + * Extract the archive and place `stack` somewhere on your PATH (see the + [Path](#path) section below). + + * Now you can run Stack from the command line in a terminal. + ### Using Homebrew [Homebrew](https://brew.sh/) is a popular package manager for macOS. If you @@ -373,34 +372,50 @@ will take hours), see [their FAQ on the topic](https://github.com/Homebrew/brew/blob/master/docs/FAQ.md#why-do-you-compile-everything). - ### Notes + ### Xcode Command Line Tools - After installation, running `stack setup` might fail with - `configure: error: cannot run C compiled programs.` in which case you should - command: + macOS does not come with all the tools required for software development but + a collection of useful tools, known as the Xcode Command Line Tools, is + readily available. A version of that collection is provided with each + version of Xcode (Apple’s integrated development environment) and can also + be obtained from Apple separately from Xcode. The collection also includes + the macOS SDK (software development kit). The macOS SDK provides header + files for macOS APIs. - ~~~text - xcode-select --install - ~~~ + If you use a command that refers to a common Xcode Command Line Tool and + the Xcode Command Line Tools are not installed, macOS may prompt you to + install the tools. - Starting with macOs 10.14 (Mojave) running `xcode-select --install` - [might not be enough](https://forums.developer.apple.com/thread/104296). You - will need to install additional headers with commands: + macOS also comes with a command line tool, `xcode-select`, that can be used + to obtain the Xcode Command Line Tools. Command `xcode-select --print-path` + to print the path to the currently selected (active) developer directory. If + the directory does not exist, or is empty, then the Xcode Command Line Tools + are not installed. - ~~~text - cd /Library/Developer/CommandLineTools/Packages/ - open macOS_SDK_headers_for_macOS_10.14.pkg - ~~~ + If the Xcode Command Line Tools are not installed, command + `xcode-select --install` to open a user interface dialog to request + automatic installation of the tools. - If you are on OS X 10.11 (El Capitan) and encounter either of these problems, - see the linked FAQ entries: + An upgrade of macOS may sometimes require the existing Xcode Command Line + Tools to be uninstalled and an updated version of the tools to be installed. + The existing tools can be uninstalled by deleting the directory reported by + `xcode-select --print-path`. - * [GHC 7.8.4 fails with `/usr/bin/ar: permission denied`](faq.md#usr-bin-ar-permission-denied) - * [DYLD_LIBRARY_PATH is ignored](faq.md#dyld-library-path-ignored) + If, after the installation of Stack, running `stack setup` fails with + `configure: error: cannot run C compiled programs.` that indicates that the + Xcode Command Line Tools are not installed. - If you are on macOS 10.12 (Sierra) and encounter GHC panic while building, - see this [issue](https://github.com/commercialhaskell/stack/issues/2577). + If building fails with messages that `*.h` files are not found, that may + also indicate that Xcode Command Line Tools are not up to date. + Xcode 10 provided an SDK for macOS 10.14 (Mojave) and + [changed the location](https://developer.apple.com/documentation/xcode-release-notes/xcode-10-release-notes#Command-Line-Tools) + of the macOS system headers. As a workaround, an extra package was provided + by Apple which installed the headers to the base system under + `/usr/include`. + + ### Auto-completion of Stack commands + It is possible to set up auto-completion of Stack commands. For further information, see the [shell auto-completion](shell_autocompletion.md) documentation. @@ -410,6 +425,13 @@ On 64-bit Windows, the easiest way to install Stack directly (rather than use GHCup) is to download and use the [Windows installer](https://get.haskellstack.org/stable/windows-x86_64-installer.exe). + + !!! warning "Long user PATH environment variable" + + The Windows installer for Stack 2.9.1, 2.9.3 and 2.11.1 (current) (only) + will replace the user `PATH` environment variable (rather than append to + it) if a 1024 character limit is exceeded. If the content of your + existing user `PATH` is long, preserve it before running the installer. !!! note "Anti-virus software"
@@ -8,21 +8,22 @@ stack list [PACKAGE] ~~~ -`stack list <package_name>` will list the latest version of the package from -Hackage. If the package name cannot be found on Hackage, even after updating the -package index, suggestions (not necessarily good ones) will be made about the -intended package name. +`stack list <package_name>` will send to the standard output stream the latest +version of the package from Hackage. If the package name cannot be found on +Hackage, even after updating the package index, suggestions (not necessarily +good ones) will be made about the intended package name. -`stack --resolver <snapshot> list <package_name>` will list the version of the -package in the specified snapshot, unless the package comes with GHC on -Unix-like operating systems. If the package name cannot be found in the -snapshot, the command will fail, identifying only the package(s) that did not -appear in the snapshot. +`stack --resolver <snapshot> list <package_name>` will send to the standard +output stream the version of the package in the specified snapshot, unless the +package comes with GHC on Unix-like operating systems. If the package name +cannot be found in the snapshot, the command will fail, identifying only the +package(s) that did not appear in the snapshot. More than one package name can be specified. -`stack --resolver <snapshot> list` will list all the packages in the specified -snapshot, except those which come with GHC on Unix-like operating systems. +`stack --resolver <snapshot> list` will send to the standard output stream a +list of all the packages in the specified snapshot, except those which come with +GHC on Unix-like operating systems. For example: @@ -32,29 +33,31 @@ unix-2.8.1.1 Win32-2.13.4.0 acme-missiles-0.3 -pantry-0.8.1 +pantry-0.9.2 stack list paltry Could not find package paltry, updating ... Package index cache populated Error: [S-4926] -- Could not find package paltry on Hackage. Perhaps you meant: retry, path, pantry, pretty, pasty, xattr, alloy, para, pappy, alure + * Could not find package paltry on Hackage. Perhaps you meant one of: + pantry, pretty, pasty, xattr, alloy, para, pappy, alure, polar and + factory. -stack --resolver lts-20.19 list base unix Win32 acme-missiles pantry +stack --resolver lts-21.13 list base unix Win32 acme-missiles pantry Error: [S-4926] -- Package does not appear in snapshot: base -- Package does not appear in snapshot: unix -- Package does not appear in snapshot: acme-missiles + * Package does not appear in snapshot: base. + * Package does not appear in snapshot: unix. + * Package does not appear in snapshot: Win32. + * Package does not appear in snapshot: acme-missiles. -stack --resolver lts-20.19 list Win32 pantry -Win32-2.12.0.1 -pantry-0.5.7 +stack --resolver lts-21.13 list pantry +pantry-0.8.3 -stack --resolver lts-20.19 list +stack --resolver lts-21.13 list AC-Angle-1.0 ALUT-2.4.0.3 ... +zot-0.0.3 zstd-0.1.3.0 -ztail-1.2.0.3 ~~~
@@ -103,8 +103,10 @@ The `--separator` option specifies the separator between the package name and its version. The default is a space character. -Set the `--licence` flag, after the `text` or `tree` subcommand, to replace each -package's version with its licence. +Set the `--license` flag, after the `text` or `tree` subcommand, to replace each +package's version with its licence. (Consistent with the Cabal package +description format specification, only the American English spelling (license) +is accepted.) Set the `--no-external` flag to exclude external dependencies. @@ -112,8 +114,9 @@ The `--depth` option limits the depth of dependency resolution. -The `--prune <packages>` option prunes the specified packages from the output, -where `<packages>` is a comma separated list of package names. +The `--prune <packages>` option prunes the specified packages and their +dependencies from the tree of packages used to generate the output, where +`<packages>` is a comma separated list of package names. The `--flag` option allows Cabal flags to be specified.
@@ -56,6 +56,18 @@ 2. add the command `source ~/.nix-profile/etc/profile.d/nix.sh` to your `~/.bashrc` or `~/.bash_profile` file. +A Nix path can be specified between angle brackets, e.g. `<nixpkgs>`, and the +directories listed in the `NIX_PATH` environment variable will be searched for +the given file or directory name. Stack makes use of path `<nixpkgs>`. From +Nix 2.4, `NIX_PATH` is not set by `nix.sh`. If `NIX_PATH` is not set, Nix will +fall back to (first) `$HOME/.nix-defexpr/channels` in impure and unrestricted +evaluation mode. However, Stack may use a pure Nix mode (see further +[below](#pure-and-impure-nix-shells)). That directory can be appended to +`NIX_PATH` with +`export NIX_PATH=${NIX_PATH:+$NIX_PATH:}$HOME/.nix-defexpr/channels`. For +information about how Stack itself can configure `NIX_PATH`, see further +[below](#nix-package-sources). + ### Enable Nix integration To enable Nix integration, add the following section to your Stack YAML
@@ -181,6 +181,19 @@ that your build will not be deterministic, because when someone else tries to build the project they can get a different checkout of the package. +!!! warning + + For the contents of a Git repository, Stack cannot handle filepaths or + symbolic link names that are longer than those supported by the `ustar` + (Unix Standard TAR) archive format defined by + [POSIX.1-1988](https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub151-1.pdf). + + Stack uses `git archive` to convert the content of a Git repository to a + TAR archive, which it then seeks to consume. Git produces `pax` format + archives which use 'extended' headers for matters that the `ustar` format + cannot handle. Unfortunately, Stack cannot consume an extended header and + will silently discard the item. + A common practice in the Haskell world is to use "megarepos", or repositories with multiple packages in various subdirectories. Some common examples include [wai](https://github.com/yesodweb/wai/) and
@@ -18,13 +18,7 @@ the command line (with the `--resolver` option). For example: ~~~text -stack --resolver lts-20.19 MyScript.hs -~~~ - -or, equivalently: - -~~~text -stack script --resolver lts-20.19 MyScript.hs +stack script --resolver lts-21.13 MyScript.hs ~~~ The `stack script` command behaves as if the `--install-ghc` flag had been @@ -39,12 +33,36 @@ Each required package can be specified by name on the command line with the `--package` option (which can be specified multiple times). A single `--package` option can also refer to a list of package names, separated by a space or comma -character. If the package is not in the snapshot, the most recent version on -Hackage will be obtained. If no packages are specified in that way, all the -required packages that are in the snapshot will be deduced by reference to the +character. If the package is not in the snapshot, the most recent version in the +package index (e.g. Hackage) will be obtained. + +If no packages are specified in that way, all the required packages that are in +the snapshot or are a GHC boot package (packages that come with GHC and are +included in GHC's global package database) will be deduced by reference to the `import` statements in the source file. The `base` package associated with the version of GHC specified by the snapshot is always available. +If a required package is a GHC boot package, the behaviour can be complex. If +the boot package has not been 'replaced', then it will be used in Stack's build +plan. However, if the boot package has been 'replaced', the latest version of +that package in the package index will be used in Stack's build plan, which may +differ from the version provided by the version of GHC specified by the +snapshot. A boot package will be treated as 'replaced' if the package i +included directly in the Stackage snapshot or it depends on a package included +directly in the snapshot. Stackage snapshots do not include directly most boot +packages but some snapshots may include directly some boot packages. In +particular, some snapshots include directly `Win32` (which is a boot package on +Windows) while others do not. For example, if `Cabal` (a boot package) is a +required package then, with Stackage snapshot LTS Haskell 20.25, Stack will: + +* on Windows, try to construct a build plan based on the latest version of + `Cabal` in the package index (because that snapshot includes `Win32` directly, + and `Cabal` depends on `Win32` and so is treated as 'replaced'); and +* on non-Windows, use the boot package in the build plan (because `Cabal` is not + 'replaced'). + +Boot packages that have been 'replaced' can be specified as an `--extra-dep`. + The source file can be compiled by passing either the `--compile` flag (no optimization) or the `--optimize` flag (compilation with optimization). If the file is compiled, passing the `--no-run` flag will mean the compiled code is not @@ -82,7 +100,7 @@ can be compiled and run, with arguments, with: ~~~text -stack --resolver lts-20.19 script --package acme-missiles --compile MyScript.hs -- "Don't panic!" "Duck and cover!" +stack --resolver lts-21.13 script --package acme-missiles --compile MyScript.hs -- "Don't panic!" "Duck and cover!" ~~~ All the compilation outputs (like `Main.hi`, `Main.o`, and the executable @@ -91,3 +109,69 @@ If compiled and run with the additional flag `--use-root`, all the compilation outputs will be written to a directory named `MyScript.hs` at `Users/jane/my-project/` in the `scripts` directory of the Stack root. + +For example, consider the following script extract, based on snapshot Stackage +LTS Haskell 20.25, where considerations on Windows differ from non-Windows. The +`stack script` command is specified using Stack's +[script interpreter](scripts.md). + +=== "Windows" + + The snapshot includes `Win32` directly. As a consequence, GHC boot packages + `directory`, `process` and `time` (which depend on `Win32`) are all treated + as 'replaced'. + + ~~~haskell + {- stack script + --resolver lts-20.25 + --extra-dep acme-missiles-0.3 + --extra-dep directory-1.3.6.2 + --extra-dep process-1.6.16.0 + --extra-dep time-1.11.1.1 + -} + + import Acme.Missiles -- from acme-missiles + import Data.Time.Clock.System -- from time + import System.Time.Extra -- from extra + + ... + ~~~ + + `acme-missiles` is not in the snapshot and so needs to be specified as an + extra dep. + + Stack can deduce that the module imports imply that the required packages + are `acme-missiles`, `time` and `extra` (which is in the snapshot). + + `extra` depends on `directory` and `process`. If `directory` and `process` + are not specified as extra deps, Stack will complain that they have been + 'pruned'. + + `directory-1.3.6.2` depends on `time < 1.12`. If `time` is not specified as + an extra dep, Stack will try to construct a build plan based on the latest + version in the package index (which will fail, as the latest version is + `>= 1.12`) + +=== "Unix-like" + + ~~~haskell + {- stack script + --resolver lts-20.25 + --extra-dep acme-missiles-0.3 + -} + + import Acme.Missiles -- from acme-missiles + import Data.Time.Clock.System -- from time + import System.Time.Extra -- from extra + + ... + ~~~ + + `acme-missiles` is not in the snapshot and so needs to be specified as an + extra dep. + + Stack can deduce that the module imports imply that the required packages + are `acme-missiles`, `time` and `extra` (which is in the snapshot). + + All the other dependencies required are either GHC boot packages (which have + not been 'replaced') or in the snapshot.
@@ -19,7 +19,7 @@ ~~~haskell #!/usr/bin/env stack --- stack script --resolver lts-20.19 --package turtle +-- stack script --resolver lts-21.13 --package turtle {-# LANGUAGE OverloadedStrings #-} import Turtle (echo) main = echo "Hello World!" @@ -78,10 +78,10 @@ The second line of the source code is the Stack interpreter options comment. In this example, it specifies the `stack script` command with the options of a -LTS Haskell 20.19 snapshot (`--resolver lts-20.19`) and ensuring the +LTS Haskell 21.13 snapshot (`--resolver lts-21.13`) and ensuring the [`turtle` package](https://hackage.haskell.org/package/turtle) is available (`--package turtle`). The version of the package will be that in the specified -snapshot (`lts-20.19` provides `turtle-1.5.25`). +snapshot (`lts-21.13` provides `turtle-1.6.1`). ## Arguments and interpreter options and arguments @@ -116,7 +116,7 @@ ~~~haskell #!/usr/bin/env stack {- stack script - --resolver lts-20.19 + --resolver lts-21.13 -- +RTS -s -RTS -} @@ -132,7 +132,7 @@ is equivalent to the following command at the command line: ~~~text -stack script --resolver lts-20.19 -- MyScript.hs arg1 arg2 +RTS -s -RTS +stack script --resolver lts-21.13 -- MyScript.hs arg1 arg2 +RTS -s -RTS ~~~ where `+RTS -s -RTS` are some of GHC's @@ -161,7 +161,7 @@ ~~~haskell #!/usr/bin/env stack {- stack script - --resolver lts-20.19 + --resolver lts-21.13 --package turtle --package "stm async" --package http-client,http-conduit @@ -191,7 +191,7 @@ ~~~haskell {- stack script - --resolver lts-20.19 + --resolver lts-21.13 --package acme-missiles -} import Acme.Missiles (launchMissiles) @@ -202,7 +202,7 @@ The command `stack --script-no-run-compile Script.hs` then behaves as if the command -`stack script --resolver lts-20.19 --package acme-missiles --no-run --compile -- Script.hs` +`stack script --resolver lts-21.13 --package acme-missiles --no-run --compile -- Script.hs` had been given. `Script.hs` is compiled (without optimisation) and the resulting executable is not run: no missiles are launched in the process! @@ -239,7 +239,7 @@ {- stack runghc --install-ghc - --resolver lts-20.19 + --resolver lts-21.13 --package base --package turtle -- @@ -262,7 +262,7 @@ {- stack exec ghci --install-ghc - --resolver lts-20.19 + --resolver lts-21.13 --package turtle -} ~~~
@@ -43,25 +43,30 @@ required on Linux, Stack will refer to the presence or absence of certain libraries or the versions of those libraries. - For example, Stack 2.11.1 considers: + For example, Stack 2.13.1 considers: - * the version of `libc6`, the + * If `libc.musl-x86_64.so.1` is present. This file is provided by the + [musl libc](https://musl.libc.org/). + + * The version of `libc6` (if musl libc is not applicable), the [GNU C Library](https://www.gnu.org/software/libc/) (glibc), that is present. The GNU C Library is designed to be backwards compatible. - * if `libgmp.so.3` or `libgmp.so.10` is present. These files are provided + * If `libgmp.so.3` or `libgmp.so.10` is present. These files are provided by different versions of the [GNU Multiple Precision Arithmetic Library](https://gmplib.org/). - * if `libncursesw.so.6` is present. This file is provided by a shared + * If `libncursesw.so.6` is present. This file is provided by a shared library for terminal handling with wide character support. - * if `libtinfo.so.5` or `libtinfo.so.6` is present. These files are + * If `libtinfo.so.5` or `libtinfo.so.6` is present. These files are provided by different versions of a shared low-level terminfo library for terminal handling. - Stack 2.11.1 uses `ghc-build`: + Stack 2.13.1 uses `ghc-build`: + * `musl` to indicate `libc.musl-x86_64.so.1` is present and Stack should use + the GHC binary distribution for Alpine Linux. * `tinfo6` to indicate `libgmp.so.10` and `libtinfo.so.6` are present and `libc6` is compatible with `libc6` 2.32. * `tinfo6-libc6-pre232` to indicate `libgmp.so.10` and `libtinfo.so.6` are
@@ -64,8 +64,8 @@ The most common means by which this set of packages is defined is via a snapshot provided by Stackage. For example, if you go to the page -<https://www.stackage.org/lts-20.19>, you will see a list of 3,051 packages at -specific version numbers. When you then specify `resolver: lts-20.19`, you're +<https://www.stackage.org/lts-21.13>, you will see a list of 3,010 packages at +specific version numbers. When you then specify `resolver: lts-21.13`, you're telling Stack to use those package versions in resolving dependencies down to specific versions of packages.
@@ -6,8 +6,8 @@ stack templates ~~~ -`stack templates` provides information about project templates used with the -[`stack new` command](new_command.md). +`stack templates` provides information to the standard output stream about +project templates used with the [`stack new` command](new_command.md). Project templates are specified in `.hsfiles` files. The format of those files is documented at the
@@ -6,6 +6,6 @@ stack uninstall ~~~ -`stack uninstall` provides information about how to uninstall Stack or a -Stack-supplied tool (such as GHC or, on Windows, MSYS2). It does not -itself uninstall Stack or a Stack-supplied tool. +`stack uninstall` provides information to the standard output stream about how +to uninstall Stack or a Stack-supplied tool (such as GHC or, on Windows, MSYS2). +It does not itself uninstall Stack or a Stack-supplied tool.
@@ -79,7 +79,7 @@ `my-stack upgrade --no-only-local-bin` seeks also to upgrade `my-stack` to the latest version of Stack available. -* `stack upgrade --binary-version 2.11.1` seeks an upgrade to Stack 2.11.1 if +* `stack upgrade --binary-version 2.13.1` seeks an upgrade to Stack 2.13.1 if available as a binary distribution for the platform, even if not newer. * `stack upgrade --source-only` seeks an upgrade by building Stack with
@@ -13,7 +13,9 @@ configured at the project-level or globally. The **project-level** configuration file (`stack.yaml`) contains -project-specific options and may contain non-project-specific options. +project-specific options and may contain non-project-specific options. However, +non-project-specific options in the project-level configuration file in the +`global-project` directory (see below) are ignored by Stack. Stack obtains project-level configuration from one of the following (in order of preference): @@ -96,10 +98,10 @@ since a snapshot states how dependencies are resolved. There are currently four resolver types: -* LTS Haskell snapshots, e.g. `resolver: lts-20.19` -* Stackage Nightly snapshots, e.g. `resolver: nightly-2023-05-05` +* LTS Haskell snapshots, e.g. `resolver: lts-21.13` +* Stackage Nightly snapshots, e.g. `resolver: nightly-2023-09-24` * No snapshot, just use packages shipped with the compiler. For GHC this looks - like `resolver: ghc-9.6.1` + like `resolver: ghc-9.6.2` * Custom snapshot, via a URL or relative file path. For further information, see the [Pantry](pantry.md) documentation. @@ -301,8 +303,10 @@ ## Non-project-specific configuration -Non-project configuration options are valid in a project-level configuration -file (`stack.yaml`) or in global configuration files (`config.yaml`). The +Non-project configuration options can be included in a project-level +configuration file (`stack.yaml`) or in global configuration files +(`config.yaml`). However, non-project-specific options in the project-level +configuration file in the `global-project` directory are ignored by Stack. The options below are listed in alphabetic order. ### allow-different-user @@ -426,16 +430,15 @@ prefetch: false keep-going: false keep-tmp-files: false - # NOTE: global usage of haddock can cause build failures when documentation is # incorrectly formatted. This could also affect scripts which use Stack. haddock: false haddock-arguments: - haddock-args: [] # Additional arguments passed to haddock, --haddock-arguments + haddock-args: [] # Additional arguments passed to haddock, --haddock-arguments # haddock-args: # - "--css=/home/user/my-css" - open-haddocks: false # --open - haddock-deps: false # if unspecified, defaults to true if haddock is set + open-haddocks: false # --open + haddock-deps: false # if unspecified, defaults to true if haddock is set haddock-internal: false # These are inadvisable to use in your global configuration, as they make the @@ -460,8 +463,9 @@ # Since 1.8. Starting with 2.0, the default is true interleaved-output: true - - # Since 1.10 + # Since 2.13.1. Available options are none, count-only, capped and full. + progress-bar: capped + # Since 1.10. ddump-dir: "" ~~~ @@ -474,17 +478,39 @@ [`stack build` command](build_command.md) documentation and the [users guide](GUIDE.md#the-build-command). +### casa + +[:octicons-tag-24: 2.13.1](https://github.com/commercialhaskell/stack/releases/tag/v2.13.1) + +Default: + +~~~yaml +casa: + enable: true # Use a Casa server? + repo-prefix: https://casa.fpcomplete.com # Unless casa-repo-prefix is set. + max-keys-per-request: 1280 # Maximum number of keys per request. +~~~ + +This option specifies whether or not Stack should use a Casa +(content-addressable storage archive) server to cache Cabal files and all other +files in packages; and, if so, the prefix for the URL used to pull information +from the server and the maximum number of keys per request. For further +information, see this blog post about +[Casa and Stack](https://www.fpcomplete.com/blog/casa-and-stack/). + +`repo-prefix` replaces [`casa-repo-prefix`](#casa-repo-prefix) (which is +deprecated) and has precedence if both keys are set. + ### casa-repo-prefix [:octicons-tag-24: 2.3.1](https://github.com/commercialhaskell/stack/releases/tag/v2.3.1) +Deprecated in favour of [`casa`](#casa), which takes precedence if present. + Default: `https://casa.fpcomplete.com` This option specifies the prefix for the URL used to pull information from the -Casa (content-addressable storage archive) server that is used by Stack to cache -Cabal files and all other files in packages. For further information, see this -blog post about -[Casa and Stack](https://www.fpcomplete.com/blog/casa-and-stack/). +Casa server. ### color @@ -506,12 +532,12 @@ Overrides the compiler version in the resolver. Note that the `compiler-check` flag also applies to the version numbers. This uses the same syntax as compiler -resolvers like `ghc-9.6.1`. This can be used to override the +resolvers like `ghc-9.6.2`. This can be used to override the compiler for a Stackage snapshot, like this: ~~~yaml -resolver: lts-20.19 -compiler: ghc-9.6.1 +resolver: lts-21.13 +compiler: ghc-9.6.2 compiler-check: match-exact ~~~ @@ -521,12 +547,13 @@ [:octicons-tag-24: 2.1.1](https://github.com/commercialhaskell/stack/releases/tag/v2.1.1) -Stack supports building the GHC compiler from source. The version to build and -to use is defined by a a Git commit ID and an Hadrian "flavour" (Hadrian is the -build system of GHC) with the following syntax: +Stack supports building the GHC compiler from source, using +[Hadrian](https://gitlab.haskell.org/ghc/ghc/blob/master/hadrian/README.md) (the +build system for GHC). The GHC version to build and to use is defined by a a Git +commit ID and a Hadrian "flavour", with the following syntax: ~~~yaml -compiler: ghc-git-COMMIT-FLAVOUR +compiler: ghc-git-<commit_id>-<Hadrian_flavour> ~~~ In the following example the commit ID is "5be7ad..." and the flavour is @@ -536,8 +563,8 @@ compiler: ghc-git-5be7ad7861c8d39f60b7101fd8d8e816ff50353a-quick ~~~ -By default the code is retrieved from the main GHC repository. If you want to -select another repository, set the "compiler-repository" option: +By default, the code is retrieved from the main GHC repository. If you want to +select another repository, use the `compiler-repository` option: ~~~yaml compiler-repository: git://my/ghc/repository @@ -545,13 +572,101 @@ # compiler-repository: https://gitlab.haskell.org/ghc/ghc.git ~~~ -Note that Stack doesn't check the compiler version when it uses a compiler built -from source. Moreover it is assumed that the built compiler is recent enough as -Stack doesn't enable any known workaround to make older compilers work. +Stack does not check the compiler version when it uses a compiler built from +source. It is assumed that the built compiler is recent enough as Stack doesn't +enable any known workaround to make older compilers work. -Building the compiler can take a very long time (more than one hour). Hint: for -faster build times, use Hadrian flavours that disable documentation generation. +Building the compiler can take a very long time (more than one hour). For faster +build times, use Hadrian flavours that disable documentation generation. +#### Bootstrap compiler + +Building GHC from source requires a working GHC (known as the bootstrap +compiler). As we use a Stack based version of Hadrian (`hadrian/build-stack` in +GHC sources), the bootstrap compiler is configured into `hadrian/stack.yaml` and +fully managed by Stack. + +!!! note + + For some commit IDs, the resolver specified in `hadrian/stack.yaml` + specifies a version of GHC that cannot be used to build GHC. This results in + GHC's `configure` script reporting messages similar to the following before + aborting: + + ~~~text + checking version of ghc... 9.0.2 + configure: error: GHC version 9.2 or later is required to compile GHC. + ~~~ + + The resolution is: (1) to specify an alternative resolver (one that + specifies a sufficiently recent version of GHC) on the command line, using + Stack's option `--resolver <resolver>`. Stack will use that resolver when + running GHC's `configure` script; and (2) to set the contents of the `STACK` + environment variable to be `stack --resolver <resolver>`. Hadrian's + `build-stack` script wil refer to that environment variable for the Stack + command it uses. + +#### Hadrian prerequisites + +The Hadrian build system has certain +[prerequisites](https://gitlab.haskell.org/ghc/ghc/-/wikis/building/preparation). +It requires certain versions of the `happy` and `alex` executables on the PATH. +Stack will build and install `happy` and `alex`, if not already on the PATH. + +=== "macOS" + + Hadrian requires, or case use, certain tools or Python packages that do not + come with macOS by default and that need to be installed using `brew` or + `pip3` (Python). Hadrian's LaTeX documentation also requires the + [DejaVu fonts](https://dejavu-fonts.github.io/) to be installed. + + ~~~zsh + brew install python@3.11 + # GHC uses a Python script named `boot`. + brew install automake + # Tool for generating GNU Standards-compliant Makefiles. + brew install texinfo + # Official documentation format of the GNU project. + pip3 install -U sphinx + # Sphinx is the Python documentation generator. + brew install --cask mactex + # MacTeX: Full TeX Live distribution with GUI applications + ~~~ + +=== "Windows" + + Hadrian requires, or can use, certain MSYS2 or Python packages that do not + come with the Stack-supplied MSYS2 by default and need to be installed + using `pacman` (MSYS2) or `pip` (Python). Hadrian's LaTeX documentation also + requires the [DejaVu fonts](https://dejavu-fonts.github.io/) to be + installed. + + ~~~pwsh + stack exec -- pacman --sync --refresh + # Synchronize MSYS2 package databases + stack exec -- pacman --sync mingw-w64-x86_64-python-pip + # The PyPA recommended tool (pip) for installing Python packages. Also + # installs Python as a dependency. GHC uses a Python script named `boot`. + # The package must be the one from the `mingw64` MSYS2 repository, as Python + # from the `msys` repository cannot interpret Windows file paths correctly. + stack exec -- pacman --sync mingw-w64-x86_64-autotools + # The GNU autotools build system, including `autoreconf`, `aclocal` + # and `make`. GHC uses a sh script named `configure` which is itself created + # from a file named `configure.ac`. + stack exec -- pacman --sync patch + # A utility to apply patch files to original sources. + stack exec -- pacman --sync texinfo + # Utilities to work with and produce manuals, ASCII text, and on-line + # documentation from a single source file, including `makeinfo`. + stack exec -- pacman --sync mingw-w64-x86_64-ca-certificates + # Common CA (certificate authority) certificates. + stack exec -- pip install -U sphinx + # Sphinx is the Python documentation generator. + ~~~ + + Hadrian may require certain LaTeX packages and may prompt for these to be + installed duing the build process. + #### Global packages The GHC compiler you build from sources may depend on unreleased versions of @@ -583,13 +698,6 @@ - libraries/... ~~~ -#### Bootstrapping compiler - -Building GHC from source requires a working GHC (known as the bootstrap -compiler). As we use a Stack based version of Hadrian (`hadrian/build-stack` in -GHC sources), the bootstrap compiler is configured into `hadrian/stack.yaml` and -fully managed by Stack. - ### compiler-check [:octicons-tag-24: 0.1.4.0](https://github.com/commercialhaskell/stack/releases/tag/v0.1.4.0) @@ -683,22 +791,32 @@ In the case of *non-interleaved* output and *more than one* target package, Stack sends the build output from GHC for each target package to a log file, -unless an error occurs. For further information, see the -[`stack build --[no-]interleaved-output` flag](build_command.md#the-stack-build---no-interleaved-output-flag) +unless an error occurs that prevents that. For further information, see the +[`stack build --[no-]interleaved-output` flag](build_command.md#-no-interleaved-output-flag) documentation. The value of the `dump-logs` key controls what, if any, log file content is sent -('dumped') to the console at the end of the build. Possible values are: +('dumped') to the standard error stream of the console at the end of the build. +Possible values are: ~~~yaml -dump-logs: none # don't dump the content of any log files -dump-logs: warning # dump the content of log files that are warnings -dump-logs: all # dump all of the content of log files +dump-logs: none # don't dump the content of any log files +dump-logs: warning # dump the content of any log files that include GHC warnings +dump-logs: all # dump the content of all log files ~~~ At the command line, `--no-dump-logs` is equivalent to `dump-logs: none` and `--dump-logs` is equivalent to `dump-logs: all`. +If GHC reports an error during the build and a log file is created, that build +output will be included in the log file. Stack will also report errors during +building to the standard error stream. That stream can be piped to a file. For +example, for a file named `stderr.log`: + +~~~text +stack --no-dump-logs --color always build --no-interleaved-output 2> stderr.log +~~~ + ### extra-include-dirs Default: `[]` @@ -906,17 +1024,23 @@ ### jobs -Default: the number of processors reported by your CPU. +Default: the number of CPUs (cores) that the machine has. -Command line equivalent (takes precedence): `-j`, `--jobs` option +Command line equivalent (takes precedence): +[`-j`, `--jobs` option](global_flags.md#-jobs-or-j-option) -Specifies how many build tasks should be run in parallel. One usage for this -might be to avoid running out of memory by setting it to 1, like this: +Specifies the number of concurrent jobs (principally, Stack actions during +building - see further below) to run. -~~~yaml -jobs: 1 -~~~ +When [building GHC from source](#building-ghc-from-source), specifies the +`-j[<n>]` flag of GHC's Hadrian build system. +In some circumstances, the default can cause some machines to run out of memory +during building. If those circumstances arise, specify `jobs: 1`. + +This configuration option is distinct from GHC's own `-j[<n>]` flag, which +relates to parallel compilation of modules within a package. + ### local-bin-path Default (on Unix-like operating systems): `~/.local/bin` @@ -1119,13 +1243,14 @@ #### Basic use Values are `none` (unchanged), `upper` (add upper bounds), `lower` (add -lower bounds), and both (and upper and lower bounds). The algorithm it follows -is: +lower bounds), and both (and upper and lower bounds). The algorithm Stack +follows is: -* If an upper or lower bound already exists on a dependency, it's left alone -* When adding a lower bound, we look at the current version specified by - `stack.yaml`, and set it as the lower bound (e.g., `foo >= 1.2.3`) -* When adding an upper bound, we require less than the next major version +* If an upper or lower bound (other than `>= 0` - 'any version') already exists + on a dependency, it is left alone +* When adding a lower bound, Stack looks at the current version specified by + `stack.yaml`, and sets it as the lower bound (e.g., `foo >= 1.2.3`) +* When adding an upper bound, Stack sets it as less than the next major version (e.g., `foo < 1.3`) ~~~yaml @@ -1153,30 +1278,27 @@ [:octicons-tag-24: 2.1.1](https://github.com/commercialhaskell/stack/releases/tag/v2.1.1) +Default: `true` + When Stack notices that a new version of Stack is available, should it notify the user? -~~~yaml -recommend-stack-upgrade: true -~~~ - ### rebuild-ghc-options [:octicons-tag-24: 0.1.6.0](https://github.com/commercialhaskell/stack/releases/tag/v0.1.6.0) Default: `false` -Should we rebuild a package when its GHC options change? Before Stack 0.1.6, -this was a non-configurable `true`. However, in most cases, the flag is used to -affect optimization levels and warning behavior, for which GHC itself doesn't -actually recompile the modules anyway. Therefore, the new behavior is to not -recompile on an options change, but this behavior can be changed back with the -following: +Should Stack rebuild a package when its GHC options change? -~~~yaml -rebuild-ghc-options: true -~~~ +The default value reflects that, in most cases, GHC options are used to affect +optimization levels and warning behavior, for which GHC does not recompile the +modules. +!!! note + + Before Stack 0.1.6.0, Stack rebuilt a package when its GHC options changed. + ### require-stack-version Default: `"-any"` @@ -1241,7 +1363,7 @@ 'Platforms' are pairs of an operating system and a machine architecture (for example, 32-bit i386 or 64-bit x86-64) (represented by the -`Cabal.Distribution.Systems.Platform` type). Stack currently (version 2.11.1) +`Cabal.Distribution.Systems.Platform` type). Stack currently (version 2.13.1) supports the following pairs in the format of the `setup-info` key: |Operating system|I386 arch|X86_64 arch|Other machine architectures |
@@ -12,7 +12,7 @@ , runActions ) where -import Control.Concurrent.STM ( retry ) +import Control.Concurrent.STM ( check ) import Stack.Prelude import Data.List ( sortBy ) import qualified Data.Set as Set @@ -28,33 +28,41 @@ "Inconsistent dependencies were discovered while executing your build \ \plan." +-- | Type representing types of Stack build actions. data ActionType = ATBuild -- ^ Action for building a package's library and executables. If - -- 'taskAllInOne' is 'True', then this will also build benchmarks - -- and tests. It is 'False' when then library's benchmarks or - -- test-suites have cyclic dependencies. + -- 'taskAllInOne' is 'True', then this will also build benchmarks and tests. + -- It is 'False' when the library's benchmarks or test-suites have cyclic + -- dependencies. | ATBuildFinal - -- ^ Task for building the package's benchmarks and test-suites. - -- Requires that the library was already built. + -- ^ Task for building the package's benchmarks and test-suites. Requires + -- that the library was already built. | ATRunTests -- ^ Task for running the package's test-suites. | ATRunBenchmarks -- ^ Task for running the package's benchmarks. deriving (Show, Eq, Ord) +-- | Types representing the unique ids of Stack build actions. data ActionId = ActionId !PackageIdentifier !ActionType deriving (Eq, Ord, Show) -data Action - = Action +-- | Type representing Stack build actions. +data Action = Action { actionId :: !ActionId + -- ^ The action's unique id. , actionDeps :: !(Set ActionId) + -- ^ Actions on which this action depends. , actionDo :: !(ActionContext -> IO ()) + -- ^ The action's 'IO' action, given a context. , actionConcurrency :: !Concurrency + -- ^ Whether this action may be run concurrently with others. } +-- | Type representing permissions for actions to be run concurrently with +-- others. data Concurrency = ConcurrencyAllowed | ConcurrencyDisallowed @@ -62,11 +70,11 @@ data ActionContext = ActionContext { acRemaining :: !(Set ActionId) - -- ^ Does not include the current action + -- ^ Does not include the current action. , acDownstream :: [Action] - -- ^ Actions which depend on the current action + -- ^ Actions which depend on the current action. , acConcurrency :: !Concurrency - -- ^ Whether this action may be run concurrently with others + -- ^ Whether this action may be run concurrently with others. } data ExecuteState = ExecuteState @@ -77,18 +85,19 @@ , esKeepGoing :: Bool } -runActions :: Int -- ^ threads - -> Bool -- ^ keep going after one task has failed - -> [Action] - -> (TVar Int -> TVar (Set ActionId) -> IO ()) -- ^ progress updated - -> IO [SomeException] -runActions threads keepGoing actions0 withProgress = do +runActions :: + Int -- ^ threads + -> Bool -- ^ keep going after one task has failed + -> [Action] + -> (TVar Int -> TVar (Set ActionId) -> IO ()) -- ^ progress updated + -> IO [SomeException] +runActions threads keepGoing actions withProgress = do es <- ExecuteState - <$> newTVarIO (sortActions actions0) - <*> newTVarIO [] - <*> newTVarIO Set.empty - <*> newTVarIO 0 - <*> pure keepGoing + <$> newTVarIO (sortActions actions) -- esActions + <*> newTVarIO [] -- esExceptions + <*> newTVarIO Set.empty -- esInAction + <*> newTVarIO 0 -- esCompleted + <*> pure keepGoing -- esKeepGoing _ <- async $ withProgress (esCompleted es) (esInAction es) if threads <= 1 then runActions' es @@ -110,53 +119,71 @@ runActions' :: ExecuteState -> IO () runActions' ExecuteState {..} = loop where + loop :: IO () + loop = join $ atomically $ breakOnErrs $ withActions processActions + + breakOnErrs :: STM (IO ()) -> STM (IO ()) breakOnErrs inner = do errs <- readTVar esExceptions if null errs || esKeepGoing then inner - else pure $ pure () + else doNothing + + withActions :: ([Action] -> STM (IO ())) -> STM (IO ()) withActions inner = do - as <- readTVar esActions - if null as - then pure $ pure () - else inner as - loop = join $ atomically $ breakOnErrs $ withActions $ \as -> - case break (Set.null . actionDeps) as of + actions <- readTVar esActions + if null actions + then doNothing + else inner actions + + processActions :: [Action] -> STM (IO ()) + processActions actions = do + inAction <- readTVar esInAction + case break (Set.null . actionDeps) actions of (_, []) -> do - inAction <- readTVar esInAction - if Set.null inAction - then do - unless esKeepGoing $ - modifyTVar esExceptions (toException InconsistentDependenciesBug:) - pure $ pure () - else retry - (xs, action:ys) -> do - inAction <- readTVar esInAction - case actionConcurrency action of - ConcurrencyAllowed -> pure () - ConcurrencyDisallowed -> unless (Set.null inAction) retry - let as' = xs ++ ys - remaining = Set.union - (Set.fromList $ map actionId as') - inAction - writeTVar esActions as' - modifyTVar esInAction (Set.insert $ actionId action) - pure $ mask $ \restore -> do - eres <- try $ restore $ actionDo action ActionContext - { acRemaining = remaining - , acDownstream = downstreamActions (actionId action) as' - , acConcurrency = actionConcurrency action - } - atomically $ do - modifyTVar esInAction (Set.delete $ actionId action) - modifyTVar esCompleted (+1) - case eres of - Left err -> modifyTVar esExceptions (err:) - Right () -> - let dropDep a = - a { actionDeps = Set.delete (actionId action) $ actionDeps a } - in modifyTVar esActions $ map dropDep - restore loop + check (Set.null inAction) + unless esKeepGoing $ + modifyTVar esExceptions (toException InconsistentDependenciesBug:) + doNothing + (xs, action:ys) -> processAction inAction (xs ++ ys) action -downstreamActions :: ActionId -> [Action] -> [Action] -downstreamActions aid = filter (\a -> aid `Set.member` actionDeps a) + processAction :: Set ActionId -> [Action] -> Action -> STM (IO ()) + processAction inAction otherActions action = do + let concurrency = actionConcurrency action + unless (concurrency == ConcurrencyAllowed) $ + check (Set.null inAction) + let action' = actionId action + otherActions' = Set.fromList $ map actionId otherActions + remaining = Set.union otherActions' inAction + actionContext = ActionContext + { acRemaining = remaining + , acDownstream = downstreamActions action' otherActions + , acConcurrency = concurrency + } + writeTVar esActions otherActions + modifyTVar esInAction (Set.insert action') + pure $ do + mask $ \restore -> do + eres <- try $ restore $ actionDo action actionContext + atomically $ do + modifyTVar esInAction (Set.delete action') + modifyTVar esCompleted (+1) + case eres of + Left err -> modifyTVar esExceptions (err:) + Right () -> modifyTVar esActions $ map (dropDep action') + loop + + -- | Filter a list of actions to include only those that depend on the given + -- action. + downstreamActions :: ActionId -> [Action] -> [Action] + downstreamActions aid = filter (\a -> aid `Set.member` actionDeps a) + + -- | Given two actions (the first specified by its id) yield an action + -- equivalent to the second but excluding any dependency on the first action. + dropDep :: ActionId -> Action -> Action + dropDep action' action = + action { actionDeps = Set.delete action' $ actionDeps action } + + -- | @IO ()@ lifted into 'STM'. + doNothing :: STM (IO ()) + doNothing = pure $ pure ()
@@ -0,0 +1,613 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TupleSections #-} + +-- This module is based on GHC's utils\ghc-pkg\Main.hs at +-- commit f66fc15f2e6849125074bcfeb44334a663323ca6 (see GHC merge request +-- !11142), with: +-- * changeDBDir' does not perform an effective @ghc-pkg recache@, +-- * the cache is not used, +-- * consistency checks are not performed, +-- * use Stack program name, +-- * use "Stack.Prelude" rather than "Prelude", +-- * use 'RIO' @env@ monad, +-- * use well-typed representations of paths from the @path@ package, +-- * add pretty messages and exceptions, +-- * redundant code deleted, +-- * Hlint applied, and +-- * explicit import lists. +-- +-- The version of the ghc-pkg executable supplied with GHCs published before +-- 28 August 2023 does not efficiently bulk unregister. This module exports a +-- function that does efficiently bulk unregister. + +module GHC.Utils.GhcPkg.Main.Compat + ( ghcPkgUnregisterForce + ) where + +----------------------------------------------------------------------------- +-- +-- (c) The University of Glasgow 2004-2009. +-- +-- Package management tool +-- +----------------------------------------------------------------------------- + +import qualified Data.Foldable as F +import Data.List ( init, isPrefixOf, isSuffixOf, last ) +import qualified Data.Traversable as F +import Distribution.InstalledPackageInfo as Cabal +import Distribution.Package ( UnitId, mungedId ) +import qualified Distribution.Parsec as Cabal +import Distribution.Text ( display ) +import Distribution.Version ( nullVersion ) +import GHC.IO.Exception (IOErrorType(InappropriateType)) +import qualified GHC.Unit.Database as GhcPkg +import Path + ( SomeBase (..), fileExtension, mapSomeBase, parseRelFile + , parseSomeDir, prjSomeBase + ) +import qualified Path as P +import Path.IO + ( createDirIfMissing, doesDirExist, listDir, removeFile ) +import qualified RIO.ByteString as BS +import RIO.Partial ( fromJust ) +import Stack.Constants ( relFilePackageCache ) +import Stack.Prelude hiding ( display ) +import System.Environment ( getEnv ) +import System.FilePath as FilePath +import System.IO ( readFile ) +import System.IO.Error + ( ioeGetErrorType, ioError, isDoesNotExistError ) + +-- | Function equivalent to: +-- +-- > ghc-pkg --no-user-package-db --package-db=<pkgDb> unregister [--ipid] <P> +-- +ghcPkgUnregisterForce :: + HasTerm env + => Path Abs Dir -- ^ Path to the global package database + -> Path Abs Dir -- ^ Path to the package database + -> Bool -- ^ Apply ghc-pkg's --ipid, --unit-id flag? + -> [String] -- ^ Packages to unregister + -> RIO env () +ghcPkgUnregisterForce globalDb pkgDb hasIpid pkgarg_strs = do + pkgargs <- forM pkgarg_strs $ readPackageArg as_arg + prettyDebugL + $ flow "Unregistering from" + : (pretty pkgDb <> ":") + : mkNarrativeList (Just Current) False + (map (fromString . show) pkgargs :: [StyleDoc]) + unregisterPackages globalDb pkgargs pkgDb + where + as_arg = if hasIpid then AsUnitId else AsDefault + +-- | Type representing \'pretty\' exceptions thrown by functions exported by the +-- "GHC.Utils.GhcPkg.Main.Compat" module. +data GhcPkgPrettyException + = CannotParse !String !String !String + | CannotOpenDBForModification !(SomeBase Dir) !IOException + | SingleFileDBUnsupported !(SomeBase Dir) + | ParsePackageInfoExceptions !String + | CannotFindPackage !PackageArg !(Maybe (SomeBase Dir)) + deriving (Show, Typeable) + +instance Pretty GhcPkgPrettyException where + pretty (CannotParse str what e) = + "[S-6512]" + <> line + <> fillSep + [ flow "cannot parse" + , style Current (fromString str) + , flow "as a" + , fromString what <> ":" + ] + <> blankLine + <> fromString e + pretty (CannotOpenDBForModification db_path e) = + "[S-3384]" + <> line + <> fillSep + [ flow "Couldn't open database" + , pretty db_path + , flow "for modification:" + ] + <> blankLine + <> string (displayException e) + pretty (SingleFileDBUnsupported path) = + "[S-1430]" + <> line + <> fillSep + [ flow "ghc no longer supports single-file style package databases" + , parens (pretty path) + , "use" + , style Shell (flow "ghc-pkg init") + , flow "to create the database with the correct format." + ] + pretty (ParsePackageInfoExceptions errs) = + "[S-5996]" + <> line + <> flow errs + pretty (CannotFindPackage pkgarg mdb_path) = + "[S-3189]" + <> line + <> fillSep + [ flow "cannot find package" + , style Current (pkg_msg pkgarg) + , maybe + "" + (\db_path -> fillSep ["in", pretty db_path]) + mdb_path + ] + where + pkg_msg (Substring pkgpat _) = fillSep ["matching", fromString pkgpat] + pkg_msg pkgarg' = fromString $ show pkgarg' + +instance Exception GhcPkgPrettyException + +-- ----------------------------------------------------------------------------- +-- Do the business + +-- | Enum flag representing argument type +data AsPackageArg + = AsUnitId + | AsDefault + +-- | Represents how a package may be specified by a user on the command line. +data PackageArg + -- | A package identifier foo-0.1, or a glob foo-* + = Id GlobPackageIdentifier + -- | An installed package ID foo-0.1-HASH. This is guaranteed to uniquely + -- match a single entry in the package database. + | IUId UnitId + -- | A glob against the package name. The first string is the literal + -- glob, the second is a function which returns @True@ if the argument + -- matches. + | Substring String (String -> Bool) + +instance Show PackageArg where + show (Id pkgid) = displayGlobPkgId pkgid + show (IUId ipid) = display ipid + show (Substring pkgpat _) = pkgpat + +parseCheck :: Cabal.Parsec a => String -> String -> RIO env a +parseCheck str what = + case Cabal.eitherParsec str of + Left e -> prettyThrowIO $ CannotParse str what e + Right x -> pure x + +-- | Either an exact 'PackageIdentifier', or a glob for all packages +-- matching 'PackageName'. +data GlobPackageIdentifier + = ExactPackageIdentifier MungedPackageId + | GlobPackageIdentifier MungedPackageName + +displayGlobPkgId :: GlobPackageIdentifier -> String +displayGlobPkgId (ExactPackageIdentifier pid) = display pid +displayGlobPkgId (GlobPackageIdentifier pn) = display pn ++ "-*" + +readGlobPkgId :: String -> RIO env GlobPackageIdentifier +readGlobPkgId str + | "-*" `isSuffixOf` str = + GlobPackageIdentifier <$> parseCheck (init (init str)) "package identifier (glob)" + | otherwise = ExactPackageIdentifier <$> parseCheck str "package identifier (exact)" + +readPackageArg :: AsPackageArg -> String -> RIO env PackageArg +readPackageArg AsUnitId str = IUId <$> parseCheck str "installed package id" +readPackageArg AsDefault str = Id <$> readGlobPkgId str + +-- ----------------------------------------------------------------------------- +-- Package databases + +data PackageDB (mode :: GhcPkg.DbMode) = PackageDB + { location :: !(SomeBase Dir) + -- We only need possibly-relative package db location. The relative + -- location is used as an identifier for the db, so it is important we do + -- not modify it. + , packageDbLock :: !(GhcPkg.DbOpenMode mode GhcPkg.PackageDbLock) + -- If package db is open in read write mode, we keep its lock around for + -- transactional updates. + , packages :: [InstalledPackageInfo] + } + +-- | A stack of package databases. Convention: head is the topmost in the stack. +type PackageDBStack = [PackageDB 'GhcPkg.DbReadOnly] + +-- | Selector for picking the right package DB to modify as 'modify' changes the +-- first database that contains a specific package. +newtype DbModifySelector = ContainsPkg PackageArg + +getPkgDatabases :: + forall env. HasTerm env + => Path Abs Dir + -- ^ Path to the global package database. + -> PackageArg + -> Path Abs Dir + -- ^ Path to the package database. + -> RIO + env + ( PackageDBStack + -- the real package DB stack: [global,user] ++ DBs specified on the + -- command line with -f. + , GhcPkg.DbOpenMode GhcPkg.DbReadWrite (PackageDB GhcPkg.DbReadWrite) + -- which one to modify, if any + , PackageDBStack + -- the package DBs specified on the command line, or [global,user] + -- otherwise. This is used as the list of package DBs for commands + -- that just read the DB, such as 'list'. + ) +getPkgDatabases globalDb pkgarg pkgDb = do + -- Second we determine the location of the global package config. On Windows, + -- this is found relative to the ghc-pkg.exe binary, whereas on Unix the + -- location is passed to the binary using the --global-package-db flag by the + -- wrapper script. + let sys_databases = [Abs globalDb] + e_pkg_path <- tryIO (liftIO $ System.Environment.getEnv "GHC_PACKAGE_PATH") + let env_stack = + case e_pkg_path of + Left _ -> sys_databases + Right path + | not (null path) && isSearchPathSeparator (last path) + -> mapMaybe parseSomeDir (splitSearchPath (init path)) <> sys_databases + | otherwise + -> mapMaybe parseSomeDir (splitSearchPath path) + + -- -f flags on the command line add to the database stack, unless any of them + -- are present in the stack already. + let final_stack = [Abs pkgDb | Abs pkgDb `notElem` env_stack] <> env_stack + + (db_stack, db_to_operate_on) <- getDatabases pkgDb final_stack + + let flag_db_stack = [ db | db <- db_stack, location db == Abs pkgDb ] + + prettyDebugL + $ flow "Db stack:" + : map (pretty . location) db_stack + F.forM_ db_to_operate_on $ \db -> + prettyDebugL + [ "Modifying:" + , pretty $ location db + ] + prettyDebugL + $ flow "Flag db stack:" + : map (pretty . location) flag_db_stack + + pure (db_stack, db_to_operate_on, flag_db_stack) + where + getDatabases flag_db_name final_stack = do + -- The package db we open in read write mode is the first one included in + -- flag_db_names that contains specified package. Therefore we need to + -- open each one in read/write mode first and decide whether it's for + -- modification based on its contents. + (db_stack, mto_modify) <- stateSequence Nothing + [ \case + to_modify@(Just _) -> (, to_modify) <$> readDatabase db_path + Nothing -> if db_path /= Abs flag_db_name + then (, Nothing) <$> readDatabase db_path + else do + let hasPkg :: PackageDB mode -> Bool + hasPkg = not . null . findPackage pkgarg . packages + + openRo (e::IOException) = do + db <- readDatabase db_path + if hasPkg db + then + prettyThrowIO $ CannotOpenDBForModification db_path e + else pure (db, Nothing) + + -- If we fail to open the database in read/write mode, we need + -- to check if it's for modification first before throwing an + -- error, so we attempt to open it in read only mode. + handle openRo $ do + db <- readParseDatabase + (GhcPkg.DbOpenReadWrite $ ContainsPkg pkgarg) db_path + let ro_db = db { packageDbLock = GhcPkg.DbOpenReadOnly } + if hasPkg db + then pure (ro_db, Just db) + else do + -- If the database is not for modification after all, + -- drop the write lock as we are already finished with + -- the database. + case packageDbLock db of + GhcPkg.DbOpenReadWrite lock -> + liftIO $ GhcPkg.unlockPackageDb lock + pure (ro_db, Nothing) + | db_path <- final_stack ] + + to_modify <- case mto_modify of + Just db -> pure db + Nothing -> cannotFindPackage pkgarg Nothing + + pure (db_stack, GhcPkg.DbOpenReadWrite to_modify) + where + -- Parse package db in read-only mode. + readDatabase :: SomeBase Dir -> RIO env (PackageDB 'GhcPkg.DbReadOnly) + readDatabase = readParseDatabase GhcPkg.DbOpenReadOnly + + stateSequence :: Monad m => s -> [s -> m (a, s)] -> m ([a], s) + stateSequence s [] = pure ([], s) + stateSequence s (m:ms) = do + (a, s') <- m s + (as, s'') <- stateSequence s' ms + pure (a : as, s'') + +readParseDatabase :: + forall mode t env. HasTerm env + => GhcPkg.DbOpenMode mode t + -> SomeBase Dir + -> RIO env (PackageDB mode) +readParseDatabase mode path = do + e <- tryIO $ prjSomeBase listDir path + case e of + Left err + | ioeGetErrorType err == InappropriateType -> do + -- We provide a limited degree of backwards compatibility for + -- old single-file style db: + mdb <- tryReadParseOldFileStyleDatabase mode path + case mdb of + Just db -> pure db + Nothing -> prettyThrowIO $ SingleFileDBUnsupported path + + | otherwise -> liftIO $ ioError err + Right (_, fs) -> ignore_cache + where + confs = filter isConf fs + + isConf :: Path Abs File -> Bool + isConf f = case fileExtension f of + Nothing -> False + Just ext -> ext == ".conf" + + ignore_cache :: RIO env (PackageDB mode) + ignore_cache = do + -- If we're opening for modification, we need to acquire a lock even if + -- we don't open the cache now, because we are going to modify it later. + lock <- liftIO $ + F.mapM (const $ GhcPkg.lockPackageDb (prjSomeBase toFilePath cache)) mode + pkgs <- mapM parseSingletonPackageConf confs + mkPackageDB pkgs lock + where + cache = mapSomeBase (P.</> relFilePackageCache) path + + mkPackageDB :: + [InstalledPackageInfo] + -> GhcPkg.DbOpenMode mode GhcPkg.PackageDbLock + -> RIO env (PackageDB mode) + mkPackageDB pkgs lock = do + pure $ PackageDB + { location = path + , packageDbLock = lock + , packages = pkgs + } + +parseSingletonPackageConf :: + HasTerm env + => Path Abs File + -> RIO env InstalledPackageInfo +parseSingletonPackageConf file = do + prettyDebugL + [ flow "Reading package config:" + , pretty file + ] + BS.readFile (toFilePath file) >>= fmap fst . parsePackageInfo + +-- ----------------------------------------------------------------------------- +-- Workaround for old single-file style package dbs + +-- Single-file style package dbs have been deprecated for some time, but +-- it turns out that Cabal was using them in one place. So this code is for a +-- workaround to allow older Cabal versions to use this newer ghc. + +-- We check if the file db contains just "[]" and if so, we look for a new +-- dir-style db in path.d/, ie in a dir next to the given file. +-- We cannot just replace the file with a new dir style since Cabal still +-- assumes it's a file and tries to overwrite with 'writeFile'. + +-- ghc itself also cooperates in this workaround + +tryReadParseOldFileStyleDatabase :: + HasTerm env + => GhcPkg.DbOpenMode mode t + -> SomeBase Dir + -> RIO env (Maybe (PackageDB mode)) +tryReadParseOldFileStyleDatabase mode path = do + -- assumes we've already established that path exists and is not a dir + content <- liftIO $ readFile (prjSomeBase toFilePath path) `catchIO` \_ -> pure "" + if take 2 content == "[]" + then do + let path_dir = adjustOldDatabasePath path + prettyWarnL + [ flow "Ignoring old file-style db and trying" + , pretty path_dir + ] + direxists <- prjSomeBase doesDirExist path_dir + if direxists + then do + db <- readParseDatabase mode path_dir + -- but pretend it was at the original location + pure $ Just db { location = path } + else do + lock <- F.forM mode $ \_ -> do + prjSomeBase (createDirIfMissing True) path_dir + liftIO $ GhcPkg.lockPackageDb $ + prjSomeBase (toFilePath . (P.</> relFilePackageCache)) path_dir + pure $ Just PackageDB + { location = path + , packageDbLock = lock + , packages = [] + } + + -- if the path is not a file, or is not an empty db then we fail + else pure Nothing + +adjustOldFileStylePackageDB :: PackageDB mode -> RIO env (PackageDB mode) +adjustOldFileStylePackageDB db = do + -- assumes we have not yet established if it's an old style or not + mcontent <- liftIO $ + fmap Just (readFile (prjSomeBase toFilePath (location db))) `catchIO` \_ -> pure Nothing + case fmap (take 2) mcontent of + -- it is an old style and empty db, so look for a dir kind in location.d/ + Just "[]" -> pure db + { location = adjustOldDatabasePath $ location db } + -- it is old style but not empty, we have to bail + Just _ -> prettyThrowIO $ SingleFileDBUnsupported (location db) + -- probably not old style, carry on as normal + Nothing -> pure db + +adjustOldDatabasePath :: SomeBase Dir -> SomeBase Dir +adjustOldDatabasePath = + fromJust . prjSomeBase (parseSomeDir . (<> ".d") . toFilePath) + +parsePackageInfo :: BS.ByteString -> RIO env (InstalledPackageInfo, [String]) +parsePackageInfo str = + case parseInstalledPackageInfo str of + Right (warnings, ok) -> pure (mungePackageInfo ok, ws) + where + ws = [ msg | msg <- warnings + , not ("Unrecognized field pkgroot" `isPrefixOf` msg) ] + Left err -> prettyThrowIO $ ParsePackageInfoExceptions (unlines (F.toList err)) + +mungePackageInfo :: InstalledPackageInfo -> InstalledPackageInfo +mungePackageInfo ipi = ipi + +-- ----------------------------------------------------------------------------- +-- Making changes to a package database + +newtype DBOp = RemovePackage InstalledPackageInfo + +changeNewDB :: + HasTerm env + => [DBOp] + -> PackageDB 'GhcPkg.DbReadWrite + -> RIO env () +changeNewDB cmds new_db = do + new_db' <- adjustOldFileStylePackageDB new_db + prjSomeBase (createDirIfMissing True) (location new_db') + changeDBDir' cmds new_db' + +changeDBDir' :: + HasTerm env + => [DBOp] + -> PackageDB 'GhcPkg.DbReadWrite + -> RIO env () +changeDBDir' cmds db = do + mapM_ do_cmd cmds + case packageDbLock db of + GhcPkg.DbOpenReadWrite lock -> liftIO $ GhcPkg.unlockPackageDb lock + where + do_cmd (RemovePackage p) = do + let relFileConf = + fromJust (parseRelFile $ display (installedUnitId p) <> ".conf") + file = mapSomeBase (P.</> relFileConf) (location db) + prettyDebugL + [ "Removing" + , pretty file + ] + removeFileSafe file + +unregisterPackages :: + forall env. HasTerm env + => Path Abs Dir + -- ^ Path to the global package database. + -> [PackageArg] + -> Path Abs Dir + -- ^ Path to the package database. + -> RIO env () +unregisterPackages globalDb pkgargs pkgDb = do + pkgsByPkgDBs <- F.foldlM (getPkgsByPkgDBs []) [] pkgargs + forM_ pkgsByPkgDBs unregisterPackages' + where + -- Update a list of 'packages by package database' for a package. Assumes that + -- a package to be unregistered is in no more than one database. + getPkgsByPkgDBs :: [(PackageDB GhcPkg.DbReadWrite, [UnitId])] + -- ^ List of considered 'packages by package database' + -> [(PackageDB GhcPkg.DbReadWrite, [UnitId])] + -- ^ List of to be considered 'packages by package database' + -> PackageArg + -- Package to update + -> RIO env [(PackageDB GhcPkg.DbReadWrite, [UnitId])] + -- No more 'packages by package database' to consider? We need to try to get + -- another package database. + getPkgsByPkgDBs pkgsByPkgDBs [] pkgarg = + getPkgDatabases globalDb pkgarg pkgDb >>= \case + (_, GhcPkg.DbOpenReadWrite (db :: PackageDB GhcPkg.DbReadWrite), _) -> do + pks <- do + let pkgs = packages db + ps = findPackage pkgarg pkgs + -- This shouldn't happen if getPkgsByPkgDBs picks the DB correctly. + when (null ps) $ cannotFindPackage pkgarg $ Just db + pure (map installedUnitId ps) + let pkgsByPkgDB = (db, pks) + pure (pkgsByPkgDB : pkgsByPkgDBs) + -- Consider the next 'packages by package database' in the list of ones to + -- consider. + getPkgsByPkgDBs pkgsByPkgDBs ( pkgsByPkgDB : pkgsByPkgDBs') pkgarg = do + let (db, pks') = pkgsByPkgDB + pkgs = packages db + ps = findPackage pkgarg pkgs + pks = map installedUnitId ps + pkgByPkgDB' = (db, pks <> pks') + if null ps + then + -- Not found in the package database? Add the package database to those + -- considered and try with the remaining package databases to consider. + getPkgsByPkgDBs ( pkgsByPkgDB : pkgsByPkgDBs ) pkgsByPkgDBs' pkgarg + else + -- Found in the package database? Add to the list of packages to be + -- unregistered from that package database. TO DO: Perhaps check not + -- already in that list for better error messages when there are + -- duplicated requests to unregister. + pure (pkgsByPkgDBs <> (pkgByPkgDB' : pkgsByPkgDBs')) + + unregisterPackages' :: (PackageDB GhcPkg.DbReadWrite, [UnitId]) -> RIO env () + unregisterPackages' (db, pks) = do + let pkgs = packages db + cmds = [ RemovePackage pkg + | pkg <- pkgs, installedUnitId pkg `elem` pks + ] + new_db = db{ packages = pkgs' } + where + deleteFirstsBy' :: (a -> b -> Bool) -> [a] -> [b] -> [a] + deleteFirstsBy' eq = foldl' (deleteBy' eq) + + deleteBy' :: (a -> b -> Bool) -> [a] -> b -> [a] + deleteBy' _ [] _ = [] + deleteBy' eq (y:ys) x = if y `eq` x then ys else y : deleteBy' eq ys x + + pkgs' = deleteFirstsBy' (\p1 p2 -> installedUnitId p1 == p2) pkgs pks + -- Use changeNewDB, rather than changeDB, to avoid duplicating + -- updateInternalDB db cmds + changeNewDB cmds new_db + +findPackage :: PackageArg -> [InstalledPackageInfo] -> [InstalledPackageInfo] +findPackage pkgarg = filter (pkgarg `matchesPkg`) + +cannotFindPackage :: PackageArg -> Maybe (PackageDB mode) -> RIO env a +cannotFindPackage pkgarg mdb = + prettyThrowIO $ CannotFindPackage pkgarg (location <$> mdb) + +matches :: GlobPackageIdentifier -> MungedPackageId -> Bool +GlobPackageIdentifier pn `matches` pid' = pn == mungedName pid' +ExactPackageIdentifier pid `matches` pid' = + mungedName pid == mungedName pid' + && ( mungedVersion pid == mungedVersion pid' + || mungedVersion pid == nullVersion + ) + +matchesPkg :: PackageArg -> InstalledPackageInfo -> Bool +(Id pid) `matchesPkg` pkg = pid `matches` mungedId pkg +(IUId ipid) `matchesPkg` pkg = ipid == installedUnitId pkg +(Substring _ m) `matchesPkg` pkg = m (display (mungedId pkg)) + +-- removeFileSave doesn't throw an exceptions, if the file is already deleted +removeFileSafe :: SomeBase File -> RIO env () +removeFileSafe fn = do + prjSomeBase removeFile fn `catchIO` \ e -> + unless (isDoesNotExistError e) $ liftIO $ ioError e
@@ -83,7 +83,11 @@ ) import Network.HTTP.Conduit ( requestHeaders ) import Network.HTTP.Download - hiding ( download, redownload, verifiedDownload ) + ( CheckHexDigest (..), DownloadRequest, HashCheck (..) + , VerifiedDownloadException (..), drRetryPolicyDefault + , mkDownloadRequest, modifyRequest, setForceDownload + , setHashChecks, setLengthCheck, setRetryPolicy + ) import qualified Network.HTTP.Download as Download import Network.HTTP.Simple ( addRequestHeader, getResponseBody, getResponseHeaders
@@ -18,16 +18,13 @@ import Control.Monad.Trans.Except ( runExceptT ) import Control.Monad.Trans.Writer ( runWriter, tell ) import Options.Applicative - ( CommandFields, Parser, ParserFailure, ParserHelp - , ParserInfo (..), ParserResult (..), (<**>), abortOption - , command, execParserPure, footer, fullDesc + ( Parser, ParserFailure, ParserHelp, ParserResult (..) + , abortOption, command, execParserPure, footer, fullDesc , handleParseResult, header, help, info, infoOption, long , metavar, noBacktrack, prefs, progDesc, showHelpOnEmpty + , hsubparser ) import Options.Applicative.Builder.Extra ( showHelpText ) -import Options.Applicative.Builder.Internal - ( Mod (..), mkCommand, mkParser ) -import Options.Applicative.Types ( OptReader (..) ) import Stack.Prelude import Stack.Types.AddCommand ( AddCommand ) import Stack.Types.GlobalOptsMonoid ( GlobalOptsMonoid ) @@ -172,19 +169,8 @@ (,) <$> commonParser <*> case runWriter (runExceptT commandParser) of - (Right (), d) -> hsubparser' commandMetavar d + (Right (), m) -> hsubparser (m <> metavar commandMetavar) (Left b, _) -> pure (b, mempty) - --- | Subparser with @--help@ argument. Borrowed with slight modification --- from Options.Applicative.Extra. -hsubparser' :: String -> Mod CommandFields a -> Parser a -hsubparser' commandMetavar m = mkParser d g rdr - where - Mod _ d g = metavar commandMetavar `mappend` m - (groupName, cmds, subs) = mkCommand m - rdr = CmdReader groupName cmds (fmap add_helper . subs) - add_helper pinfo = pinfo - { infoParser = infoParser pinfo <**> helpOption } -- | Non-hidden help option. helpOption :: Parser (a -> a)
@@ -0,0 +1,138 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE OverloadedStrings #-} + +-- | Main Stack tool entry point. + +module Stack + ( main + ) where + +import GHC.IO.Encoding ( mkTextEncoding, textEncodingName ) +import Options.Applicative.Builder.Extra ( execExtraHelp ) +import Stack.BuildInfo ( versionString' ) +import Stack.CLI ( commandLineHandler ) +import Stack.Constants ( stackProgName ) +import Stack.Docker ( dockerCmdName, dockerHelpOptName ) +import Stack.Nix ( nixCmdName, nixHelpOptName ) +import Stack.Options.DockerParser ( dockerOptsParser ) +import Stack.Options.GlobalParser ( globalOptsFromMonoid ) +import Stack.Options.NixParser ( nixOptsParser ) +import Stack.Prelude +import Stack.Runners + ( ShouldReexec (..), withConfig, withRunnerGlobal ) +import Stack.Types.GlobalOpts ( GlobalOpts (..) ) +import Stack.Types.Runner ( Runner ) +import Stack.Types.Version + ( VersionCheck (..), checkVersion, showStackVersion + , stackVersion + ) +import System.Directory ( getCurrentDirectory ) +import System.Environment ( getArgs, getProgName ) +import System.IO ( hGetEncoding, hPutStrLn, hSetEncoding ) +import System.Terminal ( hIsTerminalDeviceOrMinTTY ) + +-- | Type representing exceptions thrown by functions in the "Stack" module. +data StackException + = InvalidReExecVersion String String + deriving (Show, Typeable) + +instance Exception StackException where + displayException (InvalidReExecVersion expected actual) = concat + [ "Error: [S-2186]\n" + , "When re-executing '" + , stackProgName + , "' in a container, the incorrect version was found\nExpected: " + , expected + , "; found: " + , actual + ] + +main :: IO () +main = do + -- Line buffer the output by default, particularly for non-terminal runs. + -- See https://github.com/commercialhaskell/stack/pull/360 + hSetBuffering stdout LineBuffering + hSetBuffering stdin LineBuffering + hSetBuffering stderr LineBuffering + hSetTranslit stdout + hSetTranslit stderr + args <- getArgs + progName <- getProgName + isTerminal <- hIsTerminalDeviceOrMinTTY stdout + execExtraHelp + args + dockerHelpOptName + (dockerOptsParser False) + ("Only showing --" ++ dockerCmdName ++ "* options.") + execExtraHelp + args + nixHelpOptName + (nixOptsParser False) + ("Only showing --" ++ nixCmdName ++ "* options.") + currentDir <- getCurrentDirectory + eGlobalRun <- try $ commandLineHandler currentDir progName False + case eGlobalRun of + Left (exitCode :: ExitCode) -> + throwIO exitCode + Right (globalMonoid, run) -> do + global <- globalOptsFromMonoid isTerminal globalMonoid + when (globalLogLevel global == LevelDebug) $ + hPutStrLn stderr versionString' + case globalReExecVersion global of + Just expectVersion -> do + expectVersion' <- parseVersionThrowing expectVersion + unless (checkVersion MatchMinor expectVersion' stackVersion) $ + throwIO $ + InvalidReExecVersion expectVersion showStackVersion + _ -> pure () + withRunnerGlobal global $ run `catches` + [ Handler handleExitCode + , Handler handlePrettyException + , Handler handlePantryException + , Handler handleSomeException + ] + +-- | Change the character encoding of the given Handle to transliterate on +-- unsupported characters instead of throwing an exception +hSetTranslit :: Handle -> IO () +hSetTranslit h = do + menc <- hGetEncoding h + case fmap textEncodingName menc of + Just name + | '/' `notElem` name -> do + enc' <- mkTextEncoding $ name ++ "//TRANSLIT" + hSetEncoding h enc' + _ -> pure () + +-- | Handle ExitCode exceptions. +handleExitCode :: ExitCode -> RIO Runner a +handleExitCode = exitWith + +-- | Handle PrettyException exceptions. +handlePrettyException :: PrettyException -> RIO Runner a +handlePrettyException = handleAnyPrettyException + +-- | Handle (pretty) PantryException exceptions. +handlePantryException :: PantryException -> RIO Runner a +handlePantryException = handleAnyPrettyException + +-- | Handle any pretty exception. +handleAnyPrettyException :: (Exception e, Pretty e) => e -> RIO Runner a +handleAnyPrettyException e = do + -- The code below loads the entire Stack configuration, when all that is + -- needed are the Stack colours. A tailored approach may be better. + result <- tryAny $ withConfig NoReexec $ prettyError $ pretty e + case result of + -- Falls back to the command line's Stack colours if there is any error in + -- loading the entire Stack configuration. + Left _ -> prettyError $ pretty e + Right _ -> pure () + exitFailure + +-- | Handle SomeException exceptions. This special handler stops "stack: " from +-- being printed before the exception. +handleSomeException :: SomeException -> RIO Runner a +handleSomeException (SomeException e) = do + logError $ fromString $ displayException e + exitFailure
@@ -77,13 +77,13 @@ "[S-5973]" <> line <> fillSep - [ flow "Stack does not support Cabal versions before 1.22, but \ + [ flow "Stack does not support Cabal versions before 1.24, but \ \version" , fromString $ versionString cabalVer , flow "was found. To fix this, consider updating the snapshot to" - , style Shell "lts-3.0" + , style Shell "lts-7.0" , flow "or later or to" - , style Shell "nightly-2015-05-05" + , style Shell "nightly-2016-05-26" , flow "or later." ] @@ -206,7 +206,7 @@ checkCabalVersion :: HasEnvConfig env => RIO env () checkCabalVersion = do cabalVer <- view cabalVersionL - when (cabalVer < mkVersion [1, 22]) $ + when (cabalVer < mkVersion [1, 24]) $ prettyThrowM $ CabalVersionNotSupported cabalVer -- | See https://github.com/commercialhaskell/stack/issues/1198.
@@ -8,7 +8,9 @@ ( constructPlan ) where -import Control.Monad.RWS.Strict hiding ( (<>) ) +import Control.Monad.RWS.Strict + ( RWST, get, modify, modify', pass, put, runRWST, tell ) +import Control.Monad.Trans.Maybe ( MaybeT (..) ) import qualified Data.List as L import qualified Data.Map.Merge.Strict as Map import qualified Data.Map.Strict as Map @@ -57,6 +59,7 @@ import Stack.Types.EnvSettings ( EnvSettings (..), minimalEnvSettings ) import Stack.Types.GHCVariant ( HasGHCVariant (..) ) import Stack.Types.GhcPkgId ( GhcPkgId ) +import Stack.Types.GlobalOpts ( GlobalOpts (..) ) import Stack.Types.IsMutable ( IsMutable (..) ) import Stack.Types.NamedComponent ( exeComponents, renderComponent ) import Stack.Types.Package @@ -67,7 +70,8 @@ ) import Stack.Types.ParentMap ( ParentMap ) import Stack.Types.Platform ( HasPlatform (..) ) -import Stack.Types.Runner ( HasRunner (..) ) +import Stack.Types.ProjectConfig ( isPCGlobalProject ) +import Stack.Types.Runner ( HasRunner (..), globalOptsL ) import Stack.Types.SourceMap ( CommonPackage (..), DepPackage (..), FromSnapshot (..) , GlobalPackage (..), SMTargets (..), SourceMap (..) @@ -75,7 +79,6 @@ import Stack.Types.Version ( latestApplicableVersion, versionRangeText, withinRange ) import System.Environment ( lookupEnv ) -import System.IO ( putStrLn ) data PackageInfo = PIOnlyInstalled InstallLocation Installed @@ -260,7 +263,7 @@ sources <- getSources globalCabalVersion mcur <- view $ buildConfigL.to bcCurator - let onTarget = void . addDep + let onTarget = void . getCachedDepOrAddDep let inner = mapM_ onTarget $ Map.keys (smtTargets $ smTargets sourceMap) pathEnvVar' <- liftIO $ maybe mempty T.pack <$> lookupEnv "PATH" let ctx = mkCtx econfig globalCabalVersion sources mcur pathEnvVar' @@ -296,11 +299,11 @@ else Map.empty } else do - planDebug $ show errs stackYaml <- view stackYamlL stackRoot <- view stackRootL + isImplicitGlobal <- view $ configL.to (isPCGlobalProject . configProject) prettyThrowM $ ConstructPlanFailed - errs stackYaml stackRoot parents (wanted ctx) prunedGlobalDeps + errs stackYaml stackRoot isImplicitGlobal parents (wanted ctx) prunedGlobalDeps where hasBaseInDeps = Map.member (mkPackageName "base") (smDeps sourceMap) @@ -539,56 +542,66 @@ -- marked as a dependency, even if it is directly wanted. This makes sense - if -- we left out packages that are deps, it would break the --only-dependencies -- build plan. -addDep :: PackageName -> M (Either ConstructPlanException AddDepRes) -addDep name = do +getCachedDepOrAddDep :: + PackageName + -> M (Either ConstructPlanException AddDepRes) +getCachedDepOrAddDep name = do libMap <- get case Map.lookup name libMap of Just res -> do - planDebug $ - "addDep: Using cached result for " ++ show name ++ ": " ++ show res + logDebugPlanS "getCachedDepOrAddDep" $ + "Using cached result for " + <> fromString (packageNameString name) + <> ": " + <> fromString (show res) pure res - Nothing -> addDep' name + Nothing -> checkCallStackAndAddDep name --- | Given a 'PackageName', adds all of the build tasks to build the package. --- First checks that the package name is not already in the call stack. -addDep' :: PackageName -> M (Either ConstructPlanException AddDepRes) -addDep' name = do +-- | Given a 'PackageName', known not to be in the library map, adds all of the +-- build tasks to build the package. First checks that the package name is not +-- already in the call stack. +checkCallStackAndAddDep :: + PackageName + -> M (Either ConstructPlanException AddDepRes) +checkCallStackAndAddDep name = do ctx <- ask - let mpackageInfo = Map.lookup name $ combinedMap ctx res <- if name `elem` callStack ctx then do - planDebug $ - "addDep': Detected cycle " - <> show name + logDebugPlanS "checkCallStackAndAddDep" $ + "Detected cycle " + <> fromString (packageNameString name) <> ": " - <> show (callStack ctx) + <> fromString (show $ map packageNameString (callStack ctx)) pure $ Left $ DependencyCycleDetected $ name : callStack ctx - else local (\ctx' -> ctx' { callStack = name : callStack ctx' }) $ do - case mpackageInfo of - -- TODO look up in the package index and see if there's a - -- recommendation available - Nothing -> do - planDebug $ - "addDep': No package info for " - <> show name - pure $ Left $ UnknownPackage name - Just packageInfo -> addDep'' name packageInfo + else case Map.lookup name $ combinedMap ctx of + -- TODO look up in the package index and see if there's a + -- recommendation available + Nothing -> do + logDebugPlanS "checkCallStackAndAddDep" $ + "No package info for " + <> fromString (packageNameString name) + <> "." + pure $ Left $ UnknownPackage name + Just packageInfo -> + -- Add the current package name to the head of the call stack. + local (\ctx' -> ctx' { callStack = name : callStack ctx' }) $ + addDep name packageInfo updateLibMap name res pure res -- | Given a 'PackageName' and its 'PackageInfo' from the combined map, adds all -- of the build tasks to build the package. Assumes that the head of the call -- stack is the current package name. -addDep'' :: +addDep :: PackageName -> PackageInfo -> M (Either ConstructPlanException AddDepRes) -addDep'' name packageInfo = do - planDebug $ - "addDep'': Package info for " - <> show name +addDep name packageInfo = do + logDebugPlanS "addDep" $ + "Package info for " + <> fromString (packageNameString name) <> ": " - <> show packageInfo + <> fromString (show packageInfo) case packageInfo of PIOnlyInstalled loc installed -> do -- FIXME Slightly hacky, no flags since they likely won't affect @@ -678,18 +691,19 @@ ctx <- ask case ps of PSRemote pkgLoc _version _fromSnapshot cp -> do - planDebug $ - "installPackage: Doing all-in-one build for upstream package " - <> show name + logDebugPlanS "installPackage" $ + "Doing all-in-one build for upstream package " + <> fromString (packageNameString name) + <> "." package <- loadPackage ctx pkgLoc (cpFlags cp) (cpGhcOptions cp) (cpCabalConfigOpts cp) resolveDepsAndInstall True (cpHaddocks cp) ps package minstalled PSFilePath lp -> do case lpTestBench lp of Nothing -> do - planDebug $ - "installPackage: No test / bench component for " - <> show name + logDebugPlanS "installPackage" $ + "No test or bench component for " + <> fromString (packageNameString name) <> " so doing an all-in-one build." resolveDepsAndInstall True (lpBuildHaddocks lp) ps (lpPackage lp) minstalled @@ -705,10 +719,10 @@ pure (res, writerFunc) case res of Right deps -> do - planDebug $ - "installPackage: For " - <> show name - <> ", successfully added package deps" + logDebugPlanS "installPackage" $ + "For " + <> fromString (packageNameString name) + <> ", successfully added package deps." -- in curator builds we can't do all-in-one build as -- test/benchmark failure could prevent library from being -- available to its dependencies but when it's already available @@ -727,10 +741,9 @@ Left _ -> do -- Reset the state to how it was before attempting to find an -- all-in-one build plan. - planDebug $ - "installPackage: Before trying cyclic plan, resetting lib \ - \result map to " - <> show libMap + logDebugPlanS "installPackage" $ + "Before trying cyclic plan, resetting lib result map to: " + <> fromString (show libMap) put libMap -- Otherwise, fall back on building the tests / benchmarks in a -- separate step. @@ -863,7 +876,7 @@ checkAndWarnForUnknownTools package let deps' = packageDeps package deps <- forM (Map.toList deps') $ \(depname, DepValue range depType) -> do - eres <- addDep depname + eres <- getCachedDepOrAddDep depname let getLatestApplicableVersionAndRev :: M (Maybe (Version, BlobKey)) getLatestApplicableVersionAndRev = do vsAndRevs <- @@ -1194,18 +1207,28 @@ -- tool dependencies. checkAndWarnForUnknownTools :: Package -> M () checkAndWarnForUnknownTools p = do - -- Check whether the tool is on the PATH before warning about it. - warnings <- fmap catMaybes $ forM (Set.toList $ packageUnknownTools p) $ - \name@(ExeName toolName) -> do - let settings = minimalEnvSettings { esIncludeLocals = True } - config <- view configL - menv <- liftIO $ configProcessContextSettings config settings - mfound <- runRIO menv $ findExecutable $ T.unpack toolName - case mfound of - Left _ -> pure $ Just $ ToolWarning name (packageName p) - Right _ -> pure Nothing + let unknownTools = Set.toList $ packageUnknownTools p + -- Check whether the tool is on the PATH or a package executable before + -- warning about it. + warnings <- + fmap catMaybes $ forM unknownTools $ \name@(ExeName toolName) -> + runMaybeT $ notOnPath toolName *> notPackageExe toolName *> warn name tell mempty { wWarnings = (map toolWarningText warnings ++) } pure () + where + -- From Cabal 2.0, build-tools can specify a pre-built executable that should + -- already be on the PATH. + notOnPath toolName = MaybeT $ do + let settings = minimalEnvSettings { esIncludeLocals = True } + config <- view configL + menv <- liftIO $ configProcessContextSettings config settings + eFound <- runRIO menv $ findExecutable $ T.unpack toolName + skipIf $ isRight eFound + -- From Cabal 1.12, build-tools can specify another executable in the same + -- package. + notPackageExe toolName = MaybeT $ skipIf $ toolName `Set.member` packageExes p + warn name = MaybeT . pure . Just $ ToolWarning name (packageName p) + skipIf p' = pure $ if p' then Nothing else Just () -- | Warn about tools in the snapshot definition. States the tool name -- expected and the package name using it. @@ -1276,6 +1299,11 @@ -- TODO: Consider intersecting version ranges for multiple deps on a -- package. This is why VersionRange is in the parent map. --- Switch this to 'True' to enable some debugging putStrLn in this module -planDebug :: MonadIO m => String -> m () -planDebug = if False then liftIO . putStrLn else \_ -> pure () +logDebugPlanS :: + (HasCallStack, HasRunner env, MonadIO m, MonadReader env m) + => LogSource + -> Utf8Builder + -> m () +logDebugPlanS s msg = do + debugPlan <- view $ globalOptsL.to globalPlanInLog + when debugPlan $ logDebugS s msg
@@ -17,6 +17,7 @@ , KeepOutputOpen (..) ) where +import Control.Concurrent.Companion ( Companion, withCompanion ) import Control.Concurrent.Execute ( Action (..), ActionContext (..), ActionId (..) , ActionType (..) @@ -43,7 +44,7 @@ import qualified Data.Conduit.Text as CT import qualified Data.List as L import Data.List.NonEmpty ( nonEmpty ) -import qualified Data.List.NonEmpty as NonEmpty ( toList ) +import qualified Data.List.NonEmpty as NonEmpty import Data.List.Split ( chunksOf ) import qualified Data.Map.Merge.Strict as Map import qualified Data.Map.Strict as Map @@ -55,7 +56,6 @@ ( ZonedTime, getZonedTime, formatTime, defaultTimeLocale ) import qualified Data.ByteString.Char8 as S8 import qualified Distribution.PackageDescription as C -import Distribution.Pretty ( prettyShow ) import qualified Distribution.Simple.Build.Macros as C import Distribution.System ( OS (Windows), Platform (Platform) ) import qualified Distribution.Text as C @@ -66,7 +66,6 @@ ( mkUnqualComponentName ) import Distribution.Verbosity ( showForCabal ) import Distribution.Version ( mkVersion ) -import Pantry.Internal.Companion ( Companion, withCompanion ) import Path ( PathException, (</>), addExtension, filename , isProperPrefixOf, parent, parseRelDir, parseRelFile @@ -85,10 +84,9 @@ import RIO.Process ( HasProcessContext, byteStringInput, doesExecutableExist , eceExitCode, findExecutable, getStderr, getStdout, inherit - , modifyEnvVars, proc, readProcess_, runProcess_, setStderr - , setStdin, setStdout, showProcessArgDebug, useHandleOpen - , waitExitCode, withModifyEnvVars, withProcessWait - , withWorkingDir + , modifyEnvVars, proc, runProcess_, setStderr, setStdin + , setStdout, showProcessArgDebug, useHandleOpen, waitExitCode + , withProcessWait, withWorkingDir ) import Stack.Build.Cache ( TestStatus (..), deleteCaches, getTestStatus @@ -107,13 +105,13 @@ import Stack.Build.Source ( addUnlistedToBuildCache ) import Stack.Build.Target ( ) import Stack.Config ( checkOwnership ) +import Stack.Config.ConfigureScript ( ensureConfigureScript ) import Stack.Constants ( bindirSuffix, cabalPackageName, compilerOptionsCabalFlag - , osIsWindows, relDirBuild, relDirDist, relDirSetup - , relDirSetupExeCache, relDirSetupExeSrc, relFileBuildLock - , relFileConfigure, relFileSetupHs, relFileSetupLhs - , relFileSetupLower, relFileSetupMacrosH, setupGhciShimCode - , stackProgName, testGhcEnvRelFile + , relDirBuild, relDirDist, relDirSetup, relDirSetupExeCache + , relDirSetupExeSrc, relFileBuildLock, relFileSetupHs + , relFileSetupLhs, relFileSetupLower, relFileSetupMacrosH + , setupGhciShimCode, stackProgName, testGhcEnvRelFile ) import Stack.Constants.Config ( distDirFromDir, distRelativeDir, hpcDirFromDir @@ -123,8 +121,7 @@ ( deleteHpcReports, generateHpcMarkupIndex, generateHpcReport , generateHpcUnifiedReport, updateTixFile ) -import Stack.DefaultColorWhen ( defaultColorWhen ) -import Stack.GhcPkg ( ghcPkgPathEnvVar, unregisterGhcPkgIds ) +import Stack.GhcPkg ( ghcPkg, unregisterGhcPkgIds ) import Stack.Package ( buildLogPath ) import Stack.PackageDump ( conduitDumpPackage, ghcPkgDescribe ) import Stack.Prelude @@ -140,7 +137,8 @@ ( BuildConfig (..), HasBuildConfig (..), projectRootL ) import Stack.Types.BuildOpts ( BenchmarkOpts (..), BuildOpts (..), BuildOptsCLI (..) - , CabalVerbosity (..), HaddockOpts (..), TestOpts (..) + , CabalVerbosity (..), HaddockOpts (..) + , ProgressBarFormat (..), TestOpts (..) ) import Stack.Types.Compiler ( ActualCompiler (..), WhichCompiler (..) @@ -580,7 +578,7 @@ fillSep ( ( fillSep ( flow "Dumping log file" - : [ flow msgSuffix | L.null msgSuffix ] + : [ flow msgSuffix | not (L.null msgSuffix) ] ) <> ":" ) @@ -785,6 +783,7 @@ let keepGoing = fromMaybe (not (Map.null (planFinals plan))) (boptsKeepGoing eeBuildOpts) terminal <- view terminalL + terminalWidth <- view termWidthL errs <- liftIO $ runActions threads keepGoing actions $ \doneVar actionsVar -> do let total = length actions @@ -803,10 +802,20 @@ ": " : L.intersperse ", " (map (fromString . packageNameString) names) - when terminal $ run $ - logSticky $ - "Progress " <> display prev <> "/" <> display total <> - nowBuilding packageNames + progressFormat = boptsProgressBar eeBuildOpts + progressLine prev' total' = + "Progress " + <> display prev' <> "/" <> display total' + <> if progressFormat == CountOnlyBar + then mempty + else nowBuilding packageNames + ellipsize n text = + if T.length text <= n || progressFormat /= CappedBar + then text + else T.take (n - 1) text <> "…" + when (terminal && progressFormat /= NoBar) $ + run $ logSticky $ display $ ellipsize terminalWidth $ + utf8BuilderToText $ progressLine prev total done <- atomically $ do done <- readTVar doneVar check $ done /= prev @@ -866,7 +875,7 @@ let unregisterSinglePkg select (gid, (ident, reason)) = do logReason ident reason pkg <- getGhcPkgExe - unregisterGhcPkgIds pkg localDB $ select ident gid :| [] + unregisterGhcPkgIds True pkg localDB $ select ident gid :| [] case cv of -- GHC versions >= 8.2.1 support batch unregistering of packages. See -- https://gitlab.haskell.org/ghc/ghc/issues/12637 @@ -886,7 +895,7 @@ for_ (chunksOfNE batchSize ids) $ \batch -> do for_ batch $ \(_, (ident, reason)) -> logReason ident reason pkg <- getGhcPkgExe - unregisterGhcPkgIds pkg localDB $ fmap (Right . fst) batch + unregisterGhcPkgIds True pkg localDB $ fmap (Right . fst) batch -- GHC versions >= 7.9 support unregistering of packages via their GhcPkgId. ACGhc v | v >= mkVersion [7, 9] -> @@ -1089,7 +1098,11 @@ || mOldProjectRoot /= Just newProjectRoot let ConfigureOpts dirs nodirs = configCacheOpts newConfigCache - when (taskBuildTypeConfig task) ensureConfigureScript + when (taskBuildTypeConfig task) $ + -- When build-type is Configure, we need to have a configure script in the + -- local directory. If it doesn't exist, build it with autoreconf -i. See: + -- https://github.com/commercialhaskell/stack/issues/3534 + ensureConfigureScript pkgDir when needConfig $ withMVar eeConfigureLock $ \_ -> do deleteCaches pkgDir @@ -1126,89 +1139,7 @@ -- reasonable too. getNewSetupConfigMod >>= writeSetupConfigMod pkgDir writePackageProjectRoot pkgDir newProjectRoot - pure needConfig - where - -- When build-type is Configure, we need to have a configure script in the - -- local directory. If it doesn't exist, build it with autoreconf -i. See: - -- https://github.com/commercialhaskell/stack/issues/3534 - ensureConfigureScript = do - let fp = pkgDir </> relFileConfigure - exists <- doesFileExist fp - unless exists $ do - prettyInfoL - [ flow "Trying to generate configure with autoreconf in" - , pretty pkgDir <> "." - ] - let autoreconf = if osIsWindows - then readProcessNull "sh" ["autoreconf", "-i"] - else readProcessNull "autoreconf" ["-i"] - -- On Windows 10, an upstream issue with the `sh autoreconf -i` - -- command means that command clears, but does not then restore, the - -- ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for native terminals. The - -- following hack re-enables the lost ANSI-capability. - fixupOnWindows = when osIsWindows (void $ liftIO defaultColorWhen) - withWorkingDir (toFilePath pkgDir) $ autoreconf `catchAny` \ex -> do - fixupOnWindows - prettyWarn $ - fillSep - [ flow "Stack failed to run" - , style Shell "autoreconf" <> "." - ] - <> blankLine - <> flow "Stack encountered the following error:" - <> blankLine - <> string (displayException ex) - when osIsWindows $ do - prettyInfo $ - fillSep - [ flow "Check that executable" - , style File "perl" - , flow "is on the path in Stack's MSYS2" - , style Dir "\\usr\\bin" - , flow "folder, and working, and that script file" - , style File "autoreconf" - , flow "is on the path in that location. To check that" - , style File "perl" - , "or" - , style File "autoreconf" - , flow "are on the path in the required location, run commands:" - ] - <> blankLine - <> indent 4 (style Shell $ flow "stack exec where -- perl") - <> line - <> indent 4 (style Shell $ flow "stack exec where -- autoreconf") - <> blankLine - <> fillSep - [ "If" - , style File "perl" - , "or" - , style File "autoreconf" - , flow "is not on the path in the required location, add them \ - \with command (note that the relevant package name is" - , style File "autoconf" - , "not" - , style File "autoreconf" <> "):" - ] - <> blankLine - <> indent 4 - (style Shell $ flow "stack exec pacman -- --sync --refresh autoconf") - <> blankLine - <> fillSep - [ flow "Some versions of" - , style File "perl" - , flow "from MSYS2 are broken. See" - , style Url "https://github.com/msys2/MSYS2-packages/issues/1611" - , "and" - , style Url "https://github.com/commercialhaskell/stack/pull/4781" <> "." - , "To test if" - , style File "perl" - , flow "in the required location is working, try command:" - ] - <> blankLine - <> indent 4 (style Shell $ flow "stack exec perl -- --version") - <> blankLine - fixupOnWindows -- | Make a padded prefix for log messages packageNamePrefix :: ExecuteEnv -> PackageName -> String @@ -1788,7 +1719,6 @@ _ -> pure Nothing copyPreCompiled (PrecompiledCache mlib sublibs exes) = do - wc <- view $ actualCompilerVersionL.whichCompilerL announceTask ee task "using precompiled package" -- We need to copy .conf files for the main library and all sublibraries @@ -1803,39 +1733,32 @@ toMungedPackageId sublib = let sublibName = LSubLibName $ mkUnqualComponentName $ T.unpack sublib in MungedPackageId (MungedPackageName pname sublibName) pversion + toPackageId :: MungedPackageId -> PackageIdentifier + toPackageId (MungedPackageId n v) = + PackageIdentifier (encodeCompatPackageName n) v + allToUnregister :: [Either PackageIdentifier GhcPkgId] allToUnregister = mcons - (prettyShow taskProvides <$ mlib) - (map (prettyShow . toMungedPackageId) subLibNames) + (Left taskProvides <$ mlib) + (map (Left . toPackageId . toMungedPackageId) subLibNames) allToRegister = mcons mlib sublibs unless (null allToRegister) $ withMVar eeInstallLock $ \() -> do - -- We want to ignore the global and user databases. - -- Unfortunately, ghc-pkg doesn't take such arguments on the - -- command line. Instead, we'll set GHC_PACKAGE_PATH. See: - -- https://github.com/commercialhaskell/stack/issues/1146 - - let modifyEnv = Map.insert - (ghcPkgPathEnvVar wc) - (T.pack $ toFilePathNoTrailingSep $ bcoSnapDB eeBaseConfigOpts) - - withModifyEnvVars modifyEnv $ do - GhcPkgExe ghcPkgExe <- getGhcPkgExe - - -- first unregister everything that needs to be unregistered - forM_ allToUnregister $ \packageName -> catchAny - ( readProcessNull - (toFilePath ghcPkgExe) - [ "unregister", "--force", packageName] + -- We want to ignore the global and user package databases. ghc-pkg + -- allows us to specify --no-user-package-db and --package-db=<db> on + -- the command line. + let pkgDb = bcoSnapDB eeBaseConfigOpts + ghcPkgExe <- getGhcPkgExe + -- First unregister, silently, everything that needs to be unregistered. + unless (null allToUnregister) $ + catchAny + ( unregisterGhcPkgIds False ghcPkgExe pkgDb $ + NonEmpty.fromList allToUnregister ) (const (pure ())) - - -- now, register the cached conf files - forM_ allToRegister $ \libpath -> - proc - (toFilePath ghcPkgExe) - [ "register", "--force", toFilePath libpath] - readProcess_ + -- Now, register the cached conf files. + forM_ allToRegister $ \libpath -> + ghcPkg ghcPkgExe [pkgDb] ["register", "--force", toFilePath libpath] liftIO $ forM_ exes $ \exe -> do ensureDir bindir @@ -2715,21 +2638,22 @@ -> LocalPackage -> [String] primaryComponentOptions executableBuildStatuses lp = - -- TODO: get this information from target parsing instead, - -- which will allow users to turn off library building if - -- desired - (case packageLibraries package of - NoLibraries -> [] - HasLibraries names -> - map T.unpack - $ T.append "lib:" (T.pack (packageNameString (packageName package))) - : map (T.append "flib:") (Set.toList names)) ++ - map - (T.unpack . T.append "lib:") - (Set.toList $ packageInternalLibraries package) ++ - map - (T.unpack . T.append "exe:") - (Set.toList $ exesToBuild executableBuildStatuses lp) + -- TODO: get this information from target parsing instead, which will allow + -- users to turn off library building if desired + ( case packageLibraries package of + NoLibraries -> [] + HasLibraries names -> map + T.unpack + ( T.append "lib:" (T.pack (packageNameString (packageName package))) + : map (T.append "flib:") (Set.toList names) + ) + ) + ++ map + (T.unpack . T.append "lib:") + (Set.toList $ packageInternalLibraries package) + ++ map + (T.unpack . T.append "exe:") + (Set.toList $ exesToBuild executableBuildStatuses lp) where package = lpPackage lp
@@ -14,7 +14,6 @@ , hashSourceMapData ) where -import Conduit ( ZipSink (..), withSourceFile ) import Data.ByteString.Builder ( toLazyByteString ) import qualified Data.List as L import qualified Data.Map as Map @@ -48,6 +47,7 @@ ( EnvConfig (..), HasEnvConfig (..), HasSourceMap (..) , actualCompilerVersionL ) +import Stack.Types.FileDigestCache ( readFileDigest ) import Stack.Types.NamedComponent ( NamedComponent (..), isCInternalLib ) import Stack.Types.Package @@ -436,26 +436,27 @@ -- | Compare the current filesystem state to the cached information, and -- determine (1) if the files are dirty, and (2) the new cache values. -checkBuildCache :: forall m. (MonadIO m) - => Map FilePath FileCacheInfo -- ^ old cache - -> [Path Abs File] -- ^ files in package - -> m (Set FilePath, Map FilePath FileCacheInfo) +checkBuildCache :: + HasEnvConfig env + => Map FilePath FileCacheInfo -- ^ old cache + -> [Path Abs File] -- ^ files in package + -> RIO env (Set FilePath, Map FilePath FileCacheInfo) checkBuildCache oldCache files = do - fileTimes <- fmap Map.fromList $ forM files $ \fp -> do - mdigest <- liftIO (getFileDigestMaybe (toFilePath fp)) + fileDigests <- fmap Map.fromList $ forM files $ \fp -> do + mdigest <- getFileDigestMaybe (toFilePath fp) pure (toFilePath fp, mdigest) fmap (mconcat . Map.elems) $ sequence $ Map.merge (Map.mapMissing (\fp mdigest -> go fp mdigest Nothing)) (Map.mapMissing (\fp fci -> go fp Nothing (Just fci))) (Map.zipWithMatched (\fp mdigest fci -> go fp mdigest (Just fci))) - fileTimes + fileDigests oldCache where go :: FilePath -> Maybe SHA256 -> Maybe FileCacheInfo - -> m (Set FilePath, Map FilePath FileCacheInfo) + -> RIO env (Set FilePath, Map FilePath FileCacheInfo) -- Filter out the cabal_macros file to avoid spurious recompilations go fp _ _ | takeFileName fp == "cabal_macros.h" = pure (Set.empty, Map.empty) -- Common case where it's in the cache and on the filesystem. @@ -519,17 +520,12 @@ pure (componentsFiles, warnings) -- | Get file digest, if it exists -getFileDigestMaybe :: MonadIO m => FilePath -> m (Maybe SHA256) -getFileDigestMaybe fp = - liftIO $ - catch - (fmap Just . withSourceFile fp $ getDigest) - (\e -> - if isDoesNotExistError e - then pure Nothing - else throwM e) - where - getDigest src = runConduit $ src .| getZipSink (ZipSink SHA256.sinkHash) +getFileDigestMaybe :: HasEnvConfig env => FilePath -> RIO env (Maybe SHA256) +getFileDigestMaybe fp = do + cache <- view $ envConfigL.to envConfigFileDigestCache + catch + (Just <$> readFileDigest cache fp) + (\e -> if isDoesNotExistError e then pure Nothing else throwM e) -- | Get 'PackageConfig' for package given its name. getPackageConfig ::
@@ -0,0 +1,89 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE OverloadedStrings #-} + +#ifdef USE_GIT_INFO +{-# LANGUAGE TemplateHaskell #-} +#endif + +-- Extracted from "Stack" so that module does not use CPP or Template Haskell, +-- and therefore doesn't need to be recompiled as often. +module Stack.BuildInfo + ( versionString' + , hpackVersion + , maybeGitHash + ) where + +#ifndef HIDE_DEP_VERSIONS +import qualified Build_stack +#endif +import Data.Version ( versionBranch ) +import Distribution.System ( buildArch ) +import qualified Distribution.Text as Cabal ( display ) +#ifdef USE_GIT_INFO +import GitHash ( giCommitCount, giHash, tGitInfoCwdTry ) +import Options.Applicative.Simple ( simpleVersion ) +#endif +import qualified Paths_stack as Meta +import Stack.Prelude +#ifndef USE_GIT_INFO +import Stack.Types.Version ( showStackVersion ) +#endif + +versionString' :: String +#ifdef USE_GIT_INFO +versionString' = concat $ concat + [ [$(simpleVersion Meta.version)] + -- Leave out number of commits for --depth=1 clone + -- See https://github.com/commercialhaskell/stack/issues/792 + , case giCommitCount <$> $$tGitInfoCwdTry of + Left _ -> [] + Right 1 -> [] + Right count -> [" (", show count, " commits)"] + , [afterVersion] + ] +#else +versionString' = showStackVersion ++ afterVersion +#endif + where + afterVersion = concat + [ preReleaseString + , ' ' : Cabal.display buildArch + , depsString + , warningString + ] + preReleaseString = + case versionBranch Meta.version of + (_:y:_) | even y -> " PRE-RELEASE" + (_:_:z:_) | even z -> " RELEASE-CANDIDATE" + _ -> "" +#ifdef HIDE_DEP_VERSIONS + depsString = " hpack-" ++ VERSION_hpack +#else + depsString = "\nCompiled with:\n" ++ unlines (map ("- " ++) Build_stack.deps) +#endif +#ifdef SUPPORTED_BUILD + warningString = "" +#else + warningString = unlines + [ "" + , "Warning: this is an unsupported build that may use different versions of" + , "dependencies and GHC than the officially released binaries, and therefore may" + , "not behave identically. If you encounter problems, please try the latest" + , "official build by running 'stack upgrade --force-download'." + ] +#endif + +-- | Hpack version we're compiled against +hpackVersion :: String +hpackVersion = VERSION_hpack + +-- | If USE_GIT_INFO is enabled, the Git hash in the build directory, otherwise +-- Nothing. +maybeGitHash :: Maybe String +maybeGitHash = +#ifdef USE_GIT_INFO + (either (const Nothing) (Just . giHash) $$tGitInfoCwdTry) +#else + Nothing +#endif
@@ -0,0 +1,700 @@+{-# LANGUAGE NoImplicitPrelude #-} + +module Stack.CLI + ( commandLineHandler + ) where + +import Data.Attoparsec.Interpreter ( getInterpreterArgs ) +import Data.Char ( toLower ) +import qualified Data.List as L +import Options.Applicative + ( Parser, ParserFailure, ParserHelp, ParserResult (..), flag, switch + , handleParseResult, help, helpError, idm, long, metavar + , overFailure, renderFailure, strArgument, switch ) +import Options.Applicative.Help ( errorHelp, stringChunk, vcatChunks ) +import Options.Applicative.Builder.Extra + ( boolFlags, extraHelpOption, textOption ) +import Options.Applicative.Complicated + ( addCommand, addSubCommands, complicatedOptions ) +import qualified RIO.Process ( exec ) +import RIO.Process ( withProcessContextNoLogging ) +import Stack.Build ( buildCmd ) +import Stack.BuildInfo ( hpackVersion, versionString' ) +import Stack.Clean ( CleanCommand (..), cleanCmd ) +import Stack.ConfigCmd as ConfigCmd +import Stack.Constants ( globalFooter, osIsWindows, stackProgName ) +import Stack.Coverage ( hpcReportCmd ) +import Stack.Docker + ( dockerCmdName, dockerHelpOptName, dockerPullCmdName ) +import Stack.DockerCmd ( dockerPullCmd, dockerResetCmd ) +import qualified Stack.Dot ( dot ) +import Stack.Exec ( SpecialExecCmd (..), execCmd ) +import Stack.Eval ( evalCmd ) +import Stack.Ghci ( ghciCmd ) +import Stack.Hoogle ( hoogleCmd ) +import Stack.IDE + ( ListPackagesCmd (..), OutputStream (..), idePackagesCmd + , ideTargetsCmd + ) +import Stack.Init ( initCmd ) +import Stack.List ( listCmd ) +import Stack.Ls ( lsCmd ) +import Stack.New ( newCmd ) +import qualified Stack.Nix as Nix +import Stack.Options.BuildParser ( buildOptsParser ) +import Stack.Options.CleanParser ( cleanOptsParser ) +import Stack.Options.DotParser ( dotOptsParser ) +import Stack.Options.EvalParser ( evalOptsParser ) +import Stack.Options.ExecParser ( execOptsParser ) +import Stack.Options.GhciParser ( ghciOptsParser ) +import Stack.Options.GlobalParser ( globalOptsParser ) +import Stack.Options.HpcReportParser ( hpcReportOptsParser ) +import Stack.Options.InitParser ( initOptsParser ) +import Stack.Options.LsParser ( lsOptsParser ) +import Stack.Options.NewParser ( newOptsParser ) +import Stack.Options.PathParser ( pathParser ) +import Stack.Options.SDistParser ( sdistOptsParser ) +import Stack.Options.ScriptParser ( scriptOptsParser ) +import Stack.Options.SetupParser ( setupOptsParser ) +import Stack.Options.UpgradeParser ( upgradeOptsParser ) +import Stack.Options.UploadParser ( uploadOptsParser ) +import Stack.Options.Utils ( GlobalOptsContext (..) ) +import qualified Stack.Path ( path ) +import Stack.Prelude +import Stack.Query ( queryCmd ) +import Stack.Runners + ( ShouldReexec (..), withConfig, withDefaultEnvConfig ) +import Stack.SDist ( sdistCmd ) +import Stack.Script ( ScriptOpts (..), scriptCmd ) +import Stack.SetupCmd ( setupCmd ) +import Stack.Templates ( templatesCmd ) +import Stack.Types.AddCommand ( AddCommand ) +import Stack.Types.BuildOpts ( BuildCommand (..) ) +import Stack.Types.GlobalOptsMonoid ( GlobalOptsMonoid (..) ) +import Stack.Types.Runner ( Runner ) +import Stack.Types.Version ( stackVersion ) +import Stack.Uninstall ( uninstallCmd ) +import Stack.Unpack ( unpackCmd ) +import Stack.Update ( updateCmd ) +import Stack.Upgrade ( upgradeCmd ) +import Stack.Upload ( uploadCmd ) +import qualified System.Directory as D +import System.Environment ( getProgName, withArgs ) +import System.FilePath ( pathSeparator, takeDirectory ) + +-- | Stack's command line handler. +commandLineHandler :: + FilePath + -> String + -> Bool + -> IO (GlobalOptsMonoid, RIO Runner ()) +commandLineHandler currentDir progName isInterpreter = + -- Append the relevant default (potentially affecting the LogLevel) *after* + -- appending the global options of the `stack` command to the global options + -- of the subcommand - see #5326. + first (<> defaultGlobalOpts) <$> complicatedOptions + stackVersion + (Just versionString') + hpackVersion + "stack - The Haskell Tool Stack" + "" + ("Stack's documentation is available at https://docs.haskellstack.org/. \ + \Command '" <> progName <> " COMMAND --help' for help about a Stack command. Stack also \ + \supports the Haskell Error Index at https://errors.haskell.org/.") + (globalOpts OuterGlobalOpts) + (Just failureCallback) + addCommands + where + defaultGlobalOpts = if isInterpreter + then + -- Silent except when errors occur - see #2879 + mempty { globalMonoidLogLevel = First (Just LevelError) } + else mempty + failureCallback f args = + case L.stripPrefix "Invalid argument" (fst (renderFailure f "")) of + Just _ -> if isInterpreter + then parseResultHandler args f + else secondaryCommandHandler args f + >>= interpreterHandler currentDir args + Nothing -> parseResultHandler args f + + parseResultHandler args f = + if isInterpreter + then do + let hlp = errorHelp $ stringChunk + (unwords ["Error executing interpreter command:" + , progName + , unwords args]) + handleParseResult (overFailure (vcatErrorHelp hlp) (Failure f)) + else handleParseResult (Failure f) + + -- The order of commands below determines the order in which they are listed + -- in `stack --help`. + addCommands = do + unless isInterpreter $ do + build + install + uninstall + test + bench + haddock + new + templates + init + setup + path + ls + unpack + update + upgrade + upload + sdist + dot + ghc + hoogle + -- These are the only commands allowed in interpreter mode as well + exec + run + ghci + repl + runghc + runhaskell + script + unless isInterpreter $ do + eval + clean + purge + query + list + ide + docker + config + hpc + + -- Stack's subcommands are listed below in alphabetical order + + bench = addBuildCommand' + "bench" + "Shortcut for 'build --bench'." + buildCmd + (buildOptsParser Bench) + + build = addBuildCommand' + "build" + "Build the package(s) in this directory/configuration." + buildCmd + (buildOptsParser Build) + + clean = addCommand' + "clean" + "Delete build artefacts for the project packages." + cleanCmd + (cleanOptsParser Clean) + + config = addSubCommands' + ConfigCmd.cfgCmdName + "Subcommands for accessing and modifying configuration values." + ( do + addCommand' + ConfigCmd.cfgCmdSetName + "Sets a key in YAML configuration file to value." + (withConfig NoReexec . cfgCmdSet) + configCmdSetParser + addCommand' + ConfigCmd.cfgCmdEnvName + "Print environment variables for use in a shell." + (withConfig YesReexec . withDefaultEnvConfig . cfgCmdEnv) + configCmdEnvParser + ) + + docker = addSubCommands' + dockerCmdName + "Subcommands specific to Docker use." + ( do + addCommand' + dockerPullCmdName + "Pull latest version of Docker image from registry." + dockerPullCmd + (pure ()) + addCommand' + "reset" + "Reset the Docker sandbox." + dockerResetCmd + ( switch + ( long "keep-home" + <> help "Do not delete sandbox's home directory." + ) + ) + ) + + dot = addCommand' + "dot" + "Visualize your project's dependency graph using Graphviz dot." + Stack.Dot.dot + (dotOptsParser False) -- Default for --external is False. + + eval = addCommand' + "eval" + "Evaluate some Haskell code inline. Shortcut for \ + \'stack exec ghc -- -e CODE'." + evalCmd + (evalOptsParser "CODE") + + exec = addCommand' + "exec" + "Execute a command. If the command is absent, the first of any arguments \ + \is taken as the command." + execCmd + (execOptsParser Nothing) + + ghc = addCommand' + "ghc" + "Run ghc." + execCmd + (execOptsParser $ Just ExecGhc) + + ghci = addGhciCommand' + "ghci" + "Run ghci in the context of package(s)." + ghciCmd + ghciOptsParser + + haddock = addBuildCommand' + "haddock" + "Shortcut for 'build --haddock'." + buildCmd + (buildOptsParser Haddock) + + hoogle = addCommand' + "hoogle" + "Run hoogle, the Haskell API search engine. Use the '-- ARGUMENT(S)' \ + \syntax to pass Hoogle arguments, e.g. 'stack hoogle -- --count=20', \ + \or 'stack hoogle -- server --local'." + hoogleCmd + ( (,,,) + <$> many (strArgument + ( metavar "-- ARGUMENT(S) (e.g. 'stack hoogle -- server --local')" + )) + <*> boolFlags + True + "setup" + "If needed: install Hoogle, build Haddock documentation and \ + \generate a Hoogle database." + idm + <*> switch + ( long "rebuild" + <> help "Rebuild the Hoogle database." + ) + <*> switch + ( long "server" + <> help "Start local Hoogle server." + ) + ) + + hpc = addSubCommands' + "hpc" + "Subcommands specific to Haskell Program Coverage." + ( addCommand' + "report" + "Generate unified HPC coverage report from tix files and project \ + \targets." + hpcReportCmd + hpcReportOptsParser + ) + + ide = addSubCommands' + "ide" + "IDE-specific commands." + ( let outputFlag = flag + OutputLogInfo + OutputStdout + ( long "stdout" + <> help "Send output to the standard output stream instead of the \ + \default, the standard error stream." + ) + cabalFileFlag = flag + ListPackageNames + ListPackageCabalFiles + ( long "cabal-files" + <> help "Print paths to package Cabal files instead of package \ + \names." + ) + exeFlag = switch + ( long "exes" + <> help "Include executables." + ) + testFlag = switch + ( long "tests" + <> help "Include test suites." + ) + benchFlag = switch + ( long "benchmarks" + <> help "Include benchmarks." + ) + in do + addCommand' + "packages" + "List all available local loadable packages." + idePackagesCmd + ((,) <$> outputFlag <*> cabalFileFlag) + addCommand' + "targets" + "List all targets or pick component types to list." + ideTargetsCmd + ( (,) + <$> ((,,) <$> exeFlag <*> testFlag <*> benchFlag) + <*> outputFlag + ) + ) + + init = addCommand' + "init" + "Create Stack project configuration from Cabal or Hpack package \ + \specifications." + initCmd + initOptsParser + + install = addBuildCommand' + "install" + "Shortcut for 'build --copy-bins'." + buildCmd + (buildOptsParser Install) + + list = addCommand' + "list" + "List package id's in snapshot (experimental)." + listCmd + (many $ strArgument $ metavar "PACKAGE") + + ls = addCommand' + "ls" + "List command. (Supports snapshots, dependencies, Stack's styles and \ + \installed tools.)" + lsCmd + lsOptsParser + + new = addCommand' + "new" + "Create a new project from a template. Run 'stack templates' to see \ + \available templates. Will also initialise if there is no stack.yaml \ + \file. Note: you can also specify a local file or a remote URL as a \ + \template; or force an initialisation." + newCmd + newOptsParser + + path = addCommand' + "path" + "Print out handy path information." + Stack.Path.path + pathParser + + purge = addCommand' + "purge" + "Delete the project Stack working directories (.stack-work by \ + \default). Shortcut for 'stack clean --full'." + cleanCmd + (cleanOptsParser Purge) + + query = addCommand' + "query" + "Query general build information (experimental)." + queryCmd + (many $ strArgument $ metavar "SELECTOR...") + + repl = addGhciCommand' + "repl" + "Run ghci in the context of package(s) (alias for 'ghci')." + ghciCmd + ghciOptsParser + + run = addCommand' + "run" + "Build and run an executable. Defaults to the first available \ + \executable if none is provided as the first argument." + execCmd + (execOptsParser $ Just ExecRun) + + runghc = addCommand' + "runghc" + "Run runghc." + execCmd + (execOptsParser $ Just ExecRunGhc) + + runhaskell = addCommand' + "runhaskell" + "Run runghc (alias for 'runghc')." + execCmd + (execOptsParser $ Just ExecRunGhc) + + script = addCommand + "script" + "Run a Stack script." + globalFooter + scriptCmd + ( \so gom -> + gom + { globalMonoidResolverRoot = + First $ Just $ takeDirectory $ soFile so + } + ) + (globalOpts OtherCmdGlobalOpts) + scriptOptsParser + + sdist = addCommand' + "sdist" + "Create source distribution tarballs." + sdistCmd + sdistOptsParser + + setup = addCommand' + "setup" + "Get the appropriate GHC for your project." + setupCmd + setupOptsParser + + templates = addCommand' + "templates" + "Show how to find templates available for 'stack new'. 'stack new' \ + \can accept a template from a remote repository (default: github), \ + \local file or remote URL. Note: this downloads the help file." + templatesCmd + (pure ()) + + test = addBuildCommand' + "test" + "Shortcut for 'build --test'." + buildCmd + (buildOptsParser Test) + + uninstall = addCommand' + "uninstall" + "Show how to uninstall Stack or a Stack-supplied tool. This command does \ + \not itself uninstall Stack or a Stack-supplied tool." + uninstallCmd + (pure ()) + + unpack = addCommand' + "unpack" + "Unpack one or more packages locally." + unpackCmd + ( (,) + <$> some (strArgument $ metavar "PACKAGE") + <*> optional (textOption + ( long "to" + <> help "Optional path to unpack the package into (will \ + \unpack into subdirectory)." + )) + ) + + update = addCommand' + "update" + "Update the package index." + updateCmd + (pure ()) + + upgrade = addCommand'' + "upgrade" + "Upgrade Stack, installing to Stack's local-bin directory and, if \ + \different and permitted, the directory of the current Stack \ + \executable." + upgradeCmd + "Warning: if you use GHCup to install Stack, use only GHCup to \ + \upgrade Stack." + (upgradeOptsParser onlyLocalBins) + where + onlyLocalBins = + (lowercase progName /= lowercase stackProgName) + && not ( osIsWindows + && lowercase progName == lowercase (stackProgName <> ".EXE") + ) + lowercase = map toLower + + upload = addCommand' + "upload" + "Upload a package to Hackage." + uploadCmd + uploadOptsParser + + -- addCommand hiding global options + addCommand' :: + String + -> String + -> (a -> RIO Runner ()) + -> Parser a + -> AddCommand + addCommand' cmd title constr = + addCommand + cmd + title + globalFooter + constr + (\_ gom -> gom) + (globalOpts OtherCmdGlobalOpts) + + -- addCommand with custom footer hiding global options + addCommand'' :: + String + -> String + -> (a -> RIO Runner ()) + -> String + -> Parser a + -> AddCommand + addCommand'' cmd title constr cmdFooter = + addCommand + cmd + title + (globalFooter <> " " <> cmdFooter) + constr + (\_ gom -> gom) + (globalOpts OtherCmdGlobalOpts) + + addSubCommands' :: + String + -> String + -> AddCommand + -> AddCommand + addSubCommands' cmd title = + addSubCommands + cmd + title + globalFooter + (globalOpts OtherCmdGlobalOpts) + + -- Additional helper that hides global options and shows build options + addBuildCommand' :: + String + -> String + -> (a -> RIO Runner ()) + -> Parser a + -> AddCommand + addBuildCommand' cmd title constr = + addCommand + cmd + title + globalFooter + constr + (\_ gom -> gom) + (globalOpts BuildCmdGlobalOpts) + + -- Additional helper that hides global options and shows some ghci options + addGhciCommand' :: + String + -> String + -> (a -> RIO Runner ()) + -> Parser a + -> AddCommand + addGhciCommand' cmd title constr = + addCommand + cmd + title + globalFooter + constr + (\_ gom -> gom) + (globalOpts GhciCmdGlobalOpts) + + globalOpts :: GlobalOptsContext -> Parser GlobalOptsMonoid + globalOpts kind = + extraHelpOption + hide + progName + (dockerCmdName ++ "*") + dockerHelpOptName + <*> extraHelpOption + hide + progName + (Nix.nixCmdName ++ "*") + Nix.nixHelpOptName + <*> globalOptsParser currentDir kind + where + hide = kind /= OuterGlobalOpts + +-- | fall-through to external executables in `git` style if they exist +-- (i.e. `stack something` looks for `stack-something` before +-- failing with "Invalid argument `something'") +secondaryCommandHandler :: + [String] + -> ParserFailure ParserHelp + -> IO (ParserFailure ParserHelp) +secondaryCommandHandler args f = + -- don't even try when the argument looks like a path or flag + if elem pathSeparator cmd || "-" `L.isPrefixOf` L.head args + then pure f + else do + mExternalExec <- D.findExecutable cmd + case mExternalExec of + Just ex -> withProcessContextNoLogging $ do + -- TODO show the command in verbose mode + -- hPutStrLn stderr $ unwords $ + -- ["Running", "[" ++ ex, unwords (tail args) ++ "]"] + _ <- RIO.Process.exec ex (L.tail args) + pure f + Nothing -> pure $ fmap (vcatErrorHelp (noSuchCmd cmd)) f + where + -- FIXME this is broken when any options are specified before the command + -- e.g. stack --verbosity silent cmd + cmd = stackProgName ++ "-" ++ L.head args + noSuchCmd name = errorHelp $ stringChunk + ("Auxiliary command not found in path '" ++ name ++ "'.") + +interpreterHandler :: + Monoid t + => FilePath + -> [String] + -> ParserFailure ParserHelp + -> IO (GlobalOptsMonoid, (RIO Runner (), t)) +interpreterHandler currentDir args f = do + -- args can include top-level config such as --extra-lib-dirs=... (set by + -- nix-shell) - we need to find the first argument which is a file, everything + -- afterwards is an argument to the script, everything before is an argument + -- to Stack + (stackArgs, fileArgs) <- spanM (fmap not . D.doesFileExist) args + case fileArgs of + (file:fileArgs') -> runInterpreterCommand file stackArgs fileArgs' + [] -> parseResultHandler (errorCombine (noSuchFile firstArg)) + where + firstArg = L.head args + + spanM _ [] = pure ([], []) + spanM p xs@(x:xs') = do + r <- p x + if r + then do + (ys, zs) <- spanM p xs' + pure (x:ys, zs) + else + pure ([], xs) + + -- if the first argument contains a path separator then it might be a file, + -- or a Stack option referencing a file. In that case we only show the + -- interpreter error message and exclude the command related error messages. + errorCombine = + if pathSeparator `elem` firstArg + then overrideErrorHelp + else vcatErrorHelp + + overrideErrorHelp h1 h2 = h2 { helpError = helpError h1 } + + parseResultHandler fn = handleParseResult (overFailure fn (Failure f)) + noSuchFile name = errorHelp $ stringChunk + ("File does not exist or is not a regular file '" ++ name ++ "'.") + + runInterpreterCommand path stackArgs fileArgs = do + progName <- getProgName + iargs <- getInterpreterArgs path + let parseCmdLine = commandLineHandler currentDir progName True + -- Implicit file arguments are put before other arguments that + -- occur after "--". See #3658 + cmdArgs = stackArgs ++ case break (== "--") iargs of + (beforeSep, []) -> beforeSep ++ ["--"] ++ [path] ++ fileArgs + (beforeSep, optSep : afterSep) -> + beforeSep ++ [optSep] ++ [path] ++ fileArgs ++ afterSep + -- TODO show the command in verbose mode + -- hPutStrLn stderr $ unwords $ + -- ["Running", "[" ++ progName, unwords cmdArgs ++ "]"] + (a,b) <- withArgs cmdArgs parseCmdLine + pure (a,(b,mempty)) + +-- Vertically combine only the error component of the first argument with the +-- error component of the second. +vcatErrorHelp :: ParserHelp -> ParserHelp -> ParserHelp +vcatErrorHelp h1 h2 = h2 { helpError = vcatChunks [helpError h2, helpError h1] }
@@ -19,6 +19,7 @@ ) where import Control.Exception ( throw ) +import Data.Foldable ( foldrM ) import Data.List ( find, isPrefixOf ) import qualified Data.Map.Strict as M import qualified Data.Set as S @@ -164,36 +165,50 @@ -> [DotCabalDescriptor] -- ^ Base names. -> RIO GetPackageFileContext - (Map ModuleName (Path Abs File),[DotCabalPath],[PackageWarning]) + (Map ModuleName (Path Abs File), [DotCabalPath], [PackageWarning]) resolveFilesAndDeps component dirs names0 = do - (dotCabalPaths, foundModules, missingModules) <- loop names0 S.empty + (dotCabalPaths, foundModules, missingModules, _) <- loop names0 S.empty M.empty warnings <- liftM2 (++) (warnUnlisted foundModules) (warnMissing missingModules) pure (foundModules, dotCabalPaths, warnings) where - loop [] _ = pure ([], M.empty, []) - loop names doneModules0 = do + loop :: + [DotCabalDescriptor] + -> Set ModuleName + -> Map FilePath (Path Abs File) + -- ^ Known file usages, where the file path has already been resolved. + -> RIO + GetPackageFileContext + ( [DotCabalPath] + , Map ModuleName (Path Abs File) + , [ModuleName] + , Map k a + ) + loop [] _ _ = pure ([], M.empty, [], M.empty) + loop names doneModules0 knownUsages = do resolved <- resolveFiles dirs names let foundFiles = mapMaybe snd resolved foundModules = mapMaybe toResolvedModule resolved missingModules = mapMaybe toMissingModule resolved - pairs <- mapM (getDependencies component dirs) foundFiles + getDependenciesFold c (ps, ku) = do + p <- getDependencies ku component dirs c + pure (p : ps, ku <> snd p) + (pairs, foundUsages) <- foldrM getDependenciesFold ([], knownUsages) foundFiles let doneModules = S.union doneModules0 (S.fromList (mapMaybe dotCabalModule names)) moduleDeps = S.unions (map fst pairs) - thDepFiles = concatMap snd pairs + thDepFiles = concatMap (M.elems . snd) pairs modulesRemaining = S.difference moduleDeps doneModules -- Ignore missing modules discovered as dependencies - they may -- have been deleted. - (resolvedFiles, resolvedModules, _) <- - loop (map DotCabalModule (S.toList modulesRemaining)) doneModules + (resolvedFiles, resolvedModules, _, foundUsages') <- + loop (map DotCabalModule (S.toList modulesRemaining)) doneModules foundUsages pure ( nubOrd $ foundFiles <> map DotCabalFilePath thDepFiles <> resolvedFiles - , M.union - (M.fromList foundModules) - resolvedModules + , M.union (M.fromList foundModules) resolvedModules , missingModules + , foundUsages' ) warnUnlisted foundModules = do let unlistedModules = @@ -238,16 +253,18 @@ -- | Get the dependencies of a Haskell module file. getDependencies :: - NamedComponent + Map FilePath (Path Abs File) + -- ^ Known file usages, where the file path has already been resolved. + -> NamedComponent -> [Path Abs Dir] -> DotCabalPath - -> RIO GetPackageFileContext (Set ModuleName, [Path Abs File]) -getDependencies component dirs dotCabalPath = + -> RIO GetPackageFileContext (Set ModuleName, Map FilePath (Path Abs File)) +getDependencies knownUsages component dirs dotCabalPath = case dotCabalPath of DotCabalModulePath resolvedFile -> readResolvedHi resolvedFile DotCabalMainPath resolvedFile -> readResolvedHi resolvedFile - DotCabalFilePath{} -> pure (S.empty, []) - DotCabalCFilePath{} -> pure (S.empty, []) + DotCabalFilePath{} -> pure (S.empty, M.empty) + DotCabalCFilePath{} -> pure (S.empty, M.empty) where readResolvedHi resolvedFile = do dumpHIDir <- componentOutputDir component <$> asks ctxDistDir @@ -255,21 +272,25 @@ let sourceDir = fromMaybe dir $ find (`isProperPrefixOf` resolvedFile) dirs stripSourceDir d = stripProperPrefix d resolvedFile case stripSourceDir sourceDir of - Nothing -> pure (S.empty, []) + Nothing -> pure (S.empty, M.empty) Just fileRel -> do let hiPath = FilePath.replaceExtension (toFilePath (dumpHIDir </> fileRel)) ".hi" dumpHIExists <- liftIO $ D.doesFileExist hiPath if dumpHIExists - then parseHI hiPath - else pure (S.empty, []) + then parseHI knownUsages hiPath + else pure (S.empty, M.empty) --- | Parse a .hi file into a set of modules and files. +-- | Parse a .hi file into a set of modules and files (a map from a given path +-- to a file to the resolved absolute path to the file). parseHI :: - FilePath - -> RIO GetPackageFileContext (Set ModuleName, [Path Abs File]) -parseHI hiPath = do + Map FilePath (Path Abs File) + -- ^ Known file usages, where the file path has already been resolved. + -> FilePath + -- ^ The path to the *.hi file to be parsed + -> RIO GetPackageFileContext (Set ModuleName, Map FilePath (Path Abs File)) +parseHI knownUsages hiPath = do dir <- asks (parent . ctxFile) result <- liftIO $ catchAnyDeep @@ -283,24 +304,28 @@ , flow "Decoding failure:" , style Error $ fromString msg ] - pure (S.empty, []) + pure (S.empty, M.empty) Right iface -> do let moduleNames = fmap (fromString . T.unpack . decodeUtf8Lenient . fst) . Iface.unList . Iface.dmods . Iface.deps - resolveFileDependency file = do - resolved <- forgivingResolveFile dir file >>= rejectMissingFile - when (isNothing resolved) $ - prettyWarnL - [ flow "Dependent file listed in:" - , style File $ fromString hiPath - , flow "does not exist:" - , style File $ fromString file - ] - pure resolved + resolveFileDependency file = + case M.lookup file knownUsages of + Just p -> + pure $ Just (file, p) + Nothing -> do + resolved <- forgivingResolveFile dir file >>= rejectMissingFile + when (isNothing resolved) $ + prettyWarnL + [ flow "Dependent file listed in:" + , style File $ fromString hiPath + , flow "does not exist:" + , style File $ fromString file + ] + pure $ (file,) <$> resolved resolveUsages = traverse (resolveFileDependency . Iface.unUsage) . Iface.unList . Iface.usage resolvedUsages <- catMaybes <$> resolveUsages iface - pure (S.fromList $ moduleNames iface, resolvedUsages) + pure (S.fromList $ moduleNames iface, M.fromList resolvedUsages) -- | The directory where generated files are put like .o or .hs (from .x files). componentOutputDir :: NamedComponent -> Path Abs Dir -> Path Abs Dir
@@ -32,6 +32,9 @@ ) where import Control.Monad.Extra ( firstJustM ) +import Data.Aeson.Types ( Value ) +import Data.Aeson.WarningParser + ( WithJSONWarnings (..), logJSONWarnings ) import Data.Array.IArray ( (!), (//) ) import qualified Data.ByteString as S import Data.ByteString.Builder ( byteString ) @@ -51,8 +54,6 @@ import Network.HTTP.StackClient ( httpJSON, parseUrlThrow, getResponseBody ) import Options.Applicative ( Parser, help, long, metavar, strOption ) -import Pantry.Internal.AesonExtended - ( Value, WithJSONWarnings (..), logJSONWarnings ) import Path ( PathException (..), (</>), parent, parseAbsDir , parseAbsFile, parseRelDir, stripProperPrefix @@ -114,6 +115,7 @@ , ParseAbsolutePathException (..), packageIndicesWarning ) import Stack.Types.ConfigMonoid ( ConfigMonoid (..), parseConfigMonoid ) +import Stack.Types.Casa ( CasaOptsMonoid (..) ) import Stack.Types.Docker ( DockerOptsMonoid (..), dockerEnable ) import Stack.Types.DumpLogs ( DumpLogs (..) ) import Stack.Types.GlobalOpts ( GlobalOpts (..) ) @@ -482,16 +484,33 @@ addr' = display $ T.dropWhileEnd (=='/') addr let configStackDeveloperMode = fromFirst stackDeveloperModeDefault configMonoidStackDeveloperMode + configCasa = if fromFirstTrue $ casaMonoidEnable configMonoidCasaOpts + then + let casaRepoPrefix = fromFirst + (fromFirst defaultCasaRepoPrefix configMonoidCasaRepoPrefix) + (casaMonoidRepoPrefix configMonoidCasaOpts) + casaMaxKeysPerRequest = fromFirst + defaultCasaMaxPerRequest + (casaMonoidMaxKeysPerRequest configMonoidCasaOpts) + in Just (casaRepoPrefix, casaMaxKeysPerRequest) + else Nothing withNewLogFunc go useColor'' stylesUpdate' $ \logFunc -> do let configRunner = configRunner'' & logFuncL .~ logFunc - withLocalLogFunc logFunc $ handleMigrationException $ - withPantryConfig + withLocalLogFunc logFunc $ handleMigrationException $ do + logDebug $ case configCasa of + Nothing -> "Use of Casa server disabled." + Just (repoPrefix, maxKeys) -> + "Use of Casa server enabled: (" + <> fromString (show repoPrefix) + <> ", " + <> fromString (show maxKeys) + <> ")." + withPantryConfig' pantryRoot pic (maybe HpackBundled HpackCommand $ getFirst configMonoidOverrideHpack) clConnectionCount - (fromFirst defaultCasaRepoPrefix configMonoidCasaRepoPrefix) - defaultCasaMaxPerRequest + configCasa snapLoc (\configPantryConfig -> initUserStorage (configStackRoot </> relFileStorage)
@@ -14,9 +14,9 @@ import Stack.Types.BuildOpts ( BenchmarkOpts (..), BenchmarkOptsMonoid (..) , BuildOpts (..), BuildOptsMonoid (..), CabalVerbosity (..) - , HaddockOpts (..), HaddockOptsMonoid (..), TestOpts (..) - , TestOptsMonoid (..), defaultBenchmarkOpts - , defaultHaddockOpts, defaultTestOpts + , HaddockOpts (..), HaddockOptsMonoid (..) + , ProgressBarFormat (..), TestOpts (..), TestOptsMonoid (..) + , defaultBenchmarkOpts, defaultHaddockOpts, defaultTestOpts ) -- | Interprets BuildOptsMonoid options. @@ -59,6 +59,7 @@ , boptsSplitObjs = fromFirstFalse buildMonoidSplitObjs , boptsSkipComponents = buildMonoidSkipComponents , boptsInterleavedOutput = fromFirstTrue buildMonoidInterleavedOutput + , boptsProgressBar = fromFirst CappedBar buildMonoidProgressBar , boptsDdumpDir = getFirst buildMonoidDdumpDir } where
@@ -0,0 +1,105 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +module Stack.Config.ConfigureScript + ( ensureConfigureScript + ) where + +import Path ( (</>) ) +import Path.IO ( doesFileExist ) +import Stack.Constants ( osIsWindows, relFileConfigure ) +import Stack.DefaultColorWhen ( defaultColorWhen ) +import Stack.Prelude +import RIO.Process ( HasProcessContext, withWorkingDir ) + +ensureConfigureScript :: + (HasProcessContext env, HasTerm env) + => Path b Dir + -> RIO env () +ensureConfigureScript dir = do + let fp = dir </> relFileConfigure + exists <- doesFileExist fp + unless exists $ do + prettyInfoL + [ flow "Trying to generate" + , style Shell "configure" + , "with" + , style Shell "autoreconf" + , "in" + , pretty dir <> "." + ] + let autoreconf = if osIsWindows + then readProcessNull "sh" ["autoreconf", "-i"] + else readProcessNull "autoreconf" ["-i"] + -- On Windows 10, an upstream issue with the `sh autoreconf -i` + -- command means that command clears, but does not then restore, the + -- ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for native terminals. The + -- following hack re-enables the lost ANSI-capability. + fixupOnWindows = when osIsWindows (void $ liftIO defaultColorWhen) + withWorkingDir (toFilePath dir) $ autoreconf `catchAny` \ex -> do + fixupOnWindows + prettyWarn $ + fillSep + [ flow "Stack failed to run" + , style Shell "autoreconf" <> "." + ] + <> blankLine + <> flow "Stack encountered the following error:" + <> blankLine + <> string (displayException ex) + when osIsWindows $ do + prettyInfo $ + fillSep + [ flow "Check that executable" + , style File "perl" + , flow "is on the path in Stack's MSYS2" + , style Dir "\\usr\\bin" + , flow "folder, and working, and that script files" + , style File "autoreconf" + , "and" + , style File "aclocal" + , flow "are on the path in that location. To check that" + , style File "perl" <> "," + , style File "autoreconf" + , "or" + , style File "aclocal" + , flow "are on the path in the required location, run commands:" + ] + <> blankLine + <> indent 4 (style Shell $ flow "stack exec where.exe -- perl") + <> line + <> indent 4 (style Shell $ flow "stack exec where.exe -- autoreconf") + <> line + <> indent 4 (style Shell $ flow "stack exec where.exe -- aclocal") + <> blankLine + <> fillSep + [ "If" + , style File "perl" <> "," + , style File "autoreconf" + , "or" + , style File "aclocal" + , flow "is not on the path in the required location, add them \ + \with command (note that the relevant package name is" + , style File "autotools" + , "not" + , style File "autoreconf" <> "):" + ] + <> blankLine + <> indent 4 + (style Shell $ flow "stack exec pacman -- --sync --refresh mingw-w64-x86_64-autotools") + <> blankLine + <> fillSep + [ flow "Some versions of" + , style File "perl" + , flow "from MSYS2 are broken. See" + , style Url "https://github.com/msys2/MSYS2-packages/issues/1611" + , "and" + , style Url "https://github.com/commercialhaskell/stack/pull/4781" <> "." + , "To test if" + , style File "perl" + , flow "in the required location is working, try command:" + ] + <> blankLine + <> indent 4 (style Shell $ flow "stack exec perl -- --version") + <> blankLine + fixupOnWindows
@@ -364,4 +364,4 @@ encodeUtf8Builder key <> ";\n" escape '\'' = "'\"'\"'" escape c = T.singleton c - hPutBuilder stdout $ Map.foldMapWithKey toLine actions + putBuilder $ Map.foldMapWithKey toLine actions
@@ -36,6 +36,7 @@ , minTerminalWidth , maxTerminalWidth , defaultTerminalWidth + , osIsMacOS , osIsWindows , relFileSetupHs , relFileSetupLhs @@ -105,6 +106,7 @@ , relDirDotStackProgName , relDirUnderHome , relDirSrc + , relFileLibcMuslx86_64So1 , relFileLibtinfoSo5 , relFileLibtinfoSo6 , relFileLibncurseswSo6 @@ -121,8 +123,16 @@ , relFileStackDotTmpDotExe , relFileStackDotTmp , ghcShowOptionsOutput + , ghcBootScript + , ghcConfigureScript + , ghcConfigureWindows + , ghcConfigureMacOS + , ghcConfigurePosix + , relDirHadrian + , relFileHadrianStackDotYaml , hadrianScriptsWindows , hadrianScriptsPosix + , libDirs , usrLibDirs , testGhcEnvRelFile , relFileBuildLock @@ -143,10 +153,10 @@ import qualified Language.Haskell.TH.Syntax as TH ( runIO, lift ) import Path ( (</>), mkRelDir, mkRelFile, parseAbsFile ) import Stack.Constants.StackProgName ( stackProgName ) -import Stack.Constants.UsrLibDirs ( usrLibDirs ) +import Stack.Constants.UsrLibDirs ( libDirs, usrLibDirs ) import Stack.Prelude import Stack.Types.Compiler ( WhichCompiler (..) ) -import System.Permissions ( osIsWindows ) +import System.Permissions ( osIsMacOS, osIsWindows ) import System.Process ( readProcess ) -- | Type representing exceptions thrown by functions exported by the @@ -234,7 +244,7 @@ [ "ghc-prim" -- A magic package , "integer-gmp" - -- No longer magic > 1.0.3.0. With GHC 9.2.7 at least, there seems to be + -- No longer magic > 1.0.3.0. With GHC 9.4.7 at least, there seems to be -- no problem in using it. , "integer-simple" -- A magic package @@ -246,16 +256,16 @@ -- A magic package , "dph-seq" -- Deprecated in favour of dph-prim-seq, which does not appear to be - -- magic. With GHC 9.2.7 at least, there seems to be no problem in using + -- magic. With GHC 9.4.7 at least, there seems to be no problem in using -- it. , "dph-par" -- Deprecated in favour of dph-prim-par, which does not appear to be - -- magic. With GHC 9.2.7 at least, there seems to be no problem in using + -- magic. With GHC 9.4.7 at least, there seems to be no problem in using -- it. , "ghc" -- A magic package , "interactive" - -- Could not identify information about this package name. With GHC 9.2.7 + -- Could not identify information about this package name. With GHC 9.4.7 -- at least, there seems to be no problem in using it. , "ghc-bignum" -- A magic package @@ -547,6 +557,9 @@ relDirSrc :: Path Rel Dir relDirSrc = $(mkRelDir "src") +relFileLibcMuslx86_64So1 :: Path Rel File +relFileLibcMuslx86_64So1 = $(mkRelFile "libc.musl-x86_64.so.1") + relFileLibtinfoSo5 :: Path Rel File relFileLibtinfoSo5 = $(mkRelFile "libtinfo.so.5") @@ -598,15 +611,48 @@ ghcShowOptionsOutput = $(TH.runIO (readProcess "ghc" ["--show-options"] "") >>= TH.lift . lines) +-- | Relative paths inside a GHC repo to the boot script. +ghcBootScript :: Path Rel File +ghcBootScript = $(mkRelFile "boot") + +-- | Relative paths inside a GHC repo to the configure script. +ghcConfigureScript :: Path Rel File +ghcConfigureScript = $(mkRelFile "configure") + +-- | Command applicable to GHC's configure script on Windows. See: +-- https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md +ghcConfigureWindows :: [String] +ghcConfigureWindows = ["sh", "configure", "--enable-tarballs-autodownload"] + +-- | Command applicable to GHC's configure script on macOS. See: +-- https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md +ghcConfigureMacOS :: [String] +ghcConfigureMacOS = ["./configure", "--with-intree-gmp"] + +-- | Command applicable to GHC's configure script on non-Windows, non-macOS. +-- See: https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/README.md +ghcConfigurePosix :: [String] +ghcConfigurePosix = ["./configure"] + +relDirHadrian :: Path Rel Dir +relDirHadrian = $(mkRelDir "hadrian") + +relFileHadrianStackDotYaml :: Path Rel File +relFileHadrianStackDotYaml = relDirHadrian </> stackDotYaml + -- | Relative paths inside a GHC repo to the Hadrian build batch script. -- The second path is maintained for compatibility with older GHC versions. hadrianScriptsWindows :: [Path Rel File] -hadrianScriptsWindows = [$(mkRelFile "hadrian/build-stack.bat"), $(mkRelFile "hadrian/build.stack.bat")] +hadrianScriptsWindows = + [ $(mkRelFile "hadrian/build-stack.bat") + , $(mkRelFile "hadrian/build.stack.bat") + ] -- | Relative paths inside a GHC repo to the Hadrian build shell script -- The second path is maintained for compatibility with older GHC versions. hadrianScriptsPosix :: [Path Rel File] -hadrianScriptsPosix = [$(mkRelFile "hadrian/build-stack"), $(mkRelFile "hadrian/build.stack.sh")] +hadrianScriptsPosix = + [$(mkRelFile "hadrian/build-stack"), $(mkRelFile "hadrian/build.stack.sh")] -- | Relative file path for a temporary GHC environment file for tests testGhcEnvRelFile :: Path Rel File
@@ -3,32 +3,32 @@ {-# LANGUAGE TemplateHaskell #-} module Stack.Constants.Config - ( distDirFromDir - , rootDistDirFromDir - , setupConfigFromDir - , workDirFromDir - , distRelativeDir - , imageStagingDir - , projectDockerSandboxDir + ( buildCachesDir , configCabalMod - , configSetupConfigMod , configPackageProjectRoot - , buildCachesDir - , testSuccessFile - , testBuiltFile - , hpcRelativeDir + , configSetupConfigMod + , distDirFromDir + , distRelativeDir + , ghciDirL , hpcDirFromDir + , hpcRelativeDir + , imageStagingDir , objectInterfaceDirL - , ghciDirL + , projectDockerSandboxDir + , rootDistDirFromDir + , setupConfigFromDir , templatesDir + , testBuiltFile + , testSuccessFile + , workDirFromDir ) where import Path ( (</>), mkRelDir, mkRelFile, parseRelDir ) -import Stack.Constants - ( cabalPackageName, relDirDist, relDirGhci, relDirHpc ) +import Stack.Constants ( relDirDist, relDirGhci, relDirHpc ) import Stack.Prelude import Stack.Types.BuildConfig ( HasBuildConfig, projectRootL ) -import Stack.Types.CompilerPaths ( cabalVersionL ) +import Stack.Types.Compiler ( compilerVersionString ) +import Stack.Types.CompilerPaths ( compilerVersionL ) import Stack.Types.Config ( Config, HasConfig, stackRootL, workDirL ) import Stack.Types.EnvConfig ( HasEnvConfig, platformGhcRelDir, useShaPathOnWindows ) @@ -47,55 +47,62 @@ root = view projectRootL env in root </> workDir </> relDirGhci --- | The directory containing the files used for dirtiness check of source files. -buildCachesDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir -- ^ Package directory. - -> m (Path Abs Dir) +-- | The directory containing the files used for dirtiness check of source +-- files. +buildCachesDir :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir -- ^ Package directory. + -> m (Path Abs Dir) buildCachesDir dir = fmap (</> $(mkRelDir "stack-build-caches")) (distDirFromDir dir) --- | The filename used to mark tests as having succeeded -testSuccessFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir -- ^ Package directory - -> m (Path Abs File) +-- | The filename used to mark tests as having succeeded. +testSuccessFile :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir -- ^ Package directory + -> m (Path Abs File) testSuccessFile dir = fmap (</> $(mkRelFile "stack-test-success")) (distDirFromDir dir) --- | The filename used to mark tests as having built -testBuiltFile :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir -- ^ Package directory - -> m (Path Abs File) +-- | The filename used to mark tests as having built. +testBuiltFile :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir -- ^ Package directory + -> m (Path Abs File) testBuiltFile dir = fmap (</> $(mkRelFile "stack-test-built")) (distDirFromDir dir) --- | The filename used for modification check of .cabal -configCabalMod :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir -- ^ Package directory. - -> m (Path Abs File) +-- | The filename used for modification check of a Cabal file. +configCabalMod :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir -- ^ Package directory. + -> m (Path Abs File) configCabalMod dir = fmap (</> $(mkRelFile "stack-cabal-mod")) (distDirFromDir dir) --- | The filename used for modification check of setup-config -configSetupConfigMod :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir -- ^ Package directory. - -> m (Path Abs File) +-- | The filename used for modification check of setup-config. +configSetupConfigMod :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir -- ^ Package directory. + -> m (Path Abs File) configSetupConfigMod dir = fmap (</> $(mkRelFile "stack-setup-config-mod")) (distDirFromDir dir) --- | The filename used for the project root from the last build of a package -configPackageProjectRoot :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir -- ^ Package directory. - -> m (Path Abs File) +-- | The filename used for the project root from the last build of a package. +configPackageProjectRoot :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir -- ^ Package directory. + -> m (Path Abs File) configPackageProjectRoot dir = fmap (</> $(mkRelFile "stack-project-root")) @@ -103,55 +110,59 @@ -- | Directory for HPC work. hpcDirFromDir :: - (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir -- ^ Package directory. - -> m (Path Abs Dir) + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir -- ^ Package directory. + -> m (Path Abs Dir) hpcDirFromDir fp = fmap (fp </>) hpcRelativeDir -- | Relative location of directory for HPC work. -hpcRelativeDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => m (Path Rel Dir) +hpcRelativeDir :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => m (Path Rel Dir) hpcRelativeDir = fmap (</> relDirHpc) distRelativeDir --- | Package's setup-config storing Cabal configuration -setupConfigFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir - -> m (Path Abs File) +-- | Package's setup-config storing Cabal configuration. +setupConfigFromDir :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir + -> m (Path Abs File) setupConfigFromDir fp = do - dist <- distDirFromDir fp - pure $ dist </> $(mkRelFile "setup-config") + dist <- distDirFromDir fp + pure $ dist </> $(mkRelFile "setup-config") -- | Package's build artifacts directory. -distDirFromDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => Path Abs Dir - -> m (Path Abs Dir) +distDirFromDir :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => Path Abs Dir + -> m (Path Abs Dir) distDirFromDir fp = fmap (fp </>) distRelativeDir -- | The directory containing all dist directories, including all --- different GHC/Cabal combos. +-- different platform/compiler combinations. rootDistDirFromDir :: - (MonadReader env m, HasConfig env) + (HasConfig env, MonadReader env m) => Path Abs Dir -> m (Path Abs Dir) rootDistDirFromDir fp = fmap (fp </>) rootDistRelativeDir -- | Relative directory to the top dist directory, containing --- individual GHC/Cabal combo as subdirs. +-- individual platform/compiler combinations as subdirs. rootDistRelativeDir :: - (MonadReader env m, HasConfig env) + (HasConfig env, MonadReader env m) => m (Path Rel Dir) rootDistRelativeDir = do - workDir <- view workDirL - pure $ workDir </> relDirDist + workDir <- view workDirL + pure $ workDir </> relDirDist -- | Package's working directory. -workDirFromDir :: (MonadReader env m, HasConfig env) - => Path Abs Dir - -> m (Path Abs Dir) +workDirFromDir :: + (HasConfig env, MonadReader env m) + => Path Abs Dir + -> m (Path Abs Dir) workDirFromDir fp = view $ workDirL.to (fp </>) -- | Directory for project templates. @@ -159,22 +170,21 @@ templatesDir config = view stackRootL config </> $(mkRelDir "templates") -- | Relative location of build artifacts. -distRelativeDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) - => m (Path Rel Dir) +distRelativeDir :: + (HasEnvConfig env, MonadReader env m, MonadThrow m) + => m (Path Rel Dir) distRelativeDir = do - cabalPkgVer <- view cabalVersionL - platform <- platformGhcRelDir - -- Cabal version - envDir <- - parseRelDir $ - packageIdentifierString $ - PackageIdentifier cabalPackageName cabalPkgVer - platformAndCabal <- useShaPathOnWindows (platform </> envDir) - allDist <- rootDistRelativeDir - pure $ allDist </> platformAndCabal + compilerVer <- view compilerVersionL + platform <- platformGhcRelDir + -- Compiler version: allows build artefacts to be distinguished by compiler + -- version, which will also distinguish one Cabal version from another. + compilerDir <- parseRelDir $ compilerVersionString compilerVer + platformAndCompiler <- useShaPathOnWindows (platform </> compilerDir) + allDist <- rootDistRelativeDir + pure $ allDist </> platformAndCompiler -- | Docker sandbox from project root. -projectDockerSandboxDir :: (MonadReader env m, HasConfig env) +projectDockerSandboxDir :: (HasConfig env, MonadReader env m) => Path Abs Dir -- ^ Project root -> m (Path Abs Dir) -- ^ Docker sandbox projectDockerSandboxDir projectRoot = do @@ -182,7 +192,8 @@ pure $ projectRoot </> workDir </> $(mkRelDir "docker/") -- | Image staging dir from project root. -imageStagingDir :: (MonadReader env m, HasConfig env, MonadThrow m) +imageStagingDir :: + (HasConfig env, MonadReader env m, MonadThrow m) => Path Abs Dir -- ^ Project root -> Int -- ^ Index of image -> m (Path Abs Dir) -- ^ Docker sandbox
@@ -14,8 +14,7 @@ , generateHpcMarkupIndex ) where -import qualified Data.ByteString.Char8 as S8 -import qualified Data.ByteString.Lazy as BL +import qualified Data.ByteString.Lazy.Char8 as L8 import qualified Data.List as L import qualified Data.Map.Strict as Map import qualified Data.Set as Set @@ -32,6 +31,7 @@ , ignoringAbsence, listDir, removeDirRecur, removeFile , resolveDir', resolveFile' ) +import RIO.ByteString.Lazy ( putStrLn ) import RIO.Process ( ProcessException, proc, readProcess_ ) import Stack.Build.Target ( NeedTargets (..) ) import Stack.Constants @@ -45,7 +45,6 @@ import Stack.Types.BuildConfig ( BuildConfig (..), HasBuildConfig (..) ) import Stack.Types.Compiler ( getGhcVersion ) -import Stack.Types.CompilerPaths ( cabalVersionL ) import Stack.Types.BuildOpts ( BuildOptsCLI (..), defaultBuildOptsCLI ) import Stack.Types.EnvConfig ( EnvConfig (..), HasEnvConfig (..), actualCompilerVersionL @@ -213,9 +212,9 @@ tixSrc <- tixFilePath (packageName package) (T.unpack testName) let report = fillSep [ flow "coverage report for" - , fromString pkgName' <> "'s" + , style Current (fromString pkgName') <> "'s" , "test-suite" - , fromString $ "\"" <> T.unpack testName <> "\"" + , style PkgComponent (fromString $ T.unpack testName) ] reportHtml = "coverage report for" @@ -290,14 +289,15 @@ [ "Generating" , report <> "." ] - outputLines <- map (S8.filter (/= '\r')) . S8.lines . BL.toStrict . fst <$> + -- Strip @\r@ characters because Windows. + outputLines <- map (L8.filter (/= '\r')) . L8.lines . fst <$> proc "hpc" ( "report" : toFilePath tixSrc : (args ++ extraReportArgs) ) readProcess_ - if all ("(0/0)" `S8.isSuffixOf`) outputLines + if all ("(0/0)" `L8.isSuffixOf`) outputLines then do let msgHtml = "Error: [S-6829]\n\ @@ -328,9 +328,16 @@ pure Nothing else do let reportPath = reportDir </> relFileHpcIndexHtml - -- Print output, stripping @\r@ characters because Windows. - forM_ outputLines (logInfo . displayBytesUtf8) - -- Generate the markup. + -- Print the summary report to the standard output stream. + putUtf8Builder =<< displayWithColor + ( fillSep + [ "Summary" + , report <> ":" + ] + <> line + ) + forM_ outputLines putStrLn + -- Generate the HTML markup. void $ proc "hpc" ( "markup" : toFilePath tixSrc @@ -393,8 +400,8 @@ dest <- resolveDir' destDir ensureDir dest pure dest - let report = flow "combined report" - reportHtml = "combined report" + let report = flow "combined coverage report" + reportHtml = "combined coverage report" mreportPath <- generateUnionReport report reportHtml reportDir tixPaths forM_ mreportPath $ \reportPath -> if hroptsOpenBrowser opts @@ -430,8 +437,8 @@ , flow "so not generating a unified coverage report." ] else do - let report = flow "unified report" - reportHtml = "unified report" + let report = flow "unified coverage report" + reportHtml = "unified coverage report" mreportPath <- generateUnionReport report reportHtml reportDir tixFiles forM_ mreportPath (displayReportPath "The" report . pretty) @@ -590,60 +597,57 @@ distDir <- distDirFromDir pkgDir let inplaceDir = distDir </> relDirPackageConfInplace pkgIdStr = packageIdentifierString pkgId - notFoundErr = pure $ Left $ "Failed to find package key for " <> T.pack pkgIdStr + notFoundErr = pure $ + Left $ "Failed to find package key for " <> T.pack pkgIdStr extractField path = do contents <- readFileUtf8 (toFilePath path) case asum (map (T.stripPrefix (field <> ": ")) (T.lines contents)) of Just result -> pure $ Right $ T.strip result Nothing -> notFoundErr - cabalVer <- view cabalVersionL - if cabalVer < mkVersion [1, 24] - then do - -- here we don't need to handle internal libs - path <- (inplaceDir </>) <$> parseRelFile (pkgIdStr ++ "-inplace.conf") - logDebug $ - "Parsing config in Cabal < 1.24 location: " - <> fromString (toFilePath path) - exists <- doesFileExist path - if exists then fmap (:[]) <$> extractField path else notFoundErr - else do - -- With Cabal-1.24, it's in a different location. - logDebug $ "Scanning " <> fromString (toFilePath inplaceDir) <> " for files matching " <> fromString pkgIdStr - (_, files) <- handleIO (const $ pure ([], [])) $ listDir inplaceDir - logDebug $ displayShow files - -- From all the files obtained from the scanning process above, we - -- need to identify which are .conf files and then ensure that - -- there is at most one .conf file for each library and internal - -- library (some might be missing if that component has not been - -- built yet). We should error if there are more than one .conf - -- file for a component or if there are no .conf files at all in - -- the searched location. - let toFilename = T.pack . toFilePath . filename - -- strip known prefix and suffix from the found files to determine only the conf files - stripKnown = T.stripSuffix ".conf" <=< T.stripPrefix (T.pack (pkgIdStr ++ "-")) - stripped = mapMaybe (\file -> fmap (,file) . stripKnown . toFilename $ file) files - -- which component could have generated each of these conf files - stripHash n = let z = T.dropWhile (/= '-') n in if T.null z then "" else T.tail z - matchedComponents = map (\(n, f) -> (stripHash n, [f])) stripped - byComponents = Map.restrictKeys (Map.fromListWith (++) matchedComponents) $ Set.insert "" internalLibs - logDebug $ displayShow byComponents - if Map.null $ Map.filter (\fs -> length fs > 1) byComponents - then case concat $ Map.elems byComponents of - [] -> notFoundErr - -- for each of these files, we need to extract the requested field - paths -> do - (errors, keys) <- partitionEithers <$> traverse extractField paths - case errors of - (a:_) -> pure $ Left a -- the first error only, since they're repeated anyway - [] -> pure $ Right keys - else - pure - $ Left - $ "Multiple files matching " - <> T.pack (pkgIdStr ++ "-*.conf") - <> " found in " - <> T.pack (toFilePath inplaceDir) - <> ". Maybe try 'stack clean' on this package?" + logDebug $ + "Scanning " + <> fromString (toFilePath inplaceDir) + <> " for files matching " + <> fromString pkgIdStr + (_, files) <- handleIO (const $ pure ([], [])) $ listDir inplaceDir + logDebug $ displayShow files + -- From all the files obtained from the scanning process above, we need to + -- identify which are .conf files and then ensure that there is at most one + -- .conf file for each library and internal library (some might be missing if + -- that component has not been built yet). We should error if there are more + -- than one .conf file for a component or if there are no .conf files at all + -- in the searched location. + let toFilename = T.pack . toFilePath . filename + -- strip known prefix and suffix from the found files to determine only the conf files + stripKnown = + T.stripSuffix ".conf" <=< T.stripPrefix (T.pack (pkgIdStr ++ "-")) + stripped = + mapMaybe (\file -> fmap (,file) . stripKnown . toFilename $ file) files + -- which component could have generated each of these conf files + stripHash n = + let z = T.dropWhile (/= '-') n + in if T.null z then "" else T.tail z + matchedComponents = map (\(n, f) -> (stripHash n, [f])) stripped + byComponents = + Map.restrictKeys (Map.fromListWith (++) matchedComponents) $ Set.insert "" internalLibs + logDebug $ displayShow byComponents + if Map.null $ Map.filter (\fs -> length fs > 1) byComponents + then case concat $ Map.elems byComponents of + [] -> notFoundErr + -- for each of these files, we need to extract the requested field + paths -> do + (errors, keys) <- partitionEithers <$> traverse extractField paths + case errors of + (a:_) -> pure $ Left a -- the first error only, since they're repeated anyway + [] -> pure $ Right keys + else + pure + $ Left + $ "Multiple files matching " + <> T.pack (pkgIdStr ++ "-*.conf") + <> " found in " + <> T.pack (toFilePath inplaceDir) + <> ". Maybe try 'stack clean' on this package?" displayReportPath :: HasTerm env
@@ -18,12 +18,14 @@ ) where import qualified Crypto.Hash as Hash ( Digest, MD5, hash ) +import Data.Aeson ( eitherDecode ) +import Data.Aeson.Types ( FromJSON (..), (.!=) ) +import Data.Aeson.WarningParser ( (.:), (.:?) ) import qualified Data.ByteString.Char8 as BS import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString.Lazy.Char8 as LBS import Data.Char ( isAscii, isDigit ) import Data.Conduit.List ( sinkNull ) -import Data.Conduit.Process.Typed hiding ( proc ) import Data.List ( dropWhileEnd, isInfixOf, isPrefixOf ) import Data.List.Extra ( trim ) import qualified Data.Map.Strict as Map @@ -32,18 +34,23 @@ import Data.Time ( UTCTime ) import qualified Data.Version ( parseVersion ) import Distribution.Version ( mkVersion, mkVersion' ) -import Pantry.Internal.AesonExtended - ( FromJSON (..), (.:), (.:?), (.!=), eitherDecode ) import Path ( (</>), dirname, filename, parent, parseAbsDir , splitExtension ) import Path.Extra ( toFilePathNoTrailingSep ) -import Path.IO hiding ( canonicalizePath ) +import Path.IO + ( copyFile, doesDirExist, doesFileExist, ensureDir + , getCurrentDir, getHomeDir, getModificationTime, listDir + , removeDirRecur, removeFile, resolveFile' + ) import qualified RIO.Directory ( makeAbsolute ) import RIO.Process - ( HasProcessContext, augmentPath, doesExecutableExist, proc - , processContextL, withWorkingDir + ( ExitCodeException (..), HasProcessContext, augmentPath + , closed, doesExecutableExist, proc, processContextL + , readProcessStdout_, readProcess_, runProcess, runProcess_ + , setStderr, setStdin, setStdout, useHandleOpen + , withWorkingDir ) import Stack.Config ( getInContainer ) import Stack.Constants
@@ -138,7 +138,7 @@ getRunCmd args = do packages <- view $ buildConfigL.to (smwProject . bcSMWanted) pkgComponents <- for (Map.elems packages) ppComponents - let executables = filter isCExe $ concatMap Set.toList pkgComponents + let executables = concatMap (filter isCExe . Set.toList) pkgComponents let (exe, args') = case args of [] -> (firstExe, args) x:xs -> case L.find (\y -> y == CExe (T.pack x)) executables of
@@ -8,6 +8,7 @@ ( createDatabase , findGhcPkgField , getGlobalDB + , ghcPkg , ghcPkgPathEnvVar , mkGhcPackagePath , unregisterGhcPkgIds @@ -18,6 +19,7 @@ import qualified Data.List as L import qualified Data.Text as T import qualified Data.Text.Encoding as T +import GHC.Utils.GhcPkg.Main.Compat ( ghcPkgUnregisterForce ) import Path ( (</>), parent ) import Path.Extra ( toFilePathNoTrailingSep ) import Path.IO @@ -26,7 +28,10 @@ import Stack.Constants ( relFilePackageCache ) import Stack.Prelude import Stack.Types.Compiler ( WhichCompiler (..) ) -import Stack.Types.CompilerPaths ( GhcPkgExe (..) ) +import Stack.Types.CompilerPaths + ( CompilerPaths (..), GhcPkgExe (..), HasCompiler + , compilerPathsL + ) import Stack.Types.GhcPkgId ( GhcPkgId, ghcPkgIdString ) import System.FilePath ( searchPathSeparator ) @@ -137,22 +142,53 @@ -- | unregister list of package ghcids, batching available from GHC 8.2.1, -- see https://github.com/commercialhaskell/stack/issues/2662#issuecomment-460342402 -- using GHC package id where available (from GHC 7.9) +-- +-- The version of the ghc-pkg executable supplied with GHCs published before +-- 28 August 2023 does not efficiently bulk unregister. Until an 'efficient' +-- ghc-pkg is available, this function no longer uses: +-- +-- > eres <- ghcPkg pkgexe [pkgDb] args +-- > where +-- > args = "unregister" : "--user" : "--force" : +-- > map packageIdentifierString idents ++ +-- > if null gids then [] else "--ipid" : map ghcPkgIdString gids +-- +-- but uses: +-- +-- > globalDb <- view $ compilerPathsL.to cpGlobalDB +-- > eres <- tryAny $ liftIO $ +-- > ghcPkgUnregisterUserForce globalDb pkgDb hasIpid pkgarg_strs +-- unregisterGhcPkgIds :: - (HasProcessContext env, HasTerm env) - => GhcPkgExe + (HasCompiler env, HasProcessContext env, HasTerm env) + => Bool + -- ^ Report pretty exceptions as warnings? + -> GhcPkgExe -> Path Abs Dir -- ^ package database -> NonEmpty (Either PackageIdentifier GhcPkgId) -> RIO env () -unregisterGhcPkgIds pkgexe pkgDb epgids = do - eres <- ghcPkg pkgexe [pkgDb] args +unregisterGhcPkgIds isWarn pkgexe pkgDb epgids = do + globalDb <- view $ compilerPathsL.to cpGlobalDB + eres <- try $ do + ghcPkgUnregisterForce globalDb pkgDb hasIpid pkgarg_strs + -- ghcPkgUnregisterForce does not perform an effective + -- 'ghc-pkg recache', as that depends on a specific version of the Cabal + -- package. + ghcPkg pkgexe [pkgDb] ["recache"] case eres of - Left e -> prettyWarn $ string $ displayException e + Left (PrettyException e) -> when isWarn $ + prettyWarn $ + "[S-8729]" + <> line + <> flow "While unregistering packages, Stack encountered the following \ + \error:" + <> blankLine + <> pretty e Right _ -> pure () where (idents, gids) = partitionEithers $ toList epgids - args = "unregister" : "--user" : "--force" : - map packageIdentifierString idents ++ - if null gids then [] else "--ipid" : map ghcPkgIdString gids + hasIpid = not (null gids) + pkgarg_strs = map packageIdentifierString idents <> map ghcPkgIdString gids -- | Get the value for GHC_PACKAGE_PATH mkGhcPackagePath :: Bool -> Path Abs Dir -> Path Abs Dir -> [Path Abs Dir] -> Path Abs Dir -> Text
@@ -8,6 +8,7 @@ import qualified Data.ByteString.Lazy.Char8 as BL8 import Data.Char ( isSpace ) +import Data.Either.Extra ( eitherToMaybe ) import qualified Data.Text as T import Distribution.PackageDescription ( packageDescription, package ) import Distribution.Types.PackageName ( mkPackageName ) @@ -44,21 +45,18 @@ -- | Type representing exceptions thrown by functions exported by the -- "Stack.Hoogle" module. data HoogleException - = HoogleDatabaseNotFound - | HoogleOnPathNotFoundBug + = HoogleOnPathNotFoundBug deriving (Show, Typeable) instance Exception HoogleException where - displayException HoogleDatabaseNotFound = - "Error: [S-3025]\n" - ++ "No Hoogle database. Not building one due to '--no-setup'." displayException HoogleOnPathNotFoundBug = bugReport "[S-9669]" "Cannot find Hoogle executable on PATH, after installing." -- | Type representing \'pretty\' exceptions thrown by functions exported by the -- "Stack.Hoogle" module. -newtype HooglePrettyException +data HooglePrettyException = HoogleNotFound StyleDoc + | HoogleDatabaseNotFound deriving (Show, Typeable) instance Pretty HooglePrettyException where @@ -71,6 +69,13 @@ [ flow "Not installing Hoogle due to" , style Shell "--no-setup" <> "." ] + pretty HoogleDatabaseNotFound = + "[S-3025]" + <> line + <> fillSep + [ flow "No Hoogle database. Not building one due to" + , style Shell "--no-setup" <> "." + ] instance Exception HooglePrettyException @@ -105,19 +110,19 @@ then do prettyWarn $ if rebuild - then flow "Rebuilding database ..." - else - fillSep - [ flow "No Hoogle database yet. Automatically building \ - \Haddock documentation and Hoogle database (use" - , style Shell "--no-setup" - , flow "to disable) ..." - ] + then flow "Rebuilding database ..." + else + fillSep + [ flow "No Hoogle database yet. Automatically building \ + \Haddock documentation and Hoogle database (use" + , style Shell "--no-setup" + , flow "to disable) ..." + ] buildHaddocks prettyInfoS "Built Haddock documentation." generateDb hooglePath prettyInfoS "Generated Hoogle database." - else throwIO HoogleDatabaseNotFound + else prettyThrowIO HoogleDatabaseNotFound generateDb :: Path Abs File -> RIO EnvConfig () generateDb hooglePath = do @@ -226,11 +231,13 @@ ensureHoogleInPath = do config <- view configL menv <- liftIO $ configProcessContextSettings config envSettings - mhooglePath <- runRIO menv (findExecutable "hoogle") <> - requiringHoogle NotMuted (findExecutable "hoogle") - eres <- case mhooglePath of - Left _ -> pure $ Left (flow "Hoogle isn't installed.") - Right hooglePath -> do + mHooglePath' <- eitherToMaybe <$> runRIO menv (findExecutable "hoogle") + let mHooglePath'' = + eitherToMaybe <$> requiringHoogle NotMuted (findExecutable "hoogle") + mHooglePath <- maybe mHooglePath'' (pure . Just) mHooglePath' + eres <- case mHooglePath of + Nothing -> pure $ Left (flow "Hoogle isn't installed.") + Just hooglePath -> do result <- withProcessContext menv $ proc hooglePath ["--numeric-version"] $ tryAny . fmap fst . readProcess_
@@ -14,25 +14,28 @@ import qualified Data.Map as Map import qualified Data.Set as Set import qualified Data.Text as T +import Data.Tuple ( swap ) import Stack.Prelude import Stack.Runners ( ShouldReexec (..), withBuildConfig, withConfig ) import Stack.Types.BuildConfig ( BuildConfig (..), HasBuildConfig (..) ) import Stack.Types.NamedComponent - ( NamedComponent, renderPkgComponent ) + ( NamedComponent, isCBench, isCExe, isCTest + , renderPkgComponent + ) import Stack.Types.Runner ( Runner ) import Stack.Types.SourceMap - ( ProjectPackage (..), SMWanted (..), ppComponents ) + ( ProjectPackage (..), SMWanted (..), ppComponentsMaybe ) import System.IO ( putStrLn ) --- Type representing output channel choices for the @stack ide packages@ and +-- Type representing output stream choices for the @stack ide packages@ and -- @stack ide targets@ commands. data OutputStream = OutputLogInfo - -- ^ To the same output channel as other log information. + -- ^ To the same output stream as other log information. | OutputStdout - -- ^ To the standard output channel. + -- ^ To the standard output stream. -- Type representing output choices for the @stack ide packages@ command. data ListPackagesCmd @@ -47,10 +50,16 @@ idePackagesCmd = withConfig NoReexec . withBuildConfig . uncurry listPackages +compTypes :: (Bool, Bool, Bool) -> NamedComponent -> Bool +compTypes (False, False, False) = const True +compTypes (exe, test, bench) = + \x -> (exe && isCExe x) || (test && isCTest x) || (bench && isCBench x) + -- | Function underlying the @stack ide targets@ command. List targets in the -- project. -ideTargetsCmd :: OutputStream -> RIO Runner () -ideTargetsCmd = withConfig NoReexec . withBuildConfig . listTargets +ideTargetsCmd :: ((Bool, Bool, Bool), OutputStream) -> RIO Runner () +ideTargetsCmd = withConfig NoReexec . + withBuildConfig . uncurry listTargets . fmap compTypes . swap outputFunc :: HasTerm env => OutputStream -> String -> RIO env () outputFunc OutputLogInfo = prettyInfo . fromString @@ -72,8 +81,12 @@ mapM_ (outputFunc stream) strs -- | List the targets in the current project. -listTargets :: forall env. HasBuildConfig env => OutputStream -> RIO env () -listTargets stream = do +listTargets :: + forall env. HasBuildConfig env + => OutputStream + -> (NamedComponent -> Bool) + -> RIO env () +listTargets stream isCompType = do packages <- view $ buildConfigL.to (smwProject . bcSMWanted) pairs <- concat <$> Map.traverseWithKey toNameAndComponent packages outputFunc stream $ T.unpack $ T.intercalate "\n" $ @@ -84,4 +97,5 @@ -> ProjectPackage -> RIO env [(PackageName, NamedComponent)] toNameAndComponent pkgName' = - fmap (map (pkgName', ) . Set.toList) . ppComponents + fmap (map (pkgName',) . Set.toList) . ppComponentsMaybe (\x -> + if isCompType x then Just x else Nothing)
@@ -421,15 +421,15 @@ , "A snapshot resolver dictates the compiler version and the set of packages" , "to be used for project dependencies. For example:" , "" - , "resolver: lts-3.5" - , "resolver: nightly-2015-09-21" - , "resolver: ghc-7.10.2" + , "resolver: lts-21.13" + , "resolver: nightly-2023-09-24" + , "resolver: ghc-9.6.2" , "" , "The location of a snapshot can be provided as a file or url. Stack assumes" , "a snapshot provided as a file might change, whereas a url resource does not." , "" , "resolver: ./custom-snapshot.yaml" - , "resolver: https://example.com/snapshots/2018-01-01.yaml" + , "resolver: https://example.com/snapshots/2023-01-01.yaml" ] userMsgHelp = commentHelp [ "A warning or info to be displayed to the user on config load." ]
@@ -1,25 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE CPP #-} - -#ifdef USE_GIT_INFO -{-# LANGUAGE TemplateHaskell #-} -#endif - -module Stack.Internal.BuildInfo - ( maybeGitHash - ) where - -#ifdef USE_GIT_INFO -import GitHash ( giHash, tGitInfoCwdTry ) -#endif -import Stack.Prelude - --- | If USE_GIT_INFO is enabled, the Git hash in the build directory, otherwise --- Nothing. -maybeGitHash :: Maybe String -maybeGitHash = -#ifdef USE_GIT_INFO - (either (const Nothing) (Just . giHash) $$tGitInfoCwdTry) -#else - Nothing -#endif
@@ -8,7 +8,7 @@ ) where import Pantry ( loadSnapshot ) -import RIO.List ( intercalate ) +import qualified RIO.ByteString.Lazy as Lazy import qualified RIO.Map as Map import RIO.Process ( HasProcessContext ) import Stack.Config ( makeConcreteResolver ) @@ -19,15 +19,18 @@ -- | Type representing exceptions thrown by functions exported by the -- "Stack.List" module. -newtype ListException - = CouldNotParsePackageSelectors [String] +newtype ListPrettyException + = CouldNotParsePackageSelectors [StyleDoc] deriving (Show, Typeable) -instance Exception ListException where - displayException (CouldNotParsePackageSelectors strs) = unlines $ - "Error: [S-4926]" - : map ("- " ++) strs +instance Pretty ListPrettyException where + pretty (CouldNotParsePackageSelectors errs) = + "[S-4926]" + <> line + <> bulletedList errs +instance Exception ListPrettyException + -- | Function underlying the @stack list@ command. List packages. listCmd :: [String] -> RIO Runner () listCmd names = withConfig NoReexec $ do @@ -53,13 +56,13 @@ (errs2, locs) <- partitionEithers <$> traverse toLoc names case errs1 ++ errs2 of [] -> pure () - errs -> throwM $ CouldNotParsePackageSelectors errs - mapM_ (prettyInfo . fromString . packageIdentifierString) locs + errs -> prettyThrowM $ CouldNotParsePackageSelectors errs + mapM_ (Lazy.putStrLn . fromString . packageIdentifierString) locs where toLoc | Just snapshot <- mSnapshot = toLocSnapshot snapshot | otherwise = toLocNoSnapshot - toLocNoSnapshot :: PackageName -> RIO env (Either String PackageIdentifier) + toLocNoSnapshot :: PackageName -> RIO env (Either StyleDoc PackageIdentifier) toLocNoSnapshot name = do mloc1 <- getLatestHackageLocation YesRequireHackageIndex name UsePreferredVersions @@ -82,26 +85,30 @@ case mloc of Nothing -> do candidates <- getHackageTypoCorrections name - pure $ Left $ concat - [ "Could not find package " - , packageNameString name - , " on Hackage" + pure $ Left $ fillSep + [ flow "Could not find package" + , style Current (fromString $ packageNameString name) + , flow "on Hackage." , if null candidates - then "" - else ". Perhaps you meant: " ++ - intercalate ", " (map packageNameString candidates) + then mempty + else fillSep $ + flow "Perhaps you meant one of:" + : mkNarrativeList (Just Good) False + (map (fromString . packageNameString) candidates :: [StyleDoc]) ] Just loc -> pure $ Right (packageLocationIdent loc) toLocSnapshot :: RawSnapshot -> PackageName - -> RIO env (Either String PackageIdentifier) + -> RIO env (Either StyleDoc PackageIdentifier) toLocSnapshot snapshot name = case Map.lookup name (rsPackages snapshot) of Nothing -> - pure $ Left $ - "Package does not appear in snapshot: " ++ packageNameString name + pure $ Left $ fillSep + [ flow "Package does not appear in snapshot:" + , style Current (fromString $ packageNameString name) <> "." + ] Just sp -> do loc <- cplComplete <$> completePackageLocation (rspLocation sp) pure $ Right (packageLocationIdent loc) @@ -109,4 +116,7 @@ parse s = case parsePackageName s of Just x -> Right x - Nothing -> Left $ "Could not parse as package name or identifier: " ++ s + Nothing -> Left $ fillSep + [ flow "Could not parse as package name or identifier:" + , style Current (fromString s) <> "." + ]
@@ -8,17 +8,16 @@ , Locked (..) ) where +import Data.Aeson.Types ( FromJSON (..), ToJSON, Value, (.=), object ) +import Data.Aeson.WarningParser + ( WithJSONWarnings (..), (..:), jsonSubWarnings + , jsonSubWarningsT, logJSONWarnings, withObjectWarnings + ) import Data.ByteString.Builder ( byteString ) import qualified Data.List.NonEmpty as NE import qualified Data.Map as Map import qualified Data.Text as T import qualified Data.Yaml as Yaml -import Pantry.Internal.AesonExtended - ( FromJSON (..), ToJSON, Value, WithJSONWarnings (..), (.=) - , (..:), jsonSubWarnings, jsonSubWarningsT, logJSONWarnings - , object - , withObjectWarnings - ) import Path ( parent ) import Path.Extended ( addExtension ) import Path.IO ( doesFileExist )
@@ -18,7 +18,7 @@ import Distribution.Package ( mkPackageName ) import qualified Data.Aeson.Types as A import qualified Data.List as L -import Data.Text hiding ( filter, intercalate, pack, reverse ) +import Data.Text ( isPrefixOf ) import qualified Data.Text as T import qualified Data.Text.IO as T import qualified Data.Vector as V
@@ -24,7 +24,7 @@ import Stack.Options.HaddockParser ( haddockOptsParser ) import Stack.Options.Utils ( GlobalOptsContext (..), hideMods ) import Stack.Types.BuildOpts - ( BuildOptsMonoid (..), CabalVerbosity + ( BuildOptsMonoid (..), CabalVerbosity, readProgressBarFormat , toFirstCabalVerbosity ) @@ -58,6 +58,7 @@ <*> splitObjs <*> skipComponents <*> interleavedOutput + <*> progressBar <*> ddumpDir where hideBool = hide0 /= BuildCmdGlobalOpts @@ -198,6 +199,13 @@ "printing concurrent GHC output to the console with a prefix for the \ \package name." hide + progressBar = First <$> optional (option (eitherReader readProgressBarFormat) + ( long "progress-bar" + <> metavar "FORMAT" + <> help "Progress bar format (accepts none, count-only, capped and full). \ + \(default: capped)" + <> hide + )) ddumpDir = optionalFirst (strOption ( long "ddump-dir" <> help "Specify output directory for ddump-files."
@@ -64,10 +64,10 @@ targetCompleter = buildConfigCompleter $ \input -> do packages <- view $ buildConfigL.to (smwProject . bcSMWanted) comps <- for packages ppComponents - pure - $ filter (input `isPrefixOf`) - $ concatMap allComponentNames - $ Map.toList comps + pure $ + concatMap + (filter (input `isPrefixOf`) . allComponentNames) + (Map.toList comps) where allComponentNames (name, comps) = map (T.unpack . renderPkgComponent . (name,)) (Set.toList comps)
@@ -57,6 +57,10 @@ "rsl-in-log" "inclusion of raw snapshot layer (rsl) in logs." hide + <*> firstBoolFlagsFalse + "plan-in-log" + "inclusion of information about build plan construction in logs." + hide <*> configOptsParser currentDir kind <*> optionalFirst (abstractResolverOptsParser hide0) <*> pure (First Nothing) @@ -129,6 +133,7 @@ , globalLogLevel = fromFirst defaultLogLevel globalMonoidLogLevel , globalTimeInLog = fromFirstTrue globalMonoidTimeInLog , globalRSLInLog = fromFirstFalse globalMonoidRSLInLog + , globalPlanInLog = fromFirstFalse globalMonoidPlanInLog , globalConfigMonoid = globalMonoidConfigMonoid , globalResolver = resolver , globalCompiler = getFirst globalMonoidCompiler
@@ -19,7 +19,7 @@ setupOptsParser = SetupCmdOpts <$> OA.optional (OA.argument readVersion ( OA.metavar "GHC_VERSION" - <> OA.help "Version of GHC to install, e.g. 9.2.7. (default: install \ + <> OA.help "Version of GHC to install, e.g. 9.6.2. (default: install \ \the version implied by the resolver)" )) <*> OA.boolFlags False
@@ -51,7 +51,10 @@ import Distribution.Verbosity ( silent ) import Distribution.Version ( anyVersion, mkVersion, orLaterVersion ) -import Path as FL hiding ( replaceExtension ) +import Path + ( (</>), parent, parseAbsDir, parseRelDir, parseRelFile + , stripProperPrefix + ) import Path.Extra ( concatAndCollapseAbsDir, toFilePathNoTrailingSep ) import Stack.Constants (relFileCabalMacrosH, relDirLogs) import Stack.Constants.Config ( distDirFromDir )
@@ -12,7 +12,12 @@ import qualified Data.Text as T import Distribution.CabalSpecVersion ( CabalSpecVersion ) import Distribution.ModuleName ( ModuleName ) -import Distribution.PackageDescription hiding ( FlagName ) +import Distribution.PackageDescription + ( BuildType (..), PackageDescription, benchmarkName + , benchmarks, buildType, dataDir, dataFiles, exeName + , executables, extraSrcFiles, libName, library + , libraryNameString, specVersion, subLibraries, testName + , testSuites ) import Distribution.Simple.Glob ( matchDirFileGlob ) import qualified Distribution.Types.UnqualComponentName as Cabal import Path ( parent, (</>) )
@@ -23,6 +23,8 @@ , bugReport , bugPrettyReport , blankLine + , putUtf8Builder + , putBuilder , ppException , prettyThrowIO , prettyThrowM @@ -46,6 +48,7 @@ , bulletedList , debugBracket , defaultStyles + , displayWithColor , encloseSep , fill , fillSep @@ -78,6 +81,7 @@ , sep , softbreak , softline + , spacedBulletedList , string , style , vsep @@ -102,18 +106,22 @@ import RIO.File as X hiding ( writeBinaryFileAtomic ) import RIO.PrettyPrint ( HasStylesUpdate (..), HasTerm (..), Pretty (..), Style (..) - , StyleDoc, (<+>), align, bulletedList, debugBracket - , displayWithColor, encloseSep, fill, fillSep, flow, hang - , hcat, hsep, indent, line, logLevelToStyle, mkNarrativeList - , parens, prettyDebug, prettyDebugL, prettyError - , prettyErrorL, prettyInfo, prettyInfoL, prettyInfoS - , prettyNote, prettyNoteL, prettyNoteS, prettyWarn - , prettyWarnL, prettyWarnNoIndent, prettyWarnS, punctuate - , sep, softbreak, softline, string, style, stylesUpdateL - , useColorL, vsep + , StyleDoc, (<+>), align, blankLine, bulletedList + , debugBracket, displayWithColor, encloseSep, fill, fillSep + , flow, hang, hcat, hsep, indent, line, logLevelToStyle + , mkNarrativeList, parens, prettyDebug, prettyDebugL + , prettyError, prettyErrorL, prettyGeneric, prettyInfo + , prettyInfoL, prettyInfoS, prettyNote, prettyNoteL + , prettyNoteS, prettyWarn, prettyWarnL, prettyWarnNoIndent + , prettyWarnS, punctuate, sep, softbreak, softline + , spacedBulletedList, string, style, stylesUpdateL, useColorL + , vsep ) import RIO.PrettyPrint.DefaultStyles (defaultStyles) -import RIO.PrettyPrint.PrettyException ( PrettyException (..) ) +import RIO.PrettyPrint.PrettyException + ( PrettyException (..), ppException, prettyThrowIO + , prettyThrowM + ) import RIO.PrettyPrint.StylesUpdate ( StylesUpdate (..), parseStylesUpdateFromString ) import RIO.PrettyPrint.Types ( StyleSpec ) @@ -343,32 +351,14 @@ bugRequest :: String bugRequest = "Please report this bug at Stack's repository." --- | A \'pretty\' blank line. -blankLine :: StyleDoc -blankLine = line <> line - --- | Provide the prettiest available information about an exception. -ppException :: SomeException -> StyleDoc -ppException e = case fromException e of - Just (PrettyException e') -> pretty e' - Nothing -> (string . displayException) e - --- | Synchronously throw the given exception as a 'PrettyException'. -prettyThrowIO :: (Exception e, MonadIO m, Pretty e) => e -> m a -prettyThrowIO = throwIO . PrettyException - --- | Throw the given exception as a 'PrettyException', when the action is run in --- the monad @m@. -prettyThrowM :: (Exception e, MonadThrow m, Pretty e) => e -> m a -prettyThrowM = throwM . PrettyException - -- | Maybe cons. mcons :: Maybe a -> [a] -> [a] mcons ma as = maybe as (:as) ma -prettyGeneric :: - (HasTerm env, HasCallStack, Pretty b, MonadReader env m, MonadIO m) - => LogLevel - -> b - -> m () -prettyGeneric level = logGeneric "" level . display <=< displayWithColor +-- | Write a 'Utf8Builder' to the standard output stream. +putUtf8Builder :: MonadIO m => Utf8Builder -> m () +putUtf8Builder = putBuilder . getUtf8Builder + +-- | Write a 'Builder' to the standard output stream. +putBuilder :: MonadIO m => Builder -> m () +putBuilder = hPutBuilder stdout
@@ -39,8 +39,8 @@ import Distribution.PackageDescription.PrettyPrint ( showGenericPackageDescription ) import Distribution.Version - ( simplifyVersionRange, orLaterVersion, earlierVersion - , hasUpperBound, hasLowerBound + ( earlierVersion, hasLowerBound, hasUpperBound, isAnyVersion + , orLaterVersion, simplifyVersionRange ) import Path ( (</>), parent, parseRelDir, parseRelFile ) import Path.IO ( ensureDir, resolveDir' ) @@ -94,27 +94,38 @@ ) import qualified System.FilePath as FP --- | Type representing exceptions thrown by functions exported by the +-- | Type representing \'pretty\' exceptions thrown by functions exported by the -- "Stack.SDist" module. -data SDistException +data SDistPrettyException = CheckException (NonEmpty Check.PackageCheck) | CabalFilePathsInconsistentBug (Path Abs File) (Path Abs File) | ToTarPathException String deriving (Show, Typeable) -instance Exception SDistException where - displayException (CheckException xs) = unlines $ - [ "Error: [S-6439]" - , "Package check reported the following errors:" - ] <> fmap show (NE.toList xs) - displayException (CabalFilePathsInconsistentBug cabalfp cabalfp') = concat - [ "Error: [S-9595]\n" - , "The impossible happened! Two Cabal file paths are inconsistent: " - , show (cabalfp, cabalfp') - ] - displayException (ToTarPathException e) = - "Error: [S-7875\n" - ++ e +instance Pretty SDistPrettyException where + pretty (CheckException xs) = + "[S-6439]" + <> line + <> flow "Package check reported the following errors:" + <> line + <> bulletedList (map (string . show) (NE.toList xs) :: [StyleDoc]) + pretty (CabalFilePathsInconsistentBug cabalfp cabalfp') = + "[S-9595]" + <> line + <> fillSep + [ flow "The impossible happened! Two Cabal file paths are \ + \inconsistent:" + , pretty cabalfp + , "and" + , pretty cabalfp' <> "." + ] + pretty (ToTarPathException e) = + "[S-7875]" + <> line + <> string e + +instance Exception SDistPrettyException + -- | Type representing command line options for @stack sdist@ command. data SDistOpts = SDistOpts { sdoptsDirsToWorkWith :: [String] @@ -136,15 +147,17 @@ -- If no directories are specified, build all sdist tarballs. dirs' <- if null (sdoptsDirsToWorkWith sdistOpts) then do - dirs <- view $ buildConfigL.to (map ppRoot . Map.elems . smwProject . bcSMWanted) + dirs <- view $ + buildConfigL.to (map ppRoot . Map.elems . smwProject . bcSMWanted) when (null dirs) $ do stackYaml <- view stackYamlL prettyErrorL [ style Shell "stack sdist" - , flow "expects a list of targets, and otherwise defaults to all of the project's packages." - , flow "However, the configuration at" + , flow "expects a list of targets, and otherwise defaults to all \ + \of the project's packages. However, the configuration at" , pretty stackYaml - , flow "contains no packages, so no sdist tarballs will be generated." + , flow "contains no packages, so no sdist tarballs will be \ + \generated." ] exitFailure pure dirs @@ -170,18 +183,18 @@ createDirectoryIfMissing True $ FP.takeDirectory targetTarPath copyFile (toFilePath tarPath) targetTarPath --- | Given the path to a local package, creates its source --- distribution tarball. +-- | Given the path to a local package, creates its source distribution tarball. -- --- While this yields a 'FilePath', the name of the tarball, this --- tarball is not written to the disk and instead yielded as a lazy --- bytestring. +-- While this yields a 'FilePath', the name of the tarball, this tarball is not +-- written to the disk and instead yielded as a lazy bytestring. getSDistTarball :: HasEnvConfig env - => Maybe PvpBounds -- ^ Override Config value - -> Path Abs Dir -- ^ Path to local package + => Maybe PvpBounds + -- ^ Override Config value + -> Path Abs Dir + -- ^ Path to local package -> RIO env (FilePath, L.ByteString, Maybe (PackageIdentifier, L.ByteString)) - -- ^ Filename, tarball contents, and option Cabal file revision to upload + -- ^ Filename, tarball contents, and option Cabal file revision to upload getSDistTarball mpvpBounds pkgDir = do config <- view configL let PvpBounds pvpBounds asRevision = @@ -221,35 +234,33 @@ ] files <- normalizeTarballPaths (map (T.unpack . stripCR . T.pack) (lines fileList)) - -- We're going to loop below and eventually find the cabal - -- file. When we do, we'll upload this reference, if the - -- mpvpBounds value indicates that we should be uploading a cabal - -- file revision. + -- We're going to loop below and eventually find the Cabal file. When we do, + -- we'll upload this reference, if the mpvpBounds value indicates that we + -- should be uploading a Cabal file revision. cabalFileRevisionRef <- liftIO (newIORef Nothing) - -- NOTE: Could make this use lazy I/O to only read files as needed - -- for upload (both GZip.compress and Tar.write are lazy). - -- However, it seems less error prone and more predictable to read - -- everything in at once, so that's what we're doing for now: + -- NOTE: Could make this use lazy I/O to only read files as needed for upload + -- (both GZip.compress and Tar.write are lazy). However, it seems less error + -- prone and more predictable to read everything in at once, so that's what + -- we're doing for now: let tarPath isDir fp = case Tar.toTarPath isDir (forceUtf8Enc (pkgId FP.</> fp)) of - Left e -> throwIO $ ToTarPathException e + Left e -> prettyThrowIO $ ToTarPathException e Right tp -> pure tp - -- convert a String of proper characters to a String of bytes - -- in UTF8 encoding masquerading as characters. This is - -- necessary for tricking the tar package into proper - -- character encoding. + -- convert a String of proper characters to a String of bytes in UTF8 + -- encoding masquerading as characters. This is necessary for tricking the + -- tar package into proper character encoding. forceUtf8Enc = S8.unpack . T.encodeUtf8 . T.pack packWith f isDir fp = liftIO $ f (pkgFp FP.</> fp) =<< tarPath isDir fp packDir = packWith Tar.packDirectoryEntry True packFile fp - -- This is a Cabal file, we're going to tweak it, but only - -- tweak it as a revision. + -- This is a Cabal file, we're going to tweak it, but only tweak it as a + -- revision. | tweakCabal && isCabalFp fp && asRevision = do lbsIdent <- getCabalLbs pvpBounds (Just 1) cabalfp sourceMap liftIO (writeIORef cabalFileRevisionRef (Just lbsIdent)) packWith packFileEntry False fp - -- Same, except we'll include the Cabal file in the - -- original tarball upload. + -- Same, except we'll include the Cabal file in the original tarball + -- upload. | tweakCabal && isCabalFp fp = do (_ident, lbs) <- getCabalLbs pvpBounds Nothing cabalfp sourceMap currTime <- liftIO getPOSIXTime -- Seconds from UNIX epoch @@ -269,23 +280,26 @@ ) -- | Get the PVP bounds-enabled version of the given Cabal file -getCabalLbs :: HasEnvConfig env - => PvpBoundsType - -> Maybe Int -- ^ optional revision - -> Path Abs File -- ^ Cabal file - -> SourceMap - -> RIO env (PackageIdentifier, L.ByteString) +getCabalLbs :: + HasEnvConfig env + => PvpBoundsType + -> Maybe Int -- ^ optional revision + -> Path Abs File -- ^ Cabal file + -> SourceMap + -> RIO env (PackageIdentifier, L.ByteString) getCabalLbs pvpBounds mrev cabalfp sourceMap = do (gpdio, _name, cabalfp') <- loadCabalFilePath (Just stackProgName') (parent cabalfp) gpd <- liftIO $ gpdio NoPrintWarnings unless (cabalfp == cabalfp') $ - throwIO $ CabalFilePathsInconsistentBug cabalfp cabalfp' + prettyThrowIO $ CabalFilePathsInconsistentBug cabalfp cabalfp' installMap <- toInstallMap sourceMap (installedMap, _, _, _) <- getInstalled installMap let internalPackages = Set.fromList $ - gpdPackageName gpd : - map (Cabal.unqualComponentNameToPackageName . fst) (Cabal.condSubLibraries gpd) + gpdPackageName gpd + : map + (Cabal.unqualComponentNameToPackageName . fst) + (Cabal.condSubLibraries gpd) gpd' = gtraverseT (addBounds internalPackages installMap installedMap) gpd gpd'' = case mrev of @@ -301,19 +315,20 @@ } } ident = Cabal.package $ Cabal.packageDescription gpd'' - -- Sanity rendering and reparsing the input, to ensure there are no - -- cabal bugs, since there have been bugs here before, and currently - -- are at the time of writing: + -- Sanity rendering and reparsing the input, to ensure there are no Cabal + -- bugs, since there have been bugs here before, and currently are at the time + -- of writing: -- -- https://github.com/haskell/cabal/issues/1202 -- https://github.com/haskell/cabal/issues/2353 -- https://github.com/haskell/cabal/issues/4863 (current issue) let roundtripErrs = - [ flow "Bug detected in Cabal library. ((parse . render . parse) === \ - \id) does not hold for the Cabal file at" - <+> pretty cabalfp - , "" - ] + fillSep + [ flow "Bug detected in Cabal library. ((parse . render . parse) \ + \=== id) does not hold for the Cabal file at" + , pretty cabalfp + ] + <> blankLine (_warnings, eres) = Cabal.runParseResult $ Cabal.parseGenericPackageDescription $ T.encodeUtf8 @@ -322,64 +337,86 @@ case eres of Right roundtripped | roundtripped == gpd -> pure () - | otherwise -> - prettyWarn $ vsep $ roundtripErrs ++ - [ "This seems to be fixed in development versions of Cabal, but \ - \at time of writing, the fix is not in any released versions." - , "" - , "Please see this GitHub issue for status:" <+> style Url "https://github.com/commercialhaskell/stack/issues/3549" - , "" - , fillSep - [ flow "If the issue is closed as resolved, then you may be \ - \able to fix this by upgrading to a newer version of \ - \Stack via" - , style Shell "stack upgrade" - , flow "for latest stable version or" - , style Shell "stack upgrade --git" - , flow "for the latest development version." - ] - , "" - , fillSep - [ flow "If the issue is fixed, but updating doesn't solve the \ - \problem, please check if there are similar open \ - \issues, and if not, report a new issue to the Stack \ - \issue tracker, at" - , style Url "https://github.com/commercialhaskell/stack/issues/new" - ] - , "" - , flow "If the issue is not fixed, feel free to leave a comment \ - \on it indicating that you would like it to be fixed." - , "" - ] - Left (_version, errs) -> - prettyWarn $ vsep $ roundtripErrs ++ - [ flow "In particular, parsing the rendered Cabal file is yielding a \ - \parse error. Please check if there are already issues \ - \tracking this, and if not, please report new issues to the \ - \Stack and Cabal issue trackers, via" - , bulletedList - [ style Url "https://github.com/commercialhaskell/stack/issues/new" - , style Url "https://github.com/haskell/cabal/issues/new" - ] - , flow $ "The parse error is: " ++ unlines (map show (toList errs)) - , "" - ] + | otherwise -> prettyWarn $ + roundtripErrs + <> flow "This seems to be fixed in development versions of Cabal, \ + \but at time of writing, the fix is not in any released \ + \versions." + <> blankLine + <> fillSep + [ flow "Please see this GitHub issue for status:" + , style Url "https://github.com/commercialhaskell/stack/issues/3549" + ] + <> blankLine + <> fillSep + [ flow "If the issue is closed as resolved, then you may be \ + \able to fix this by upgrading to a newer version of \ + \Stack via" + , style Shell "stack upgrade" + , flow "for latest stable version or" + , style Shell "stack upgrade --git" + , flow "for the latest development version." + ] + <> blankLine + <> fillSep + [ flow "If the issue is fixed, but updating doesn't solve the \ + \problem, please check if there are similar open \ + \issues, and if not, report a new issue to the Stack \ + \issue tracker, at" + , style Url "https://github.com/commercialhaskell/stack/issues/new" + ] + <> blankLine + <> flow "If the issue is not fixed, feel free to leave a comment \ + \on it indicating that you would like it to be fixed." + <> blankLine + Left (_version, errs) -> prettyWarn $ + roundtripErrs + <> flow "In particular, parsing the rendered Cabal file is yielding a \ + \parse error. Please check if there are already issues \ + \tracking this, and if not, please report new issues to the \ + \Stack and Cabal issue trackers, via" + <> line + <> bulletedList + [ style Url "https://github.com/commercialhaskell/stack/issues/new" + , style Url "https://github.com/haskell/cabal/issues/new" + ] + <> line + <> flow ("The parse error is: " <> unlines (map show (toList errs))) + <> blankLine pure ( ident , TLE.encodeUtf8 $ TL.pack $ showGenericPackageDescription gpd'' ) where - addBounds :: Set PackageName -> InstallMap -> InstalledMap -> Dependency -> Dependency - addBounds internalPackages installMap installedMap dep@(Dependency name range s) = + addBounds :: + Set PackageName + -> InstallMap + -> InstalledMap + -> Dependency + -> Dependency + addBounds internalPackages installMap installedMap dep = if name `Set.member` internalPackages then dep else case foundVersion of Nothing -> dep - Just version -> Dependency name (simplifyVersionRange - $ (if toAddUpper && not (hasUpperBound range) then addUpper version else id) - $ (if toAddLower && not (hasLowerBound range) then addLower version else id) - range) s + Just version -> Dependency + name + ( simplifyVersionRange + $ ( if toAddUpper && not (hasUpperBound range) + then addUpper version + else id + ) + -- From Cabal-3.4.0.0, 'hasLowerBound isAnyVersion' is 'True'. + $ ( if toAddLower + && (isAnyVersion range || not (hasLowerBound range)) + then addLower version + else id + ) + range + ) + s where + Dependency name range s = dep foundVersion = case Map.lookup name installMap of Just (_, version) -> Just version @@ -406,9 +443,8 @@ Nothing -> gtraverseT f x Just b -> fromMaybe x (cast (f b))) --- | Read in a 'LocalPackage' config. This makes some default decisions --- about 'LocalPackage' fields that might not be appropriate for other --- use-cases. +-- | Read in a 'LocalPackage' config. This makes some default decisions about +-- 'LocalPackage' fields that might not be appropriate for other use-cases. readLocalPackage :: HasEnvConfig env => Path Abs Dir -> RIO env LocalPackage readLocalPackage pkgDir = do config <- getDefaultPackageConfig @@ -417,7 +453,8 @@ let package = resolvePackage config gpd pure LocalPackage { lpPackage = package - , lpWanted = False -- HACK: makes it so that sdist output goes to a log instead of a file. + , lpWanted = False -- HACK: makes it so that sdist output goes to a log + -- instead of a file. , lpCabalFile = cabalfp -- NOTE: these aren't the 'correct values, but aren't used in -- the usage of this function in this module. @@ -445,7 +482,8 @@ baseConfigOpts <- mkBaseConfigOpts boptsCli locals <- projectLocalPackages withExecuteEnv bopts boptsCli baseConfigOpts locals - [] [] [] Nothing -- provide empty list of globals. This is a hack around custom Setup.hs files + [] [] [] Nothing -- provide empty list of globals. This is a hack around + -- custom Setup.hs files $ \ee -> withSingleContext ac ee task deps (Just "sdist") $ \_package cabalfp _pkgDir cabal _announce _outputType -> do @@ -480,8 +518,8 @@ => [FilePath] -> RIO env [FilePath] normalizeTarballPaths fps = do - -- TODO: consider whether erroring out is better - otherwise the - -- user might upload an incomplete tar? + -- TODO: consider whether erroring out is better - otherwise the user might + -- upload an incomplete tar? unless (null outsideDir) $ prettyWarn $ flow "These files are outside of the package directory, and will be \ @@ -509,8 +547,8 @@ | Set.member x s = s | otherwise = go (Set.insert x s) (FP.takeDirectory x) --- | Check package in given tarball. This will log all warnings --- and will throw an exception in case of critical errors. +-- | Check package in given tarball. This will log all warnings and will throw +-- an exception in case of critical errors. -- -- Note that we temporarily decompress the archive to analyze it. checkSDistTarball :: @@ -519,7 +557,7 @@ -> Path Abs File -- ^ Absolute path to tarball -> RIO env () checkSDistTarball opts tarball = withTempTarGzContents tarball $ \pkgDir' -> do - pkgDir <- (pkgDir' </>) <$> + pkgDir <- (pkgDir' </>) <$> (parseRelDir . FP.takeBaseName . FP.takeBaseName . toFilePath $ tarball) -- ^ drop ".tar" ^ drop ".gz" when (sdoptsBuildTarball opts) @@ -537,7 +575,7 @@ checkPackageInExtractedTarball pkgDir = do (gpdio, name, _cabalfp) <- loadCabalFilePath (Just stackProgName') pkgDir gpd <- liftIO $ gpdio YesPrintWarnings - config <- getDefaultPackageConfig + config <- getDefaultPackageConfig let PackageDescriptionPair pkgDesc _ = resolvePackageDescription config gpd prettyInfoL [ flow "Checking package" @@ -545,20 +583,19 @@ , flow "for common mistakes." ] let pkgChecks = - -- MSS 2017-12-12: Try out a few different variants of - -- pkgDesc to try and provoke an error or warning. I don't - -- know why, but when using `Just pkgDesc`, it appears that - -- Cabal does not detect that `^>=` is used with - -- `cabal-version: 1.24` or earlier. It seems like pkgDesc - -- (the one we create) does not populate the `buildDepends` - -- field, whereas flattenPackageDescription from Cabal - -- does. In any event, using `Nothing` seems more logical - -- for this check anyway, and the fallback to `Just pkgDesc` - -- is just a crazy sanity check. + -- MSS 2017-12-12: Try out a few different variants of pkgDesc to try + -- and provoke an error or warning. I don't know why, but when using + -- `Just pkgDesc`, it appears that Cabal does not detect that `^>=` is + -- used with `cabal-version: 1.24` or earlier. It seems like pkgDesc + -- (the one we create) does not populate the `buildDepends` field, + -- whereas flattenPackageDescription from Cabal does. In any event, + -- using `Nothing` seems more logical for this check anyway, and the + -- fallback to `Just pkgDesc` is just a crazy sanity check. case Check.checkPackage gpd Nothing of [] -> Check.checkPackage gpd (Just pkgDesc) x -> x - fileChecks <- liftIO $ Check.checkPackageFiles minBound pkgDesc (toFilePath pkgDir) + fileChecks <- + liftIO $ Check.checkPackageFiles minBound pkgDesc (toFilePath pkgDir) let checks = pkgChecks ++ fileChecks (errors, warnings) = let criticalIssue (Check.PackageBuildImpossible _) = True @@ -572,7 +609,7 @@ <> bulletedList (map (fromString . show) warnings) case NE.nonEmpty errors of Nothing -> pure () - Just ne -> throwM $ CheckException ne + Just ne -> prettyThrowM $ CheckException ne buildExtractedTarball :: HasEnvConfig env => ResolvedPath Dir -> RIO env () buildExtractedTarball pkgDir = do @@ -584,10 +621,9 @@ pure $ packageName (lpPackage localPackage) == packageName (lpPackage localPackageToBuild) - pathsToKeep - <- fmap Map.fromList - $ flip filterM (Map.toList (smwProject (bcSMWanted (envConfigBuildConfig envConfig)))) - $ fmap not . isPathToRemove . resolvedAbsolute . ppResolvedDir . snd + pathsToKeep <- Map.fromList <$> filterM + (fmap not . isPathToRemove . resolvedAbsolute . ppResolvedDir . snd) + (Map.toList (smwProject (bcSMWanted (envConfigBuildConfig envConfig)))) pp <- mkProjectPackage YesPrintWarnings pkgDir False let adjustEnvForBuild env = let updatedEnvConfig = envConfig @@ -614,7 +650,7 @@ -> L.ByteString -- ^ Tarball contents as a byte string -> RIO env () checkSDistTarball' opts name bytes = withSystemTempDir "stack" $ \tpath -> do - npath <- (tpath </>) <$> parseRelFile name + npath <- (tpath </>) <$> parseRelFile name liftIO $ L.writeFile (toFilePath npath) bytes checkSDistTarball opts npath @@ -634,27 +670,31 @@ -- Copy+modified from the tar package to avoid issues with lazy IO ( see -- https://github.com/commercialhaskell/stack/issues/1344 ) -packFileEntry :: FilePath -- ^ Full path to find the file on the local disk - -> Tar.TarPath -- ^ Path to use for the tar Entry in the archive - -> IO Tar.Entry +packFileEntry :: + FilePath -- ^ Full path to find the file on the local disk + -> Tar.TarPath -- ^ Path to use for the tar Entry in the archive + -> IO Tar.Entry packFileEntry filepath tarpath = do - mtime <- getModTime filepath - perms <- getPermissions filepath + mtime <- getModTime filepath + perms <- getPermissions filepath content <- S.readFile filepath let size = fromIntegral (S.length content) - pure (Tar.simpleEntry tarpath (Tar.NormalFile (L.fromStrict content) size)) { - Tar.entryPermissions = if executable perms - then Tar.executableFilePermissions - else Tar.ordinaryFilePermissions, - Tar.entryTime = mtime - } + entryContent = Tar.NormalFile (L.fromStrict content) size + entry = Tar.simpleEntry tarpath entryContent + pure entry + { Tar.entryPermissions = if executable perms + then Tar.executableFilePermissions + else Tar.ordinaryFilePermissions + , Tar.entryTime = mtime + } getModTime :: FilePath -> IO Tar.EpochTime getModTime path = do t <- getModificationTime path pure $ floor . utcTimeToPOSIXSeconds $ t -getDefaultPackageConfig :: (MonadIO m, MonadReader env m, HasEnvConfig env) +getDefaultPackageConfig :: + (MonadIO m, MonadReader env m, HasEnvConfig env) => m PackageConfig getDefaultPackageConfig = do platform <- view platformL
@@ -181,7 +181,8 @@ pure $ root </> relDirScripts </> escapedRelDir else pure scriptDir - let dropExtension path = fst <$> splitExtension path + -- path does not necessarily end with an extension. + let dropExtension path = pure $ maybe path fst $ splitExtension path exe <- if osIsWindows then replaceExtension ".exe" (outputDir </> scriptFile)
@@ -29,6 +29,9 @@ import Control.Applicative ( empty ) import Crypto.Hash ( SHA1 (..), SHA256 (..) ) import qualified Data.Aeson.KeyMap as KeyMap +import Data.Aeson.Types ( Value (..) ) +import Data.Aeson.WarningParser + ( WithJSONWarnings (..), logJSONWarnings ) import qualified Data.Attoparsec.Text as P import qualified Data.ByteString as S import qualified Data.ByteString.Lazy as LBS @@ -40,6 +43,7 @@ import Data.Conduit.Zlib ( ungzip ) import Data.List.Split ( splitOn ) import qualified Data.Map as Map +import Data.Maybe ( fromJust ) import qualified Data.Set as Set import qualified Data.Text as T import qualified Data.Text.Lazy as TL @@ -61,16 +65,19 @@ , verifiedDownloadWithProgress, withResponse ) import Network.HTTP.Simple ( getResponseHeader ) -import Pantry.Internal.AesonExtended - ( Value (..), WithJSONWarnings (..), logJSONWarnings ) import Path - ( (</>), addExtension, dirname, filename, parent, parseAbsDir - , parseAbsFile, parseRelDir, parseRelFile, toFilePath + ( (</>), addExtension, filename, fromAbsDir, parent + , parseAbsDir, parseAbsFile, parseRelDir, parseRelFile + , toFilePath ) import Path.CheckInstall ( warnInstallSearchPathIssues ) import Path.Extended ( fileExtension ) import Path.Extra ( toFilePathNoTrailingSep ) -import Path.IO hiding ( findExecutable, withSystemTempDir ) +import Path.IO + ( canonicalizePath, doesFileExist, ensureDir, executable + , getPermissions, ignoringAbsence, listDir, removeDirRecur + , renameDir, renameFile, resolveFile', withTempDir + ) import RIO.List ( headMaybe, intercalate, intersperse, isPrefixOf , maximumByMaybe, sort, sortOn, stripPrefix ) @@ -78,18 +85,21 @@ ( EnvVars, HasProcessContext (..), ProcessContext , augmentPath, augmentPathMap, doesExecutableExist, envVarsL , exeSearchPathL, getStdout, mkProcessContext, modifyEnvVars - , proc, readProcess_, readProcessStdout, readProcessStdout_ - , runProcess, runProcess_, setStdout, waitExitCode - , withModifyEnvVars, withProcessWait, withWorkingDir - , workingDirL + , proc, readProcess_, readProcessStdout, runProcess + , runProcess_, setStdout, waitExitCode, withModifyEnvVars + , withProcessWait, withWorkingDir, workingDirL ) import Stack.Build.Haddock ( shouldHaddockDeps ) import Stack.Build.Source ( hashSourceMapData, loadSourceMap ) import Stack.Build.Target ( NeedTargets (..), parseTargets ) +import Stack.Config.ConfigureScript ( ensureConfigureScript ) import Stack.Constants - ( cabalPackageName, hadrianScriptsPosix - , hadrianScriptsWindows, relDirBin, relDirUsr, relFile7zdll - , relFile7zexe, relFileConfigure, relFileLibgmpSo10 + ( cabalPackageName, ghcBootScript,ghcConfigureMacOS + , ghcConfigurePosix, ghcConfigureWindows, hadrianScriptsPosix + , hadrianScriptsWindows, libDirs, osIsMacOS, osIsWindows + , relDirBin, relDirUsr, relFile7zdll, relFile7zexe + , relFileConfigure, relFileHadrianStackDotYaml + , relFileLibcMuslx86_64So1, relFileLibgmpSo10 , relFileLibgmpSo3, relFileLibncurseswSo6, relFileLibtinfoSo5 , relFileLibtinfoSo6, relFileMainHs, relFileStack , relFileStackDotExe, relFileStackDotTmp @@ -138,6 +148,7 @@ ) import Stack.Types.EnvSettings ( EnvSettings (..), minimalEnvSettings ) import Stack.Types.ExtraDirs ( ExtraDirs (..) ) +import Stack.Types.FileDigestCache ( newFileDigestCache ) import Stack.Types.GHCDownloadInfo ( GHCDownloadInfo (..) ) import Stack.Types.GHCVariant ( GHCVariant (..), HasGHCVariant (..), ghcVariantName @@ -156,9 +167,9 @@ import qualified System.Directory as D import System.Environment ( getExecutablePath, lookupEnv ) import System.IO.Error ( isPermissionError ) -import System.FilePath ( searchPathSeparator ) +import System.FilePath ( searchPathSeparator, takeDrive ) import qualified System.FilePath as FP -import System.Permissions ( osIsWindows, setFileExecutable ) +import System.Permissions ( setFileExecutable ) import System.Uname ( getRelease ) -- | Type representing exceptions thrown by functions exported by the @@ -209,6 +220,7 @@ | GHCInfoMissingTargetPlatform | GHCInfoTargetPlatformInvalid !String | CabalNotFound !(Path Abs File) + | GhcBootScriptNotFound | HadrianScriptNotFound | URLInvalid !String | UnknownArchiveExtension !String @@ -432,6 +444,10 @@ [ flow "Cabal library not found in global package database for" , pretty compiler <> "." ] + pretty GhcBootScriptNotFound = + "[S-8488]" + <> line + <> flow "No GHC boot script found." pretty HadrianScriptNotFound = "[S-1128]" <> line @@ -653,9 +669,12 @@ sourceMapHash <- hashSourceMapData boptsCLI sourceMap pure (sourceMap, sourceMapHash) + fileDigestCache <- newFileDigestCache + let envConfig0 = EnvConfig { envConfigBuildConfig = bc , envConfigBuildOptsCLI = boptsCLI + , envConfigFileDigestCache = fileDigestCache , envConfigSourceMap = sourceMap , envConfigSourceMapHash = sourceMapHash , envConfigCompilerPaths = compilerPaths @@ -767,6 +786,7 @@ } } , envConfigBuildOptsCLI = boptsCLI + , envConfigFileDigestCache = fileDigestCache , envConfigSourceMap = sourceMap , envConfigSourceMapHash = sourceMapHash , envConfigCompilerPaths = compilerPaths @@ -833,6 +853,71 @@ set processContextL pc env runRIO envg inner +-- | A modified environment which we know has MSYS2 on the PATH. +newtype WithMSYS env = WithMSYS env + +insideMSYSL :: Lens' (WithMSYS env) env +insideMSYSL = lens (\(WithMSYS x) -> x) (\(WithMSYS _) -> WithMSYS) + +instance HasLogFunc env => HasLogFunc (WithMSYS env) where + logFuncL = insideMSYSL.logFuncL + +instance HasRunner env => HasRunner (WithMSYS env) where + runnerL = insideMSYSL.runnerL + +instance HasProcessContext env => HasProcessContext (WithMSYS env) where + processContextL = insideMSYSL.processContextL + +instance HasStylesUpdate env => HasStylesUpdate (WithMSYS env) where + stylesUpdateL = insideMSYSL.stylesUpdateL + +instance HasTerm env => HasTerm (WithMSYS env) where + useColorL = insideMSYSL.useColorL + termWidthL = insideMSYSL.termWidthL + +instance HasPantryConfig env => HasPantryConfig (WithMSYS env) where + pantryConfigL = insideMSYSL.pantryConfigL + +instance HasConfig env => HasPlatform (WithMSYS env) where + platformL = configL.platformL + {-# INLINE platformL #-} + platformVariantL = configL.platformVariantL + {-# INLINE platformVariantL #-} + +instance HasConfig env => HasGHCVariant (WithMSYS env) where + ghcVariantL = configL.ghcVariantL + {-# INLINE ghcVariantL #-} + +instance HasConfig env => HasConfig (WithMSYS env) where + configL = insideMSYSL.configL + +instance HasBuildConfig env => HasBuildConfig (WithMSYS env) where + buildConfigL = insideMSYSL.buildConfigL + +-- | Set up a modified environment which includes the modified PATH that MSYS2 +-- can be found on. +runWithMSYS :: + HasConfig env + => Maybe ExtraDirs + -> RIO (WithMSYS env) a + -> RIO env a +runWithMSYS mmsysPaths inner = do + env <- ask + pc0 <- view processContextL + pc <- case mmsysPaths of + Nothing -> pure pc0 + Just msysPaths -> do + envars <- either throwM pure $ + augmentPathMap + (map toFilePath $ edBins msysPaths) + (view envVarsL pc0) + mkProcessContext envars + let envMsys + = WithMSYS $ + set envOverrideSettingsL (\_ -> pure pc) $ + set processContextL pc env + runRIO envMsys inner + -- | special helper for GHCJS which needs an updated source map -- only project dependencies should get included otherwise source map hash will -- get changed and EnvConfig will become inconsistent @@ -894,16 +979,16 @@ ensureCompilerAndMsys sopts = do getSetupInfo' <- memoizeRef getSetupInfo mmsys2Tool <- ensureMsys sopts getSetupInfo' - msysPaths <- maybe (pure Nothing) (fmap Just . extraDirs) mmsys2Tool - + mmsysPaths <- maybe (pure Nothing) (fmap Just . extraDirs) mmsys2Tool actual <- either throwIO pure $ wantedToActual $ soptsWantedCompiler sopts didWarn <- warnUnsupportedCompiler $ getGhcVersion actual - - (cp, ghcPaths) <- ensureCompiler sopts getSetupInfo' + -- Modify the initial environment to include the MSYS2 path, if MSYS2 is being + -- used + (cp, ghcPaths) <- runWithMSYS mmsysPaths $ ensureCompiler sopts getSetupInfo' warnUnsupportedCompilerCabal cp didWarn - let paths = maybe ghcPaths (ghcPaths <>) msysPaths + let paths = maybe ghcPaths (ghcPaths <>) mmsysPaths pure (cp, paths) -- | See <https://github.com/commercialhaskell/stack/issues/4246> @@ -921,9 +1006,9 @@ , style Url "https://github.com/commercialhaskell/stack/issues/648" <> "." ] pure True - | ghcVersion >= mkVersion [9, 5] -> do + | ghcVersion >= mkVersion [9, 7] -> do prettyWarnL - [ flow "Stack has not been tested with GHC versions above 9.6, and \ + [ flow "Stack has not been tested with GHC versions 9.8 and above, and \ \using" , fromString (versionString ghcVersion) <> "," , flow "this may fail." @@ -945,19 +1030,19 @@ let cabalVersion = cpCabalVersion cp if - | cabalVersion < mkVersion [1, 19, 2] -> do + | cabalVersion < mkVersion [1, 24, 0] -> do prettyWarnL - [ flow "Stack no longer supports Cabal versions below 1.19.2, but \ + [ flow "Stack no longer supports Cabal versions below 1.24.0.0, but \ \version" , fromString (versionString cabalVersion) , flow "was found. This invocation will most likely fail. To fix \ \this, either use an older version of Stack or a newer \ - \resolver. Acceptable resolvers: lts-3.0/nightly-2015-05-05 \ + \resolver. Acceptable resolvers: lts-7.0/nightly-2016-05-26 \ \or later." ] - | cabalVersion >= mkVersion [3, 9] -> + | cabalVersion >= mkVersion [3, 11] -> prettyWarnL - [ flow "Stack has not been tested with Cabal versions above 3.10, \ + [ flow "Stack has not been tested with Cabal versions 3.12 and above, \ \but version" , fromString (versionString cabalVersion) , flow "was found, this may fail." @@ -1067,12 +1152,12 @@ (soptsStackYaml sopts) suggestion --- | Ensure compiler is installed, without worrying about msys +-- | Ensure compiler is installed. ensureCompiler :: forall env. (HasConfig env, HasBuildConfig env, HasGHCVariant env) => SetupOpts -> Memoized SetupInfo - -> RIO env (CompilerPaths, ExtraDirs) + -> RIO (WithMSYS env) (CompilerPaths, ExtraDirs) ensureCompiler sopts getSetupInfo' = do let wanted = soptsWantedCompiler sopts wc <- either throwIO (pure . whichCompiler) $ wantedToActual wanted @@ -1094,7 +1179,7 @@ isWanted = isWantedCompiler (soptsCompilerCheck sopts) (soptsWantedCompiler sopts) - let checkCompiler :: Path Abs File -> RIO env (Maybe CompilerPaths) + let checkCompiler :: Path Abs File -> RIO (WithMSYS env) (Maybe CompilerPaths) checkCompiler compiler = do eres <- tryAny $ pathsFromCompiler wc CompilerBuildStandard False compiler >>= canUseCompiler @@ -1193,7 +1278,7 @@ HasBuildConfig env => SetupOpts -> Memoized SetupInfo - -> RIO env (CompilerPaths, ExtraDirs) + -> RIO (WithMSYS env) (CompilerPaths, ExtraDirs) ensureSandboxedCompiler sopts getSetupInfo' = do let wanted = soptsWantedCompiler sopts -- List installed tools @@ -1413,45 +1498,81 @@ -> [Tool] -> CompilerRepository -> Text + -- ^ Commit ID. -> Text - -> RIO env (Tool, CompilerBuild) + -- ^ Hadrain flavour. + -> RIO (WithMSYS env) (Tool, CompilerBuild) buildGhcFromSource getSetupInfo' installed (CompilerRepository url) commitId flavour = do config <- view configL let compilerTool = ToolGhcGit commitId flavour - -- detect when the correct GHC is already installed if compilerTool `elem` installed - then pure (compilerTool,CompilerBuildStandard) + then pure (compilerTool, CompilerBuildStandard) else -- clone the repository and execute the given commands withRepo (SimpleRepo url commitId RepoGit) $ do -- withRepo is guaranteed to set workingDirL, so let's get it mcwd <- traverse parseAbsDir =<< view workingDirL cwd <- maybe (throwIO WorkingDirectoryInvalidBug) pure mcwd - threads <- view $ configL.to configJobs - let hadrianArgs = fmap T.unpack - [ "-c" -- run ./boot and ./configure - , "-j" <> tshow threads -- parallel build - , "--flavour=" <> flavour -- selected flavour - , "binary-dist" - ] + let threads = configJobs config + relFileHadrianStackDotYaml' = toFilePath relFileHadrianStackDotYaml + ghcBootScriptPath = cwd </> ghcBootScript + boot = if osIsWindows + then proc "python3" ["boot"] runProcess_ + else + proc (toFilePath ghcBootScriptPath) [] runProcess_ + stack args = proc "stack" args'' runProcess_ + where + args'' = "--stack-yaml=" <> relFileHadrianStackDotYaml' : args' + -- If a resolver is specified on the command line, Stack will + -- apply it. This allows the resolver specified in Hadrian's + -- stack.yaml file to be overridden. + args' = maybe args addResolver (configResolver config) + addResolver resolver = "--resolver=" <> show resolver : args + happy = stack ["install", "happy"] + alex = stack ["install", "alex"] + -- Executed in the Stack environment, because GHC is required. + configure = stack ("exec" : "--" : ghcConfigure) + ghcConfigure + | osIsWindows = ghcConfigureWindows + | osIsMacOS = ghcConfigureMacOS + | otherwise = ghcConfigurePosix hadrianScripts | osIsWindows = hadrianScriptsWindows | otherwise = hadrianScriptsPosix - + hadrianArgs = fmap T.unpack + [ "-j" <> tshow threads -- parallel build + , "--flavour=" <> flavour -- selected flavour + , "binary-dist" + ] foundHadrianPaths <- filterM doesFileExist $ (cwd </>) <$> hadrianScripts hadrianPath <- maybe (prettyThrowIO HadrianScriptNotFound) pure $ listToMaybe foundHadrianPaths - + exists <- doesFileExist ghcBootScriptPath + unless exists $ prettyThrowIO GhcBootScriptNotFound + ensureConfigureScript cwd + logInfo "Running GHC boot script..." + boot + doesExecutableExist "happy" >>= \case + True -> logInfo "happy executable installed on the PATH." + False -> do + logInfo "Installing happy executable..." + happy + doesExecutableExist "alex" >>= \case + True -> logInfo "alex executable installed on the PATH." + False -> do + logInfo "Installing alex executable..." + alex + logInfo "Running GHC configure script..." + configure logSticky $ "Building GHC from source with `" <> display flavour <> "` flavour. It can take a long time (more than one hour)..." - - -- We need to provide an absolute path to the script since - -- the process package only sets working directory _after_ - -- discovering the executable + -- We need to provide an absolute path to the script since the process + -- package only sets working directory _after_ discovering the + -- executable. proc (toFilePath hadrianPath) hadrianArgs runProcess_ -- find the bindist and install it @@ -1548,36 +1669,41 @@ | osIsWindows = -- Cannot parse /usr/lib on Windows pure False - | otherwise = do + | otherwise = hasMatches lib usrLibDirs -- This is a workaround for the fact that libtinfo.so.x doesn't -- appear in the 'ldconfig -p' output on Arch or Slackware even -- when it exists. There doesn't seem to be an easy way to get the -- true list of directories to scan for shared libs, but this -- works for our particular cases. - matches <- filterM (doesFileExist .(</> lib)) usrLibDirs - case matches of - [] -> - logDebug - ( "Did not find shared library " - <> libD - ) - >> pure False - (path:_) -> - logDebug - ( "Found shared library " - <> libD - <> " in " - <> fromString (Path.toFilePath path) - ) - >> pure True where + libD = fromString (toFilePath lib) libT = T.pack (toFilePath lib) + hasMatches lib dirs = do + matches <- filterM (doesFileExist .(</> lib)) dirs + case matches of + [] -> + logDebug + ( "Did not find shared library " + <> libD + ) + >> pure False + (path:_) -> + logDebug + ( "Found shared library " + <> libD + <> " in " + <> fromString (Path.toFilePath path) + ) + >> pure True + where libD = fromString (toFilePath lib) getLibc6Version = do elddOut <- - proc "ldd" ["--version"] $ tryAny . readProcessStdout_ + -- On Alpine Linux, 'ldd --version' will send output to stderr, + -- which we wish to smother. + proc "ldd" ["--version"] $ tryAny . readProcess_ pure $ case elddOut of - Right lddOut -> + Right (lddOut, _) -> let lddOut' = decodeUtf8Lenient (LBS.toStrict lddOut) in case P.parse lddVersion lddOut' of @@ -1599,6 +1725,7 @@ lddMinorVersion <- P.decimal P.skip (not . isDigit) pure $ mkVersion [ lddMajorVersion, lddMinorVersion ] + hasMusl <- hasMatches relFileLibcMuslx86_64So1 libDirs mLibc6Version <- getLibc6Version case mLibc6Version of Just libc6Version -> logDebug $ @@ -1613,17 +1740,21 @@ hasncurses6 <- checkLib relFileLibncurseswSo6 hasgmp5 <- checkLib relFileLibgmpSo10 hasgmp4 <- checkLib relFileLibgmpSo3 - let libComponents = concat - [ if hastinfo6 && hasgmp5 - then - if hasLibc6_2_32 - then [["tinfo6"]] - else [["tinfo6-libc6-pre232"]] - else [[]] - , [[] | hastinfo5 && hasgmp5] - , [["ncurses6"] | hasncurses6 && hasgmp5 ] - , [["gmp4"] | hasgmp4 ] - ] + let libComponents = if hasMusl + then + [ ["musl"] ] + else + concat + [ if hastinfo6 && hasgmp5 + then + if hasLibc6_2_32 + then [["tinfo6"]] + else [["tinfo6-libc6-pre232"]] + else [[]] + , [ [] | hastinfo5 && hasgmp5 ] + , [ ["ncurses6"] | hasncurses6 && hasgmp5 ] + , [ ["gmp4"] | hasgmp4 ] + ] useBuilds $ map (\c -> case c of [] -> CompilerBuildStandard @@ -1676,7 +1807,8 @@ ensureDockerStackExe :: HasConfig env => Platform -> RIO env (Path Abs File) ensureDockerStackExe containerPlatform = do config <- view configL - containerPlatformDir <- runReaderT platformOnlyRelDir (containerPlatform,PlatformVariantNone) + containerPlatformDir <- + runReaderT platformOnlyRelDir (containerPlatform,PlatformVariantNone) let programsPath = configLocalProgramsBase config </> containerPlatformDir tool = Tool (PackageIdentifier (mkPackageName "stack") stackVersion) stackExeDir <- installDir programsPath tool @@ -1700,7 +1832,7 @@ -- | Get all executables on the path that might match the wanted compiler sourceSystemCompilers :: - (HasProcessContext env, HasLogFunc env) + (HasLogFunc env, HasProcessContext env) => WantedCompiler -> ConduitT i (Path Abs File) (RIO env) () sourceSystemCompilers wanted = do @@ -1742,10 +1874,11 @@ logJSONWarnings urlOrFile warnings pure si -getInstalledTool :: [Tool] -- ^ already installed - -> PackageName -- ^ package to find - -> (Version -> Bool) -- ^ which versions are acceptable - -> Maybe Tool +getInstalledTool :: + [Tool] -- ^ already installed + -> PackageName -- ^ package to find + -> (Version -> Bool) -- ^ which versions are acceptable + -> Maybe Tool getInstalledTool installed name goodVersion = Tool <$> maximumByMaybe (comparing pkgVersion) (filterTools name goodVersion installed) @@ -1774,30 +1907,36 @@ liftIO $ ignoringAbsence (removeDirRecur tempDir) pure tool -downloadAndInstallCompiler :: (HasBuildConfig env, HasGHCVariant env) - => CompilerBuild - -> SetupInfo - -> WantedCompiler - -> VersionCheck - -> Maybe String - -> RIO env Tool +-- Exceptions thrown by this function are caught by +-- 'downloadAndInstallPossibleCompilers'. +downloadAndInstallCompiler :: + (HasBuildConfig env, HasGHCVariant env) + => CompilerBuild + -> SetupInfo + -> WantedCompiler + -> VersionCheck + -> Maybe String + -> RIO env Tool downloadAndInstallCompiler ghcBuild si wanted@(WCGhc version) versionCheck mbindistURL = do ghcVariant <- view ghcVariantL (selectedVersion, downloadInfo) <- case mbindistURL of Just bindistURL -> do case ghcVariant of GHCCustom _ -> pure () - _ -> prettyThrowM RequireCustomGHCVariant - pure (version, GHCDownloadInfo mempty mempty DownloadInfo - { downloadInfoUrl = T.pack bindistURL - , downloadInfoContentLength = Nothing - , downloadInfoSha1 = Nothing - , downloadInfoSha256 = Nothing - }) + _ -> throwM RequireCustomGHCVariant + pure + ( version + , GHCDownloadInfo mempty mempty DownloadInfo + { downloadInfoUrl = T.pack bindistURL + , downloadInfoContentLength = Nothing + , downloadInfoSha1 = Nothing + , downloadInfoSha256 = Nothing + } + ) _ -> do ghcKey <- getGhcKey ghcBuild case Map.lookup ghcKey $ siGHCs si of - Nothing -> prettyThrowM $ UnknownOSKey ghcKey + Nothing -> throwM $ UnknownOSKey ghcKey Just pairs_ -> getWantedCompilerInfo ghcKey versionCheck wanted ACGhc pairs_ config <- view configL @@ -1812,8 +1951,8 @@ GHCStandard -> [] v -> ["(" <> fromString (ghcVariantName v) <> ")"] <> case ghcBuild of - CompilerBuildStandard -> [] - b -> ["(" <> fromString (compilerBuildName b) <> ")"] + CompilerBuildStandard -> [] + b -> ["(" <> fromString (compilerBuildName b) <> ")"] <> [ flow "to an isolated location. This will not interfere with any \ \system-level installation." ] @@ -1829,19 +1968,22 @@ downloadAndInstallCompiler _ _ WCGhcjs{} _ _ = throwIO GhcjsNotSupported downloadAndInstallCompiler _ _ WCGhcGit{} _ _ = - prettyThrowIO DownloadAndInstallCompilerError + throwIO DownloadAndInstallCompilerError -getWantedCompilerInfo :: (Ord k, MonadThrow m) - => Text - -> VersionCheck - -> WantedCompiler - -> (k -> ActualCompiler) - -> Map k a - -> m (k, a) +-- Exceptions thrown by this function are caught by +-- 'downloadAndInstallPossibleCompilers'. +getWantedCompilerInfo :: + (Ord k, MonadThrow m) + => Text + -> VersionCheck + -> WantedCompiler + -> (k -> ActualCompiler) + -> Map k a + -> m (k, a) getWantedCompilerInfo key versionCheck wanted toCV pairs_ = case mpair of Just pair -> pure pair - Nothing -> prettyThrowM $ + Nothing -> throwM $ UnknownCompilerVersion (Set.singleton key) wanted @@ -1856,13 +1998,13 @@ -- | Download and install the first available compiler build. downloadAndInstallPossibleCompilers :: - (HasGHCVariant env, HasBuildConfig env) - => [CompilerBuild] - -> SetupInfo - -> WantedCompiler - -> VersionCheck - -> Maybe String - -> RIO env (Tool, CompilerBuild) + (HasGHCVariant env, HasBuildConfig env) + => [CompilerBuild] + -> SetupInfo + -> WantedCompiler + -> VersionCheck + -> Maybe String + -> RIO env (Tool, CompilerBuild) downloadAndInstallPossibleCompilers possibleCompilers si wanted versionCheck mbindistURL = go possibleCompilers Nothing where @@ -1911,9 +2053,7 @@ <> T.pack (ghcVariantSuffix ghcVariant) <> T.pack (compilerBuildSuffix ghcBuild) -getOSKey :: (MonadThrow m) - => Platform - -> m Text +getOSKey :: (MonadThrow m) => Platform -> m Text getOSKey platform = case platform of Platform I386 Cabal.Linux -> pure "linux32" @@ -1963,8 +2103,8 @@ } = downloadInfo when (isJust contentLength) $ prettyWarnS - "`content-length` is not checked and should not be specified when \ - \`url` is a file path." + "`content-length` is not checked and should not be specified when \ + \`url` is a file path." when (isJust sha1) $ prettyWarnS "`sha1` is not checked and should not be specified when `url` is a \ @@ -2012,14 +2152,15 @@ | TarGz | SevenZ -installGHCPosix :: HasConfig env - => GHCDownloadInfo - -> SetupInfo - -> Path Abs File - -> ArchiveType - -> Path Abs Dir - -> Path Abs Dir - -> RIO env () +installGHCPosix :: + HasConfig env + => GHCDownloadInfo + -> SetupInfo + -> Path Abs File + -> ArchiveType + -> Path Abs Dir + -> Path Abs Dir + -> RIO env () installGHCPosix downloadInfo _ archiveFile archiveType tempDir destDir = do platform <- view platformL menv0 <- view processContextL @@ -2130,13 +2271,14 @@ Left _ -> y Right x' -> pure $ Right x' -installGHCWindows :: HasBuildConfig env - => SetupInfo - -> Path Abs File - -> ArchiveType - -> Path Abs Dir - -> Path Abs Dir - -> RIO env () +installGHCWindows :: + HasBuildConfig env + => SetupInfo + -> Path Abs File + -> ArchiveType + -> Path Abs Dir + -> Path Abs Dir + -> RIO env () installGHCWindows si archiveFile archiveType _tempDir destDir = do withUnpackedTarball7z "GHC" si archiveFile archiveType destDir prettyInfoL @@ -2144,13 +2286,14 @@ , pretty destDir <> "." ] -installMsys2Windows :: HasBuildConfig env - => SetupInfo - -> Path Abs File - -> ArchiveType - -> Path Abs Dir - -> Path Abs Dir - -> RIO env () +installMsys2Windows :: + HasBuildConfig env + => SetupInfo + -> Path Abs File + -> ArchiveType + -> Path Abs Dir + -> Path Abs Dir + -> RIO env () installMsys2Windows si archiveFile archiveType _tempDir destDir = do exists <- liftIO $ D.doesDirectoryExist $ toFilePath destDir when exists $ @@ -2159,10 +2302,9 @@ withUnpackedTarball7z "MSYS2" si archiveFile archiveType destDir - -- I couldn't find this officially documented anywhere, but you need to run - -- the MSYS shell once in order to initialize some pacman stuff. Once that - -- run happens, you can just run commands as usual. + -- the MSYS shell once in order to initialize some pacman stuff. Once that run + -- happens, you can just run commands as usual. menv0 <- view processContextL newEnv0 <- modifyEnvVars menv0 $ Map.insert "MSYSTEM" "MSYS" newEnv <- either throwM pure $ augmentPathMap @@ -2179,15 +2321,16 @@ -- Install git. We could install other useful things in the future too. -- runCmd (Cmd (Just destDir) "pacman" menv ["-Sy", "--noconfirm", "git"]) Nothing --- | Unpack a compressed tarball using 7zip. Expects a single directory in --- the unpacked results, which is renamed to the destination directory. -withUnpackedTarball7z :: HasBuildConfig env - => String -- ^ Name of tool, used in error messages - -> SetupInfo - -> Path Abs File -- ^ Path to archive file - -> ArchiveType - -> Path Abs Dir -- ^ Destination directory. - -> RIO env () +-- | Unpack a compressed tarball using 7zip. Expects a single directory in the +-- unpacked results, which is renamed to the destination directory. +withUnpackedTarball7z :: + HasBuildConfig env + => String -- ^ Name of tool, used in error messages + -> SetupInfo + -> Path Abs File -- ^ Path to archive file + -> ArchiveType + -> Path Abs Dir -- ^ Destination directory. + -> RIO env () withUnpackedTarball7z name si archiveFile archiveType destDir = do suffix <- case archiveType of @@ -2200,15 +2343,26 @@ Nothing -> prettyThrowIO $ TarballFileInvalid name archiveFile Just x -> parseRelFile $ T.unpack x run7z <- setup7z si - let tmpName = toFilePathNoTrailingSep (dirname destDir) ++ "-tmp" + -- We use a short name for the temporary directory to reduce the risk of a + -- filepath length of more than 260 characters, which can be problematic for + -- 7-Zip even if Long Filepaths are enabled on Windows. + let tmpName = "stack-tmp" + destDrive = fromJust $ parseAbsDir $ takeDrive $ fromAbsDir destDir ensureDir (parent destDir) withRunInIO $ \run -> - withTempDir (parent destDir) tmpName $ \tmpDir -> + -- We use a temporary directory in the same drive as that of 'destDir' to + -- reduce the risk of a filepath length of more than 260 characters, which can + -- be problematic for 7-Zip even if Long Filepaths are enabled on Windows. We + -- do not use the system temporary directory as it may be on a different + -- drive. + withTempDir destDrive tmpName $ \tmpDir -> run $ do liftIO $ ignoringAbsence (removeDirRecur destDir) run7z tmpDir archiveFile run7z tmpDir (tmpDir </> tarFile) absSrcDir <- expectSingleUnpackedDir archiveFile tmpDir + -- On Windows, 'renameDir' does not work across drives. However, we have + -- ensured that 'tmpDir' has the same drive as 'destDir'. renameDir absSrcDir destDir expectSingleUnpackedDir :: @@ -2216,8 +2370,8 @@ => Path Abs File -> Path Abs Dir -> m (Path Abs Dir) -expectSingleUnpackedDir archiveFile destDir = do - contents <- listDir destDir +expectSingleUnpackedDir archiveFile unpackDir = do + contents <- listDir unpackDir case contents of ([dir], _ ) -> pure dir _ -> prettyThrowIO $ UnknownArchiveStructure archiveFile @@ -2225,9 +2379,10 @@ -- | Download 7z as necessary, and get a function for unpacking things. -- -- Returned function takes an unpack directory and archive. -setup7z :: (HasBuildConfig env, MonadIO m) - => SetupInfo - -> RIO env (Path Abs Dir -> Path Abs File -> m ()) +setup7z :: + (HasBuildConfig env, MonadIO m) + => SetupInfo + -> RIO env (Path Abs Dir -> Path Abs File -> m ()) setup7z si = do dir <- view $ configL.to configLocalPrograms ensureDir dir @@ -2278,11 +2433,12 @@ liftIO $ prettyThrowM (ProblemWhileDecompressing archive) _ -> prettyThrowM SetupInfoMissingSevenz -chattyDownload :: HasTerm env - => Text -- ^ label - -> DownloadInfo -- ^ URL, content-length, sha1, and sha256 - -> Path Abs File -- ^ destination - -> RIO env () +chattyDownload :: + HasTerm env + => Text -- ^ label + -> DownloadInfo -- ^ URL, content-length, sha1, and sha256 + -> Path Abs File -- ^ destination + -> RIO env () chattyDownload label downloadInfo path = do let url = downloadInfoUrl downloadInfo req <- parseUrlThrow $ T.unpack url @@ -2324,8 +2480,10 @@ mtotalSize = downloadInfoContentLength downloadInfo -- | Perform a basic sanity check of GHC -sanityCheck :: (HasProcessContext env, HasLogFunc env) - => Path Abs File -> RIO env () +sanityCheck :: + (HasLogFunc env, HasProcessContext env) + => Path Abs File + -> RIO env () sanityCheck ghc = withSystemTempDir "stack-sanity-check" $ \dir -> do let fp = toFilePath $ dir </> relFileMainHs liftIO $ S.writeFile fp $ T.encodeUtf8 $ T.pack $ unlines @@ -2336,6 +2494,12 @@ eres <- withWorkingDir (toFilePath dir) $ proc (toFilePath ghc) [ fp , "-no-user-package-db" + -- Required to stop GHC looking for a package environment in default + -- locations. + , "-hide-all-packages" + -- Required because GHC flag -hide-all-packages is passed. + , "-package base" + , "-package Cabal" -- required for "import Distribution.Simple" ] $ try . readProcess_ case eres of Left e -> prettyThrowIO $ GHCSanityCheckCompileFailed e ghc @@ -2355,7 +2519,8 @@ -- https://github.com/commercialhaskell/stack/issues/3444 Map.delete "GHCRTS" --- | Get map of environment variables to set to change the GHC's encoding to UTF-8 +-- | Get map of environment variables to set to change the GHC's encoding to +-- UTF-8. getUtf8EnvVars :: (HasPlatform env, HasProcessContext env, HasTerm env) => ActualCompiler @@ -2505,7 +2670,7 @@ deriving Show downloadStackReleaseInfo :: - (HasPlatform env, HasLogFunc env) + (HasLogFunc env, HasPlatform env) => Maybe String -- GitHub org -> Maybe String -- GitHub repo -> Maybe String -- ^ optional version @@ -2615,8 +2780,9 @@ then pure $ SRIGitHub $ getResponseBody res else prettyThrowIO $ StackReleaseInfoNotFound url -preferredPlatforms :: (MonadReader env m, HasPlatform env, MonadThrow m) - => m [(Bool, String)] +preferredPlatforms :: + (MonadReader env m, HasPlatform env, MonadThrow m) + => m [(Bool, String)] preferredPlatforms = do Platform arch' os' <- view platformL (isWindows, os) <- @@ -2631,11 +2797,14 @@ I386 -> pure "i386" X86_64 -> pure "x86_64" Arm -> pure "arm" + AArch64 -> pure "aarch64" _ -> prettyThrowM $ BinaryUpgradeOnArchUnsupported arch' let hasgmp4 = False -- FIXME import relevant code from Stack.Setup? -- checkLib $(mkRelFile "libgmp.so.3") suffixes + -- 'gmp4' ceased to be relevant after Stack 1.9.3 (December 2018). | hasgmp4 = ["-static", "-gmp4", ""] + -- 'static' will cease to be relevant after Stack 2.11.1 (May 2023). | otherwise = ["-static", ""] pure $ map (\suffix -> (isWindows, concat [os, "-", arch, suffix])) suffixes
@@ -30,7 +30,7 @@ ( mkMigrate, mkPersist, persistLowerCase, share , sqlSettings ) -import qualified Pantry.Internal as SQLite +import Pantry.SQLite ( initStorage, withStorage_ ) import Stack.Prelude import Stack.Storage.Util ( handleMigrationException, updateList, updateSet ) @@ -90,7 +90,7 @@ -> (ProjectStorage -> RIO env a) -> RIO env a initProjectStorage fp f = handleMigrationException $ - SQLite.initStorage "Stack" migrateAll fp $ f . ProjectStorage + initStorage "Stack" migrateAll fp $ f . ProjectStorage -- | Run an action in a database transaction withProjectStorage :: @@ -99,7 +99,7 @@ -> RIO env a withProjectStorage inner = do storage <- view (buildConfigL . to bcProjectStorage . to unProjectStorage) - SQLite.withStorage_ storage inner + withStorage_ storage inner -- | Key used to retrieve configuration or flag cache type ConfigCacheKey = Unique ConfigCacheParent
@@ -39,7 +39,7 @@ ) import Distribution.Text ( simpleParse, display ) import Foreign.C.Types ( CTime (..) ) -import qualified Pantry.Internal as SQLite +import Pantry.SQLite ( initStorage, withStorage_ ) import Path ( (</>), mkRelFile, parseRelFile ) import Path.IO ( resolveFile', resolveDir' ) import qualified RIO.FilePath as FP @@ -159,7 +159,7 @@ -> (UserStorage -> RIO env a) -> RIO env a initUserStorage fp f = handleMigrationException $ - SQLite.initStorage "Stack" migrateAll fp $ f . UserStorage + initStorage "Stack" migrateAll fp $ f . UserStorage -- | Run an action in a database transaction withUserStorage :: @@ -168,7 +168,7 @@ -> RIO env a withUserStorage inner = do storage <- view (configL . to configUserStorage . to unUserStorage) - SQLite.withStorage_ storage inner + withStorage_ storage inner -- | Key used to retrieve the precompiled cache type PrecompiledCacheKey = Unique PrecompiledCacheParent
@@ -8,7 +8,7 @@ ) where import qualified Data.ByteString.Lazy as LB -import qualified Data.Text as T +import qualified Data.Text.IO as T import Network.HTTP.StackClient ( HttpException (..), getResponseBody, httpLbs, parseUrlThrow , setGitHubHeaders @@ -69,7 +69,7 @@ (prettyThrowM . DownloadTemplatesHelpFailed) case decodeUtf8' $ LB.toStrict $ getResponseBody resp of Left err -> prettyThrowM $ TemplatesHelpEncodingInvalid url err - Right txt -> prettyInfo (string $ T.unpack txt) + Right txt -> liftIO $ T.putStrLn txt -- | Default web URL to get the `stack templates` help output. defaultTemplatesHelpUrl :: String
@@ -4,9 +4,9 @@ ( AllowNewerDeps (..) ) where +import Data.Aeson.Types ( FromJSON (..) ) import qualified Distribution.PackageDescription as C import Generics.Deriving.Monoid ( mappenddefault, memptydefault ) -import Pantry.Internal.AesonExtended ( FromJSON (..) ) import Stack.Prelude newtype AllowNewerDeps
@@ -5,7 +5,7 @@ ( ApplyGhcOptions (..) ) where -import Pantry.Internal.AesonExtended ( FromJSON (..), withText ) +import Data.Aeson.Types ( FromJSON (..), withText ) import Stack.Prelude -- | Which packages do ghc-options on the command line apply to?
@@ -5,7 +5,7 @@ ( ApplyProgOptions (..) ) where -import Pantry.Internal.AesonExtended ( FromJSON (..), withText ) +import Data.Aeson.Types ( FromJSON (..), withText ) import Stack.Prelude -- | Which packages do all and any --PROG-option options on the command line
@@ -257,6 +257,7 @@ [ConstructPlanException] (Path Abs File) (Path Abs Dir) + Bool -- Is the project the implicit global project? ParentMap (Set PackageName) (Map PackageName [PackageName]) @@ -283,13 +284,13 @@ deriving (Show, Typeable) instance Pretty BuildPrettyException where - pretty ( ConstructPlanFailed errs stackYaml stackRoot parents wanted prunedGlobalDeps ) = + pretty ( ConstructPlanFailed errs stackYaml stackRoot isImplicitGlobal parents wanted prunedGlobalDeps ) = "[S-4804]" <> line <> flow "Stack failed to construct a build plan." <> blankLine <> pprintExceptions - errs stackYaml stackRoot parents wanted prunedGlobalDeps + errs stackYaml stackRoot isImplicitGlobal parents wanted prunedGlobalDeps pretty (ExecutionFailure es) = "[S-7282]" <> line @@ -426,46 +427,84 @@ [ConstructPlanException] -> Path Abs File -> Path Abs Dir + -> Bool -> ParentMap -> Set PackageName -> Map PackageName [PackageName] -> StyleDoc -pprintExceptions exceptions stackYaml stackRoot parentMap wanted' prunedGlobalDeps = - mconcat $ - [ flow "While constructing the build plan, Stack encountered the \ - \following errors:" - , blankLine - , mconcat (L.intersperse blankLine (mapMaybe pprintException exceptions')) - ] ++ if L.null recommendations - then [] - else - [ blankLine - , flow "Some different approaches to resolving this:" - , blankLine - ] ++ recommendations - +pprintExceptions exceptions stackYaml stackRoot isImplicitGlobal parentMap wanted' prunedGlobalDeps = + fillSep + [ flow + ( "While constructing the build plan, Stack encountered the \ + \following errors" + <> if hasConfigurationRefs then "." else ":" + ) + , if hasConfigurationRefs + then flow + "The 'Stack configuration' refers to the set of package versions \ + \specified by the snapshot (after any dropped packages, or pruned \ + \GHC boot packages; if a boot package is replaced, Stack prunes \ + \all other such packages that depend on it) and any extra-deps:" + else mempty + ] + <> blankLine + <> mconcat (L.intersperse blankLine (mapMaybe pprintException exceptions')) + <> if L.null recommendations + then mempty + else + blankLine + <> flow "Some different approaches to resolving some or all of this:" + <> blankLine + <> indent 2 (spacedBulletedList recommendations) where exceptions' = {- should we dedupe these somehow? nubOrd -} exceptions recommendations = - if not onlyHasDependencyMismatches - then [] - else - [ " *" <+> align (fillSep - [ "Set" - , style Shell (flow "allow-newer: true") - , "in" - , pretty (defaultUserConfigPath stackRoot) - , flow "to ignore all version constraints and build anyway." - ]) - , blankLine - ] - ++ addExtraDepsRecommendations + [ allowNewerMsg True False | onlyHasDependencyMismatches ] + <> [ fillSep + $ allowNewerMsg False onlyHasDependencyMismatches + : flow "add these package names under" + : style Shell "allow-newer-deps" <> ":" + : mkNarrativeList (Just Shell) False + (map (fromString . packageNameString) (Set.elems pkgsWithMismatches) :: [StyleDoc]) + | not $ Set.null pkgsWithMismatches + ] + <> addExtraDepsRecommendations + where + allowNewerMsg isAll isRepetitive = fillSep + $ flow "To ignore" + : (if isAll then "all" else "certain") + : flow "version constraints and build anyway," + : if isRepetitive + then ["also"] + else + [ fillSep + $ [ "in" + , pretty (defaultUserConfigPath stackRoot) + , flow + ( "(global configuration)" + <> if isImplicitGlobal then "," else mempty + ) + ] + <> ( if isImplicitGlobal + then [] + else + [ "or" + , pretty stackYaml + , flow "(project-level configuration)," + ] + ) + <> [ "set" + , style Shell (flow "allow-newer: true") + <> if isAll then "." else mempty + ] + <> [ "and" | not isAll ] + ] addExtraDepsRecommendations | Map.null extras = [] | (Just _) <- Map.lookup (mkPackageName "base") extras = - [ " *" <+> align (fillSep + [ fillSep [ flow "Build requires unattainable version of the" , style Current "base" , flow "package. Since" @@ -473,35 +512,21 @@ , flow "is a part of GHC, you most likely need to use a \ \different GHC version with the matching" , style Current "base"<> "." - ]) - , line + ] ] | otherwise = - [ " *" <+> align (fillSep - [ style Recommendation (flow "Recommended action:") - , flow "try adding the following to your" - , style Shell "extra-deps" - , "in" - , pretty stackYaml <> ":" - ]) - , blankLine - , vsep (map pprintExtra (Map.toList extras)) - , line - ] + [ fillSep + [ style Recommendation (flow "Recommended action:") + , flow "try adding the following to your" + , style Shell "extra-deps" + , "in" + , pretty stackYaml + , "(project-level configuration):" + ] + <> blankLine + <> vsep (map pprintExtra (Map.toList extras)) + ] - extras = Map.unions $ map getExtras exceptions' - getExtras DependencyCycleDetected{} = Map.empty - getExtras UnknownPackage{} = Map.empty - getExtras (DependencyPlanFailures _ m) = - Map.unions $ map go $ Map.toList m - where - -- TODO: Likely a good idea to distinguish these to the user. In - -- particular, for DependencyMismatch - go (name, (_range, Just (version,cabalHash), NotInBuildPlan)) = - Map.singleton name (version,cabalHash) - go (name, (_range, Just (version,cabalHash), DependencyMismatch{})) = - Map.singleton name (version, cabalHash) - go _ = Map.empty pprintExtra (name, (version, BlobKey cabalHash cabalSize)) = let cfInfo = CFIHash cabalHash (Just cabalSize) packageIdRev = PackageIdentifierRevision name version cfInfo @@ -515,16 +540,38 @@ (Map.toList pDeps) toNotInBuildPlan _ = [] - -- This checks if 'allow-newer: true' could resolve all issues. - onlyHasDependencyMismatches = all go exceptions' + (onlyHasDependencyMismatches, hasConfigurationRefs, extras, pkgsWithMismatches) = + filterExceptions + + filterExceptions :: + ( Bool + -- ^ All the errors are DependencyMismatch. This checks if + -- 'allow-newer: true' could resolve all reported issues. + , Bool + -- ^ One or more messages refer to 'the Stack configuration'. This + -- triggers a message to explain what that phrase means. + , Map PackageName (Version, BlobKey) + -- ^ Recommended extras. TO DO: Likely a good idea to distinguish these to + -- the user. In particular, those recommended for DependencyMismatch. + , Set.Set PackageName + -- ^ Set of names of packages with one or more DependencyMismatch errors. + ) + filterExceptions = L.foldl go acc0 exceptions' where - go DependencyCycleDetected{} = False - go UnknownPackage{} = False - go (DependencyPlanFailures _ m) = - all (\(_, _, depErr) -> isMismatch depErr) (M.elems m) - isMismatch DependencyMismatch{} = True - isMismatch Couldn'tResolveItsDependencies{} = True - isMismatch _ = False + acc0 = (True, False, Map.empty, Set.empty) + go acc (DependencyPlanFailures pkg m) = Map.foldrWithKey go' acc m + where + pkgName = packageName pkg + go' name (_, Just extra, NotInBuildPlan) (_, _, m', s) = + (False, True, Map.insert name extra m', s) + go' _ (_, _, NotInBuildPlan) (_, _, m', s) = (False, True, m', s) + go' name (_, Just extra, DependencyMismatch _) (p1, _, m', s) = + (p1, True, Map.insert name extra m', Set.insert pkgName s) + go' _ (_, _, DependencyMismatch _) (p1, _, m', s) = + (p1, True, m', Set.insert pkgName s) + go' _ (_, _, Couldn'tResolveItsDependencies _) acc' = acc' + go' _ _ (_, p2, m', s) = (False, p2, m', s) + go (_, p2, m, s) _ = (False, p2, m, s) pprintException (DependencyCycleDetected pNames) = Just $ flow "Dependency cycle detected in packages:" @@ -537,28 +584,31 @@ case mapMaybe pprintDep (Map.toList pDeps) of [] -> Nothing depErrors -> Just $ - flow "In the dependencies for" <+> pkgIdent <> - pprintFlags (packageFlags pkg) <> ":" <> line <> - indent 4 (vsep depErrors) <> - case getShortestDepsPath parentMap wanted' (packageName pkg) of - Nothing -> - line - <> flow "needed for unknown reason - stack invariant violated." - Just [] -> - line - <> fillSep - [ flow "needed since" - , pkgName' - , flow "is a build target." - ] - Just (target:path) -> - line - <> flow "needed due to" <+> encloseSep "" "" " -> " pathElems - where - pathElems = - [style Target . fromString . packageIdentifierString $ target] ++ - map (fromString . packageIdentifierString) path ++ - [pkgIdent] + fillSep + [ flow "In the dependencies for" + , pkgIdent <> pprintFlags (packageFlags pkg) <> ":" + ] + <> line + <> indent 2 (bulletedList depErrors) + <> case getShortestDepsPath parentMap wanted' (packageName pkg) of + Nothing -> + line + <> flow "needed for unknown reason - Stack invariant violated." + Just [] -> + line + <> fillSep + [ flow "needed since" + , pkgName' + , flow "is a build target." + ] + Just (target:path) -> + line + <> flow "needed due to" <+> encloseSep "" "" " -> " pathElems + where + pathElems = + [style Target . fromString . packageIdentifierString $ target] + <> map (fromString . packageIdentifierString) path + <> [pkgIdent] where pkgName' = style Current . fromString . packageNameString $ packageName pkg @@ -579,9 +629,9 @@ in Just $ fillSep [ flow "Can't use GHC boot package" , style Current . fromString . packageNameString $ name - , flow "when it has an overridden dependency (issue #4510);" - , flow "you need to add the following as explicit dependencies \ - \to the project:" + , flow "when it depends on a replaced boot package. You need to \ + \add the following as explicit dependencies to the \ + \project:" , line , encloseSep "" "" ", " prunedDeps ] @@ -598,79 +648,79 @@ pprintDep (name, (range, mlatestApplicable, badDep)) = case badDep of NotInBuildPlan - | name `elem` fold prunedGlobalDeps -> Just $ - style Error (fromString $ packageNameString name) <+> - align - ( ( if range == C.anyVersion - then flow "needed" - else flow "must match" <+> goodRange - ) - <> "," - <> softline - <> fillSep - [ flow "but this GHC boot package has been pruned (issue \ - \#4510); you need to add the package explicitly to \ - \extra-deps" - ,latestApplicable Nothing - ] - ) - | otherwise -> Just $ - style Error (fromString $ packageNameString name) <+> - align - ( ( if range == C.anyVersion - then flow "needed" - else flow "must match" <+> goodRange - ) - <> "," - <> softline - <> fillSep - [ flow "but the Stack configuration has no specified version" - , latestApplicable Nothing - ] - ) + | name `elem` fold prunedGlobalDeps -> butMsg $ fillSep + [ flow "this GHC boot package has been pruned from the Stack \ + \configuration. You need to add the package explicitly to" + , style Shell "extra-deps" <> "." + ] + | otherwise -> butMsg $ inconsistentMsg Nothing -- TODO: For local packages, suggest editing constraints - DependencyMismatch version -> Just $ - style - Error - (fromString . packageIdentifierString $ PackageIdentifier name version) - <+> - align - ( fillSep - [ flow "from Stack configuration does not match" - , goodRange - , latestApplicable (Just version) - ] - ) + DependencyMismatch version -> butMsg $ inconsistentMsg $ Just version -- I think the main useful info is these explain why missing packages are -- needed. Instead lets give the user the shortest path from a target to the -- package. Couldn'tResolveItsDependencies _version -> Nothing - HasNoLibrary -> Just $ - style Error (fromString $ packageNameString name) <+> - align (flow "is a library dependency, but the package provides no library") - BDDependencyCycleDetected names -> Just $ - style Error (fromString $ packageNameString name) <+> - align - ( flow $ "dependency cycle detected: " + HasNoLibrary -> Just $ fillSep + [ errorName + , flow "is a library dependency, but the package provides no library." + ] + BDDependencyCycleDetected names -> Just $ fillSep + [ errorName + , flow $ "dependency cycle detected: " ++ L.intercalate ", " (map packageNameString names) - ) + ] where + errorName = style Error . fromString . packageNameString $ name goodRange = style Good (fromString (C.display range)) + rangeMsg = if range == C.anyVersion + then "needed," + else fillSep + [ flow "must match" + , goodRange <> "," + ] + butMsg msg = Just $ fillSep + [ errorName + , rangeMsg + , "but" + , msg + , latestApplicable Nothing + ] + inconsistentMsg mVersion = fillSep + [ style Error $ maybe + ( flow "no version" ) + ( fromString . packageIdentifierString . PackageIdentifier name ) + mVersion + , flow "is in the Stack configuration" + ] latestApplicable mversion = case mlatestApplicable of Nothing - | isNothing mversion -> - flow "(no package with that name found, perhaps there is a typo \ - \in a package's build-depends or an omission from the \ - \stack.yaml packages list?)" + | isNothing mversion -> fillSep + [ flow "(no matching package and version found. Perhaps there is \ + \an error in the specification of a package's" + , style Shell "dependencies" + , "or" + , style Shell "build-tools" + , flow "(Hpack) or" + , style Shell "build-depends" <> "," + , style Shell "build-tools" + , "or" + , style Shell "build-tool-depends" + , flow "(Cabal file)" + , flow "or an omission from the" + , style Shell "packages" + , flow "list in" + , pretty stackYaml + , flow "(project-level configuration).)" + ] | otherwise -> "" Just (laVer, _) | Just laVer == mversion -> - flow "(latest matching version is specified)" + flow "(latest matching version is specified)." | otherwise -> fillSep [ flow "(latest matching version is" - , style Good (fromString $ versionString laVer) <> ")" + , style Good (fromString $ versionString laVer) <> ")." ] data ConstructPlanException
@@ -13,6 +13,8 @@ , BuildOptsCLI (..) , boptsCLIAllProgOptions , BuildOptsMonoid (..) + , ProgressBarFormat (..) + , readProgressBarFormat , buildOptsMonoidBenchmarksL , buildOptsMonoidHaddockL , buildOptsMonoidInstallExesL @@ -34,15 +36,16 @@ , toFirstCabalVerbosity ) where +import Data.Aeson.Types ( FromJSON (..), withText ) +import Data.Aeson.WarningParser + ( WithJSONWarnings, (..:?), (..!=), jsonSubWarnings + , withObjectWarnings + ) import qualified Data.Map.Strict as Map import qualified Data.Text as T import Distribution.Parsec ( Parsec (..), simpleParsec ) import Distribution.Verbosity ( Verbosity, normal, verbose ) import Generics.Deriving.Monoid ( mappenddefault, memptydefault ) -import Pantry.Internal.AesonExtended - ( FromJSON (..), WithJSONWarnings, (..:?), (..!=) - , jsonSubWarnings, withObjectWarnings, withText - ) import Stack.Prelude -- | Build options that is interpreted by the build command. This is built up @@ -100,6 +103,8 @@ , boptsInterleavedOutput :: !Bool -- ^ Should we use the interleaved GHC output when building -- multiple packages? + , boptsProgressBar :: !ProgressBarFormat + -- ^ Format of the progress bar , boptsDdumpDir :: !(Maybe Text) } deriving Show @@ -132,6 +137,7 @@ , boptsSplitObjs = defaultFirstFalse buildMonoidSplitObjs , boptsSkipComponents = [] , boptsInterleavedOutput = defaultFirstTrue buildMonoidInterleavedOutput + , boptsProgressBar = CappedBar , boptsDdumpDir = Nothing } @@ -245,6 +251,7 @@ , buildMonoidSplitObjs :: !FirstFalse , buildMonoidSkipComponents :: ![Text] , buildMonoidInterleavedOutput :: !FirstTrue + , buildMonoidProgressBar :: !(First ProgressBarFormat) , buildMonoidDdumpDir :: !(First Text) } deriving (Generic, Show) @@ -294,6 +301,8 @@ o ..:? buildMonoidSkipComponentsName ..!= mempty buildMonoidInterleavedOutput <- FirstTrue <$> o ..:? buildMonoidInterleavedOutputName + buildMonoidProgressBar <- + First <$> o ..:? buildMonoidProgressBarName buildMonoidDdumpDir <- o ..:? buildMonoidDdumpDirName ..!= mempty pure BuildOptsMonoid{..} @@ -375,6 +384,9 @@ buildMonoidInterleavedOutputName :: Text buildMonoidInterleavedOutputName = "interleaved-output" +buildMonoidProgressBarName :: Text +buildMonoidProgressBarName = "progress-bar" + buildMonoidDdumpDirName :: Text buildMonoidDdumpDirName = "ddump-dir" @@ -589,3 +601,26 @@ buildOptsHaddockL = lens boptsHaddock (\bopts t -> bopts {boptsHaddock = t}) + +-- Type representing formats of Stack's progress bar when building. +data ProgressBarFormat + = NoBar -- No progress bar at all. + | CountOnlyBar -- A bar that only counts packages. + | CappedBar -- A bar capped at a length equivalent to the terminal's width. + | FullBar -- A full progress bar. + deriving (Eq, Show) + +instance FromJSON ProgressBarFormat where + parseJSON = withText "ProgressBarFormat" $ \t -> either + fail + pure + (readProgressBarFormat $ T.unpack t) + +-- | Parse ProgressBarFormat from a String. +readProgressBarFormat :: String -> Either String ProgressBarFormat +readProgressBarFormat s + | s == "none" = pure NoBar + | s == "count-only" = pure CountOnlyBar + | s == "capped" = pure CappedBar + | s == "full" = pure FullBar + | otherwise = Left $ "Invalid progress bar format: " ++ s
@@ -6,11 +6,11 @@ , parseCabalConfigKey ) where -import qualified Data.Text as T -import Pantry.Internal.AesonExtended +import Data.Aeson.Types ( FromJSON (..), FromJSONKey (..), FromJSONKeyFunction (..) , withText ) +import qualified Data.Text as T import Stack.Prelude -- | Which packages do configure opts apply to?
@@ -0,0 +1,57 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} + +-- | Casa configuration types. + +module Stack.Types.Casa + ( CasaOptsMonoid (..) + ) where + +import Data.Aeson.Types ( FromJSON (..) ) +import Data.Aeson.WarningParser + ( WithJSONWarnings, (..:?), withObjectWarnings ) +import Casa.Client ( CasaRepoPrefix ) +import Generics.Deriving.Monoid ( mappenddefault, memptydefault ) +import Stack.Prelude + +-- | An uninterpreted representation of Casa configuration options. +-- Configurations may be "cascaded" using mappend (left-biased). +data CasaOptsMonoid = CasaOptsMonoid + { casaMonoidEnable :: !FirstTrue + , casaMonoidRepoPrefix :: !(First CasaRepoPrefix) + , casaMonoidMaxKeysPerRequest :: !(First Int) + } + deriving (Generic, Show) + +-- | Decode uninterpreted Casa configuration options from JSON/YAML. +instance FromJSON (WithJSONWarnings CasaOptsMonoid) where + parseJSON = withObjectWarnings "CasaOptsMonoid" + ( \o -> do + casaMonoidEnable <- FirstTrue <$> o ..:? casaEnableName + casaMonoidRepoPrefix <- First <$> o ..:? casaRepoPrefixName + casaMonoidMaxKeysPerRequest <- + First <$> o ..:? casaMaxKeysPerRequestName + pure CasaOptsMonoid {..} + ) + +-- | Left-biased combine Casa configuration options +instance Semigroup CasaOptsMonoid where + (<>) = mappenddefault + +-- | Left-biased combine Casa configurations options +instance Monoid CasaOptsMonoid where + mempty = memptydefault + mappend = (<>) + +-- | Casa configuration enable setting name. +casaEnableName :: Text +casaEnableName = "enable" + +-- | Casa configuration repository prefix setting name. +casaRepoPrefixName :: Text +casaRepoPrefixName = "repo-prefix" + +-- | Casa configuration maximum keys per request setting name. +casaMaxKeysPerRequestName :: Text +casaMaxKeysPerRequestName = "max-keys-per-request"
@@ -6,9 +6,9 @@ , readColorWhen ) where +import Data.Aeson.Types ( FromJSON (..) ) import Options.Applicative ( ReadM ) import qualified Options.Applicative.Types as OA -import Pantry.Internal.AesonExtended ( FromJSON (..) ) import Stack.Prelude data ColorWhen
@@ -7,9 +7,9 @@ , parseCompilerBuild ) where -import Stack.Prelude -import Pantry.Internal.AesonExtended ( FromJSON, parseJSON, withText ) +import Data.Aeson.Types ( FromJSON, parseJSON, withText ) import Data.Text as T +import Stack.Prelude data CompilerBuild = CompilerBuildStandard
@@ -5,6 +5,7 @@ , GhcPkgExe (..) , HasCompiler (..) , cabalVersionL + , compilerVersionL , cpWhich , getCompilerPath , getGhcPkgExe @@ -61,6 +62,9 @@ cabalVersionL :: HasCompiler env => SimpleGetter env Version cabalVersionL = compilerPathsL.to cpCabalVersion + +compilerVersionL :: HasCompiler env => SimpleGetter env ActualCompiler +compilerVersionL = compilerPathsL.to cpCompilerVersion cpWhich :: (MonadReader env m, HasCompiler env) => m WhichCompiler cpWhich = view $ compilerPathsL.to (whichCompiler.cpCompilerVersion)
@@ -27,6 +27,7 @@ , prettyStackDevL ) where +import Casa.Client ( CasaRepoPrefix ) import Distribution.System ( Platform ) import Path ( (</>), parent, reldir, relfile ) import RIO.Process ( HasProcessContext (..), ProcessContext ) @@ -182,6 +183,8 @@ -- ^ Use --no-run and --compile options when using `stack script` , configStackDeveloperMode :: !Bool -- ^ Turn on Stack developer mode for additional messages? + , configCasa :: !(Maybe (CasaRepoPrefix, Int)) + -- ^ Optional Casa configuration } -- | The project root directory, if in a project.
@@ -12,6 +12,12 @@ , configMonoidSystemGHCName ) where +import Data.Aeson.Types ( Object, Value ) +import Data.Aeson.WarningParser + ( WarningParser, WithJSONWarnings, (..:?), (..!=) + , jsonSubWarnings, jsonSubWarningsT, jsonSubWarningsTT + , withObjectWarnings + ) import Casa.Client ( CasaRepoPrefix ) import Control.Monad.Writer ( tell ) import Data.Coerce ( coerce ) @@ -22,16 +28,12 @@ import qualified Data.Yaml as Yaml import Distribution.Version ( anyVersion ) import Generics.Deriving.Monoid ( mappenddefault, memptydefault ) -import Pantry.Internal.AesonExtended - ( Object, Value, WarningParser, WithJSONWarnings, (..:?) - , (..!=), jsonSubWarnings, jsonSubWarningsT - , jsonSubWarningsTT, withObjectWarnings - ) import Stack.Prelude import Stack.Types.AllowNewerDeps ( AllowNewerDeps ) import Stack.Types.ApplyGhcOptions ( ApplyGhcOptions (..) ) import Stack.Types.ApplyProgOptions ( ApplyProgOptions (..) ) import Stack.Types.BuildOpts ( BuildOptsMonoid ) +import Stack.Types.Casa ( CasaOptsMonoid ) import Stack.Types.CabalConfigKey ( CabalConfigKey ) import Stack.Types.ColorWhen ( ColorWhen ) import Stack.Types.Compiler ( CompilerRepository ) @@ -166,7 +168,10 @@ -- ^ See 'configHideSourcePaths' , configMonoidRecommendUpgrade :: !FirstTrue -- ^ See 'configRecommendUpgrade' + , configMonoidCasaOpts :: !CasaOptsMonoid + -- ^ Casa configuration options. , configMonoidCasaRepoPrefix :: !(First CasaRepoPrefix) + -- ^ Casa repository prefix (deprecated). , configMonoidSnapshotLocation :: !(First Text) -- ^ Custom location of LTS/Nightly snapshots , configMonoidNoRunCompile :: !FirstFalse @@ -333,7 +338,8 @@ FirstTrue <$> obj ..:? configMonoidHideSourcePathsName configMonoidRecommendUpgrade <- FirstTrue <$> obj ..:? configMonoidRecommendUpgradeName - + configMonoidCasaOpts <- + jsonSubWarnings (obj ..:? configMonoidCasaOptsName ..!= mempty) configMonoidCasaRepoPrefix <- First <$> obj ..:? configMonoidCasaRepoPrefixName configMonoidSnapshotLocation <- @@ -508,6 +514,9 @@ configMonoidRecommendUpgradeName :: Text configMonoidRecommendUpgradeName = "recommend-stack-upgrade" + +configMonoidCasaOptsName :: Text +configMonoidCasaOptsName = "casa" configMonoidCasaRepoPrefixName :: Text configMonoidCasaRepoPrefixName = "casa-repo-prefix"
@@ -5,11 +5,10 @@ ( Curator (..) ) where +import Data.Aeson.Types ( FromJSON (..), ToJSON (..), (.=), object ) +import Data.Aeson.WarningParser + ( WithJSONWarnings (..), (..:?), (..!=), withObjectWarnings ) import qualified Data.Set as Set -import Pantry.Internal.AesonExtended - ( FromJSON (..), ToJSON (..), WithJSONWarnings (..), (.=) - , (..:?), (..!=), object, withObjectWarnings - ) import Stack.Prelude -- | Extra configuration intended exclusively for usage by the curator tool. In
@@ -42,17 +42,23 @@ , reExecArgName ) where +import Data.Aeson.Types ( FromJSON (..), withText ) +import Data.Aeson.WarningParser + ( WithJSONWarnings, (..:), (..:?), (..!=), withObjectWarnings + ) import Data.List ( intercalate ) import qualified Data.Text as T -import Distribution.System ( Platform (..), OS (..), Arch (..) ) -import Distribution.Text ( simpleParse, display ) +import Distribution.System ( Arch (..), OS (..), Platform (..) ) +import Distribution.Text ( display, simpleParse ) import Distribution.Version ( anyVersion ) import Generics.Deriving.Monoid ( mappenddefault, memptydefault ) -import Pantry.Internal.AesonExtended -import Path +import Path ( parseAbsFile ) import Stack.Constants ( stackProgName ) import Stack.Prelude hiding ( Display (..) ) import Stack.Types.Version + ( IntersectingVersionRange (..), VersionRange + , versionRangeText + ) import Text.Read ( Read (..) ) -- | Type representing exceptions thrown by functions exported by the @@ -249,11 +255,11 @@ , dockerDetach :: !Bool -- ^ Whether to run a detached container , dockerPersist :: !Bool - -- ^ Create a persistent container (don't remove it when finished). Implied by - -- `dockerDetach`. + -- ^ Create a persistent container (don't remove it when finished). Implied + -- by `dockerDetach`. , dockerContainerName :: !(Maybe String) - -- ^ Container name to use, only makes sense from command-line with `dockerPersist` - -- or `dockerDetach`. + -- ^ Container name to use, only makes sense from command-line with + -- `dockerPersist` or `dockerDetach`. , dockerNetwork :: !(Maybe String) -- ^ The network docker uses. , dockerRunArgs :: ![String] @@ -273,43 +279,45 @@ } deriving Show --- | An uninterpreted representation of docker options. --- Configurations may be "cascaded" using mappend (left-biased). +-- | An uninterpreted representation of docker options. Configurations may be +-- "cascaded" using mappend (left-biased). data DockerOptsMonoid = DockerOptsMonoid { dockerMonoidDefaultEnable :: !Any - -- ^ Should Docker be defaulted to enabled (does @docker:@ section exist in the config)? + -- ^ Should Docker be defaulted to enabled (does @docker:@ section exist in + -- the config)? , dockerMonoidEnable :: !(First Bool) - -- ^ Is using Docker enabled? + -- ^ Is using Docker enabled? , dockerMonoidRepoOrImage :: !(First DockerMonoidRepoOrImage) - -- ^ Docker repository name (e.g. @fpco/stack-build@ or @fpco/stack-full:lts-2.8@) + -- ^ Docker repository name (e.g. @fpco/stack-build@ or + -- @fpco/stack-full:lts-2.8@) , dockerMonoidRegistryLogin :: !(First Bool) - -- ^ Does registry require login for pulls? + -- ^ Does registry require login for pulls? , dockerMonoidRegistryUsername :: !(First String) - -- ^ Optional username for Docker registry. + -- ^ Optional username for Docker registry. , dockerMonoidRegistryPassword :: !(First String) - -- ^ Optional password for Docker registry. + -- ^ Optional password for Docker registry. , dockerMonoidAutoPull :: !FirstTrue - -- ^ Automatically pull new images. + -- ^ Automatically pull new images. , dockerMonoidDetach :: !FirstFalse - -- ^ Whether to run a detached container + -- ^ Whether to run a detached container , dockerMonoidPersist :: !FirstFalse - -- ^ Create a persistent container (don't remove it when finished). Implied by - -- `dockerDetach`. + -- ^ Create a persistent container (don't remove it when finished). Implied + -- by -- `dockerDetach`. , dockerMonoidContainerName :: !(First String) - -- ^ Container name to use, only makes sense from command-line with `dockerPersist` - -- or `dockerDetach`. + -- ^ Container name to use, only makes sense from command-line with + -- `dockerPersist` or `dockerDetach`. , dockerMonoidNetwork :: !(First String) - -- ^ See: 'dockerNetwork' + -- ^ See: 'dockerNetwork' , dockerMonoidRunArgs :: ![String] - -- ^ Arguments to pass directly to @docker run@ + -- ^ Arguments to pass directly to @docker run@ , dockerMonoidMount :: ![Mount] - -- ^ Volumes to mount in the container + -- ^ Volumes to mount in the container , dockerMonoidMountMode :: !(First String) - -- ^ Volume mount mode + -- ^ Volume mount mode , dockerMonoidEnv :: ![String] - -- ^ Environment variables to set in the container + -- ^ Environment variables to set in the container , dockerMonoidStackExe :: !(First DockerStackExe) - -- ^ Location of container-compatible Stack executable + -- ^ Location of container-compatible Stack executable , dockerMonoidSetUser :: !(First Bool) -- ^ Set in-container user to match host's , dockerMonoidRequireDockerVersion :: !IntersectingVersionRange @@ -320,33 +328,37 @@ -- | Decode uninterpreted docker options from JSON/YAML. instance FromJSON (WithJSONWarnings DockerOptsMonoid) where parseJSON = withObjectWarnings "DockerOptsMonoid" - (\o -> do - let dockerMonoidDefaultEnable = Any True - dockerMonoidEnable <- First <$> o ..:? dockerEnableArgName - dockerMonoidRepoOrImage <- First <$> - ( (Just . DockerMonoidImage <$> o ..: dockerImageArgName) - <|> (Just . DockerMonoidRepo <$> o ..: dockerRepoArgName) - <|> pure Nothing - ) - dockerMonoidRegistryLogin <- First <$> o ..:? dockerRegistryLoginArgName - dockerMonoidRegistryUsername <- First <$> o ..:? dockerRegistryUsernameArgName - dockerMonoidRegistryPassword <- First <$> o ..:? dockerRegistryPasswordArgName - dockerMonoidAutoPull <- FirstTrue <$> o ..:? dockerAutoPullArgName - dockerMonoidDetach <- FirstFalse <$> o ..:? dockerDetachArgName - dockerMonoidPersist <- FirstFalse <$> o ..:? dockerPersistArgName - dockerMonoidContainerName <- First <$> o ..:? dockerContainerNameArgName - dockerMonoidNetwork <- First <$> o ..:? dockerNetworkArgName - dockerMonoidRunArgs <- o ..:? dockerRunArgsArgName ..!= [] - dockerMonoidMount <- o ..:? dockerMountArgName ..!= [] - dockerMonoidMountMode <- First <$> o ..:? dockerMountModeArgName - dockerMonoidEnv <- o ..:? dockerEnvArgName ..!= [] - dockerMonoidStackExe <- First <$> o ..:? dockerStackExeArgName - dockerMonoidSetUser <- First <$> o ..:? dockerSetUserArgName - dockerMonoidRequireDockerVersion <- IntersectingVersionRange . unVersionRangeJSON <$> - ( o ..:? dockerRequireDockerVersionArgName - ..!= VersionRangeJSON anyVersion - ) - pure DockerOptsMonoid{..}) + ( \o -> do + let dockerMonoidDefaultEnable = Any True + dockerMonoidEnable <- First <$> o ..:? dockerEnableArgName + dockerMonoidRepoOrImage <- First <$> + ( (Just . DockerMonoidImage <$> o ..: dockerImageArgName) + <|> (Just . DockerMonoidRepo <$> o ..: dockerRepoArgName) + <|> pure Nothing + ) + dockerMonoidRegistryLogin <- First <$> o ..:? dockerRegistryLoginArgName + dockerMonoidRegistryUsername <- + First <$> o ..:? dockerRegistryUsernameArgName + dockerMonoidRegistryPassword <- + First <$> o ..:? dockerRegistryPasswordArgName + dockerMonoidAutoPull <- FirstTrue <$> o ..:? dockerAutoPullArgName + dockerMonoidDetach <- FirstFalse <$> o ..:? dockerDetachArgName + dockerMonoidPersist <- FirstFalse <$> o ..:? dockerPersistArgName + dockerMonoidContainerName <- First <$> o ..:? dockerContainerNameArgName + dockerMonoidNetwork <- First <$> o ..:? dockerNetworkArgName + dockerMonoidRunArgs <- o ..:? dockerRunArgsArgName ..!= [] + dockerMonoidMount <- o ..:? dockerMountArgName ..!= [] + dockerMonoidMountMode <- First <$> o ..:? dockerMountModeArgName + dockerMonoidEnv <- o ..:? dockerEnvArgName ..!= [] + dockerMonoidStackExe <- First <$> o ..:? dockerStackExeArgName + dockerMonoidSetUser <- First <$> o ..:? dockerSetUserArgName + dockerMonoidRequireDockerVersion <- + IntersectingVersionRange . unVersionRangeJSON <$> + ( o ..:? dockerRequireDockerVersionArgName + ..!= VersionRangeJSON anyVersion + ) + pure DockerOptsMonoid {..} + ) -- | Left-biased combine Docker options instance Semigroup DockerOptsMonoid where @@ -389,15 +401,13 @@ instance Read Mount where readsPrec _ s = case break (== ':') s of - (a,':':b) -> [(Mount a b,"")] - (a,[]) -> [(Mount a a,"")] + (a, ':':b) -> [(Mount a b, "")] + (a, []) -> [(Mount a a, "")] _ -> fail "Invalid value for Docker mount (expect '/host/path:/container/path')" -- | Show instance. instance Show Mount where - show (Mount a b) = if a == b - then a - else concat [a,":",b] + show (Mount a b) = if a == b then a else concat [a, ":", b] -- | For YAML. instance FromJSON Mount where
@@ -6,9 +6,10 @@ , parseDownloadInfoFromObject ) where -import Pantry.Internal.AesonExtended - ( FromJSON (..), Object, WarningParser - , WithJSONWarnings (..), (..:), (..:?), withObjectWarnings +import Data.Aeson.Types ( FromJSON (..), Object ) +import Data.Aeson.WarningParser + ( WarningParser, WithJSONWarnings (..), (..:), (..:?) + , withObjectWarnings ) import Stack.Prelude
@@ -6,8 +6,7 @@ ( DumpLogs (..) ) where -import Pantry.Internal.AesonExtended - ( FromJSON (..), Value (..), withText ) +import Data.Aeson.Types ( FromJSON (..), Value (..), withText ) import Stack.Prelude -- | Which build log files to dump
@@ -52,6 +52,7 @@ import Stack.Types.CompilerPaths ( CompilerPaths (..), HasCompiler (..) ) import Stack.Types.Config ( HasConfig (..), stackRootL ) +import Stack.Types.FileDigestCache ( FileDigestCache ) import Stack.Types.GHCVariant ( HasGHCVariant (..), ghcVariantSuffix ) import Stack.Types.Platform ( HasPlatform (..), platformVariantSuffix ) @@ -63,6 +64,7 @@ data EnvConfig = EnvConfig { envConfigBuildConfig :: !BuildConfig , envConfigBuildOptsCLI :: !BuildOptsCLI + , envConfigFileDigestCache :: !FileDigestCache , envConfigSourceMap :: !SourceMap , envConfigSourceMapHash :: !SourceMapHash , envConfigCompilerPaths :: !CompilerPaths
@@ -0,0 +1,27 @@+{-# LANGUAGE NoImplicitPrelude #-} + +module Stack.Types.FileDigestCache + ( FileDigestCache + , newFileDigestCache + , readFileDigest + ) where + +import qualified Data.Map.Strict as Map +import Stack.Prelude +import qualified Pantry.SHA256 as SHA256 + +-- | Type synonym representing caches of digests of files. +type FileDigestCache = IORef (Map FilePath SHA256) + +newFileDigestCache :: MonadIO m => m FileDigestCache +newFileDigestCache = newIORef Map.empty + +readFileDigest :: MonadIO m => FileDigestCache -> FilePath -> m SHA256 +readFileDigest cache filePath = do + digests <- readIORef cache + case Map.lookup filePath digests of + Just digest -> pure digest + Nothing -> do + sha256 <- SHA256.hashFile filePath + writeIORef cache $ Map.insert filePath sha256 digests + pure sha256
@@ -5,10 +5,9 @@ ( GHCDownloadInfo (..) ) where -import Pantry.Internal.AesonExtended - ( FromJSON (..), WithJSONWarnings (..), (..:?), (..!=) - , withObjectWarnings - ) +import Data.Aeson.Types ( FromJSON (..) ) +import Data.Aeson.WarningParser + ( WithJSONWarnings (..), (..:?), (..!=), withObjectWarnings ) import Stack.Prelude import Stack.Types.DownloadInfo ( DownloadInfo, parseDownloadInfoFromObject )
@@ -8,9 +8,9 @@ , parseGHCVariant ) where +import Data.Aeson.Types ( FromJSON, parseJSON, withText ) import Data.List ( stripPrefix ) import qualified Data.Text as T -import Pantry.Internal.AesonExtended ( FromJSON, parseJSON, withText ) import Stack.Prelude -- | Specialized variant of GHC (e.g. libgmp4 or integer-simple)
@@ -5,9 +5,8 @@ ( GhcOptionKey (..) ) where +import Data.Aeson.Types ( FromJSONKey (..), FromJSONKeyFunction (..) ) import qualified Data.Text as T -import Pantry.Internal.AesonExtended - ( FromJSONKey (..), FromJSONKeyFunction (..) ) import Stack.Prelude data GhcOptionKey
@@ -4,9 +4,9 @@ ( GhcOptions (..) ) where +import Data.Aeson.Types ( FromJSON (..), withText ) import Data.Attoparsec.Args ( EscapingMode (Escaping), parseArgs ) import qualified Data.Text as T -import Pantry.Internal.AesonExtended ( FromJSON (..), withText ) import Stack.Prelude newtype GhcOptions = GhcOptions { unGhcOptions :: [Text] }
@@ -10,14 +10,13 @@ , ghcPkgIdString ) where +import Data.Aeson.Types ( FromJSON (..), ToJSON (..), withText ) import Data.Attoparsec.Text ( Parser, choice, digit, endOfInput, letter, many1, parseOnly , satisfy ) import qualified Data.Text as T import Database.Persist.Sql ( PersistField, PersistFieldSql ) -import Pantry.Internal.AesonExtended - ( FromJSON (..), ToJSON (..), withText ) import Prelude ( Read (..) ) import Stack.Prelude
@@ -24,6 +24,9 @@ , globalTimeInLog :: !Bool -- ^ Whether to include timings in logs. , globalRSLInLog :: !Bool -- ^ Whether to include raw snapshot layer (RSL) in logs. + , globalPlanInLog :: !Bool + -- ^ Whether to include debug information about the construction of the + -- build plan in logs. , globalConfigMonoid :: !ConfigMonoid -- ^ Config monoid, for passing into 'loadConfig' , globalResolver :: !(Maybe AbstractResolver) -- ^ Resolver override
@@ -24,6 +24,9 @@ -- ^ Whether to include timings in logs. , globalMonoidRSLInLog :: !FirstFalse -- ^ Whether to include raw snapshot layer (RSL) in logs. + , globalMonoidPlanInLog :: !FirstFalse + -- ^ Whether to include debug information about the construction of the + -- build plan in logs. , globalMonoidConfigMonoid :: !ConfigMonoid -- ^ Config monoid, for passing into 'loadConfig' , globalMonoidResolver :: !(First (Unresolved AbstractResolver))
@@ -15,11 +15,10 @@ , nixShellOptsArgName ) where +import Data.Aeson.Types ( FromJSON (..) ) +import Data.Aeson.WarningParser + ( WithJSONWarnings, (..:?), withObjectWarnings ) import Generics.Deriving.Monoid ( mappenddefault, memptydefault ) -import Pantry.Internal.AesonExtended - ( FromJSON (..), WithJSONWarnings, (..:?) - , withObjectWarnings - ) import Stack.Prelude -- | Nix configuration. Parameterize by resolver type to avoid cyclic
@@ -5,9 +5,9 @@ ( Project (..) ) where +import Data.Aeson.Types ( ToJSON (..), (.=), object ) import qualified Data.Map as Map import qualified Data.Set as Set -import Pantry.Internal.AesonExtended ( ToJSON (..), (.=), object ) import Stack.Prelude import Stack.Types.Curator ( Curator )
@@ -6,12 +6,13 @@ , parseProjectAndConfigMonoid ) where +import Data.Aeson.Types ( Value ) +import Data.Aeson.WarningParser + ( WithJSONWarnings, (...:), (..:?), (..!=), jsonSubWarnings + , jsonSubWarningsT, jsonSubWarningsTT, withObjectWarnings + ) import qualified Data.Set as Set import qualified Data.Yaml as Yaml -import Pantry.Internal.AesonExtended - ( WithJSONWarnings, Value, (...:), (..:?), (..!=) - , jsonSubWarnings, jsonSubWarningsT, jsonSubWarningsTT - , withObjectWarnings ) import Stack.Prelude import Stack.Types.ConfigMonoid ( ConfigMonoid, parseConfigMonoidObject )
@@ -2,6 +2,7 @@ module Stack.Types.ProjectConfig ( ProjectConfig (..) + , isPCGlobalProject ) where import Stack.Prelude @@ -17,3 +18,9 @@ -- the implicit global. | PCNoProject ![PackageIdentifierRevision] -- ^ Use a no project run. This comes from 'SYLNoProject'. + +-- | Yields 'True' only if the project configuration information is for the +-- implicit global project. +isPCGlobalProject :: ProjectConfig a -> Bool +isPCGlobalProject PCGlobalProject = True +isPCGlobalProject _ = False
@@ -7,11 +7,10 @@ , pvpBoundsText , parsePvpBounds ) where + +import Data.Aeson.Types ( FromJSON (..), ToJSON (..), withText ) import qualified Data.Map as Map import qualified Data.Text as T -import Pantry.Internal.AesonExtended - ( FromJSON (..), ToJSON (..), withText - ) import Stack.Prelude -- | How PVP bounds should be added to .cabal files
@@ -13,14 +13,15 @@ import qualified Data.Aeson.Key as Key import qualified Data.Aeson.KeyMap as KeyMap +import Data.Aeson.Types + ( FromJSON, parseJSON, withObject, withText ) +import Data.Aeson.WarningParser ( (.:) ) import qualified Data.IntMap.Strict as IntMap import qualified Data.Text as T import Data.Text.Read ( decimal ) import Data.Time ( Day ) import Options.Applicative ( ReadM ) import qualified Options.Applicative.Types as OA -import Pantry.Internal.AesonExtended - ( FromJSON, parseJSON, withObject, (.:), withText ) import Stack.Prelude -- | Type representing exceptions thrown by functions exported by the
@@ -5,7 +5,7 @@ ( SCM (..) ) where -import Pantry.Internal.AesonExtended ( FromJSON (..), ToJSON (..) ) +import Data.Aeson.Types ( FromJSON (..), ToJSON (..) ) import Stack.Prelude -- | A software control system.
@@ -8,11 +8,12 @@ ( SetupInfo (..) ) where -import qualified Data.Map as Map -import Pantry.Internal.AesonExtended - ( FromJSON (..), WithJSONWarnings, (..:?), (..!=) - , jsonSubWarningsT, jsonSubWarningsTT, withObjectWarnings +import Data.Aeson.Types ( FromJSON (..) ) +import Data.Aeson.WarningParser + ( WithJSONWarnings, (..:?), (..!=), jsonSubWarningsT + , jsonSubWarningsTT, withObjectWarnings ) +import qualified Data.Map as Map import Stack.Prelude import Stack.Types.DownloadInfo ( DownloadInfo ) import Stack.Types.VersionedDownloadInfo ( VersionedDownloadInfo )
@@ -16,6 +16,7 @@ , DepPackage (..) , ProjectPackage (..) , ppComponents + , ppComponentsMaybe , ppGPD , ppRoot , ppVersion @@ -174,19 +175,27 @@ -- | All components available in the given 'ProjectPackage' ppComponents :: MonadIO m => ProjectPackage -> m (Set NamedComponent) -ppComponents pp = do +ppComponents = ppComponentsMaybe Just + +ppComponentsMaybe :: + MonadIO m + => (NamedComponent -> Maybe NamedComponent) + -> ProjectPackage + -> m (Set NamedComponent) +ppComponentsMaybe compType pp = do gpd <- ppGPD pp pure $ Set.fromList $ concat - [ maybe [] (const [CLib]) (C.condLibrary gpd) - , go CExe (fst <$> C.condExecutables gpd) - , go CTest (fst <$> C.condTestSuites gpd) - , go CBench (fst <$> C.condBenchmarks gpd) + [ maybe [] (const $ catMaybes [compType CLib]) (C.condLibrary gpd) + , go (compType . CExe) (fst <$> C.condExecutables gpd) + , go (compType . CTest) (fst <$> C.condTestSuites gpd) + , go (compType . CBench) (fst <$> C.condBenchmarks gpd) ] where - go :: (T.Text -> NamedComponent) - -> [C.UnqualComponentName] - -> [NamedComponent] - go wrapper = map (wrapper . T.pack . C.unUnqualComponentName) + go :: + (T.Text -> Maybe NamedComponent) + -> [C.UnqualComponentName] + -> [NamedComponent] + go wrapper = mapMaybe (wrapper . T.pack . C.unUnqualComponentName) -- | Version for the given 'ProjectPackage ppVersion :: MonadIO m => ProjectPackage -> m Version
@@ -8,7 +8,7 @@ , UserStorage (..) ) where -import Pantry.Internal ( Storage ) +import Pantry.SQLite ( Storage ) import Stack.Prelude -- | Type representing \'pretty\' exceptions thrown by functions exported by
@@ -21,14 +21,14 @@ , stackMinorVersion ) where +import Data.Aeson.Types + ( FromJSON (..), ToJSON (..), Value (..), withText ) import Data.List ( find ) import qualified Data.Set as Set import qualified Data.Text as T import Data.Version ( showVersion ) import Distribution.Pretty ( pretty ) import qualified Distribution.Version as Cabal -import Pantry.Internal.AesonExtended - ( FromJSON (..), ToJSON (..), Value (..), withText ) import qualified Paths_stack as Meta import Stack.Prelude hiding ( Vector, pretty ) import Text.PrettyPrint ( render )
@@ -5,10 +5,9 @@ ( VersionedDownloadInfo (..) ) where -import Pantry.Internal.AesonExtended - ( FromJSON (..), WithJSONWarnings (..), (..:) - , withObjectWarnings - ) +import Data.Aeson.Types ( FromJSON (..) ) +import Data.Aeson.WarningParser + ( WithJSONWarnings (..), (..:), withObjectWarnings ) import Stack.Prelude import Stack.Types.DownloadInfo ( DownloadInfo, parseDownloadInfoFromObject )
@@ -6,14 +6,14 @@ ( uninstallCmd ) where -import Stack.Constants ( osIsWindows ) -import Stack.Prelude -import Stack.Runners ( ShouldReexec (..), withConfig ) -import Stack.Types.Config - ( configL, configLocalBin, configLocalProgramsBase - , stackGlobalConfigL, stackRootL - ) -import Stack.Types.Runner ( Runner ) +import Stack.Constants ( osIsWindows ) +import Stack.Prelude +import Stack.Runners ( ShouldReexec (..), withConfig ) +import Stack.Types.Config + ( configL, configLocalBin, configLocalProgramsBase + , stackGlobalConfigL, stackRootL + ) +import Stack.Types.Runner ( Runner ) -- | Function underlying the @stack uninstall@ command. Display help for the -- command. @@ -28,8 +28,8 @@ globalConfig' = toStyleDoc globalConfig programsDir' = toStyleDoc programsDir localBinDir' = toStyleDoc localBinDir - prettyInfo $ - vsep + putUtf8Builder =<< displayWithColor + ( vsep [ flow "To uninstall Stack, it should be sufficient to delete:" , hang 4 $ fillSep [ flow "(1) the directory containing Stack's tools" @@ -59,26 +59,27 @@ , flow "directories in any Haskell projects that you have built." ] ] - <> blankLine - <> vsep - [ fillSep - [ flow "To uninstall completely a Stack-supplied tool (such as \ - \GHC or, on Windows, MSYS2), delete from Stack's tools \ - \directory" - , parens programsDir' <> ":" - ] - , hang 4 $ fillSep - [ flow "(1) the tool's subdirectory;" - ] - , hang 4 $ fillSep - [ flow "(2) the tool's archive file" - , parens (style File "<tool>.tar.xz") <> "; and" - ] - , hang 4 $ fillSep - [ flow "(3) the file marking that the tool is installed" - , parens (style File "<tool>.installed") <> "." - ] - ] + <> blankLine + <> vsep + [ fillSep + [ flow "To uninstall completely a Stack-supplied tool (such as \ + \GHC or, on Windows, MSYS2), delete from Stack's tools \ + \directory" + , parens programsDir' <> ":" + ] + , hang 4 $ fillSep + [ flow "(1) the tool's subdirectory;" + ] + , hang 4 $ fillSep + [ flow "(2) the tool's archive file" + , parens (style File "<tool>.tar.xz") <> "; and" + ] + , hang 4 $ fillSep + [ flow "(3) the file marking that the tool is installed" + , parens (style File "<tool>.installed") <> "." + ] + ] + ) where styleShell = style Shell howToFindStack
@@ -15,8 +15,8 @@ import RIO.Process ( proc, runProcess_, withWorkingDir ) import Stack.Build ( build ) import Stack.Build.Target ( NeedTargets (..) ) +import Stack.BuildInfo ( maybeGitHash ) import Stack.Constants ( relDirStackProgName, stackDotYaml ) -import Stack.Internal.BuildInfo ( maybeGitHash ) import Stack.Prelude hiding ( force, Display (..) ) import Stack.Runners ( ShouldReexec (..), withConfig, withEnvConfig @@ -135,11 +135,13 @@ -- See #2977 - if --git or --git-repo is specified, do source upgrade. (_, Just so@(SourceOpts (Just _))) -> source so (Just bo, Just so) -> binary bo `catchAny` \e -> do - prettyWarnL - [ flow "Exception occurred when trying to perform binary upgrade:" - , fromString . show $ e - , line <> flow "Falling back to source upgrade." - ] + prettyWarn $ + flow "When trying to perform binary upgrade, Stack encountered the \ + \following error:" + <> blankLine + <> ppException e + <> blankLine + <> flow "Falling back to source upgrade." source so where binary = binaryUpgrade
@@ -1,81 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE CPP #-} -{-# LANGUAGE OverloadedStrings #-} - -#ifdef USE_GIT_INFO -{-# LANGUAGE TemplateHaskell #-} -#endif - --- Extracted from Main so that the Main module does not use CPP or TH, --- and therefore doesn't need to be recompiled as often. -module BuildInfo - ( versionString' - , hpackVersion - ) where - -#ifndef HIDE_DEP_VERSIONS -import qualified Build_stack -#endif -#ifdef USE_GIT_INFO -import Data.Version ( versionBranch ) -#else -import Data.Version ( showVersion, versionBranch ) -#endif -import Distribution.System ( buildArch ) -import qualified Distribution.Text as Cabal ( display ) -#ifdef USE_GIT_INFO -import GitHash ( giCommitCount, tGitInfoCwdTry ) -#endif -#ifdef USE_GIT_INFO -import Options.Applicative.Simple ( simpleVersion ) -#endif -import Stack.Prelude -import qualified Paths_stack as Meta - -versionString' :: String -#ifdef USE_GIT_INFO -versionString' = concat $ concat - [ [$(simpleVersion Meta.version)] - -- Leave out number of commits for --depth=1 clone - -- See https://github.com/commercialhaskell/stack/issues/792 - , case giCommitCount <$> $$tGitInfoCwdTry of - Left _ -> [] - Right 1 -> [] - Right count -> [" (", show count, " commits)"] - , [afterVersion] - ] -#else -versionString' = showStackVersion ++ afterVersion -#endif - where - afterVersion = concat - [ preReleaseString - , ' ' : Cabal.display buildArch - , depsString - , warningString - ] - preReleaseString = - case versionBranch Meta.version of - (_:y:_) | even y -> " PRE-RELEASE" - (_:_:z:_) | even z -> " RELEASE-CANDIDATE" - _ -> "" -#ifdef HIDE_DEP_VERSIONS - depsString = " hpack-" ++ VERSION_hpack -#else - depsString = "\nCompiled with:\n" ++ unlines (map ("- " ++) Build_stack.deps) -#endif -#ifdef SUPPORTED_BUILD - warningString = "" -#else - warningString = unlines - [ "" - , "Warning: this is an unsupported build that may use different versions of" - , "dependencies and GHC than the officially released binaries, and therefore may" - , "not behave identically. If you encounter problems, please try the latest" - , "official build by running 'stack upgrade --force-download'." - ] -#endif - --- | Hpack version we're compiled against -hpackVersion :: String -hpackVersion = VERSION_hpack
@@ -1,136 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE OverloadedStrings #-} - --- | Main Stack tool entry point. - -module Main (main) where - -import BuildInfo ( versionString' ) -import GHC.IO.Encoding ( mkTextEncoding, textEncodingName ) -import Options.Applicative.Builder.Extra ( execExtraHelp ) -import Stack.CLI ( commandLineHandler ) -import Stack.Constants ( stackProgName ) -import Stack.Docker ( dockerCmdName, dockerHelpOptName ) -import Stack.Nix ( nixCmdName, nixHelpOptName ) -import Stack.Options.DockerParser ( dockerOptsParser ) -import Stack.Options.GlobalParser ( globalOptsFromMonoid ) -import Stack.Options.NixParser ( nixOptsParser ) -import Stack.Prelude -import Stack.Runners - ( ShouldReexec (..), withConfig, withRunnerGlobal ) -import Stack.Types.GlobalOpts ( GlobalOpts (..) ) -import Stack.Types.Runner ( Runner ) -import Stack.Types.Version - ( VersionCheck (..), checkVersion, showStackVersion - , stackVersion - ) -import System.Directory ( getCurrentDirectory ) -import System.Environment ( getArgs, getProgName ) -import System.IO ( hGetEncoding, hPutStrLn, hSetEncoding ) -import System.Terminal ( hIsTerminalDeviceOrMinTTY ) - --- | Type representing exceptions thrown by functions in the "Main" module. -data MainException - = InvalidReExecVersion String String - deriving (Show, Typeable) - -instance Exception MainException where - displayException (InvalidReExecVersion expected actual) = concat - [ "Error: [S-2186]\n" - , "When re-executing '" - , stackProgName - , "' in a container, the incorrect version was found\nExpected: " - , expected - , "; found: " - , actual - ] - -main :: IO () -main = do - -- Line buffer the output by default, particularly for non-terminal runs. - -- See https://github.com/commercialhaskell/stack/pull/360 - hSetBuffering stdout LineBuffering - hSetBuffering stdin LineBuffering - hSetBuffering stderr LineBuffering - hSetTranslit stdout - hSetTranslit stderr - args <- getArgs - progName <- getProgName - isTerminal <- hIsTerminalDeviceOrMinTTY stdout - execExtraHelp - args - dockerHelpOptName - (dockerOptsParser False) - ("Only showing --" ++ dockerCmdName ++ "* options.") - execExtraHelp - args - nixHelpOptName - (nixOptsParser False) - ("Only showing --" ++ nixCmdName ++ "* options.") - currentDir <- getCurrentDirectory - eGlobalRun <- try $ commandLineHandler currentDir progName False - case eGlobalRun of - Left (exitCode :: ExitCode) -> - throwIO exitCode - Right (globalMonoid, run) -> do - global <- globalOptsFromMonoid isTerminal globalMonoid - when (globalLogLevel global == LevelDebug) $ - hPutStrLn stderr versionString' - case globalReExecVersion global of - Just expectVersion -> do - expectVersion' <- parseVersionThrowing expectVersion - unless (checkVersion MatchMinor expectVersion' stackVersion) $ - throwIO $ - InvalidReExecVersion expectVersion showStackVersion - _ -> pure () - withRunnerGlobal global $ run `catches` - [ Handler handleExitCode - , Handler handlePrettyException - , Handler handlePantryException - , Handler handleSomeException - ] - --- | Change the character encoding of the given Handle to transliterate on --- unsupported characters instead of throwing an exception -hSetTranslit :: Handle -> IO () -hSetTranslit h = do - menc <- hGetEncoding h - case fmap textEncodingName menc of - Just name - | '/' `notElem` name -> do - enc' <- mkTextEncoding $ name ++ "//TRANSLIT" - hSetEncoding h enc' - _ -> pure () - --- | Handle ExitCode exceptions. -handleExitCode :: ExitCode -> RIO Runner a -handleExitCode = exitWith - --- | Handle PrettyException exceptions. -handlePrettyException :: PrettyException -> RIO Runner a -handlePrettyException = handleAnyPrettyException - --- | Handle (pretty) PantryException exceptions. -handlePantryException :: PantryException -> RIO Runner a -handlePantryException = handleAnyPrettyException - --- | Handle any pretty exception. -handleAnyPrettyException :: (Exception e, Pretty e) => e -> RIO Runner a -handleAnyPrettyException e = do - -- The code below loads the entire Stack configuration, when all that is - -- needed are the Stack colours. A tailored approach may be better. - result <- tryAny $ withConfig NoReexec $ prettyError $ pretty e - case result of - -- Falls back to the command line's Stack colours if there is any error in - -- loading the entire Stack configuration. - Left _ -> prettyError $ pretty e - Right _ -> pure () - exitFailure - --- | Handle SomeException exceptions. This special handler stops "stack: " from --- being printed before the exception. -handleSomeException :: SomeException -> RIO Runner a -handleSomeException (SomeException e) = do - logError $ fromString $ displayException e - exitFailure
@@ -1,684 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} - -module Stack.CLI - ( commandLineHandler - ) where - -import BuildInfo ( hpackVersion, versionString' ) -import Data.Attoparsec.Interpreter ( getInterpreterArgs ) -import Data.Char ( toLower ) -import qualified Data.List as L -import Options.Applicative - ( Parser, ParserFailure, ParserHelp, ParserResult (..), flag - , handleParseResult, help, helpError, idm, long, metavar - , overFailure, renderFailure, strArgument, switch ) -import Options.Applicative.Help ( errorHelp, stringChunk, vcatChunks ) -import Options.Applicative.Builder.Extra - ( boolFlags, extraHelpOption, textOption ) -import Options.Applicative.Complicated - ( addCommand, addSubCommands, complicatedOptions ) -import qualified RIO.Process ( exec ) -import RIO.Process ( withProcessContextNoLogging ) -import Stack.Build ( buildCmd ) -import Stack.Clean ( CleanCommand (..), cleanCmd ) -import Stack.ConfigCmd as ConfigCmd -import Stack.Constants ( globalFooter, osIsWindows, stackProgName ) -import Stack.Coverage ( hpcReportCmd ) -import Stack.Docker - ( dockerCmdName, dockerHelpOptName, dockerPullCmdName ) -import Stack.DockerCmd ( dockerPullCmd, dockerResetCmd ) -import qualified Stack.Dot ( dot ) -import Stack.Exec ( SpecialExecCmd (..), execCmd ) -import Stack.Eval ( evalCmd ) -import Stack.Ghci ( ghciCmd ) -import Stack.Hoogle ( hoogleCmd ) -import Stack.IDE - ( ListPackagesCmd (..), OutputStream (..), idePackagesCmd - , ideTargetsCmd - ) -import Stack.Init ( initCmd ) -import Stack.List ( listCmd ) -import Stack.Ls ( lsCmd ) -import Stack.New ( newCmd ) -import qualified Stack.Nix as Nix -import Stack.Options.BuildParser ( buildOptsParser ) -import Stack.Options.CleanParser ( cleanOptsParser ) -import Stack.Options.DotParser ( dotOptsParser ) -import Stack.Options.EvalParser ( evalOptsParser ) -import Stack.Options.ExecParser ( execOptsParser ) -import Stack.Options.GhciParser ( ghciOptsParser ) -import Stack.Options.GlobalParser ( globalOptsParser ) -import Stack.Options.HpcReportParser ( hpcReportOptsParser ) -import Stack.Options.InitParser ( initOptsParser ) -import Stack.Options.LsParser ( lsOptsParser ) -import Stack.Options.NewParser ( newOptsParser ) -import Stack.Options.PathParser ( pathParser ) -import Stack.Options.SDistParser ( sdistOptsParser ) -import Stack.Options.ScriptParser ( scriptOptsParser ) -import Stack.Options.SetupParser ( setupOptsParser ) -import Stack.Options.UpgradeParser ( upgradeOptsParser ) -import Stack.Options.UploadParser ( uploadOptsParser ) -import Stack.Options.Utils ( GlobalOptsContext (..) ) -import qualified Stack.Path ( path ) -import Stack.Prelude -import Stack.Query ( queryCmd ) -import Stack.Runners - ( ShouldReexec (..), withConfig, withDefaultEnvConfig ) -import Stack.SDist ( sdistCmd ) -import Stack.Script ( ScriptOpts (..), scriptCmd ) -import Stack.SetupCmd ( setupCmd ) -import Stack.Templates ( templatesCmd ) -import Stack.Types.AddCommand ( AddCommand ) -import Stack.Types.BuildOpts ( BuildCommand (..) ) -import Stack.Types.GlobalOptsMonoid ( GlobalOptsMonoid (..) ) -import Stack.Types.Runner ( Runner ) -import Stack.Types.Version ( stackVersion ) -import Stack.Uninstall ( uninstallCmd ) -import Stack.Unpack ( unpackCmd ) -import Stack.Update ( updateCmd ) -import Stack.Upgrade ( upgradeCmd ) -import Stack.Upload ( uploadCmd ) -import qualified System.Directory as D -import System.Environment ( getProgName, withArgs ) -import System.FilePath ( pathSeparator, takeDirectory ) - -commandLineHandler :: - FilePath - -> String - -> Bool - -> IO (GlobalOptsMonoid, RIO Runner ()) -commandLineHandler currentDir progName isInterpreter = - -- Append the relevant default (potentially affecting the LogLevel) *after* - -- appending the global options of the `stack` command to the global options - -- of the subcommand - see #5326. - first (<> defaultGlobalOpts) <$> complicatedOptions - stackVersion - (Just versionString') - hpackVersion - "stack - The Haskell Tool Stack" - "" - "Stack's documentation is available at https://docs.haskellstack.org/. \ - \Command 'stack COMMAND --help' for help about a Stack command. Stack also \ - \supports the Haskell Error Index at https://errors.haskell.org/." - (globalOpts OuterGlobalOpts) - (Just failureCallback) - addCommands - where - defaultGlobalOpts = if isInterpreter - then - -- Silent except when errors occur - see #2879 - mempty { globalMonoidLogLevel = First (Just LevelError) } - else mempty - failureCallback f args = - case L.stripPrefix "Invalid argument" (fst (renderFailure f "")) of - Just _ -> if isInterpreter - then parseResultHandler args f - else secondaryCommandHandler args f - >>= interpreterHandler currentDir args - Nothing -> parseResultHandler args f - - parseResultHandler args f = - if isInterpreter - then do - let hlp = errorHelp $ stringChunk - (unwords ["Error executing interpreter command:" - , progName - , unwords args]) - handleParseResult (overFailure (vcatErrorHelp hlp) (Failure f)) - else handleParseResult (Failure f) - - -- The order of commands below determines the order in which they are listed - -- in `stack --help`. - addCommands = do - unless isInterpreter $ do - build - install - uninstall - test - bench - haddock - new - templates - init - setup - path - ls - unpack - update - upgrade - upload - sdist - dot - ghc - hoogle - -- These are the only commands allowed in interpreter mode as well - exec - run - ghci - repl - runghc - runhaskell - script - unless isInterpreter $ do - eval - clean - purge - query - list - ide - docker - config - hpc - - -- Stack's subcommands are listed below in alphabetical order - - bench = addBuildCommand' - "bench" - "Shortcut for 'build --bench'." - buildCmd - (buildOptsParser Bench) - - build = addBuildCommand' - "build" - "Build the package(s) in this directory/configuration." - buildCmd - (buildOptsParser Build) - - clean = addCommand' - "clean" - "Delete build artefacts for the project packages." - cleanCmd - (cleanOptsParser Clean) - - config = addSubCommands' - ConfigCmd.cfgCmdName - "Subcommands for accessing and modifying configuration values." - ( do - addCommand' - ConfigCmd.cfgCmdSetName - "Sets a key in YAML configuration file to value." - (withConfig NoReexec . cfgCmdSet) - configCmdSetParser - addCommand' - ConfigCmd.cfgCmdEnvName - "Print environment variables for use in a shell." - (withConfig YesReexec . withDefaultEnvConfig . cfgCmdEnv) - configCmdEnvParser - ) - - docker = addSubCommands' - dockerCmdName - "Subcommands specific to Docker use." - ( do - addCommand' - dockerPullCmdName - "Pull latest version of Docker image from registry." - dockerPullCmd - (pure ()) - addCommand' - "reset" - "Reset the Docker sandbox." - dockerResetCmd - ( switch - ( long "keep-home" - <> help "Do not delete sandbox's home directory." - ) - ) - ) - - dot = addCommand' - "dot" - "Visualize your project's dependency graph using Graphviz dot." - Stack.Dot.dot - (dotOptsParser False) -- Default for --external is False. - - eval = addCommand' - "eval" - "Evaluate some Haskell code inline. Shortcut for \ - \'stack exec ghc -- -e CODE'." - evalCmd - (evalOptsParser "CODE") - - exec = addCommand' - "exec" - "Execute a command. If the command is absent, the first of any arguments \ - \is taken as the command." - execCmd - (execOptsParser Nothing) - - ghc = addCommand' - "ghc" - "Run ghc." - execCmd - (execOptsParser $ Just ExecGhc) - - ghci = addGhciCommand' - "ghci" - "Run ghci in the context of package(s)." - ghciCmd - ghciOptsParser - - haddock = addBuildCommand' - "haddock" - "Shortcut for 'build --haddock'." - buildCmd - (buildOptsParser Haddock) - - hoogle = addCommand' - "hoogle" - "Run hoogle, the Haskell API search engine. Use the '-- ARGUMENT(S)' \ - \syntax to pass Hoogle arguments, e.g. 'stack hoogle -- --count=20', \ - \or 'stack hoogle -- server --local'." - hoogleCmd - ( (,,,) - <$> many (strArgument - ( metavar "-- ARGUMENT(S) (e.g. 'stack hoogle -- server --local')" - )) - <*> boolFlags - True - "setup" - "If needed: install Hoogle, build Haddock documentation and \ - \generate a Hoogle database." - idm - <*> switch - ( long "rebuild" - <> help "Rebuild the Hoogle database." - ) - <*> switch - ( long "server" - <> help "Start local Hoogle server." - ) - ) - - hpc = addSubCommands' - "hpc" - "Subcommands specific to Haskell Program Coverage." - ( addCommand' - "report" - "Generate unified HPC coverage report from tix files and project \ - \targets." - hpcReportCmd - hpcReportOptsParser - ) - - ide = addSubCommands' - "ide" - "IDE-specific commands." - ( let outputFlag = flag - OutputLogInfo - OutputStdout - ( long "stdout" - <> help "Send output to the standard output stream instead of the \ - \default, the standard error stream." - ) - cabalFileFlag = flag - ListPackageNames - ListPackageCabalFiles - ( long "cabal-files" - <> help "Print paths to package Cabal files instead of package \ - \names." - ) - in do - addCommand' - "packages" - "List all available local loadable packages." - idePackagesCmd - ((,) <$> outputFlag <*> cabalFileFlag) - addCommand' - "targets" - "List all available Stack targets." - ideTargetsCmd - outputFlag - ) - - init = addCommand' - "init" - "Create Stack project configuration from Cabal or Hpack package \ - \specifications." - initCmd - initOptsParser - - install = addBuildCommand' - "install" - "Shortcut for 'build --copy-bins'." - buildCmd - (buildOptsParser Install) - - list = addCommand' - "list" - "List package id's in snapshot (experimental)." - listCmd - (many $ strArgument $ metavar "PACKAGE") - - ls = addCommand' - "ls" - "List command. (Supports snapshots, dependencies, Stack's styles and \ - \installed tools.)" - lsCmd - lsOptsParser - - new = addCommand' - "new" - "Create a new project from a template. Run 'stack templates' to see \ - \available templates. Will also initialise if there is no stack.yaml \ - \file. Note: you can also specify a local file or a remote URL as a \ - \template; or force an initialisation." - newCmd - newOptsParser - - path = addCommand' - "path" - "Print out handy path information." - Stack.Path.path - pathParser - - purge = addCommand' - "purge" - "Delete the project Stack working directories (.stack-work by \ - \default). Shortcut for 'stack clean --full'." - cleanCmd - (cleanOptsParser Purge) - - query = addCommand' - "query" - "Query general build information (experimental)." - queryCmd - (many $ strArgument $ metavar "SELECTOR...") - - repl = addGhciCommand' - "repl" - "Run ghci in the context of package(s) (alias for 'ghci')." - ghciCmd - ghciOptsParser - - run = addCommand' - "run" - "Build and run an executable. Defaults to the first available \ - \executable if none is provided as the first argument." - execCmd - (execOptsParser $ Just ExecRun) - - runghc = addCommand' - "runghc" - "Run runghc." - execCmd - (execOptsParser $ Just ExecRunGhc) - - runhaskell = addCommand' - "runhaskell" - "Run runghc (alias for 'runghc')." - execCmd - (execOptsParser $ Just ExecRunGhc) - - script = addCommand - "script" - "Run a Stack script." - globalFooter - scriptCmd - ( \so gom -> - gom - { globalMonoidResolverRoot = - First $ Just $ takeDirectory $ soFile so - } - ) - (globalOpts OtherCmdGlobalOpts) - scriptOptsParser - - sdist = addCommand' - "sdist" - "Create source distribution tarballs." - sdistCmd - sdistOptsParser - - setup = addCommand' - "setup" - "Get the appropriate GHC for your project." - setupCmd - setupOptsParser - - templates = addCommand' - "templates" - "Show how to find templates available for 'stack new'. 'stack new' \ - \can accept a template from a remote repository (default: github), \ - \local file or remote URL. Note: this downloads the help file." - templatesCmd - (pure ()) - - test = addBuildCommand' - "test" - "Shortcut for 'build --test'." - buildCmd - (buildOptsParser Test) - - uninstall = addCommand' - "uninstall" - "Show how to uninstall Stack or a Stack-supplied tool. This command does \ - \not itself uninstall Stack or a Stack-supplied tool." - uninstallCmd - (pure ()) - - unpack = addCommand' - "unpack" - "Unpack one or more packages locally." - unpackCmd - ( (,) - <$> some (strArgument $ metavar "PACKAGE") - <*> optional (textOption - ( long "to" - <> help "Optional path to unpack the package into (will \ - \unpack into subdirectory)." - )) - ) - - update = addCommand' - "update" - "Update the package index." - updateCmd - (pure ()) - - upgrade = addCommand'' - "upgrade" - "Upgrade Stack, installing to Stack's local-bin directory and, if \ - \different and permitted, the directory of the current Stack \ - \executable." - upgradeCmd - "Warning: if you use GHCup to install Stack, use only GHCup to \ - \upgrade Stack." - (upgradeOptsParser onlyLocalBins) - where - onlyLocalBins = - (lowercase progName /= lowercase stackProgName) - && not ( osIsWindows - && lowercase progName == lowercase (stackProgName <> ".EXE") - ) - lowercase = map toLower - - upload = addCommand' - "upload" - "Upload a package to Hackage." - uploadCmd - uploadOptsParser - - -- addCommand hiding global options - addCommand' :: - String - -> String - -> (a -> RIO Runner ()) - -> Parser a - -> AddCommand - addCommand' cmd title constr = - addCommand - cmd - title - globalFooter - constr - (\_ gom -> gom) - (globalOpts OtherCmdGlobalOpts) - - -- addCommand with custom footer hiding global options - addCommand'' :: - String - -> String - -> (a -> RIO Runner ()) - -> String - -> Parser a - -> AddCommand - addCommand'' cmd title constr cmdFooter = - addCommand - cmd - title - (globalFooter <> " " <> cmdFooter) - constr - (\_ gom -> gom) - (globalOpts OtherCmdGlobalOpts) - - addSubCommands' :: - String - -> String - -> AddCommand - -> AddCommand - addSubCommands' cmd title = - addSubCommands - cmd - title - globalFooter - (globalOpts OtherCmdGlobalOpts) - - -- Additional helper that hides global options and shows build options - addBuildCommand' :: - String - -> String - -> (a -> RIO Runner ()) - -> Parser a - -> AddCommand - addBuildCommand' cmd title constr = - addCommand - cmd - title - globalFooter - constr - (\_ gom -> gom) - (globalOpts BuildCmdGlobalOpts) - - -- Additional helper that hides global options and shows some ghci options - addGhciCommand' :: - String - -> String - -> (a -> RIO Runner ()) - -> Parser a - -> AddCommand - addGhciCommand' cmd title constr = - addCommand - cmd - title - globalFooter - constr - (\_ gom -> gom) - (globalOpts GhciCmdGlobalOpts) - - globalOpts :: GlobalOptsContext -> Parser GlobalOptsMonoid - globalOpts kind = - extraHelpOption - hide - progName - (dockerCmdName ++ "*") - dockerHelpOptName - <*> extraHelpOption - hide - progName - (Nix.nixCmdName ++ "*") - Nix.nixHelpOptName - <*> globalOptsParser currentDir kind - where - hide = kind /= OuterGlobalOpts - --- | fall-through to external executables in `git` style if they exist --- (i.e. `stack something` looks for `stack-something` before --- failing with "Invalid argument `something'") -secondaryCommandHandler :: - [String] - -> ParserFailure ParserHelp - -> IO (ParserFailure ParserHelp) -secondaryCommandHandler args f = - -- don't even try when the argument looks like a path or flag - if elem pathSeparator cmd || "-" `L.isPrefixOf` L.head args - then pure f - else do - mExternalExec <- D.findExecutable cmd - case mExternalExec of - Just ex -> withProcessContextNoLogging $ do - -- TODO show the command in verbose mode - -- hPutStrLn stderr $ unwords $ - -- ["Running", "[" ++ ex, unwords (tail args) ++ "]"] - _ <- RIO.Process.exec ex (L.tail args) - pure f - Nothing -> pure $ fmap (vcatErrorHelp (noSuchCmd cmd)) f - where - -- FIXME this is broken when any options are specified before the command - -- e.g. stack --verbosity silent cmd - cmd = stackProgName ++ "-" ++ L.head args - noSuchCmd name = errorHelp $ stringChunk - ("Auxiliary command not found in path '" ++ name ++ "'.") - -interpreterHandler :: - Monoid t - => FilePath - -> [String] - -> ParserFailure ParserHelp - -> IO (GlobalOptsMonoid, (RIO Runner (), t)) -interpreterHandler currentDir args f = do - -- args can include top-level config such as --extra-lib-dirs=... (set by - -- nix-shell) - we need to find the first argument which is a file, everything - -- afterwards is an argument to the script, everything before is an argument - -- to Stack - (stackArgs, fileArgs) <- spanM (fmap not . D.doesFileExist) args - case fileArgs of - (file:fileArgs') -> runInterpreterCommand file stackArgs fileArgs' - [] -> parseResultHandler (errorCombine (noSuchFile firstArg)) - where - firstArg = L.head args - - spanM _ [] = pure ([], []) - spanM p xs@(x:xs') = do - r <- p x - if r - then do - (ys, zs) <- spanM p xs' - pure (x:ys, zs) - else - pure ([], xs) - - -- if the first argument contains a path separator then it might be a file, - -- or a Stack option referencing a file. In that case we only show the - -- interpreter error message and exclude the command related error messages. - errorCombine = - if pathSeparator `elem` firstArg - then overrideErrorHelp - else vcatErrorHelp - - overrideErrorHelp h1 h2 = h2 { helpError = helpError h1 } - - parseResultHandler fn = handleParseResult (overFailure fn (Failure f)) - noSuchFile name = errorHelp $ stringChunk - ("File does not exist or is not a regular file '" ++ name ++ "'.") - - runInterpreterCommand path stackArgs fileArgs = do - progName <- getProgName - iargs <- getInterpreterArgs path - let parseCmdLine = commandLineHandler currentDir progName True - -- Implicit file arguments are put before other arguments that - -- occur after "--". See #3658 - cmdArgs = stackArgs ++ case break (== "--") iargs of - (beforeSep, []) -> beforeSep ++ ["--"] ++ [path] ++ fileArgs - (beforeSep, optSep : afterSep) -> - beforeSep ++ [optSep] ++ [path] ++ fileArgs ++ afterSep - -- TODO show the command in verbose mode - -- hPutStrLn stderr $ unwords $ - -- ["Running", "[" ++ progName, unwords cmdArgs ++ "]"] - (a,b) <- withArgs cmdArgs parseCmdLine - pure (a,(b,mempty)) - --- Vertically combine only the error component of the first argument with the --- error component of the second. -vcatErrorHelp :: ParserHelp -> ParserHelp -> ParserHelp -vcatErrorHelp h1 h2 = h2 { helpError = vcatChunks [helpError h2, helpError h1] }
@@ -1,2 +0,0 @@-{-# OPTIONS_GHC -Wno-missing-export-lists #-} -{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
@@ -1,174 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} - --- | Args parser test suite. - -module Stack.ArgsSpec - ( spec - , argsSpec - , argsInputOutput - , interpreterArgsSpec - ) where - -import Data.Attoparsec.Args ( EscapingMode (..), parseArgsFromString ) -import Data.Attoparsec.Interpreter ( interpreterArgsParser ) -import qualified Data.Attoparsec.Text as P -import Data.Text ( pack ) -import Prelude ( head ) -import Stack.Constants ( stackProgName ) -import Stack.Prelude -import Test.Hspec ( Spec, describe, it ) - --- | Test spec. -spec :: Spec -spec = do - argsSpec - interpreterArgsSpec - -argsSpec :: Spec -argsSpec = forM_ argsInputOutput - (\(input,output) -> it input (parseArgsFromString Escaping input == output)) - --- | Fairly comprehensive checks. -argsInputOutput :: [(String, Either String [String])] -argsInputOutput = - [ ("x", Right ["x"]) - , ("x y z", Right ["x", "y", "z"]) - , ("aaa bbb ccc", Right ["aaa", "bbb", "ccc"]) - , (" aaa bbb ccc ", Right ["aaa", "bbb", "ccc"]) - , ("aaa\"", Left "unterminated string: endOfInput") - , ("\"", Left "unterminated string: endOfInput") - , ("\"\"", Right [""]) - , ("\"aaa", Left "unterminated string: endOfInput") - , ("\"aaa\" bbb ccc \"ddd\"", Right ["aaa", "bbb", "ccc", "ddd"]) - , ("\"aa\\\"a\" bbb ccc \"ddd\"", Right ["aa\"a", "bbb", "ccc", "ddd"]) - , ("\"aa\\\"a\" bb\\b ccc \"ddd\"", Right ["aa\"a", "bb\\b", "ccc", "ddd"]) - , ("\"\" \"\" c", Right ["","","c"])] - -interpreterArgsSpec :: Spec -interpreterArgsSpec = - describe "Script interpreter parser" $ do - describe "Success cases" $ do - describe "Line comments" $ do - checkLines "" - checkLines " --x" - checkLines " --x --y" - describe "Literate line comments" $ do - checkLiterateLines "" - checkLiterateLines " --x" - checkLiterateLines " --x --y" - describe "Block comments" $ do - checkBlocks "" - checkBlocks "\n" - checkBlocks " --x" - checkBlocks "\n--x" - checkBlocks " --x --y" - checkBlocks "\n--x\n--y" - checkBlocks "\n\t--x\n\t--y" - describe "Literate block comments" $ do - checkLiterateBlocks "" "" - checkLiterateBlocks "\n>" "" - checkLiterateBlocks " --x" " --x" - checkLiterateBlocks "\n>--x" "--x" - checkLiterateBlocks " --x --y " "--x --y" - checkLiterateBlocks "\n>--x\n>--y" "--x --y" - checkLiterateBlocks "\n>\t--x\n>\t--y" "--x --y" - describe "Failure cases" $ do - checkFailures - describe "Bare directives in literate files" $ do - forM_ (interpreterGenValid lineComment []) $ - testAndCheck (acceptFailure True) [] - forM_ (interpreterGenValid blockComment []) $ - testAndCheck (acceptFailure True) [] - where - parse isLiterate s = - P.parseOnly (interpreterArgsParser isLiterate stackProgName) (pack s) - - acceptSuccess :: Bool -> String -> String -> Bool - acceptSuccess isLiterate args s = case parse isLiterate s of - Right x | words x == words args -> True - _ -> False - - acceptFailure isLiterate _ s = case parse isLiterate s of - Left _ -> True - Right _ -> False - - testAndCheck checker out inp = it (show inp) $ checker out inp - - checkLines args = forM_ - (interpreterGenValid lineComment args) - (testAndCheck (acceptSuccess False) args) - - checkLiterateLines args = forM_ - (interpreterGenValid literateLineComment args) - (testAndCheck (acceptSuccess True) args) - - checkBlocks args = forM_ - (interpreterGenValid blockComment args) - (testAndCheck (acceptSuccess False) args) - - checkLiterateBlocks inp args = forM_ - (interpreterGenValid literateBlockComment inp) - (testAndCheck (acceptSuccess True) args) - - checkFailures = forM_ - interpreterGenInvalid - (testAndCheck (acceptFailure False) "unused") - - -- Generate a set of acceptable inputs for given format and args - interpreterGenValid fmt args = shebang <++> newLine <++> fmt args - - interpreterGenInvalid :: [String] - -- Generate a set of Invalid inputs - interpreterGenInvalid = - ["-stack\n"] -- random input - -- just the shebang - <|> shebang <++> ["\n"] - -- invalid shebang - <|> blockSpace <++> [head (interpreterGenValid lineComment args)] - -- something between shebang and Stack comment - <|> shebang - <++> newLine - <++> blockSpace - <++> ([head (lineComment args)] <|> [head (blockComment args)]) - -- unterminated block comment - -- just chop the closing chars from a valid block comment - <|> shebang - <++> ["\n"] - <++> let c = head (blockComment args) - l = length c - 2 - in [assert (drop l c == "-}") (take l c)] - -- nested block comment - <|> shebang - <++> ["\n"] - <++> [head (blockComment "--x {- nested -} --y")] - where - args = " --x --y" - (<++>) = liftA2 (++) - - -- Generative grammar for the interpreter comments - shebang = ["#!/usr/bin/env stack"] - newLine = ["\n"] <|> ["\r\n"] - - -- A comment may be the last line or followed by something else - postComment = [""] <|> newLine - - -- A command starts with zero or more whitespace followed by "stack" - makeComment maker space args = - let makePrefix s = (s <|> [""]) <++> [stackProgName] - in (maker <$> (makePrefix space <++> [args])) <++> postComment - - lineSpace = [" "] <|> ["\t"] - lineComment = makeComment makeLine lineSpace - where - makeLine s = "--" ++ s - - literateLineComment = makeComment ("> --" ++) lineSpace - - blockSpace = lineSpace <|> newLine - blockComment = makeComment makeBlock blockSpace - where - makeBlock s = "{-" ++ s ++ "-}" - - literateBlockComment = makeComment - (\s -> "> {-" ++ s ++ "-}") - (lineSpace <|> map (++ ">") newLine)
@@ -1,15 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} - -module Stack.Build.ExecuteSpec - ( main - , spec - ) where - -import Stack.Prelude -import Test.Hspec - -main :: IO () -main = hspec spec - -spec :: Spec -spec = pure ()
@@ -1,33 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} - -module Stack.Build.TargetSpec - ( main - , spec - ) where - -import qualified Data.Text as T -import Distribution.Types.PackageName (mkPackageName) -import Distribution.Version (mkVersion) -import Stack.Build.Target -import Stack.Prelude -import Stack.Types.NamedComponent -import Test.Hspec - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "parseRawTarget" $ do - let test s e = it s $ parseRawTarget (T.pack s) `shouldBe` e - test "foobar" $ Just $ RTPackage (mkPackageName "foobar") - test "foobar-1.2.3" $ Just $ RTPackageIdentifier $ PackageIdentifier - (mkPackageName "foobar") (mkVersion [1, 2, 3]) - test "./foobar" Nothing - test "foobar/" Nothing - test "/foobar" Nothing - test ":some-exe" $ Just $ RTComponent "some-exe" - test "foobar:some-exe" $ Just $ RTPackageComponent (mkPackageName "foobar") $ UnresolvedComponent "some-exe" - test "foobar:exe:some-exe" $ Just $ RTPackageComponent (mkPackageName "foobar") - $ ResolvedComponent $ CExe "some-exe"
@@ -1,29 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} - -module Stack.Config.DockerSpec - ( spec - ) where - -import Test.Hspec -import Stack.Prelude -import Stack.Types.Resolver -import RIO.Time (fromGregorian) -import Stack.Config.Docker (addDefaultTag) - -spec :: Spec -spec = do - describe "addDefaultTag" $ do - it "succeeds fails no resolver" $ addDefaultTag "foo/bar" Nothing Nothing `shouldBe` Nothing - it "succeeds on LTS" $ - addDefaultTag - "foo/bar" - Nothing - (Just $ ARResolver $ RSLSynonym $ LTS 1 2) - `shouldBe` Just "foo/bar:lts-1.2" - it "fails on nightly" $ - addDefaultTag - "foo/bar" - Nothing - (Just $ ARResolver $ RSLSynonym $ Nightly $ fromGregorian 2018 1 1) - `shouldBe` Nothing
@@ -1,259 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE RecordWildCards #-} - -module Stack.ConfigSpec - ( sampleConfig - , buildOptsConfig - , hpackConfig - , resolverConfig - , snapshotConfig - , resolverSnapshotConfig - , stackDotYaml - , setup - , noException - , spec - ) where - -import Control.Arrow ( left ) -import Data.Yaml ( decodeEither', parseEither ) -import Distribution.Verbosity ( verbose ) -import Pantry.Internal ( pcHpackExecutable ) -import Pantry.Internal.AesonExtended -import Path ( (</>), parent, parseAbsDir, parseRelDir, parseRelFile ) -import Path.IO hiding ( withSystemTempDir ) -import Stack.Config (defaultConfigYaml, loadConfig, loadConfigYaml ) -import Stack.Options.GlobalParser ( globalOptsFromMonoid ) -import Stack.Prelude -import Stack.Runners ( withBuildConfig, withRunnerGlobal ) -import Stack.Types.BuildConfig ( BuildConfig (..), projectRootL ) -import Stack.Types.BuildOpts - ( BenchmarkOpts (..), BuildOpts (..), CabalVerbosity (..) - , TestOpts (..) - ) -import Stack.Types.Config ( Config (..) ) -import Stack.Types.ConfigMonoid - ( ConfigMonoid (..), parseConfigMonoid ) -import Stack.Types.GlobalOpts ( GlobalOpts (..) ) -import Stack.Types.Project ( Project (..) ) -import Stack.Types.ProjectAndConfigMonoid - ( ProjectAndConfigMonoid (..), parseProjectAndConfigMonoid ) -import System.Directory - ( createDirectory, createDirectoryIfMissing - , getCurrentDirectory, setCurrentDirectory - ) -import System.Environment ( lookupEnv, setEnv, unsetEnv ) -import System.IO ( writeFile ) -import Test.Hspec - ( Selector, Spec, anyException, beforeAll, describe, example - , it, shouldBe, shouldThrow - ) - -sampleConfig :: String -sampleConfig = - "resolver: lts-19.22\n" ++ - "packages: ['.']\n" - -buildOptsConfig :: String -buildOptsConfig = - "resolver: lts-19.22\n" ++ - "packages: ['.']\n" ++ - "build:\n" ++ - " library-profiling: true\n" ++ - " executable-profiling: true\n" ++ - " haddock: true\n" ++ - " haddock-deps: true\n" ++ - " copy-bins: true\n" ++ - " prefetch: true\n" ++ - " force-dirty: true\n" ++ - " keep-going: true\n" ++ - " keep-tmp-files: true\n" ++ - " test: true\n" ++ - " test-arguments:\n" ++ - " rerun-tests: true\n" ++ - " additional-args: ['-fprof']\n" ++ - " coverage: true\n" ++ - " no-run-tests: true\n" ++ - " bench: true\n" ++ - " benchmark-opts:\n" ++ - " benchmark-arguments: -O2\n" ++ - " no-run-benchmarks: true\n" ++ - " reconfigure: true\n" ++ - " cabal-verbose: true\n" - -hpackConfig :: String -hpackConfig = - "resolver: lts-19.22\n" ++ - "with-hpack: /usr/local/bin/hpack\n" ++ - "packages: ['.']\n" - -resolverConfig :: String -resolverConfig = - "resolver: lts-19.22\n" ++ - "packages: ['.']\n" - -snapshotConfig :: String -snapshotConfig = - "snapshot: lts-19.22\n" ++ - "packages: ['.']\n" - -resolverSnapshotConfig :: String -resolverSnapshotConfig = - "resolver: lts-19.22\n" ++ - "snapshot: lts-19.22\n" ++ - "packages: ['.']\n" - -stackDotYaml :: Path Rel File -stackDotYaml = either impureThrow id (parseRelFile "stack.yaml") - -setup :: IO () -setup = unsetEnv "STACK_YAML" - -noException :: Selector SomeException -noException = const False - -spec :: Spec -spec = beforeAll setup $ do - let logLevel = LevelOther "silent" - -- TODO(danburton): not use inTempDir - let inTempDir action = do - currentDirectory <- getCurrentDirectory - withSystemTempDirectory "Stack_ConfigSpec" $ \tempDir -> do - let enterDir = setCurrentDirectory tempDir - let exitDir = setCurrentDirectory currentDirectory - bracket_ enterDir exitDir action - -- TODO(danburton): a safer version of this? - let withEnvVar name newValue action = do - originalValue <- fromMaybe "" <$> lookupEnv name - let setVar = setEnv name newValue - let resetVar = setEnv name originalValue - bracket_ setVar resetVar action - - describe "parseProjectAndConfigMonoid" $ do - let loadProject' fp inner = do - globalOpts <- globalOptsFromMonoid False mempty - withRunnerGlobal globalOpts { globalLogLevel = logLevel } $ do - iopc <- loadConfigYaml ( - parseProjectAndConfigMonoid (parent fp) - ) fp - ProjectAndConfigMonoid project _ <- liftIO iopc - liftIO $ inner project - - toAbsPath path = do - parentDir <- getCurrentDirectory >>= parseAbsDir - pure (parentDir </> path) - - loadProject config inner = do - yamlAbs <- toAbsPath stackDotYaml - writeFile (toFilePath yamlAbs) config - loadProject' yamlAbs inner - - it "parses snapshot using 'resolver'" $ inTempDir $ do - loadProject resolverConfig $ \Project{..} -> - projectResolver `shouldBe` RSLSynonym (LTS 19 22) - - it "parses snapshot using 'snapshot'" $ inTempDir $ do - loadProject snapshotConfig $ \Project{..} -> - projectResolver `shouldBe` RSLSynonym (LTS 19 22) - - it "throws if both 'resolver' and 'snapshot' are present" $ inTempDir $ do - loadProject resolverSnapshotConfig (const (pure ())) - `shouldThrow` anyException - - describe "loadConfig" $ do - let loadConfig' inner = do - globalOpts <- globalOptsFromMonoid False mempty - withRunnerGlobal globalOpts { globalLogLevel = logLevel } $ - loadConfig inner - -- TODO(danburton): make sure parent dirs also don't have config file - it "works even if no config file exists" $ example $ - loadConfig' $ const $ pure () - - it "works with a blank config file" $ inTempDir $ do - writeFile (toFilePath stackDotYaml) "" - -- TODO(danburton): more specific test for exception - loadConfig' (const (pure ())) `shouldThrow` anyException - - let configOverrideHpack = pcHpackExecutable . view pantryConfigL - - it "parses config option with-hpack" $ inTempDir $ do - writeFile (toFilePath stackDotYaml) hpackConfig - loadConfig' $ \config -> - liftIO $ configOverrideHpack config `shouldBe` - HpackCommand "/usr/local/bin/hpack" - - it "parses config bundled Hpack" $ inTempDir $ do - writeFile (toFilePath stackDotYaml) sampleConfig - loadConfig' $ \config -> - liftIO $ configOverrideHpack config `shouldBe` HpackBundled - - it "parses build config options" $ inTempDir $ do - writeFile (toFilePath stackDotYaml) buildOptsConfig - loadConfig' $ \config -> liftIO $ do - let BuildOpts{..} = configBuild config - boptsLibProfile `shouldBe` True - boptsExeProfile `shouldBe` True - boptsHaddock `shouldBe` True - boptsHaddockDeps `shouldBe` Just True - boptsInstallExes `shouldBe` True - boptsPreFetch `shouldBe` True - boptsKeepGoing `shouldBe` Just True - boptsKeepTmpFiles `shouldBe` True - boptsForceDirty `shouldBe` True - boptsTests `shouldBe` True - boptsTestOpts `shouldBe` TestOpts { toRerunTests = True - , toAdditionalArgs = ["-fprof"] - , toCoverage = True - , toDisableRun = True - , toMaximumTimeSeconds = Nothing - , toAllowStdin = True - } - boptsBenchmarks `shouldBe` True - boptsBenchmarkOpts `shouldBe` BenchmarkOpts { beoAdditionalArgs = Just "-O2" - , beoDisableRun = True - } - boptsReconfigure `shouldBe` True - boptsCabalVerbose `shouldBe` CabalVerbosity verbose - - it "finds the config file in a parent directory" $ inTempDir $ do - writeFile "package.yaml" "name: foo" - writeFile (toFilePath stackDotYaml) sampleConfig - parentDir <- getCurrentDirectory >>= parseAbsDir - let childDir = "child" - createDirectory childDir - setCurrentDirectory childDir - loadConfig' $ \config -> liftIO $ do - bc <- runRIO config $ withBuildConfig ask - view projectRootL bc `shouldBe` parentDir - - it "respects the STACK_YAML env variable" $ inTempDir $ do - withSystemTempDir "config-is-here" $ \dir -> do - let stackYamlFp = toFilePath (dir </> stackDotYaml) - writeFile stackYamlFp sampleConfig - writeFile (toFilePath dir ++ "/package.yaml") "name: foo" - withEnvVar "STACK_YAML" stackYamlFp $ loadConfig' $ \config -> liftIO $ do - BuildConfig{..} <- runRIO config $ withBuildConfig ask - bcStackYaml `shouldBe` dir </> stackDotYaml - parent bcStackYaml `shouldBe` dir - - it "STACK_YAML can be relative" $ inTempDir $ do - parentDir <- getCurrentDirectory >>= parseAbsDir - let childRel = either impureThrow id (parseRelDir "child") - yamlRel = childRel </> either impureThrow id (parseRelFile "some-other-name.config") - yamlAbs = parentDir </> yamlRel - packageYaml = childRel </> either impureThrow id (parseRelFile "package.yaml") - createDirectoryIfMissing True $ toFilePath $ parent yamlAbs - writeFile (toFilePath yamlAbs) "resolver: ghc-9.0" - writeFile (toFilePath packageYaml) "name: foo" - withEnvVar "STACK_YAML" (toFilePath yamlRel) $ loadConfig' $ \config -> liftIO $ do - BuildConfig{..} <- runRIO config $ withBuildConfig ask - bcStackYaml `shouldBe` yamlAbs - - describe "defaultConfigYaml" $ - it "is parseable" $ \_ -> do - curDir <- getCurrentDir - let parsed :: Either String (Either String (WithJSONWarnings ConfigMonoid)) - parsed = parseEither (parseConfigMonoid curDir) <$> left show (decodeEither' defaultConfigYaml) - case parsed of - Right (Right _) -> pure () :: IO () - _ -> fail "Failed to parse default config yaml"
@@ -1,134 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} - --- | Test suite for Stack.Dot -module Stack.DotSpec - ( dummyPayload - , spec - , sublistOf - , pkgName - , stubLoader - ) where - -import Data.List ((\\)) -import qualified Data.Map as Map -import qualified Data.Set as Set -import Distribution.License ( License (BSD3) ) -import qualified RIO.Text as T -import Stack.Dot ( DotPayload (..), pruneGraph, resolveDependencies ) -import Stack.Prelude hiding ( pkgName ) -import Test.Hspec ( Spec, describe, it, shouldBe ) -import Test.Hspec.QuickCheck ( prop ) -import Test.QuickCheck ( Gen, choose, forAll ) - -dummyPayload :: DotPayload -dummyPayload = DotPayload (parseVersion "0.0.0.0") (Just (Right BSD3)) Nothing - -spec :: Spec -spec = do - let graph = - Map.mapKeys pkgName - . fmap (\p -> (Set.map pkgName p, dummyPayload)) - . Map.fromList $ [("one",Set.fromList ["base","free"]) - ,("two",Set.fromList ["base","free","mtl","transformers","one"]) - ] - describe "Stack.Dot" $ do - it "does nothing if depth is 0" $ - resolveDependencies (Just 0) graph stubLoader `shouldBe` pure graph - - it "with depth 1, more dependencies are resolved" $ do - let graph' = Map.insert (pkgName "cycle") - (Set.singleton (pkgName "cycle"), dummyPayload) - graph - resultGraph = runIdentity (resolveDependencies (Just 0) graph stubLoader) - resultGraph' = runIdentity (resolveDependencies (Just 1) graph' stubLoader) - Map.size resultGraph < Map.size resultGraph' `shouldBe` True - - it "cycles are ignored" $ do - let graph' = Map.insert (pkgName "cycle") - (Set.singleton (pkgName "cycle"), dummyPayload) - graph - resultGraph = resolveDependencies Nothing graph stubLoader - resultGraph' = resolveDependencies Nothing graph' stubLoader - fmap Map.size resultGraph' `shouldBe` fmap ((+1) . Map.size) resultGraph - - let graphElem e = Set.member e . Set.unions . Map.elems - - prop "requested packages are pruned" $ do - let resolvedGraph = runIdentity (resolveDependencies Nothing graph stubLoader) - allPackages g = Map.keysSet g `Set.union` foldMap fst g - forAll (sublistOf (Set.toList (allPackages resolvedGraph))) $ \toPrune -> - let pruned = pruneGraph [pkgName "one", pkgName "two"] toPrune resolvedGraph - in Set.null (allPackages pruned `Set.intersection` Set.fromList toPrune) - - prop "pruning removes orphans" $ do - let resolvedGraph = runIdentity (resolveDependencies Nothing graph stubLoader) - allPackages g = Map.keysSet g `Set.union` foldMap fst g - orphans g = Map.filterWithKey (\k _ -> not (graphElem k g)) g - forAll (sublistOf (Set.toList (allPackages resolvedGraph))) $ \toPrune -> - let pruned = pruneGraph [pkgName "one", pkgName "two"] toPrune resolvedGraph - in null (Map.keys (orphans (fmap fst pruned)) \\ [pkgName "one", pkgName "two"]) - -{- Helper functions below -} --- Backport from QuickCheck 2.8 to 2.7.6 -sublistOf :: [a] -> Gen [a] -sublistOf = filterM (\_ -> choose (False, True)) - --- Unsafe internal helper to create a package name -pkgName :: Text -> PackageName -pkgName = fromMaybe failure . parsePackageName . T.unpack - where - failure = error "Internal error during package name creation in DotSpec.pkgName" - --- Stub, simulates the function to load package dependencies -stubLoader :: PackageName -> Identity (Set PackageName, DotPayload) -stubLoader name = pure $ (, dummyPayload) . Set.fromList . map pkgName $ - case show name of - "StateVar" -> ["stm", "transformers"] - "array" -> [] - "bifunctors" -> ["semigroupoids", "semigroups", "tagged"] - "binary" -> ["array", "bytestring", "containers"] - "bytestring" -> ["deepseq", "ghc-prim", "integer-gmp"] - "comonad" -> [ "containers", "contravariant", "distributive", "semigroups" - , "tagged","transformers","transformers-compat" - ] - "cont" -> [ "StateVar", "semigroups", "transformers", "transformers-compat" - , "void" - ] - "containers" -> ["array", "deepseq", "ghc-prim"] - "deepseq" -> ["array"] - "distributive" -> [ "ghc-prim", "tagged", "transformers" - , "transformers-compat" - ] - "free" -> [ "bifunctors", "comonad", "distributive", "mtl", "prelude-extras" - , "profunctors", "semigroupoids", "semigroups", "template-haskell" - , "transformers" - ] - "ghc" -> [] - "hashable" -> ["bytestring", "ghc-prim", "integer-gmp", "text"] - "integer" -> [] - "mtl" -> ["transformers"] - "nats" -> [] - "one" -> ["free"] - "prelude" -> [] - "profunctors" -> [ "comonad", "distributive", "semigroupoids", "tagged" - , "transformers" - ] - "semigroupoids" -> [ "comonad", "containers", "contravariant" - , "distributive", "semigroups", "transformers" - , "transformers-compat" - ] - "semigroups" -> [ "bytestring", "containers", "deepseq", "hashable", "nats" - , "text", "unordered-containers" - ] - "stm" -> ["array"] - "tagged" -> ["template-haskell"] - "template" -> [] - "text" -> [ "array", "binary", "bytestring", "deepseq", "ghc-prim" - , "integer-gmp" - ] - "transformers" -> [] - "two" -> ["free", "mtl", "one", "transformers"] - "unordered" -> ["deepseq", "hashable"] - "void" -> ["ghc-prim", "hashable", "semigroups"] - _ -> []
@@ -1,65 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE OverloadedLists #-} -{-# LANGUAGE TemplateHaskell #-} - --- | Test suite for the GhciScript DSL -module Stack.Ghci.ScriptSpec - ( spec - ) where - -import qualified Data.Set as S -import Distribution.ModuleName -import Test.Hspec -import qualified System.FilePath as FP -import Stack.Ghci.FakePaths -import Stack.Prelude hiding (fromString) -import Path -import Path.Extra (pathToLazyByteString) - -import Stack.Ghci.Script - -spec :: Spec -spec = do - describe "GHCi" $ do - describe "Script DSL" $ do - - describe "script" $ do - it "should separate commands with a newline" $ do - let dir = $(mkAbsDir $ defaultDrive FP.</> "src" FP.</> "package-a") - script = cmdCdGhc dir - <> cmdAdd [Left (fromString "Lib.A")] - scriptToLazyByteString script `shouldBe` - ":cd-ghc " <> pathToLazyByteString dir <> "\n:add Lib.A\n" - - describe ":add" $ do - it "should not render empty add commands" $ do - let script = cmdAdd S.empty - scriptToLazyByteString script `shouldBe` "" - - it "should ensure that a space exists between each module in an add command" $ do - let script = cmdAdd (S.fromList [Left (fromString "Lib.A"), Left (fromString "Lib.B")]) - scriptToLazyByteString script `shouldBe` ":add Lib.A Lib.B\n" - - describe ":add (by file)" $ do - it "should render a full file path" $ do - let file = $(mkAbsFile $ defaultDrive FP.</> "Users" FP.</> "someone" FP.</> "src" FP.</> "project" FP.</> "package-a" FP.</> "src" FP.</> "Main.hs") - script = cmdAdd (S.fromList [Right file]) - scriptToLazyByteString script `shouldBe` - ":add " <> pathToLazyByteString file <> "\n" - - describe ":cd-ghc" $ do - it "should render a full absolute path" $ do - let dir = $(mkAbsDir $ defaultDrive FP.</> "Users" FP.</> "someone" FP.</> "src" FP.</> "project" FP.</> "package-a") - script = cmdCdGhc dir - scriptToLazyByteString script `shouldBe` - ":cd-ghc " <> pathToLazyByteString dir <> "\n" - - describe ":module" $ do - it "should render empty module as ':module +'" $ do - let script = cmdModule [] - scriptToLazyByteString script `shouldBe` ":module +\n" - - it "should ensure that a space exists between each module in a module command" $ do - let script = cmdModule [fromString "Lib.A", fromString "Lib.B"] - scriptToLazyByteString script `shouldBe` ":module + Lib.A Lib.B\n"
@@ -1,309 +0,0 @@--- {-# LANGUAGE NoImplicitPrelude #-} --- {-# LANGUAGE QuasiQuotes #-} --- {-# LANGUAGE TemplateHaskell #-} - --- | Test suite for GHCi like applications including both GHCi and Intero. -module Stack.GhciSpec - ( spec - ) where - -import Test.Hspec ( Spec ) - -spec :: Spec -spec = pure () - -{- Commented out as part of the fix for https://github.com/commercialhaskell/stack/issues/3309 - Not sure if maintaining this test is worth the effort. - -import qualified Data.ByteString.Lazy as LBS -import qualified Data.Map as M -import qualified Data.Set as S -import qualified Data.Text as T -import qualified Data.Text.Encoding as T -import Distribution.License (License (BSD3)) -import qualified Distribution.ModuleName as ModuleName -import Distribution.PackageDescription (BuildType(..)) -import Stack.Prelude -import Stack.Types.Package -import Stack.Types.PackageName -import Stack.Types.Version -import Test.Hspec -import NeatInterpolation -import Path -import Path.Extra (pathToText) -import qualified System.FilePath as FP - -import Stack.Ghci -import Stack.Ghci.Script (scriptToLazyByteString) -import Stack.Ghci.PortableFakePaths - -textToLazy :: Text -> LBS.ByteString -textToLazy = LBS.fromStrict . T.encodeUtf8 - --- | Matches two strings, after converting line-ends in the second to Unix ones --- (in a hacky way) and converting both to the same type. Workaround for --- https://github.com/nikita-volkov/neat-interpolation/issues/14. -shouldBeLE :: LBS.ByteString -> Text -> Expectation -shouldBeLE actual expected = shouldBe actual (textToLazy $ T.filter (/= '\r') expected) - -baseProjDir, projDirA, projDirB :: Path Abs Dir -baseProjDir = $(mkAbsDir $ defaultDrive FP.</> "Users" FP.</> "someone" FP.</> "src") -projDirA = baseProjDir </> either impureThrow id (parseRelDir "project-a") -projDirB = baseProjDir </> either impureThrow id (parseRelDir "project-b") - -relFile :: Path Rel File -relFile = either impureThrow id (parseRelFile $ "exe" FP.</> "Main.hs") - -absFile :: Path Abs File -absFile = projDirA </> relFile - -projDirAT, projDirBT, relFileT, absFileT :: Text -projDirAT = pathToText projDirA -projDirBT = pathToText projDirB -relFileT = pathToText relFile -absFileT = pathToText absFile - -spec :: Spec -spec = do - describe "GHCi" $ do - describe "Script rendering" $ do - describe "should render GHCi scripts" $ do - it "with one library package" $ do - let res = scriptToLazyByteString $ renderScriptGhci packages_singlePackage Nothing [] - res `shouldBeLE` ghciScript_projectWithLib - - it "with one main package" $ do - let res = scriptToLazyByteString $ renderScriptGhci [] - (Just absFile) - [] - res `shouldBeLE` ghciScript_projectWithMain - - it "with one library and main package" $ do - let res = scriptToLazyByteString $ renderScriptGhci packages_singlePackage - (Just absFile) - [] - res `shouldBeLE` ghciScript_projectWithLibAndMain - - it "with multiple library packages" $ do - let res = scriptToLazyByteString $ renderScriptGhci packages_multiplePackages Nothing [] - res `shouldBeLE` ghciScript_multipleProjectsWithLib - - describe "should render intero scripts" $ do - it "with one library package" $ do - let res = scriptToLazyByteString $ renderScriptIntero packages_singlePackage Nothing [] - res `shouldBeLE` interoScript_projectWithLib - - it "with one main package" $ do - let res = scriptToLazyByteString $ renderScriptIntero packages_singlePackage - (Just absFile) - [] - res `shouldBeLE` interoScript_projectWithMain - - it "with one library and main package" $ do - let res = scriptToLazyByteString $ renderScriptIntero packages_singlePackage - (Just absFile) - [] - res `shouldBeLE` interoScript_projectWithLibAndMain - - it "with multiple library packages" $ do - let res = scriptToLazyByteString $ renderScriptIntero packages_multiplePackages Nothing [] - res `shouldBeLE` interoScript_multipleProjectsWithLib - --- Expected Intero scripts - -interoScript_projectWithLib :: Text -interoScript_projectWithLib = [text| -:cd-ghc $projDirAT -:add Lib.A -:module + Lib.A - -|] - -interoScript_projectWithMain :: Text -interoScript_projectWithMain = [text| -:cd-ghc $projDirAT -:add Lib.A -:cd-ghc $projDirAT -:add $absFileT -:module + Lib.A - -|] - -interoScript_projectWithLibAndMain :: Text -interoScript_projectWithLibAndMain = [text| -:cd-ghc $projDirAT -:add Lib.A -:cd-ghc $projDirAT -:add $absFileT -:module + Lib.A - -|] - -interoScript_multipleProjectsWithLib :: Text -interoScript_multipleProjectsWithLib = [text| -:cd-ghc $projDirAT -:add Lib.A -:cd-ghc $projDirBT -:add Lib.B -:module + Lib.A Lib.B - -|] - --- Expected GHCi Scripts - -ghciScript_projectWithLib :: Text -ghciScript_projectWithLib = [text| -:add Lib.A -:module + Lib.A - -|] - -ghciScript_projectWithMain :: Text -ghciScript_projectWithMain = [text| -:add $absFileT -:module + - -|] - -ghciScript_projectWithLibAndMain :: Text -ghciScript_projectWithLibAndMain = [text| -:add Lib.A -:add $absFileT -:module + Lib.A - -|] - -ghciScript_multipleProjectsWithLib :: Text -ghciScript_multipleProjectsWithLib = [text| -:add Lib.A -:add Lib.B -:module + Lib.A Lib.B - -|] - --- Expected Legacy GHCi scripts - -ghciLegacyScript_projectWithMain :: Text -ghciLegacyScript_projectWithMain = [text| -:add -:add $absFileT -:module + -|] - -ghciLegacyScript_projectWithLibAndMain :: Text -ghciLegacyScript_projectWithLibAndMain = [text| -:add Lib.A -:add $absFileT -:module + Lib.A -|] - -ghciLegacyScript_multipleProjectsWithLib :: Text -ghciLegacyScript_multipleProjectsWithLib = [text| -:add Lib.A Lib.B - -:module + Lib.A Lib.B -|] - --- Sample GHCi load configs - -packages_singlePackage :: [GhciPkgInfo] -packages_singlePackage = - [ GhciPkgInfo - { ghciPkgModules = S.fromList [ModuleName.fromString "Lib.A"] - , ghciPkgDir = projDirA - , ghciPkgName = $(mkPackageName "package-a") - , ghciPkgOpts = [] - , ghciPkgModFiles = S.empty - , ghciPkgCFiles = S.empty - , ghciPkgMainIs = M.empty - , ghciPkgTargetFiles = Nothing - , ghciPkgPackage = - Package - { packageName = $(mkPackageName "package-a") - , packageVersion = $(mkVersion "0.1.0.0") - , packageLicense = BSD3 - , packageFiles = GetPackageFiles undefined - , packageDeps = M.empty - , packageTools = [] - , packageAllDeps = S.empty - , packageGhcOptions = [] - , packageFlags = M.empty - , packageDefaultFlags = M.empty - , packageHasLibrary = True - , packageTests = M.empty - , packageBenchmarks = S.empty - , packageExes = S.empty - , packageOpts = GetPackageOpts undefined - , packageHasExposedModules = True - , packageBuildType = Just Simple - , packageSetupDeps = Nothing - } - } - ] - -packages_multiplePackages :: [GhciPkgInfo] -packages_multiplePackages = - [ GhciPkgInfo - { ghciPkgModules = S.fromList [ModuleName.fromString "Lib.A"] - , ghciPkgDir = projDirA - , ghciPkgName = $(mkPackageName "package-a") - , ghciPkgOpts = [] - , ghciPkgModFiles = S.empty - , ghciPkgCFiles = S.empty - , ghciPkgMainIs = M.empty - , ghciPkgTargetFiles = Nothing - , ghciPkgPackage = - Package - { packageName = $(mkPackageName "package-a") - , packageVersion = $(mkVersion "0.1.0.0") - , packageLicense = BSD3 - , packageFiles = GetPackageFiles undefined - , packageDeps = M.empty - , packageTools = [] - , packageAllDeps = S.empty - , packageGhcOptions = [] - , packageFlags = M.empty - , packageDefaultFlags = M.empty - , packageHasLibrary = True - , packageTests = M.empty - , packageBenchmarks = S.empty - , packageExes = S.empty - , packageOpts = GetPackageOpts undefined - , packageHasExposedModules = True - , packageBuildType = Just Simple - , packageSetupDeps = Nothing - } - } - , GhciPkgInfo - { ghciPkgModules = S.fromList [ModuleName.fromString "Lib.B"] - , ghciPkgDir = projDirB - , ghciPkgName = $(mkPackageName "package-b") - , ghciPkgOpts = [] - , ghciPkgModFiles = S.empty - , ghciPkgCFiles = S.empty - , ghciPkgMainIs = M.empty - , ghciPkgTargetFiles = Nothing - , ghciPkgPackage = - Package - { packageName = $(mkPackageName "package-b") - , packageVersion = $(mkVersion "0.1.0.0") - , packageLicense = BSD3 - , packageFiles = GetPackageFiles undefined - , packageDeps = M.empty - , packageTools = [] - , packageAllDeps = S.empty - , packageGhcOptions = [] - , packageFlags = M.empty - , packageDefaultFlags = M.empty - , packageHasLibrary = True - , packageTests = M.empty - , packageBenchmarks = S.empty - , packageExes = S.empty - , packageOpts = GetPackageOpts undefined - , packageHasExposedModules = True - , packageBuildType = Just Simple - , packageSetupDeps = Nothing - } - } - ] --}
@@ -1,166 +0,0 @@-{-# LANGUAGE QuasiQuotes #-} -{-# LANGUAGE OverloadedStrings #-} - -module Stack.LockSpec - ( toBlobKey - , decodeSHA - , decodeLocked - , spec - ) where - -import qualified Data.Yaml as Yaml -import Distribution.Types.PackageName ( mkPackageName ) -import Distribution.Types.Version ( mkVersion ) -import Pantry - ( BlobKey (..), FileSize (..), PackageIdentifier (..) - , PackageLocationImmutable (..), PackageMetadata (..) - , RawPackageLocationImmutable (..), RawPackageMetadata (..) - , Repo (..), RepoType (..), SHA256, TreeKey (..) - , resolvePaths - ) -import Pantry.Internal.AesonExtended ( WithJSONWarnings (..) ) -import qualified Pantry.SHA256 as SHA256 -import RIO ( ByteString, displayException, throwIO, unless ) -import Stack.Lock ( Locked (..), LockedLocation (..) ) -import Test.Hspec ( Spec, it, shouldBe ) -import Text.RawString.QQ ( r ) - -toBlobKey :: ByteString -> Word -> BlobKey -toBlobKey string size = BlobKey (decodeSHA string) (FileSize size) - -decodeSHA :: ByteString -> SHA256 -decodeSHA string = - case SHA256.fromHexBytes string of - Right csha -> csha - Left err -> error $ "Failed decoding. Error: " <> displayException err - -decodeLocked :: ByteString -> IO Locked -decodeLocked bs = do - val <- Yaml.decodeThrow bs - case Yaml.parseEither Yaml.parseJSON val of - Left err -> throwIO $ Yaml.AesonException err - Right (WithJSONWarnings res warnings) -> do - unless (null warnings) $ - throwIO $ Yaml.AesonException $ "Unexpected warnings: " ++ show warnings - -- we just assume no file references - resolvePaths Nothing res - -spec :: Spec -spec = do - it "parses lock file (empty with GHC resolver)" $ do - let lockFile :: ByteString - lockFile = - [r|#some -snapshots: -- completed: - compiler: ghc-8.6.5 - original: - compiler: ghc-8.6.5 -packages: [] -|] - pkgImm <- lckPkgImmutableLocations <$> decodeLocked lockFile - pkgImm `shouldBe` [] - it "parses lock file (empty with LTS resolver)" $ do - let lockFile :: ByteString - lockFile = - [r|#some -snapshots: -- completed: - size: 527801 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/22.yaml - sha256: 7c8b1853da784bd7beb8728168bf4e879d8a2f6daf408ca0fa7933451864a96a - original: lts-14.27 -- completed: - compiler: ghc-8.6.5 - original: - compiler: ghc-8.6.5 -packages: [] -|] - pkgImm <- lckPkgImmutableLocations <$> decodeLocked lockFile - pkgImm `shouldBe` [] - it "parses lock file (LTS, wai + warp)" $ do - let lockFile :: ByteString - lockFile = - [r|#some -snapshots: -- completed: - size: 527801 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/22.yaml - sha256: 7c8b1853da784bd7beb8728168bf4e879d8a2f6daf408ca0fa7933451864a96a - original: lts-14.27 -- completed: - compiler: ghc-8.6.5 - original: - compiler: ghc-8.6.5 -packages: -- original: - subdir: wai - git: https://github.com/yesodweb/wai.git - commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 - completed: - subdir: wai - name: wai - version: 3.2.1.2 - git: https://github.com/yesodweb/wai.git - pantry-tree: - size: 714 - sha256: ecfd0b4b75f435a3f362394807b35e5ef0647b1a25005d44a3632c49db4833d2 - commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 -- original: - subdir: warp - git: https://github.com/yesodweb/wai.git - commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 - completed: - subdir: warp - name: warp - version: 3.2.25 - git: https://github.com/yesodweb/wai.git - pantry-tree: - size: 5103 - sha256: f808e075811b002563d24c393ce115be826bb66a317d38da22c513ee42b7443a - commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 -|] - pkgImm <- lckPkgImmutableLocations <$> decodeLocked lockFile - let waiSubdirRepo subdir = - Repo { repoType = RepoGit - , repoUrl = "https://github.com/yesodweb/wai.git" - , repoCommit = - "d11d63f1a6a92db8c637a8d33e7953ce6194a3e0" - , repoSubdir = subdir - } - emptyRPM = RawPackageMetadata { rpmName = Nothing - , rpmVersion = Nothing - , rpmTreeKey = Nothing - } - pkgImm `shouldBe` - [ LockedLocation - (RPLIRepo (waiSubdirRepo "wai") emptyRPM) - (PLIRepo (waiSubdirRepo "wai") - (PackageMetadata { pmIdent = - PackageIdentifier - { pkgName = mkPackageName "wai" - , pkgVersion = mkVersion [3, 2, 1, 2] - } - , pmTreeKey = - TreeKey - (BlobKey - (decodeSHA - "ecfd0b4b75f435a3f362394807b35e5ef0647b1a25005d44a3632c49db4833d2") - (FileSize 714)) - })) - , LockedLocation - (RPLIRepo (waiSubdirRepo "warp") emptyRPM) - (PLIRepo (waiSubdirRepo "warp") - (PackageMetadata { pmIdent = - PackageIdentifier - { pkgName = mkPackageName "warp" - , pkgVersion = mkVersion [3, 2, 25] - } - , pmTreeKey = - TreeKey - (BlobKey - (decodeSHA - "f808e075811b002563d24c393ce115be826bb66a317d38da22c513ee42b7443a") - (FileSize 5103)) - })) - ]
@@ -1,113 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} - -module Stack.NixSpec - ( sampleConfigNixEnabled - , sampleConfigNixDisabled - , setup - , spec - ) where - -import Data.Maybe ( fromJust ) -import Options.Applicative - ( defaultPrefs, execParserPure, getParseResult, info ) -import Prelude ( writeFile ) -import Stack.Config ( loadConfig ) -import Stack.Config.Nix ( nixCompiler ) -import Stack.Constants ( osIsWindows, stackDotYaml ) -import Stack.Options.GlobalParser ( globalOptsFromMonoid ) -import Stack.Options.NixParser ( nixOptsParser ) -import Stack.Prelude -import Stack.Runners ( withRunnerGlobal ) -import Stack.Types.Config ( Config (..) ) -import Stack.Types.ConfigMonoid ( ConfigMonoid (..) ) -import Stack.Types.GlobalOpts ( GlobalOpts (..) ) -import Stack.Types.GlobalOptsMonoid ( GlobalOptsMonoid (..) ) -import Stack.Types.Nix ( NixOpts (..) ) -import System.Directory ( getCurrentDirectory, setCurrentDirectory ) -import System.Environment ( unsetEnv ) -import Test.Hspec ( Spec, around_, beforeAll, describe, it, shouldBe ) - -sampleConfigNixEnabled :: String -sampleConfigNixEnabled = - "resolver: lts-19.22\n" ++ - "packages: ['.']\n" ++ - "system-ghc: true\n" ++ - "nix:\n" ++ - " enable: True\n" ++ - " packages: [glpk]" - -sampleConfigNixDisabled :: String -sampleConfigNixDisabled = - "resolver: lts-19.22\n" ++ - "packages: ['.']\n" ++ - "nix:\n" ++ - " enable: False" - -setup :: IO () -setup = unsetEnv "STACK_YAML" - -spec :: Spec -spec = beforeAll setup $ do - let loadConfig' :: ConfigMonoid -> (Config -> IO ()) -> IO () - loadConfig' cmdLineArgs inner = do - globalOpts <- globalOptsFromMonoid False mempty { globalMonoidConfigMonoid = cmdLineArgs } - withRunnerGlobal globalOpts { globalLogLevel = LevelOther "silent" } $ - loadConfig (liftIO . inner) - inTempDir test = do - currentDirectory <- getCurrentDirectory - withSystemTempDirectory "Stack_ConfigSpec" $ \tempDir -> do - let enterDir = setCurrentDirectory tempDir - exitDir = setCurrentDirectory currentDirectory - bracket_ enterDir exitDir test - withStackDotYaml config test = inTempDir $ do - writeFile (toFilePath stackDotYaml) config - test - parseNixOpts cmdLineOpts = fromJust $ getParseResult $ execParserPure - defaultPrefs - (info (nixOptsParser False) mempty) - cmdLineOpts - parseOpts cmdLineOpts = mempty { configMonoidNixOpts = parseNixOpts cmdLineOpts } - let trueOnNonWindows = not osIsWindows - describe "nix disabled in config file" $ - around_ (withStackDotYaml sampleConfigNixDisabled) $ do - it "sees that the nix shell is not enabled" $ loadConfig' mempty $ \config -> - nixEnable (configNix config) `shouldBe` False - describe "--nix given on command line" $ - it "sees that the nix shell is enabled" $ - loadConfig' (parseOpts ["--nix"]) $ \config -> - nixEnable (configNix config) `shouldBe` trueOnNonWindows - describe "--nix-pure given on command line" $ - it "sees that the nix shell is enabled" $ - loadConfig' (parseOpts ["--nix-pure"]) $ \config -> - nixEnable (configNix config) `shouldBe` trueOnNonWindows - describe "--no-nix given on command line" $ - it "sees that the nix shell is not enabled" $ - loadConfig' (parseOpts ["--no-nix"]) $ \config -> - nixEnable (configNix config) `shouldBe` False - describe "--no-nix-pure given on command line" $ - it "sees that the nix shell is not enabled" $ - loadConfig' (parseOpts ["--no-nix-pure"]) $ \config -> - nixEnable (configNix config) `shouldBe` False - describe "nix enabled in config file" $ - around_ (withStackDotYaml sampleConfigNixEnabled) $ do - it "sees that the nix shell is enabled" $ - loadConfig' mempty $ \config -> - nixEnable (configNix config) `shouldBe` trueOnNonWindows - describe "--no-nix given on command line" $ - it "sees that the nix shell is not enabled" $ - loadConfig' (parseOpts ["--no-nix"]) $ \config -> - nixEnable (configNix config) `shouldBe` False - describe "--nix-pure given on command line" $ - it "sees that the nix shell is enabled" $ - loadConfig' (parseOpts ["--nix-pure"]) $ \config -> - nixEnable (configNix config) `shouldBe` trueOnNonWindows - describe "--no-nix-pure given on command line" $ - it "sees that the nix shell is enabled" $ - loadConfig' (parseOpts ["--no-nix-pure"]) $ \config -> - nixEnable (configNix config) `shouldBe` trueOnNonWindows - it "sees that the only package asked for is glpk and asks for the correct GHC derivation" $ loadConfig' mempty $ \config -> do - nixPackages (configNix config) `shouldBe` ["glpk"] - v <- parseVersionThrowing "9.0.2" - ghc <- either throwIO pure $ nixCompiler (WCGhc v) - ghc `shouldBe` "haskell.compiler.ghc902"
@@ -1,284 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} - -module Stack.PackageDumpSpec - ( main - , spec - , bestPrune - , checkDepsPresent - , runEnvNoLogging - ) where - -import Conduit ( withSourceFile, yield ) -import qualified Data.Conduit.List as CL -import Data.Conduit.Text ( decodeUtf8 ) -import qualified Data.Map as Map -import qualified Data.Set as Set -import Distribution.License ( License (..) ) -import Distribution.Types.PackageName ( mkPackageName ) -import Distribution.Version ( mkVersion ) -import Path ( parseAbsFile ) -import RIO.PrettyPrint.Simple ( SimplePrettyApp, mkSimplePrettyApp ) -import RIO.Process - ( envVarsL, findExecutable, mkDefaultProcessContext - , mkProcessContext - ) -import Stack.PackageDump - ( DumpPackage (..), conduitDumpPackage, eachPair - , eachSection, ghcPkgDump, pruneDeps, sinkMatching - ) -import Stack.Prelude -import Stack.Types.CompilerPaths ( GhcPkgExe (..) ) -import Stack.Types.GhcPkgId ( parseGhcPkgId ) -import Test.Hspec - ( Spec, describe, hspec, it, shouldBe ) -import Test.Hspec.QuickCheck ( prop ) - -main :: IO () -main = hspec spec - -spec :: Spec -spec = do - describe "eachSection" $ do - let test name content expected = it name $ do - actual <- runConduit $ yield content .| eachSection CL.consume .| CL.consume - actual `shouldBe` expected - test - "unix line endings" - "foo\nbar\n---\nbaz---\nbin\n---\n" - [ ["foo", "bar"] - , ["baz---", "bin"] - ] - test - "windows line endings" - "foo\r\nbar\r\n---\r\nbaz---\r\nbin\r\n---\r\n" - [ ["foo", "bar"] - , ["baz---", "bin"] - ] - - it "eachPair" $ do - let bss = - [ "key1: val1" - , "key2: val2a" - , " val2b" - , "key3:" - , "key4:" - , " val4a" - , " val4b" - ] - sink k = fmap (k, ) CL.consume - actual <- runConduit $ mapM_ yield bss .| eachPair sink .| CL.consume - actual `shouldBe` - [ ("key1", ["val1"]) - , ("key2", ["val2a", "val2b"]) - , ("key3", []) - , ("key4", ["val4a", "val4b"]) - ] - - describe "conduitDumpPackage" $ do - it "ghc 7.8" $ do - haskell2010:_ <- - withSourceFile "test/package-dump/ghc-7.8.txt" $ \src -> - runConduit - $ src - .| decodeUtf8 - .| conduitDumpPackage - .| CL.consume - ghcPkgId <- parseGhcPkgId "haskell2010-1.1.2.0-05c8dd51009e08c6371c82972d40f55a" - packageIdent <- maybe (fail "Not parsable package id") pure $ - parsePackageIdentifier "haskell2010-1.1.2.0" - depends <- mapM parseGhcPkgId - [ "array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b" - , "base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1" - , "ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37" - ] - haskell2010 { dpExposedModules = mempty } `shouldBe` DumpPackage - { dpGhcPkgId = ghcPkgId - , dpPackageIdent = packageIdent - , dpParentLibIdent = Nothing - , dpLicense = Just BSD3 - , dpLibDirs = ["/opt/ghc/7.8.4/lib/ghc-7.8.4/haskell2010-1.1.2.0"] - , dpDepends = depends - , dpLibraries = ["HShaskell2010-1.1.2.0"] - , dpHasExposedModules = True - , dpHaddockInterfaces = ["/opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0/haskell2010.haddock"] - , dpHaddockHtml = Just "/opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0" - , dpIsExposed = False - , dpExposedModules = mempty - } - - it "ghc 7.10" $ do - haskell2010:_ <- - withSourceFile "test/package-dump/ghc-7.10.txt" $ \src -> - runConduit - $ src - .| decodeUtf8 - .| conduitDumpPackage - .| CL.consume - ghcPkgId <- parseGhcPkgId "ghc-7.10.1-325809317787a897b7a97d646ceaa3a3" - pkgIdent <- maybe (fail "Not parsable package id") pure $ - parsePackageIdentifier "ghc-7.10.1" - depends <- mapM parseGhcPkgId - [ "array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9" - , "base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a" - , "bin-package-db-0.0.0.0-708fc7d634a370b311371a5bcde40b62" - , "bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db" - , "containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d" - , "directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0" - , "filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6" - , "hoopl-3.10.0.2-8c8dfc4c3140e5f7c982da224c3cb1f0" - , "hpc-0.6.0.2-ac9064885aa8cb08a93314222939ead4" - , "process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1" - , "template-haskell-2.10.0.0-e895139a0ffff267d412e3d0191ce93b" - , "time-1.5.0.1-e17a9220d438435579d2914e90774246" - , "transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f" - , "unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f" - ] - haskell2010 { dpExposedModules = mempty } `shouldBe` DumpPackage - { dpGhcPkgId = ghcPkgId - , dpPackageIdent = pkgIdent - , dpParentLibIdent = Nothing - , dpLicense = Just BSD3 - , dpLibDirs = ["/opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY"] - , dpHaddockInterfaces = ["/opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1/ghc.haddock"] - , dpHaddockHtml = Just "/opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1" - , dpDepends = depends - , dpLibraries = ["HSghc-7.10.1-EMlWrQ42XY0BNVbSrKixqY"] - , dpHasExposedModules = True - , dpIsExposed = False - , dpExposedModules = mempty - } - it "ghc 7.8.4 (osx)" $ do - hmatrix:_ <- - withSourceFile "test/package-dump/ghc-7.8.4-osx.txt" $ \src -> - runConduit - $ src - .| decodeUtf8 - .| conduitDumpPackage - .| CL.consume - ghcPkgId <- parseGhcPkgId "hmatrix-0.16.1.5-12d5d21f26aa98774cdd8edbc343fbfe" - pkgId <- maybe (fail "Not parsable package id") pure $ - parsePackageIdentifier "hmatrix-0.16.1.5" - depends <- mapM parseGhcPkgId - [ "array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b" - , "base-4.7.0.2-918c7ac27f65a87103264a9f51652d63" - , "binary-0.7.1.0-108d06eea2ef05e517f9c1facf10f63c" - , "bytestring-0.10.4.0-78bc8f2c724c765c78c004a84acf6cc3" - , "deepseq-1.3.0.2-0ddc77716bd2515426e1ba39f6788a4f" - , "random-1.1-822c19b7507b6ac1aaa4c66731e775ae" - , "split-0.2.2-34cfb851cc3784e22bfae7a7bddda9c5" - , "storable-complex-0.2.2-e962c368d58acc1f5b41d41edc93da72" - , "vector-0.10.12.3-f4222db607fd5fdd7545d3e82419b307"] - hmatrix `shouldBe` DumpPackage - { dpGhcPkgId = ghcPkgId - , dpPackageIdent = pkgId - , dpParentLibIdent = Nothing - , dpLicense = Just BSD3 - , dpLibDirs = - [ "/Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/lib/x86_64-osx-ghc-7.8.4/hmatrix-0.16.1.5" - , "/opt/local/lib/" - , "/usr/local/lib/" - , "C:/Program Files/Example/"] - , dpHaddockInterfaces = ["/Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html/hmatrix.haddock"] - , dpHaddockHtml = Just "/Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html" - , dpDepends = depends - , dpLibraries = ["HShmatrix-0.16.1.5"] - , dpHasExposedModules = True - , dpIsExposed = True - , dpExposedModules = Set.fromList ["Data.Packed","Data.Packed.Vector","Data.Packed.Matrix","Data.Packed.Foreign","Data.Packed.ST","Data.Packed.Development","Numeric.LinearAlgebra","Numeric.LinearAlgebra.LAPACK","Numeric.LinearAlgebra.Algorithms","Numeric.Container","Numeric.LinearAlgebra.Util","Numeric.LinearAlgebra.Devel","Numeric.LinearAlgebra.Data","Numeric.LinearAlgebra.HMatrix","Numeric.LinearAlgebra.Static"] - } - it "ghc HEAD" $ do - ghcBoot:_ <- - withSourceFile "test/package-dump/ghc-head.txt" $ \src -> - runConduit - $ src - .| decodeUtf8 - .| conduitDumpPackage - .| CL.consume - ghcPkgId <- parseGhcPkgId "ghc-boot-0.0.0.0" - pkgId <- maybe (fail "Not parsable package id") pure $ - parsePackageIdentifier "ghc-boot-0.0.0.0" - depends <- mapM parseGhcPkgId - [ "base-4.9.0.0" - , "binary-0.7.5.0" - , "bytestring-0.10.7.0" - , "directory-1.2.5.0" - , "filepath-1.4.1.0" - ] - ghcBoot `shouldBe` DumpPackage - { dpGhcPkgId = ghcPkgId - , dpPackageIdent = pkgId - , dpParentLibIdent = Nothing - , dpLicense = Just BSD3 - , dpLibDirs = - ["/opt/ghc/head/lib/ghc-7.11.20151213/ghc-boot-0.0.0.0"] - , dpHaddockInterfaces = ["/opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0/ghc-boot.haddock"] - , dpHaddockHtml = Just "/opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0" - , dpDepends = depends - , dpLibraries = ["HSghc-boot-0.0.0.0"] - , dpHasExposedModules = True - , dpIsExposed = True - , dpExposedModules = Set.fromList ["GHC.Lexeme", "GHC.PackageDb"] - } - - - it "sinkMatching" $ runEnvNoLogging $ \pkgexe -> do - m <- ghcPkgDump pkgexe [] - $ conduitDumpPackage - .| sinkMatching (Map.singleton (mkPackageName "transformers") (mkVersion [0, 0, 0, 0, 0, 0, 1])) - case Map.lookup (mkPackageName "base") m of - Nothing -> error "base not present" - Just _ -> pure () - liftIO $ do - Map.lookup (mkPackageName "transformers") m `shouldBe` Nothing - Map.lookup (mkPackageName "ghc") m `shouldBe` Nothing - - describe "pruneDeps" $ do - it "sanity check" $ do - let prunes = - [ ((1, 'a'), []) - , ((1, 'b'), []) - , ((2, 'a'), [(1, 'b')]) - , ((2, 'b'), [(1, 'a')]) - , ((3, 'a'), [(1, 'c')]) - , ((4, 'a'), [(2, 'a')]) - ] - actual = fst <$> pruneDeps fst fst snd bestPrune prunes - actual `shouldBe` Map.fromList - [ (1, (1, 'b')) - , (2, (2, 'a')) - , (4, (4, 'a')) - ] - - prop "invariant holds" $ \prunes' -> - -- Force uniqueness - let prunes = Map.toList $ Map.fromList prunes' - in checkDepsPresent prunes $ fst <$> pruneDeps fst fst snd bestPrune prunes - -type PruneCheck = ((Int, Char), [(Int, Char)]) - -bestPrune :: PruneCheck -> PruneCheck -> PruneCheck -bestPrune x y - | fst x > fst y = x - | otherwise = y - -checkDepsPresent :: [PruneCheck] -> Map Int (Int, Char) -> Bool -checkDepsPresent prunes selected = - all hasDeps $ Set.toList allIds - where - depMap = Map.fromList prunes - allIds = Set.fromList $ Map.elems selected - - hasDeps ident = - case Map.lookup ident depMap of - Nothing -> error "checkDepsPresent: missing in depMap" - Just deps -> Set.null $ Set.difference (Set.fromList deps) allIds - -runEnvNoLogging :: (GhcPkgExe -> RIO SimplePrettyApp a) -> IO a -runEnvNoLogging inner = do - envVars <- view envVarsL <$> mkDefaultProcessContext - menv <- mkProcessContext $ Map.delete "GHC_PACKAGE_PATH" envVars - let find name = runRIO menv (findExecutable name) >>= either throwIO parseAbsFile - pkg <- GhcPkgExe <$> find "ghc-pkg" - app <- mkSimplePrettyApp mempty (Just menv) True 80 mempty - runRIO app (inner pkg)
@@ -1,52 +0,0 @@-{-# LANGUAGE OverloadedStrings #-} - -module Stack.Types.TemplateNameSpec - ( spec - ) where - -import Stack.Types.TemplateName -import Path.Internal -import System.Info (os) -import Test.Hspec - -spec :: Spec -spec = - describe "TemplateName" $ do - describe "parseTemplateNameFromString" $ do - let pathOf s = either error templatePath (parseTemplateNameFromString s) - - it "parses out the TemplatePath" $ do - pathOf "github:user/name" `shouldBe` RepoPath (RepoTemplatePath GitHub "user" "name.hsfiles") - pathOf "bitbucket:user/name" `shouldBe` RepoPath (RepoTemplatePath Bitbucket "user" "name.hsfiles") - pathOf "gitlab:user/name" `shouldBe` RepoPath (RepoTemplatePath GitLab "user" "name.hsfiles") - - pathOf "http://www.com/file" `shouldBe` UrlPath "http://www.com/file" - pathOf "https://www.com/file" `shouldBe` UrlPath "https://www.com/file" - - pathOf "name" `shouldBe` RelPath "name.hsfiles" (Path "name.hsfiles") - pathOf "name.hsfile" `shouldBe` RelPath "name.hsfile.hsfiles" (Path "name.hsfile.hsfiles") - pathOf "name.hsfiles" `shouldBe` RelPath "name.hsfiles" (Path "name.hsfiles") - pathOf "" `shouldBe` RelPath ".hsfiles" (Path ".hsfiles") - - if os == "mingw32" - then do - pathOf "//home/file" `shouldBe` AbsPath (Path "\\\\home\\file.hsfiles") - pathOf "/home/file" `shouldBe` RelPath "/home/file.hsfiles" (Path "\\home\\file.hsfiles") - pathOf "/home/file.hsfiles" `shouldBe` RelPath "/home/file.hsfiles" (Path "\\home\\file.hsfiles") - - pathOf "c:\\home\\file" `shouldBe` AbsPath (Path "C:\\home\\file.hsfiles") - pathOf "with/slash" `shouldBe` RelPath "with/slash.hsfiles" (Path "with\\slash.hsfiles") - - let colonAction = - do - pure $! pathOf "with:colon" - colonAction `shouldThrow` anyErrorCall - - else do - pathOf "//home/file" `shouldBe` AbsPath (Path "/home/file.hsfiles") - pathOf "/home/file" `shouldBe` AbsPath (Path "/home/file.hsfiles") - pathOf "/home/file.hsfiles" `shouldBe` AbsPath (Path "/home/file.hsfiles") - - pathOf "c:\\home\\file" `shouldBe` RelPath "c:\\home\\file.hsfiles" (Path "c:\\home\\file.hsfiles") - pathOf "with/slash" `shouldBe` RelPath "with/slash.hsfiles" (Path "with/slash.hsfiles") - pathOf "with:colon" `shouldBe` RelPath "with:colon.hsfiles" (Path "with:colon.hsfiles")
binary file changed (273 → absent bytes)
binary file changed (367 → absent bytes)
@@ -1,51 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} - -module Stack.UploadSpec - ( spec - ) where - -import Data.Bits ((.&.)) -import RIO - ( Bool (..), IO, IsString, Maybe (..), String, ($), finally - , readFileBinary, replicateM_, runRIO, unless - , withSystemTempDirectory - ) -import RIO.Directory - ( emptyPermissions, getPermissions, setOwnerReadable - , setOwnerWritable - ) -import RIO.FilePath ( (</>) ) -import Stack.Upload - ( HackageKey (..), maybeGetHackageKey, writeFilePrivate ) -import System.Environment ( setEnv, unsetEnv ) -import System.Permissions ( osIsWindows ) -import System.PosixCompat.Files ( getFileStatus, fileMode ) -import Test.Hspec ( Spec, example, it, shouldBe, shouldReturn ) - -spec :: Spec -spec = do - it "writeFilePrivate" $ example $ withSystemTempDirectory "writeFilePrivate" $ \dir -> replicateM_ 2 $ do - let fp = dir </> "filename" - contents :: IsString s => s - contents = "These are the contents" - writeFilePrivate fp contents - actual <- readFileBinary fp - actual `shouldBe` contents - perms <- getPermissions fp - perms `shouldBe` setOwnerWritable True (setOwnerReadable True emptyPermissions) - - unless osIsWindows $ do - status <- getFileStatus fp - (fileMode status .&. 0o777) `shouldBe` 0o600 - - it "finds a HACKAGE_KEY env variable" $ do - runRIO () maybeGetHackageKey `shouldReturn` Nothing - - withEnv "HACKAGE_KEY" "api_key" - $ runRIO () maybeGetHackageKey `shouldReturn` Just (HackageKey "api_key") - -withEnv :: String -> String -> IO a -> IO a -withEnv k v f = do - setEnv k v - f `finally` unsetEnv k
@@ -1,8 +0,0 @@-module Stack.Ghci.FakePaths - ( defaultDrive - ) where - --- | Helpers for writing fake paths for test suite for the GhciScript DSL. This --- must be a separate module because it is used in Template Haskell splices. -defaultDrive :: FilePath -defaultDrive = "/"
@@ -1,8 +0,0 @@-module Stack.Ghci.FakePaths - ( defaultDrive - ) where - --- | Helpers for writing fake paths for test suite for the GhciScript DSL. This --- must be a separate module because it is used in Template Haskell splices. -defaultDrive :: FilePath -defaultDrive = "C:\\"
@@ -4,11 +4,17 @@ -- | The module of this name differs as between Windows and non-Windows builds. -- This is the non-Windows version. module Stack.Constants.UsrLibDirs - ( usrLibDirs + ( libDirs + , usrLibDirs ) where import Path ( mkAbsDir ) import Stack.Prelude + +-- | Used in Stack.Setup for detecting libc.musl-x86_64.so.1, see comments at +-- use site +libDirs :: [Path Abs Dir] +libDirs = [$(mkAbsDir "/lib"), $(mkAbsDir "/lib64")] -- | Used in Stack.Setup for detecting libtinfo, see comments at use site usrLibDirs :: [Path Abs Dir]
@@ -3,18 +3,27 @@ -- | The module of this name differs as between Windows and non-Windows builds. -- This is the non-Windows version. module System.Permissions - ( setScriptPerms + ( osIsMacOS , osIsWindows , setFileExecutable + , setScriptPerms ) where import RIO import qualified System.Posix.Files as Posix +import System.Info ( os ) --- | True if using Windows OS. +-- | True if using macOS. +osIsMacOS :: Bool +osIsMacOS = os == "darwin" + +-- | False if not using Windows. osIsWindows :: Bool osIsWindows = False +setFileExecutable :: MonadIO m => FilePath -> m () +setFileExecutable fp = liftIO $ Posix.setFileMode fp 0o755 + setScriptPerms :: MonadIO m => FilePath -> m () setScriptPerms fp = liftIO $ Posix.setFileMode fp $ @@ -22,6 +31,3 @@ Posix.ownerWriteMode `Posix.unionFileModes` Posix.groupReadMode `Posix.unionFileModes` Posix.otherReadMode - -setFileExecutable :: MonadIO m => FilePath -> m () -setFileExecutable fp = liftIO $ Posix.setFileMode fp 0o755
@@ -3,10 +3,16 @@ -- | The module of this name differs as between Windows and non-Windows builds. -- This is the Windows version. module Stack.Constants.UsrLibDirs - ( usrLibDirs + ( libDirs + , usrLibDirs ) where import Stack.Prelude + +-- | Used in Stack.Setup for detecting libc.musl-x86_64.so.1, see comments at +-- use site +libDirs :: [Path Abs Dir] +libDirs = [] -- | Used in Stack.Setup for detecting libtinfo, see comments at use site usrLibDirs :: [Path Abs Dir]
@@ -1,17 +1,22 @@ -- | The module of this name differs as between Windows and non-Windows builds. -- This is the Windows version. module System.Permissions - ( setScriptPerms + ( osIsMacOS , osIsWindows , setFileExecutable + , setScriptPerms ) where --- | True if using Windows OS. +-- | False if using Windows. +osIsMacOS :: Bool +osIsMacOS = False + +-- | True if using Windows. osIsWindows :: Bool osIsWindows = True -setScriptPerms :: Monad m => FilePath -> m () -setScriptPerms _ = pure () - setFileExecutable :: Monad m => FilePath -> m () setFileExecutable _ = pure () + +setScriptPerms :: Monad m => FilePath -> m () +setScriptPerms _ = pure ()
@@ -15,7 +15,7 @@ import Foreign.Storable ( peekByteOff ) import RIO.Partial ( read ) import Stack.Prelude -import System.IO hiding ( hIsTerminalDevice ) +import System.IO ( hGetContents ) import System.Process ( StdStream (..), createProcess, shell, std_err, std_in , std_out, waitForProcess
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: stack-version: 2.11.1+version: 2.13.1 license: BSD3 license-file: LICENSE maintainer: manny@fpcomplete.com@@ -37,10 +37,9 @@ doc/clean_command.md doc/config_command.md doc/CONTRIBUTING.md- doc/coverage.md doc/custom_snapshot.md doc/debugging.md- doc/dependency_visualization.md+ doc/dev_containers.md doc/developing_on_windows.md doc/docker_command.md doc/docker_integration.md@@ -93,12 +92,14 @@ doc/upload_command.md doc/yaml_configuration.md src/setup-shim/StackSetupShim.hs- test/package-dump/ghc-7.10.txt- test/package-dump/ghc-7.8.4-osx.txt- test/package-dump/ghc-7.8.txt- test/package-dump/ghc-head.txt- src/test/Stack/Untar/test1.tar.gz- src/test/Stack/Untar/test2.tar.gz+ tests/unit/package-dump/ghc-7.10.txt+ tests/unit/package-dump/ghc-7.8.4-osx.txt+ tests/unit/package-dump/ghc-7.8.txt+ tests/unit/package-dump/ghc-head.txt+ tests/unit/Stack/Untar/test1.tar.gz+ tests/unit/Stack/Untar/test2.tar.gz+ cabal.project+ cabal.config source-repository head type: git@@ -106,40 +107,44 @@ custom-setup setup-depends:- Cabal >=3.8.1.0 && <3.10,+ Cabal >=3.8.1.0 && <3.12, base >=4.14.3.0 && <5,- filepath+ filepath >=1.4.2.2 flag developer-mode- description: By default, should extra developer information be output?+ description: By default, output extra developer information. default: False manual: True flag disable-git-info- description: Disable compile-time inclusion of current git info in stack+ description:+ Disable inclusion of current Git information in the Stack executable when it is built.+ default: False manual: True flag hide-dependency-versions description:- Hides dependency versions from 'stack --version', used only by building Stack and the default 'stack.yaml'. Note to packagers/distributors: DO NOT OVERRIDE THIS FLAG IF YOU ARE BUILDING 'stack' ANY OTHER WAY (e.g. using cabal or from Hackage), as it makes debugging support requests more difficult.+ Hides dependency versions from 'stack --version'. Used only when building a Stack executable for official release. Note to packagers/distributors: DO NOT OVERRIDE THIS FLAG IF YOU ARE BUILDING STACK ANY OTHER WAY (e.g. using Cabal or from Hackage), as it makes debugging support requests more difficult. default: False manual: True flag integration-tests- description: Run the integration test suite+ description: Run the integration test suite. default: False manual: True flag static- description: Pass -static/-pthread to ghc when linking the stack binary.+ description:+ When building the Stack executable, or the stack-integration-test executable, pass the -static and -pthread flags to the linker used by GHC.+ default: False manual: True flag supported-build description:- If false, causes 'stack --version' to issue a warning about the build being unsupported. Should be True only if building with Stack and the default 'stack.yaml'. Note to packagers/distributors: DO NOT OVERRIDE THIS FLAG IF YOU ARE BUILDING 'stack' ANY OTHER WAY (e.g. using cabal or from Hackage), as it makes debugging support requests more difficult.+ If false, causes 'stack --version' to issue a warning about the build being unsupported. Used only when building a Stack executable for official release. Note to packagers/distributors: DO NOT OVERRIDE THIS FLAG IF YOU ARE BUILDING STACK ANY OTHER WAY (e.g. using Cabal or from Hackage), as it makes debugging support requests more difficult. default: False manual: True@@ -156,8 +161,10 @@ Options.Applicative.Builder.Extra Options.Applicative.Complicated Path.CheckInstall+ Path.Extended Path.Extra Path.Find+ Stack Stack.Build Stack.Build.Cache Stack.Build.ConstructPlan@@ -167,7 +174,10 @@ Stack.Build.Source Stack.Build.Target Stack.BuildPlan+ Stack.BuildInfo+ Stack.CLI Stack.Clean+ Stack.ComponentFile Stack.Config Stack.Config.Build Stack.Config.Docker@@ -175,6 +185,7 @@ Stack.ConfigCmd Stack.Constants Stack.Constants.Config+ Stack.Constants.StackProgName Stack.Coverage Stack.DefaultColorWhen Stack.Docker@@ -227,6 +238,7 @@ Stack.Options.Utils Stack.Package Stack.PackageDump+ Stack.PackageFile Stack.Path Stack.Prelude Stack.Query@@ -250,6 +262,8 @@ Stack.Types.BuildConfig Stack.Types.BuildOpts Stack.Types.CabalConfigKey+ Stack.Types.Cache+ Stack.Types.Casa Stack.Types.ColorWhen Stack.Types.CompilerBuild Stack.Types.CompilerPaths@@ -259,6 +273,7 @@ Stack.Types.ConfigMonoid Stack.Types.ConfigureOpts Stack.Types.Curator+ Stack.Types.Dependency Stack.Types.Docker Stack.Types.DockerEntrypoint Stack.Types.DownloadInfo@@ -279,6 +294,7 @@ Stack.Types.NamedComponent Stack.Types.Nix Stack.Types.Package+ Stack.Types.PackageFile Stack.Types.PackageName Stack.Types.ParentMap Stack.Types.Platform@@ -292,6 +308,7 @@ Stack.Types.SetupInfo Stack.Types.SourceMap Stack.Types.StackYamlLoc+ Stack.Types.Storage Stack.Types.TemplateName Stack.Types.UnusedFlags Stack.Types.Version@@ -305,21 +322,19 @@ System.Permissions System.Process.Pager System.Terminal+ Build_stack Paths_stack - hs-source-dirs: src/+ hs-source-dirs: src other-modules:- Path.Extended- Stack.ComponentFile- Stack.Constants.StackProgName- Stack.Internal.BuildInfo- Stack.PackageFile- Stack.Types.Cache- Stack.Types.Dependency- Stack.Types.PackageFile- Stack.Types.Storage+ GHC.Utils.GhcPkg.Main.Compat+ Stack.Config.ConfigureScript+ Stack.Types.FileDigestCache - autogen-modules: Paths_stack+ autogen-modules:+ Build_stack+ Paths_stack+ default-language: GHC2021 ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -Wmissing-export-lists@@ -328,91 +343,72 @@ build-depends: Cabal >=3.8.1.0, aeson >=2.0.3.0,- annotated-wl-pprint,+ aeson-warning-parser >=0.1.0, ansi-terminal >=1.0,- array,- async,- attoparsec,+ array >=0.5.4.0,+ async >=2.2.4,+ attoparsec >=0.14.4, base >=4.14.3.0 && <5,- base64-bytestring,- bytestring,- casa-client,- casa-types,- colour,- conduit,- conduit-extra,- containers,- cryptonite,- cryptonite-conduit,- deepseq,- directory,- echo,- exceptions,- extra,- file-embed,- filelock,- filepath,+ base64-bytestring >=1.2.1.0,+ bytestring >=0.11.5.2,+ casa-client >=0.0.2,+ companion >=0.1.0,+ conduit >=1.3.5,+ conduit-extra >=1.3.6,+ containers >=0.6.7,+ crypton >=0.33,+ directory >=1.3.7.1,+ echo >=0.1.4,+ exceptions >=0.10.5,+ extra >=1.7.14,+ file-embed >=0.0.15.0,+ filelock >=0.1.1.7,+ filepath >=1.4.2.2, fsnotify >=0.4.1,- generic-deriving,- hackage-security,- hashable,+ generic-deriving >=1.14.5,+ ghc-boot >=9.4.7, hi-file-parser >=0.1.4.0,- hpack,- hpc,- http-client,- http-client-tls,- http-conduit,- http-download,- http-types,- memory,- microlens,- mintty,- mono-traversable,- mtl,- mustache,- neat-interpolation,- network-uri,- open-browser,- optparse-applicative >=0.17.0.0,- pantry >=0.8.2.2,- path,- path-io,+ hpack >=0.36.0,+ hpc >=0.6.1.0,+ http-client >=0.7.14,+ http-client-tls >=0.3.6.2,+ http-conduit >=2.3.8.1,+ http-download >=0.2.1.0,+ http-types >=0.12.3,+ memory >=0.18.0,+ microlens >=0.4.13.1,+ mtl >=2.2.2,+ mustache >=2.4.2,+ neat-interpolation >=0.5.1.3,+ open-browser >=0.2.1.0,+ optparse-applicative >=0.18.1.0,+ pantry >=0.9.2,+ path >=0.9.2,+ path-io >=1.8.1, persistent >=2.14.0.0 && <2.15,- persistent-sqlite,- persistent-template,- pretty,- primitive,+ persistent-sqlite >=2.13.1.1,+ pretty >=1.1.3.6, process >=1.6.13.2,- project-template,- random,- retry,+ project-template >=0.2.1.0,+ random >=1.2.1.1, rio >=0.1.22.0,- rio-prettyprint >=0.1.4.0,- semigroups,- split,- stm,- streaming-commons,- tar,- template-haskell,- text,- text-metrics,- th-reify-many,- time,- tls,- transformers,- typed-process,- unicode-transforms,- unix-compat,- unliftio,- unordered-containers,- vector,- yaml,- zip-archive,- zlib+ rio-prettyprint >=0.1.7.0,+ split >=0.2.3.5,+ stm >=2.5.1.0,+ tar >=0.5.1.1,+ template-haskell >=2.19.0.0,+ text >=2.0.2,+ time >=1.12.2,+ transformers >=0.5.6.2,+ unix-compat >=0.7,+ unordered-containers >=0.2.19.1,+ vector >=0.13.0.0,+ yaml >=0.11.11.2,+ zlib >=0.6.3.0 if os(windows) cpp-options: -DWINDOWS- build-depends: Win32+ build-depends: Win32 >=2.12.0.1 else build-tool-depends: hsc2hs:hsc2hs@@ -443,19 +439,23 @@ Stack.Docker.Handlers System.Uname -executable stack- main-is: Main.hs- hs-source-dirs: src/main- other-modules:- BuildInfo- Stack.CLI- Build_stack- Paths_stack+ if !flag(disable-git-info)+ cpp-options: -DUSE_GIT_INFO+ build-depends:+ githash >=0.1.7.0,+ optparse-simple >=0.1.1.4 - autogen-modules:- Build_stack- Paths_stack+ if flag(hide-dependency-versions)+ cpp-options: -DHIDE_DEP_VERSIONS + if flag(supported-build)+ cpp-options: -DSUPPORTED_BUILD++executable stack+ main-is: Main.hs+ hs-source-dirs: app+ other-modules: Paths_stack+ autogen-modules: Paths_stack default-language: GHC2021 ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -Wmissing-export-lists@@ -464,92 +464,73 @@ build-depends: Cabal >=3.8.1.0, aeson >=2.0.3.0,- annotated-wl-pprint,+ aeson-warning-parser >=0.1.0, ansi-terminal >=1.0,- array,- async,- attoparsec,+ array >=0.5.4.0,+ async >=2.2.4,+ attoparsec >=0.14.4, base >=4.14.3.0 && <5,- base64-bytestring,- bytestring,- casa-client,- casa-types,- colour,- conduit,- conduit-extra,- containers,- cryptonite,- cryptonite-conduit,- deepseq,- directory,- echo,- exceptions,- extra,- file-embed,- filelock,- filepath,+ base64-bytestring >=1.2.1.0,+ bytestring >=0.11.5.2,+ casa-client >=0.0.2,+ companion >=0.1.0,+ conduit >=1.3.5,+ conduit-extra >=1.3.6,+ containers >=0.6.7,+ crypton >=0.33,+ directory >=1.3.7.1,+ echo >=0.1.4,+ exceptions >=0.10.5,+ extra >=1.7.14,+ file-embed >=0.0.15.0,+ filelock >=0.1.1.7,+ filepath >=1.4.2.2, fsnotify >=0.4.1,- generic-deriving,- hackage-security,- hashable,+ generic-deriving >=1.14.5,+ ghc-boot >=9.4.7, hi-file-parser >=0.1.4.0,- hpack,- hpc,- http-client,- http-client-tls,- http-conduit,- http-download,- http-types,- memory,- microlens,- mintty,- mono-traversable,- mtl,- mustache,- neat-interpolation,- network-uri,- open-browser,- optparse-applicative >=0.17.0.0,- pantry >=0.8.2.2,- path,- path-io,+ hpack >=0.36.0,+ hpc >=0.6.1.0,+ http-client >=0.7.14,+ http-client-tls >=0.3.6.2,+ http-conduit >=2.3.8.1,+ http-download >=0.2.1.0,+ http-types >=0.12.3,+ memory >=0.18.0,+ microlens >=0.4.13.1,+ mtl >=2.2.2,+ mustache >=2.4.2,+ neat-interpolation >=0.5.1.3,+ open-browser >=0.2.1.0,+ optparse-applicative >=0.18.1.0,+ pantry >=0.9.2,+ path >=0.9.2,+ path-io >=1.8.1, persistent >=2.14.0.0 && <2.15,- persistent-sqlite,- persistent-template,- pretty,- primitive,+ persistent-sqlite >=2.13.1.1,+ pretty >=1.1.3.6, process >=1.6.13.2,- project-template,- random,- retry,+ project-template >=0.2.1.0,+ random >=1.2.1.1, rio >=0.1.22.0,- rio-prettyprint >=0.1.4.0,- semigroups,- split,+ rio-prettyprint >=0.1.7.0,+ split >=0.2.3.5, stack,- stm,- streaming-commons,- tar,- template-haskell,- text,- text-metrics,- th-reify-many,- time,- tls,- transformers,- typed-process,- unicode-transforms,- unix-compat,- unliftio,- unordered-containers,- vector,- yaml,- zip-archive,- zlib+ stm >=2.5.1.0,+ tar >=0.5.1.1,+ template-haskell >=2.19.0.0,+ text >=2.0.2,+ time >=1.12.2,+ transformers >=0.5.6.2,+ unix-compat >=0.7,+ unordered-containers >=0.2.19.1,+ vector >=0.13.0.0,+ yaml >=0.11.11.2,+ zlib >=0.6.3.0 if os(windows) cpp-options: -DWINDOWS- build-depends: Win32+ build-depends: Win32 >=2.12.0.1 else build-tool-depends: hsc2hs:hsc2hs@@ -567,21 +548,9 @@ if flag(static) ld-options: -static -pthread - if !flag(disable-git-info)- cpp-options: -DUSE_GIT_INFO- build-depends:- githash,- optparse-simple-- if flag(hide-dependency-versions)- cpp-options: -DHIDE_DEP_VERSIONS-- if flag(supported-build)- cpp-options: -DSUPPORTED_BUILD- executable stack-integration-test main-is: IntegrationSpec.hs- hs-source-dirs: test/integration test/integration/lib+ hs-source-dirs: tests/integration tests/integration/lib other-modules: StackTest Paths_stack@@ -596,93 +565,74 @@ build-depends: Cabal >=3.8.1.0, aeson >=2.0.3.0,- annotated-wl-pprint,+ aeson-warning-parser >=0.1.0, ansi-terminal >=1.0,- array,- async,- attoparsec,+ array >=0.5.4.0,+ async >=2.2.4,+ attoparsec >=0.14.4, base >=4.14.3.0 && <5,- base64-bytestring,- bytestring,- casa-client,- casa-types,- colour,- conduit,- conduit-extra,- containers,- cryptonite,- cryptonite-conduit,- deepseq,- directory,- echo,- exceptions,- extra,- file-embed,- filelock,- filepath,+ base64-bytestring >=1.2.1.0,+ bytestring >=0.11.5.2,+ casa-client >=0.0.2,+ companion >=0.1.0,+ conduit >=1.3.5,+ conduit-extra >=1.3.6,+ containers >=0.6.7,+ crypton >=0.33,+ directory >=1.3.7.1,+ echo >=0.1.4,+ exceptions >=0.10.5,+ extra >=1.7.14,+ file-embed >=0.0.15.0,+ filelock >=0.1.1.7,+ filepath >=1.4.2.2, fsnotify >=0.4.1,- generic-deriving,- hackage-security,- hashable,+ generic-deriving >=1.14.5,+ ghc-boot >=9.4.7, hi-file-parser >=0.1.4.0,- hpack,- hpc,- hspec,- http-client,- http-client-tls,- http-conduit,- http-download,- http-types,- memory,- microlens,- mintty,- mono-traversable,- mtl,- mustache,- neat-interpolation,- network-uri,- open-browser,- optparse-applicative >=0.17.0.0,- optparse-generic,- pantry >=0.8.2.2,- path,- path-io,+ hpack >=0.36.0,+ hpc >=0.6.1.0,+ hspec >=2.10.10,+ http-client >=0.7.14,+ http-client-tls >=0.3.6.2,+ http-conduit >=2.3.8.1,+ http-download >=0.2.1.0,+ http-types >=0.12.3,+ memory >=0.18.0,+ microlens >=0.4.13.1,+ mtl >=2.2.2,+ mustache >=2.4.2,+ neat-interpolation >=0.5.1.3,+ open-browser >=0.2.1.0,+ optparse-applicative >=0.18.1.0,+ optparse-generic >=1.5.1,+ pantry >=0.9.2,+ path >=0.9.2,+ path-io >=1.8.1, persistent >=2.14.0.0 && <2.15,- persistent-sqlite,- persistent-template,- pretty,- primitive,+ persistent-sqlite >=2.13.1.1,+ pretty >=1.1.3.6, process >=1.6.13.2,- project-template,- random,- retry,+ project-template >=0.2.1.0,+ random >=1.2.1.1, rio >=0.1.22.0,- rio-prettyprint >=0.1.4.0,- semigroups,- split,- stm,- streaming-commons,- tar,- template-haskell,- text,- text-metrics,- th-reify-many,- time,- tls,- transformers,- typed-process,- unicode-transforms,- unix-compat,- unliftio,- unordered-containers,- vector,- yaml,- zip-archive,- zlib+ rio-prettyprint >=0.1.7.0,+ split >=0.2.3.5,+ stm >=2.5.1.0,+ tar >=0.5.1.1,+ template-haskell >=2.19.0.0,+ text >=2.0.2,+ time >=1.12.2,+ transformers >=0.5.6.2,+ unix-compat >=0.7,+ unordered-containers >=0.2.19.1,+ vector >=0.13.0.0,+ yaml >=0.11.11.2,+ zlib >=0.6.3.0 if os(windows) cpp-options: -DWINDOWS- build-depends: Win32+ build-depends: Win32 >=2.12.0.1 else build-tool-depends: hsc2hs:hsc2hs@@ -703,11 +653,11 @@ if flag(static) ld-options: -static -pthread -test-suite stack-test+test-suite stack-unit-test type: exitcode-stdio-1.0 main-is: Spec.hs build-tool-depends: hspec-discover:hspec-discover- hs-source-dirs: src/test+ hs-source-dirs: tests/unit other-modules: Stack.ArgsSpec Stack.Build.ExecuteSpec@@ -732,97 +682,77 @@ build-depends: Cabal >=3.8.1.0,- QuickCheck,+ QuickCheck >=2.14.3, aeson >=2.0.3.0,- annotated-wl-pprint,+ aeson-warning-parser >=0.1.0, ansi-terminal >=1.0,- array,- async,- attoparsec,+ array >=0.5.4.0,+ async >=2.2.4,+ attoparsec >=0.14.4, base >=4.14.3.0 && <5,- base64-bytestring,- bytestring,- casa-client,- casa-types,- colour,- conduit,- conduit-extra,- containers,- cryptonite,- cryptonite-conduit,- deepseq,- directory,- echo,- exceptions,- extra,- file-embed,- filelock,- filepath,+ base64-bytestring >=1.2.1.0,+ bytestring >=0.11.5.2,+ casa-client >=0.0.2,+ companion >=0.1.0,+ conduit >=1.3.5,+ conduit-extra >=1.3.6,+ containers >=0.6.7,+ crypton >=0.33,+ directory >=1.3.7.1,+ echo >=0.1.4,+ exceptions >=0.10.5,+ extra >=1.7.14,+ file-embed >=0.0.15.0,+ filelock >=0.1.1.7,+ filepath >=1.4.2.2, fsnotify >=0.4.1,- generic-deriving,- hackage-security,- hashable,+ generic-deriving >=1.14.5,+ ghc-boot >=9.4.7, hi-file-parser >=0.1.4.0,- hpack,- hpc,- hspec,- http-client,- http-client-tls,- http-conduit,- http-download,- http-types,- memory,- microlens,- mintty,- mono-traversable,- mtl,- mustache,- neat-interpolation,- network-uri,- open-browser,- optparse-applicative >=0.17.0.0,- pantry >=0.8.2.2,- path,- path-io,+ hpack >=0.36.0,+ hpc >=0.6.1.0,+ hspec >=2.10.10,+ http-client >=0.7.14,+ http-client-tls >=0.3.6.2,+ http-conduit >=2.3.8.1,+ http-download >=0.2.1.0,+ http-types >=0.12.3,+ memory >=0.18.0,+ microlens >=0.4.13.1,+ mtl >=2.2.2,+ mustache >=2.4.2,+ neat-interpolation >=0.5.1.3,+ open-browser >=0.2.1.0,+ optparse-applicative >=0.18.1.0,+ pantry >=0.9.2,+ path >=0.9.2,+ path-io >=1.8.1, persistent >=2.14.0.0 && <2.15,- persistent-sqlite,- persistent-template,- pretty,- primitive,+ persistent-sqlite >=2.13.1.1,+ pretty >=1.1.3.6, process >=1.6.13.2,- project-template,- random,- raw-strings-qq,- retry,+ project-template >=0.2.1.0,+ random >=1.2.1.1,+ raw-strings-qq >=1.1, rio >=0.1.22.0,- rio-prettyprint >=0.1.4.0,- semigroups,- smallcheck,- split,+ rio-prettyprint >=0.1.7.0,+ split >=0.2.3.5, stack,- stm,- streaming-commons,- tar,- template-haskell,- text,- text-metrics,- th-reify-many,- time,- tls,- transformers,- typed-process,- unicode-transforms,- unix-compat,- unliftio,- unordered-containers,- vector,- yaml,- zip-archive,- zlib+ stm >=2.5.1.0,+ tar >=0.5.1.1,+ template-haskell >=2.19.0.0,+ text >=2.0.2,+ time >=1.12.2,+ transformers >=0.5.6.2,+ unix-compat >=0.7,+ unordered-containers >=0.2.19.1,+ vector >=0.13.0.0,+ yaml >=0.11.11.2,+ zlib >=0.6.3.0 if os(windows) cpp-options: -DWINDOWS- build-depends: Win32+ build-depends: Win32 >=2.12.0.1 else build-tool-depends: hsc2hs:hsc2hs@@ -838,9 +768,9 @@ cpp-options: -DSTACK_DEVELOPER_MODE_DEFAULT=False if os(windows)- hs-source-dirs: src/test/windows/+ hs-source-dirs: tests/unit/windows/ other-modules: Stack.Ghci.FakePaths else- hs-source-dirs: src/test/unix/+ hs-source-dirs: tests/unit/unix/ other-modules: Stack.Ghci.FakePaths
@@ -1,35 +1,32 @@-# GHC 9.2.7 -resolver: lts-20.21 - -packages: -- . +resolver: lts-21.13 # GHC 9.4.7 extra-deps: +- aeson-warning-parser-0.1.0@sha256:f2c1c42b73aa35d352060abcbb867c410cbbf57d0cb0fed607bcd1e2a74954ad,1308 - ansi-terminal-1.0@sha256:640ffecfd95471388d939fcacb57bdc0cef15f0457746c234a12cdd5a6c6d1e8,2706 -- ansi-terminal-types-0.11.5@sha256:f78440dfd95c4509e88855ac7cc2d9566ddf956a92c1290404cac93ad1a1b00a,1482 -- fsnotify-0.4.1.0@sha256:44540beabea36aeeef930aa4d5f28091d431904bc9923b6ac4d358831c651235,2854 -- pantry-0.8.2.2@sha256:579aa8538c0fde65f9c08fb97d1d5aee8f59e5cc44e5f8feb350ec54bd2b14a6,6026 -- persistent-2.14.5.0@sha256:c3c7a6a200930f956b2a6bb15b9d2cd512980692f6a2d95368a6db335c34c916,7199 -- rio-prettyprint-0.1.4.0@sha256:1f8eb3ead0ef33d3736d53e1de5e9b2c91a0c207cdca23321bd74c401e85f23a,1301 -# lts-20.21 specifies Cabal-3.6.3.0 -- Cabal-3.8.1.0@sha256:155d64beeecbae2b19e5d67844532494af88bc8795d4db4146a0c29296f59967,12220 -# lts-20.21 specifies Cabal-syntax-3.6.0.0 -- Cabal-syntax-3.8.1.0@sha256:4936765e9a7a8ecbf8fdbe9067f6d972bc0299220063abb2632a9950af64b966,7619 - -allow-newer: true - -allow-newer-deps: # Required because ansi-wl-pprint-0.6.9 specifies ansi-terminal < 0.12. See: # https://github.com/ekmett/ansi-wl-pprint/issues/29 -- ansi-wl-pprint - -drop-packages: -# See https://github.com/commercialhaskell/stack/pull/4712 -- cabal-install +- ansi-wl-pprint-1.0.2@sha256:b817853b5310b8e7847469847608b664c3e75b4b30c332f2cb8c0d00751ef9c1,1915 +- companion-0.1.0@sha256:99f6de52c832d433639232a6d77d33abbca3b3037e49b7db6242fb9f569a8a2b,1093 +- crypton-0.33@sha256:5e92f29b9b7104d91fcdda1dec9400c9ad1f1791c231cc41ceebd783fb517dee,18202 +- crypton-connection-0.3.1@sha256:4d0958537197956b536ea91718b1749949757022532f50b8f683290056a19021,1581 +- crypton-x509-1.7.6@sha256:c567657a705b6d6521f9dd2de999bf530d618ec00f3b939df76a41fb0fe94281,2339 +- crypton-x509-store-1.6.9@sha256:422b9b9f87a7382c66385d047615b16fc86a68c08ea22b1e0117c143a2d44050,1750 +- crypton-x509-system-1.6.7@sha256:023ed573d82983bc473a37a89e0434a085b413be9f68d07e085361056afd4637,1532 +- crypton-x509-validation-1.6.12@sha256:85989721b64be4b90de9f66ef641c26f57575cffed1a50d707065fb60176f386,2227 +# lts-21.13 specifies hpack-0.35.2 +- hpack-0.36.0@sha256:c2daa6556afc57367a5d1dbd878bf515d442d201e24b27473051359abd47ed08,5187 +- http-client-tls-0.3.6.3@sha256:a5909ce412ee65c141b8547f8fe22236f175186c95c708e86a46b5547394f910,2046 +- http-download-0.2.1.0@sha256:a97863e96f7d44efc3d0e3061db7fe2540b8374ca44ae90d0b56040140cb7506,1716 +- optparse-applicative-0.18.1.0@sha256:b4cf8d9018e5e67cb1f14edb5130b6d05ad8bc1b5f6bd4efaa6ec0b7f28f559d,5132 +- optparse-generic-1.5.1@sha256:c65a7d3429feedf870f5a9f7f0d2aaf75609888b52449f85f22871b5f5a7e95f,2204 +- pantry-0.9.2@sha256:e1c5444d1b4003435d860853abd21e91e5fc337f2b2e2c8c992a2bac04712dc0,7650 +- static-bytes-0.1.0@sha256:35dbf30f617baa0151682c97687042516be07872a39984f9fe31f78125b962bf,1627 +- tar-conduit-0.4.0@sha256:f333649770f5ec42a83a93b0d424cf6bb895d80dfbee05a54340395f81d036ae,3126 +- tls-1.9.0@sha256:8ad332dc0224decb1b137bf6c9678b4f786487b9aaa5c9068cd3ad19d42c39a7,5571 docker: enable: false - repo: fpco/alpine-haskell-stack:9.2.7 + repo: glcr.b-data.ch/ghc/ghc-musl:9.4.7 nix: # --nix on the command-line to enable. @@ -39,11 +36,9 @@ flags: hackage-security: - Cabal-syntax: true + cabal-syntax: true + # GHC 9.4.7's boot library is Win32-2.12.0.1 mintty: win32-2-13-1: false stack: developer-mode: true - -ghc-options: - "$locals": -fhide-source-paths
@@ -1,270 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} - -import Conduit - ( (.|), connect, filterC, filterMC, foldMapC, mapM_C - , runConduit, runConduitRes, runResourceT, sourceDirectory - , sourceDirectoryDeep, stderrC, withSourceFile - ) -import Data.List ( stripPrefix ) -import Options.Generic - ( ParseField, ParseRecord (..), defaultModifiers - , fieldNameModifier, firstLetter, getRecord - , parseRecordWithModifiers, shortNameModifier - ) -import RIO -import RIO.Char ( toLower ) -import RIO.Directory hiding ( findExecutable ) -import RIO.FilePath - ( (</>), (<.>), isPathSeparator, takeDirectory - , takeExtensions, takeFileName - ) -import RIO.List ( isInfixOf, partition ) -import qualified RIO.Map as Map -import RIO.Process - ( HasProcessContext (..), closed, findExecutable, proc - , runProcess, runProcess_, setStderr, setStdin, setStdout - , useHandleOpen, withModifyEnvVars, withWorkingDir - ) -import qualified RIO.Set as Set -import qualified RIO.Text as T -import System.Environment ( getExecutablePath, lookupEnv ) -import System.Info ( os ) -import System.PosixCompat.Files ( createSymbolicLink ) - --- This code does not use a test framework so that we get direct --- control of how the output is displayed. - -main :: IO () -main = runSimpleApp $ do - logInfo "Initiating Stack integration test running" - - options <- getRecord "Stack integration tests" - results <- runApp options $ do - logInfo "Running with the following environment" - proc "env" [] runProcess_ - tests <- asks appTestDirs - let count = Set.size tests - loop !idx rest !accum = - case rest of - [] -> pure accum - next:rest' -> do - logInfo $ "Running integration test " - <> display idx - <> "/" - <> display count - <> ": " - <> fromString (takeFileName next) - res <- test next - loop (idx + 1) rest' (res <> accum) - - loop (1 :: Int) (Set.toList tests) mempty - - let (successes, failures) = partition ((== ExitSuccess) . snd) - $ Map.toList results - - unless (null successes) $ do - logInfo "Successful tests:" - for_ successes $ \(x, _) -> logInfo $ "- " <> display x - logInfo "" - - if null failures - then logInfo "No failures!" - else do - logInfo "Failed tests:" - for_ failures $ \(x, ec) -> logInfo $ "- " <> display x <> " - " <> displayShow ec - exitFailure - -data Options = Options - { optSpeed :: Maybe Speed - , optMatch :: Maybe String - , optNot :: [String] - } - deriving Generic - -instance ParseRecord Options where - parseRecord = parseRecordWithModifiers modifiers - where - optName = map toLower . drop 3 - modifiers = defaultModifiers { fieldNameModifier = optName - , shortNameModifier = firstLetter . optName - } - -data Speed = Fast | Normal | Superslow - deriving (Read, Generic) - -instance ParseField Speed - -exeExt :: String -exeExt = if isWindows then ".exe" else "" - -isWindows :: Bool -isWindows = os == "mingw32" - -runApp :: Options -> RIO App a -> RIO SimpleApp a -runApp options inner = do - let speed = fromMaybe Normal $ optSpeed options - simpleApp <- ask - runghc <- findExecutable "runghc" >>= either throwIO pure - srcDir <- canonicalizePath "" - testsRoot <- canonicalizePath $ srcDir </> "test/integration" - libdir <- canonicalizePath $ testsRoot </> "lib" - myPath <- liftIO getExecutablePath - - stack <- canonicalizePath $ takeDirectory myPath </> "stack" ++ exeExt - logInfo $ "Using Stack located at " <> fromString stack - proc stack ["--version"] runProcess_ - logInfo $ "Using runghc located at " <> fromString runghc - proc runghc ["--version"] runProcess_ - - let matchTest = case (optMatch options, optNot options) of - (Just str, _) -> (str `isInfixOf`) - (_, []) -> const True - (_, nl) -> \a -> all (\b -> not $ b `isInfixOf` a) nl - testDirs - <- runConduitRes - $ sourceDirectory (testsRoot </> "tests") - .| filterMC (liftIO . hasTest) - .| filterC matchTest - .| foldMapC Set.singleton - - let modifyEnvCommon - = Map.insert "SRC_DIR" (fromString srcDir) - . Map.insert "STACK_EXE" (fromString stack) - . Map.delete "GHC_PACKAGE_PATH" - . Map.insert "STACK_TEST_SPEED" - (case speed of - Superslow -> "SUPERSLOW" - _ -> "NORMAL") - . Map.fromList - . map (first T.toUpper) - . Map.toList - - case speed of - Fast -> do - let app = App - { appSimpleApp = simpleApp - , appRunghc = runghc - , appLibDir = libdir - , appSetupHome = id - , appTestDirs = testDirs - } - runRIO app $ withModifyEnvVars modifyEnvCommon inner - _ -> do - morigStackRoot <- liftIO $ lookupEnv "STACK_ROOT" - origStackRoot <- - case morigStackRoot of - Nothing -> getAppUserDataDirectory "stack" - Just x -> pure x - - logInfo "Initializing/updating the original Pantry store" - proc stack ["update"] runProcess_ - - pantryRoot <- canonicalizePath $ origStackRoot </> "pantry" - let modifyEnv - = Map.insert "PANTRY_ROOT" (fromString pantryRoot) - . modifyEnvCommon - - app = App - { appSimpleApp = simpleApp - , appRunghc = runghc - , appLibDir = libdir - , appSetupHome = \inner' -> withSystemTempDirectory "home" $ \newHome -> do - let newStackRoot = newHome </> ".stack" - createDirectoryIfMissing True newStackRoot - let modifyEnv' - = Map.insert "HOME" (fromString newHome) - . Map.insert "APPDATA" (fromString newHome) - . Map.insert "STACK_ROOT" (fromString newStackRoot) - writeFileBinary (newStackRoot </> "config.yaml") "system-ghc: true\ninstall-ghc: false\n" - withModifyEnvVars modifyEnv' inner' - , appTestDirs = testDirs - } - - runRIO app $ withModifyEnvVars modifyEnv inner - - -hasTest :: FilePath -> IO Bool -hasTest dir = doesFileExist $ dir </> "Main.hs" - -data App = App - { appRunghc :: !FilePath - , appLibDir :: !FilePath - , appSetupHome :: !(forall a. RIO App a -> RIO App a) - , appSimpleApp :: !SimpleApp - , appTestDirs :: !(Set FilePath) - } -simpleAppL :: Lens' App SimpleApp -simpleAppL = lens appSimpleApp (\x y -> x { appSimpleApp = y }) -instance HasLogFunc App where - logFuncL = simpleAppL.logFuncL -instance HasProcessContext App where - processContextL = simpleAppL.processContextL - --- | Call 'appSetupHome' on the inner action -withHome :: RIO App a -> RIO App a -withHome inner = do - app <- ask - appSetupHome app inner - -test :: FilePath -- ^ test dir - -> RIO App (Map Text ExitCode) -test testDir = withDir $ \dir -> withHome $ do - runghc <- asks appRunghc - libDir <- asks appLibDir - let mainFile = testDir </> "Main.hs" - - copyTree (testDir </> "files") dir - - withSystemTempFile (name <.> "log") $ \logfp logh -> do - ec <- withWorkingDir dir - $ withModifyEnvVars (Map.insert "TEST_DIR" $ fromString testDir) - $ proc runghc - [ "-clear-package-db" - , "-global-package-db" - , "-i" ++ libDir - , mainFile - ] - $ runProcess - . setStdin closed - . setStdout (useHandleOpen logh) - . setStderr (useHandleOpen logh) - hClose logh - - case ec of - ExitSuccess -> logInfo "Success!" - _ -> do - logError "Failure, dumping log\n\n" - withSourceFile logfp $ \src -> - runConduit $ src .| stderrC - logError $ "\n\nEnd of log for " <> fromString name - pure $ Map.singleton (fromString name) ec - where - name = takeFileName testDir - withDir = withSystemTempDirectory ("stack-integration-" ++ name) - -copyTree :: MonadIO m => FilePath -> FilePath -> m () -copyTree src dst = - liftIO $ - runResourceT (sourceDirectoryDeep False src `connect` mapM_C go) - `catch` \(_ :: IOException) -> pure () - where - go srcfp = liftIO $ do - Just suffix <- pure $ stripPrefix src srcfp - let dstfp = dst </> stripHeadSeparator suffix - createDirectoryIfMissing True $ takeDirectory dstfp - -- copying yaml files so lock files won't get created in - -- the source directory - if takeFileName srcfp /= "package.yaml" && - (takeExtensions srcfp == ".yaml" || takeExtensions srcfp == ".yml") - then - copyFile srcfp dstfp - else - createSymbolicLink srcfp dstfp `catch` \(_ :: IOException) -> - copyFile srcfp dstfp -- for Windows - - stripHeadSeparator :: FilePath -> FilePath - stripHeadSeparator [] = [] - stripHeadSeparator fp@(x:xs) = if isPathSeparator x - then xs - else fp
@@ -1,396 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-} - -module StackTest - ( run' - , run - , runShell - , runWithCwd - , stackExe - , stackSrc - , testDir - , stack' - , stack - , stackCleanFull - , stackIgnoreException - , stackErr - , Repl - , ReplConnection (..) - , nextPrompt - , replCommand - , replGetChar - , replGetLine - , runRepl - , repl - , stackStderr - , stackCheckStderr - , stackErrStderr - , runEx - , runEx' - , stackCheckStdout - , doesNotExist - , doesExist - , doesFileOrDirExist - , copy - , fileContentsMatch - , logInfo - , showProcessArgDebug - , exeExt - , isWindows - , isLinux - , getIsAlpine - , isARM - , isAarch64 - , isMacOSX - , defaultResolverArg - , removeFileIgnore - , removeDirIgnore - , withCwd - , withSourceDirectory - , superslow - ) where - -import Control.Monad ( forever, unless, void, when ) -import Control.Monad.IO.Class ( liftIO ) -import Control.Monad.Trans.Reader ( ReaderT, ask, runReaderT ) -import Control.Concurrent ( forkIO ) -import Control.Exception - ( Exception (..), IOException, bracket_, catch, throw - , throwIO - ) -import Data.Maybe ( fromMaybe ) -import GHC.Stack ( HasCallStack ) -import System.Environment ( getEnv, lookupEnv ) -import System.Directory - ( copyFile, doesDirectoryExist, doesFileExist - , getCurrentDirectory, removeDirectoryRecursive, removeFile - , setCurrentDirectory - ) -import System.IO - ( BufferMode (..), Handle, IOMode (..), hGetChar, hGetLine - , hPutChar, hPutStr, hPutStrLn, hSetBuffering, stderr - , withFile - ) -import System.IO.Error - ( isDoesNotExistError, isEOFError ) -import System.Process - ( CreateProcess (..), StdStream (..), createProcess, proc - , readCreateProcessWithExitCode, readProcessWithExitCode - , shell, waitForProcess - ) -import System.Exit ( ExitCode (..) ) -import System.Info ( arch, os ) - -run' :: HasCallStack => FilePath -> [String] -> IO ExitCode -run' cmd args = do - logInfo $ "Running: " ++ cmd ++ " " ++ unwords (map showProcessArgDebug args) - (Nothing, Nothing, Nothing, ph) <- createProcess (proc cmd args) - waitForProcess ph - -run :: HasCallStack => FilePath -> [String] -> IO () -run cmd args = do - ec <- run' cmd args - unless (ec == ExitSuccess) $ - error $ "Exited with exit code: " ++ displayException ec - -runShell :: HasCallStack => String -> IO () -runShell cmd = do - logInfo $ "Running: " ++ cmd - (Nothing, Nothing, Nothing, ph) <- createProcess (shell cmd) - ec <- waitForProcess ph - unless (ec == ExitSuccess) $ - error $ "Exited with exit code: " ++ displayException ec - -runWithCwd :: HasCallStack => FilePath -> String -> [String] -> IO String -runWithCwd cwdPath cmd args = do - logInfo $ "Running: " ++ cmd - let cp = proc cmd args - (ec, stdoutStr, _) <- readCreateProcessWithExitCode (cp { cwd = Just cwdPath }) "" - unless (ec == ExitSuccess) $ - error $ "Exited with exit code: " ++ displayException ec - pure stdoutStr - -stackExe :: IO String -stackExe = getEnv "STACK_EXE" - -stackSrc :: IO String -stackSrc = getEnv "SRC_DIR" - -testDir :: IO String -testDir = getEnv "TEST_DIR" - -stack' :: HasCallStack => [String] -> IO ExitCode -stack' args = do - stackEnv <- stackExe - run' stackEnv args - -stack :: HasCallStack => [String] -> IO () -stack args = do - ec <- stack' args - unless (ec == ExitSuccess) $ - error $ "Exited with exit code: " ++ displayException ec - --- Temporary workaround for Windows to ignore exceptions arising out --- of Windows when we do stack clean. More info here: https://github.com/commercialhaskell/stack/issues/4936 -stackCleanFull :: HasCallStack => IO () -stackCleanFull = stackIgnoreException ["clean", "--full"] - --- Temporary workaround for Windows to ignore exceptions arising out --- of Windows when we do stack clean. More info here: https://github.com/commercialhaskell/stack/issues/4936 -stackIgnoreException :: HasCallStack => [String] -> IO () -stackIgnoreException args = if isWindows - then void (stack' args) `catch` (\(_e :: IOException) -> pure ()) - else stack args - -stackErr :: HasCallStack => [String] -> IO () -stackErr args = do - ec <- stack' args - when (ec == ExitSuccess) $ error "stack was supposed to fail, but didn't" - -type Repl = ReaderT ReplConnection IO - -data ReplConnection - = ReplConnection - { replStdin :: Handle - , replStdout :: Handle - } - -nextPrompt :: Repl () -nextPrompt = do - (ReplConnection _ inputHandle) <- ask - c <- liftIO $ hGetChar inputHandle - if c == '>' - then do _ <- liftIO $ hGetChar inputHandle - pure () - else nextPrompt - -replCommand :: String -> Repl () -replCommand cmd = do - (ReplConnection input _) <- ask - liftIO $ hPutStrLn input cmd - -replGetLine :: Repl String -replGetLine = ask >>= liftIO . hGetLine . replStdout - -replGetChar :: Repl Char -replGetChar = ask >>= liftIO . hGetChar . replStdout - -runRepl :: HasCallStack => FilePath -> [String] -> ReaderT ReplConnection IO () -> IO ExitCode -runRepl cmd args actions = do - logInfo $ "Running: " ++ cmd ++ " " ++ unwords (map showProcessArgDebug args) - (Just rStdin, Just rStdout, Just rStderr, ph) <- - createProcess (proc cmd args) - { std_in = CreatePipe - , std_out = CreatePipe - , std_err = CreatePipe - } - hSetBuffering rStdin NoBuffering - hSetBuffering rStdout NoBuffering - hSetBuffering rStderr NoBuffering - - tempDir <- if isWindows - then fromMaybe "" <$> lookupEnv "TEMP" - else pure "/tmp" - let tempFP = tempDir ++ "/stderr" - - _ <- forkIO $ withFile tempFP WriteMode - $ \err -> do - hSetBuffering err NoBuffering - forever $ catch (hGetChar rStderr >>= hPutChar err) - $ \e -> unless (isEOFError e) $ throw e - - runReaderT (nextPrompt >> actions) (ReplConnection rStdin rStdout) - waitForProcess ph - -repl :: HasCallStack => [String] -> Repl () -> IO () -repl args action = do - stackExe' <- stackExe - ec <- runRepl stackExe' ("repl":args) action - unless (ec == ExitSuccess) $ pure () - -- TODO: Understand why the exit code is 1 despite running GHCi tests - -- successfully. - -- else error $ "Exited with exit code: " ++ show ec - -stackStderr :: HasCallStack => [String] -> IO (ExitCode, String) -stackStderr args = do - stackExe' <- stackExe - logInfo $ "Running: " ++ stackExe' ++ " " ++ unwords (map showProcessArgDebug args) - (ec, _, err) <- readProcessWithExitCode stackExe' args "" - hPutStr stderr err - pure (ec, err) - --- | Run stack with arguments and apply a check to the resulting --- stderr output if the process succeeded. -stackCheckStderr :: HasCallStack => [String] -> (String -> IO ()) -> IO () -stackCheckStderr args check = do - (ec, err) <- stackStderr args - if ec /= ExitSuccess - then error $ "Exited with exit code: " ++ displayException ec - else check err - --- | Same as 'stackCheckStderr', but ensures that the Stack process --- fails. -stackErrStderr :: HasCallStack => [String] -> (String -> IO ()) -> IO () -stackErrStderr args check = do - (ec, err) <- stackStderr args - if ec == ExitSuccess - then error "Stack process succeeded, but it shouldn't" - else check err - -runEx :: HasCallStack => FilePath -> String -> IO (ExitCode, String, String) -runEx cmd args = runEx' cmd $ words args - -runEx' :: HasCallStack => FilePath -> [String] -> IO (ExitCode, String, String) -runEx' cmd args = do - logInfo $ "Running: " ++ cmd ++ " " ++ unwords (map showProcessArgDebug args) - (ec, out, err) <- readProcessWithExitCode cmd args "" - putStr out - hPutStr stderr err - pure (ec, out, err) - --- | Run stack with arguments and apply a check to the resulting --- stdout output if the process succeeded. --- --- Take care with newlines; if the output includes a newline character that --- should not be there, use 'Data.List.Extra.trimEnd' to remove it. -stackCheckStdout :: HasCallStack => [String] -> (String -> IO ()) -> IO () -stackCheckStdout args check = do - stackExe' <- stackExe - (ec, out, _) <- runEx' stackExe' args - if ec /= ExitSuccess - then error $ "Exited with exit code: " ++ displayException ec - else check out - -doesNotExist :: HasCallStack => FilePath -> IO () -doesNotExist fp = do - logInfo $ "doesNotExist " ++ fp - exists <- doesFileOrDirExist fp - case exists of - (Right msg) -> error msg - (Left _) -> pure () - -doesExist :: HasCallStack => FilePath -> IO () -doesExist fp = do - logInfo $ "doesExist " ++ fp - exists <- doesFileOrDirExist fp - case exists of - (Right _) -> pure () - (Left _) -> error "No file or directory exists" - -doesFileOrDirExist :: HasCallStack => FilePath -> IO (Either () String) -doesFileOrDirExist fp = do - isFile <- doesFileExist fp - if isFile - then pure (Right ("File exists: " ++ fp)) - else do - isDir <- doesDirectoryExist fp - if isDir - then pure (Right ("Directory exists: " ++ fp)) - else pure (Left ()) - -copy :: HasCallStack => FilePath -> FilePath -> IO () -copy src dest = do - logInfo ("Copy " ++ show src ++ " to " ++ show dest) - System.Directory.copyFile src dest - -fileContentsMatch :: HasCallStack => FilePath -> FilePath -> IO () -fileContentsMatch f1 f2 = do - doesExist f1 - doesExist f2 - f1Contents <- readFile f1 - f2Contents <- readFile f2 - unless (f1Contents == f2Contents) $ - error ("contents do not match for " ++ show f1 ++ " " ++ show f2) - -logInfo :: String -> IO () -logInfo = hPutStrLn stderr - --- TODO: use Stack's process running utilities? (better logging) --- for now just copy+modifying this one from System.Process.Log - --- | Show a process arg including speechmarks when necessary. Just for --- debugging purposes, not functionally important. -showProcessArgDebug :: String -> String -showProcessArgDebug x - | any special x = show x - | otherwise = x - where - special '"' = True - special ' ' = True - special _ = False - --- | Extension of executables -exeExt :: String -exeExt = if isWindows then ".exe" else "" - --- | Is the OS Windows? -isWindows :: Bool -isWindows = os == "mingw32" - -isLinux :: Bool -isLinux = os == "linux" - --- | Is the OS Alpine Linux? -getIsAlpine :: IO Bool -getIsAlpine = doesFileExist "/etc/alpine-release" - --- | Is the architecture ARM? -isARM :: Bool -isARM = arch == "arm" - --- | Is the architecture Aarch64? -isAarch64 :: Bool -isAarch64 = arch == "aarch64" - --- | Is the OS Mac OS X? -isMacOSX :: Bool -isMacOSX = os == "darwin" - --- | To avoid problems with GHC version mismatch when a new LTS major --- version is released, pass this argument to @stack@ when running in --- a global context. The LTS major version here should match that of --- the main @stack.yaml@. --- -defaultResolverArg :: String -defaultResolverArg = "--resolver=lts-20.13" - --- | Remove a file and ignore any warnings about missing files. -removeFileIgnore :: HasCallStack => FilePath -> IO () -removeFileIgnore fp = removeFile fp `catch` \e -> - if isDoesNotExistError e - then pure () - else throwIO e - --- | Remove a directory and ignore any warnings about missing files. -removeDirIgnore :: HasCallStack => FilePath -> IO () -removeDirIgnore fp = removeDirectoryRecursive fp `catch` \e -> - if isDoesNotExistError e - then pure () - else throwIO e - --- | Changes to the specified working directory. -withCwd :: HasCallStack => FilePath -> IO () -> IO () -withCwd dir action = do - currentDirectory <- getCurrentDirectory - let enterDir = setCurrentDirectory dir - exitDir = setCurrentDirectory currentDirectory - bracket_ enterDir exitDir action - --- | Changes working directory to Stack source directory. -withSourceDirectory :: HasCallStack => IO () -> IO () -withSourceDirectory action = do - dir <- stackSrc - withCwd dir action - --- | Mark a test as superslow, only to be run when explicitly requested. -superslow :: HasCallStack => IO () -> IO () -superslow inner = do - mres <- lookupEnv "STACK_TEST_SPEED" - case mres of - Just "NORMAL" -> logInfo "Skipping superslow test" - Just "SUPERSLOW" -> do - logInfo "Running superslow test, hold on to your butts" - inner - Nothing -> do - logInfo "No STACK_TEST_SPEED specified. Executing superslow test, hold on to your butts" - inner - Just x -> error $ "Invalid value for STACK_TEST_SPEED env var: " ++ show x
@@ -1,1188 +0,0 @@-name: ghc -version: 7.10.1 -id: ghc-7.10.1-325809317787a897b7a97d646ceaa3a3 -key: ghc_EMlWrQ42XY0BNVbSrKixqY -license: BSD3 -maintainer: glasgow-haskell-users@haskell.org -homepage: http://www.haskell.org/ghc/ -synopsis: The GHC API -description: - GHC's functionality can be useful for more things than just - compiling Haskell programs. Important use cases are programs - that analyse (and perhaps transform) Haskell code. Others - include loading Haskell code dynamically in a GHCi-like manner. - For this reason, a lot of GHC's functionality is made available - through this package. -category: Development -author: The GHC Team -exposed: False -exposed-modules: - Avail BasicTypes ConLike DataCon PatSyn Demand Debug Exception - GhcMonad Hooks Id IdInfo Lexeme Literal Llvm Llvm.AbsSyn - Llvm.MetaData Llvm.PpLlvm Llvm.Types LlvmCodeGen LlvmCodeGen.Base - LlvmCodeGen.CodeGen LlvmCodeGen.Data LlvmCodeGen.Ppr - LlvmCodeGen.Regs LlvmMangler MkId Module Name NameEnv NameSet - OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet - UnVarGraph BlockId CLabel Cmm CmmBuildInfoTables CmmPipeline - CmmCallConv CmmCommonBlockElim CmmContFlowOpt CmmExpr CmmInfo - CmmLex CmmLint CmmLive CmmMachOp CmmNode CmmOpt CmmParse - CmmProcPoint CmmSink CmmType CmmUtils CmmLayoutStack MkGraph - PprBase PprC PprCmm PprCmmDecl PprCmmExpr Bitmap CodeGen.Platform - CodeGen.Platform.ARM CodeGen.Platform.ARM64 CodeGen.Platform.NoRegs - CodeGen.Platform.PPC CodeGen.Platform.PPC_Darwin - CodeGen.Platform.SPARC CodeGen.Platform.X86 CodeGen.Platform.X86_64 - CgUtils StgCmm StgCmmBind StgCmmClosure StgCmmCon StgCmmEnv - StgCmmExpr StgCmmForeign StgCmmHeap StgCmmHpc StgCmmArgRep - StgCmmLayout StgCmmMonad StgCmmPrim StgCmmProf StgCmmTicky - StgCmmUtils StgCmmExtCode SMRep CoreArity CoreFVs CoreLint CorePrep - CoreSubst CoreSyn TrieMap CoreTidy CoreUnfold CoreUtils MkCore - PprCore Check Coverage Desugar DsArrows DsBinds DsCCall DsExpr - DsForeign DsGRHSs DsListComp DsMonad DsUtils Match MatchCon - MatchLit HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit PlaceHolder - HsPat HsSyn HsTypes HsUtils BinIface BuildTyCl IfaceEnv IfaceSyn - IfaceType LoadIface MkIface TcIface FlagChecker Annotations - BreakArray CmdLineParser CodeOutput Config Constants DriverMkDepend - DriverPhases PipelineMonad DriverPipeline DynFlags ErrUtils Finder - GHC GhcMake GhcPlugins DynamicLoading HeaderInfo HscMain HscStats - HscTypes InteractiveEval InteractiveEvalTypes PackageConfig - Packages PlatformConstants Plugins TcPluginM PprTyThing StaticFlags - StaticPtrTable SysTools TidyPgm Ctype HaddockUtils Lexer - OptCoercion Parser RdrHsSyn ApiAnnotation ForeignCall PrelInfo - PrelNames PrelRules PrimOp TysPrim TysWiredIn CostCentre ProfInit - SCCfinal RnBinds RnEnv RnExpr RnHsDoc RnNames RnPat RnSource - RnSplice RnTypes CoreMonad CSE FloatIn FloatOut LiberateCase - OccurAnal SAT SetLevels SimplCore SimplEnv SimplMonad SimplUtils - Simplify SimplStg StgStats UnariseStg Rules SpecConstr Specialise - CoreToStg StgLint StgSyn CallArity DmdAnal WorkWrap WwLib FamInst - Inst TcAnnotations TcArrows TcBinds TcClassDcl TcDefaults TcDeriv - TcEnv TcExpr TcForeign TcGenDeriv TcGenGenerics TcHsSyn TcHsType - TcInstDcls TcMType TcValidity TcMatches TcPat TcPatSyn TcRnDriver - TcRnMonad TcRnTypes TcRules TcSimplify TcErrors TcTyClsDecls - TcTyDecls TcType TcEvidence TcUnify TcInteract TcCanonical - TcFlatten TcSMonad TcTypeNats TcSplice Class Coercion FamInstEnv - FunDeps InstEnv TyCon CoAxiom Kind Type TypeRep Unify Bag Binary - BooleanFormula BufWrite Digraph Encoding FastBool FastFunctions - FastMutInt FastString FastTypes Fingerprint FiniteMap GraphBase - GraphColor GraphOps GraphPpr IOEnv ListSetOps Maybes MonadUtils - OrdList Outputable Pair Panic Pretty Serialized State Stream - StringBuffer UniqFM UniqSet Util ExtsCompat46 - Vectorise.Builtins.Base Vectorise.Builtins.Initialise - Vectorise.Builtins Vectorise.Monad.Base Vectorise.Monad.Naming - Vectorise.Monad.Local Vectorise.Monad.Global - Vectorise.Monad.InstEnv Vectorise.Monad Vectorise.Utils.Base - Vectorise.Utils.Closure Vectorise.Utils.Hoisting - Vectorise.Utils.PADict Vectorise.Utils.Poly Vectorise.Utils - Vectorise.Generic.Description Vectorise.Generic.PAMethods - Vectorise.Generic.PADict Vectorise.Generic.PData Vectorise.Type.Env - Vectorise.Type.Type Vectorise.Type.TyConDecl - Vectorise.Type.Classify Vectorise.Convert Vectorise.Vect - Vectorise.Var Vectorise.Env Vectorise.Exp Vectorise Hoopl.Dataflow - Hoopl AsmCodeGen TargetReg NCGMonad Instruction Size Reg RegClass - PIC Platform CPrim X86.Regs X86.RegInfo X86.Instr X86.Cond X86.Ppr - X86.CodeGen PPC.Regs PPC.RegInfo PPC.Instr PPC.Cond PPC.Ppr - PPC.CodeGen SPARC.Base SPARC.Regs SPARC.Imm SPARC.AddrMode - SPARC.Cond SPARC.Instr SPARC.Stack SPARC.ShortcutJump SPARC.Ppr - SPARC.CodeGen SPARC.CodeGen.Amode SPARC.CodeGen.Base - SPARC.CodeGen.CondCode SPARC.CodeGen.Gen32 SPARC.CodeGen.Gen64 - SPARC.CodeGen.Sanity SPARC.CodeGen.Expand RegAlloc.Liveness - RegAlloc.Graph.Main RegAlloc.Graph.Stats RegAlloc.Graph.ArchBase - RegAlloc.Graph.ArchX86 RegAlloc.Graph.Coalesce RegAlloc.Graph.Spill - RegAlloc.Graph.SpillClean RegAlloc.Graph.SpillCost - RegAlloc.Graph.TrivColorable RegAlloc.Linear.Main - RegAlloc.Linear.JoinToTargets RegAlloc.Linear.State - RegAlloc.Linear.Stats RegAlloc.Linear.FreeRegs - RegAlloc.Linear.StackMap RegAlloc.Linear.Base - RegAlloc.Linear.X86.FreeRegs RegAlloc.Linear.X86_64.FreeRegs - RegAlloc.Linear.PPC.FreeRegs RegAlloc.Linear.SPARC.FreeRegs Dwarf - Dwarf.Types Dwarf.Constants DsMeta Convert ByteCodeAsm ByteCodeGen - ByteCodeInstr ByteCodeItbls ByteCodeLink Debugger LibFFI Linker - ObjLink RtClosureInspect DebuggerUtils -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/ghc-7.10.1 -hs-libraries: HSghc-7.10.1-EMlWrQ42XY0BNVbSrKixqY -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY/include -depends: - array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - bin-package-db-0.0.0.0-708fc7d634a370b311371a5bcde40b62 - bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db - containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d - directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 - filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 - hoopl-3.10.0.2-8c8dfc4c3140e5f7c982da224c3cb1f0 - hpc-0.6.0.2-ac9064885aa8cb08a93314222939ead4 - process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1 - template-haskell-2.10.0.0-e895139a0ffff267d412e3d0191ce93b - time-1.5.0.1-e17a9220d438435579d2914e90774246 - transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f - unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1/ghc.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: haskeline -version: 0.7.2.1 -id: haskeline-0.7.2.1-a646e1ddf1a755ca5b5775dcb2ef8d8b -key: haske_IlDhIe25uAn0WJY379Nu1M -license: BSD3 -copyright: (c) Judah Jacobson -maintainer: Judah Jacobson <judah.jacobson@gmail.com> -stability: Experimental -homepage: http://trac.haskell.org/haskeline -synopsis: A command-line interface for user input, written in Haskell. -description: - Haskeline provides a user interface for line input in command-line - programs. This library is similar in purpose to readline, but since - it is written in Haskell it is (hopefully) more easily used in other - Haskell programs. - . - Haskeline runs both on POSIX-compatible systems and on Windows. -category: User Interfaces -author: Judah Jacobson -exposed: True -exposed-modules: - System.Console.Haskeline System.Console.Haskeline.Completion - System.Console.Haskeline.MonadException - System.Console.Haskeline.History System.Console.Haskeline.IO -hidden-modules: System.Console.Haskeline.Backend - System.Console.Haskeline.Backend.WCWidth - System.Console.Haskeline.Command - System.Console.Haskeline.Command.Completion - System.Console.Haskeline.Command.History - System.Console.Haskeline.Command.KillRing - System.Console.Haskeline.Directory System.Console.Haskeline.Emacs - System.Console.Haskeline.InputT System.Console.Haskeline.Key - System.Console.Haskeline.LineState System.Console.Haskeline.Monads - System.Console.Haskeline.Prefs System.Console.Haskeline.RunCommand - System.Console.Haskeline.Term System.Console.Haskeline.Command.Undo - System.Console.Haskeline.Vi System.Console.Haskeline.Recover - System.Console.Haskeline.Backend.Posix - System.Console.Haskeline.Backend.Posix.Encoder - System.Console.Haskeline.Backend.DumbTerm - System.Console.Haskeline.Backend.Terminfo -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/haske_IlDhIe25uAn0WJY379Nu1M -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/haske_IlDhIe25uAn0WJY379Nu1M -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/haskeline-0.7.2.1 -hs-libraries: HShaskeline-0.7.2.1-IlDhIe25uAn0WJY379Nu1M -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db - containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d - directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 - filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 - terminfo-0.4.0.1-75199801b414a3f4c9de438be2a4e967 - transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f - unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/haskeline-0.7.2.1/haskeline.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/haskeline-0.7.2.1 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: terminfo -version: 0.4.0.1 -id: terminfo-0.4.0.1-75199801b414a3f4c9de438be2a4e967 -key: termi_7qZwBlx3clR8sTBilJl253 -license: BSD3 -copyright: (c) Judah Jacobson -maintainer: Judah Jacobson <judah.jacobson@gmail.com> -stability: Stable -homepage: https://github.com/judah/terminfo -synopsis: Haskell bindings to the terminfo library. -description: - This library provides an interface to the terminfo database (via bindings to the - curses library). <http://en.wikipedia.org/wiki/Terminfo Terminfo> allows POSIX - systems to interact with a variety of terminals using a standard set of capabilities. -category: User Interfaces -author: Judah Jacobson -exposed: True -exposed-modules: - System.Console.Terminfo System.Console.Terminfo.Base - System.Console.Terminfo.Cursor System.Console.Terminfo.Color - System.Console.Terminfo.Edit System.Console.Terminfo.Effects - System.Console.Terminfo.Keys -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/termi_7qZwBlx3clR8sTBilJl253 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/termi_7qZwBlx3clR8sTBilJl253 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/terminfo-0.4.0.1 -hs-libraries: HSterminfo-0.4.0.1-7qZwBlx3clR8sTBilJl253 -extra-libraries: - tinfo -includes: - ncurses.h term.h -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/terminfo-0.4.0.1/terminfo.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/terminfo-0.4.0.1 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: xhtml -version: 3000.2.1 -id: xhtml-3000.2.1-7de0560ea74b173b7313fc2303cc6c58 -key: xhtml_0mVDYvYGgNUBWShvlDofr1 -license: BSD3 -copyright: Bjorn Bringert 2004-2006, Andy Gill and the Oregon - Graduate Institute of Science and Technology, 1999-2001 -maintainer: Chris Dornan <chris@chrisdornan.com> -stability: Stable -homepage: https://github.com/haskell/xhtml -synopsis: An XHTML combinator library -description: - This package provides combinators for producing - XHTML 1.0, including the Strict, Transitional and - Frameset variants. -category: Web, XML, Pretty Printer -author: Bjorn Bringert -exposed: True -exposed-modules: - Text.XHtml Text.XHtml.Frameset Text.XHtml.Strict - Text.XHtml.Transitional Text.XHtml.Debug Text.XHtml.Table -hidden-modules: Text.XHtml.Strict.Attributes - Text.XHtml.Strict.Elements Text.XHtml.Frameset.Attributes - Text.XHtml.Frameset.Elements Text.XHtml.Transitional.Attributes - Text.XHtml.Transitional.Elements Text.XHtml.BlockTable - Text.XHtml.Extras Text.XHtml.Internals -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/xhtml_0mVDYvYGgNUBWShvlDofr1 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/xhtml_0mVDYvYGgNUBWShvlDofr1 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/xhtml-3000.2.1 -hs-libraries: HSxhtml-3000.2.1-0mVDYvYGgNUBWShvlDofr1 -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/xhtml-3000.2.1/xhtml.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/xhtml-3000.2.1 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: transformers -version: 0.4.2.0 -id: transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f -key: trans_ALYlebOVzVI4kxbFX5SGhm -license: BSD3 -maintainer: Ross Paterson <ross@soi.city.ac.uk> -synopsis: Concrete functor and monad transformers -description: - A portable library of functor and monad transformers, inspired by - the paper \"Functional Programming with Overloading and Higher-Order - Polymorphism\", by Mark P Jones, - in /Advanced School of Functional Programming/, 1995 - (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>). - . - This package contains: - . - * the monad transformer class (in "Control.Monad.Trans.Class") - and IO monad class (in "Control.Monad.IO.Class") - . - * concrete functor and monad transformers, each with associated - operations and functions to lift operations associated with other - transformers. - . - The package can be used on its own in portable Haskell code, in - which case operations need to be manually lifted through transformer - stacks (see "Control.Monad.Trans.Class" for some examples). - Alternatively, it can be used with the non-portable monad classes in - the @mtl@ or @monads-tf@ packages, which automatically lift operations - introduced by monad transformers through other transformers. -category: Control -author: Andy Gill, Ross Paterson -exposed: True -exposed-modules: - Control.Applicative.Backwards Control.Applicative.Lift - Control.Monad.IO.Class Control.Monad.Signatures - Control.Monad.Trans.Class Control.Monad.Trans.Cont - Control.Monad.Trans.Except Control.Monad.Trans.Error - Control.Monad.Trans.Identity Control.Monad.Trans.List - Control.Monad.Trans.Maybe Control.Monad.Trans.Reader - Control.Monad.Trans.RWS Control.Monad.Trans.RWS.Lazy - Control.Monad.Trans.RWS.Strict Control.Monad.Trans.State - Control.Monad.Trans.State.Lazy Control.Monad.Trans.State.Strict - Control.Monad.Trans.Writer Control.Monad.Trans.Writer.Lazy - Control.Monad.Trans.Writer.Strict Data.Functor.Classes - Data.Functor.Compose Data.Functor.Constant Data.Functor.Product - Data.Functor.Reverse Data.Functor.Sum -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/trans_ALYlebOVzVI4kxbFX5SGhm -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/trans_ALYlebOVzVI4kxbFX5SGhm -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/transformers-0.4.2.0 -hs-libraries: HStransformers-0.4.2.0-ALYlebOVzVI4kxbFX5SGhm -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/transformers-0.4.2.0/transformers.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/transformers-0.4.2.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: hoopl -version: 3.10.0.2 -id: hoopl-3.10.0.2-8c8dfc4c3140e5f7c982da224c3cb1f0 -key: hoopl_JxODiSRz1e84NbH6nnZuUk -license: BSD3 -maintainer: nr@cs.tufts.edu -homepage: http://ghc.cs.tufts.edu/hoopl/ -synopsis: A library to support dataflow analysis and optimization -description: - Higher-order optimization library - . - See /Norman Ramsey, Joao Dias, and Simon Peyton Jones./ - <http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"> /(2010)/ for more details. -category: Compilers/Interpreters -author: Norman Ramsey, Joao Dias, Simon Marlow and Simon Peyton Jones -exposed: True -exposed-modules: - Compiler.Hoopl Compiler.Hoopl.Internals Compiler.Hoopl.Wrappers - Compiler.Hoopl.Passes.Dominator Compiler.Hoopl.Passes.DList -hidden-modules: Compiler.Hoopl.Checkpoint - Compiler.Hoopl.Collections Compiler.Hoopl.Combinators - Compiler.Hoopl.Dataflow Compiler.Hoopl.Debug Compiler.Hoopl.Block - Compiler.Hoopl.Graph Compiler.Hoopl.Label Compiler.Hoopl.MkGraph - Compiler.Hoopl.Fuel Compiler.Hoopl.Pointed Compiler.Hoopl.Shape - Compiler.Hoopl.Show Compiler.Hoopl.Unique Compiler.Hoopl.XUtil -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hoopl_JxODiSRz1e84NbH6nnZuUk -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hoopl_JxODiSRz1e84NbH6nnZuUk -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/hoopl-3.10.0.2 -hs-libraries: HShoopl-3.10.0.2-JxODiSRz1e84NbH6nnZuUk -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hoopl-3.10.0.2/hoopl.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hoopl-3.10.0.2 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: bin-package-db -version: 0.0.0.0 -id: bin-package-db-0.0.0.0-708fc7d634a370b311371a5bcde40b62 -key: binpa_JNoexmBMuO8C771QaIy3YN -license: BSD3 -maintainer: ghc-devs@haskell.org -synopsis: The GHC compiler's view of the GHC package database format -description: - This library is shared between GHC and ghc-pkg and is used by - GHC to read package databases. - . - It only deals with the subset of the package database that the - compiler cares about: modules paths etc and not package - metadata like description, authors etc. It is thus not a - library interface to ghc-pkg and is *not* suitable for - modifying GHC package databases. - . - The package database format and this library are constructed in - such a way that while ghc-pkg depends on Cabal, the GHC library - and program do not have to depend on Cabal. -exposed: True -exposed-modules: - GHC.PackageDb -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binpa_JNoexmBMuO8C771QaIy3YN -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binpa_JNoexmBMuO8C771QaIy3YN -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/bin-package-db-0.0.0.0 -hs-libraries: HSbin-package-db-0.0.0.0-JNoexmBMuO8C771QaIy3YN -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - binary-0.7.3.0-0f543654a1ae447e0d4d0bbfc1bb704e - bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db - directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 - filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0/bin-package-db.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: Cabal -version: 1.22.2.0 -id: Cabal-1.22.2.0-9f7cae2e98cca225e3d159c1e1bc773c -key: Cabal_HWT8QvVfJLn2ubvobpycJY -license: BSD3 -copyright: 2003-2006, Isaac Jones - 2005-2011, Duncan Coutts -maintainer: cabal-devel@haskell.org -homepage: http://www.haskell.org/cabal/ -synopsis: A framework for packaging Haskell software -description: - The Haskell Common Architecture for Building Applications and - Libraries: a framework defining a common interface for authors to more - easily build their Haskell applications in a portable way. - . - The Haskell Cabal is part of a larger infrastructure for distributing, - organizing, and cataloging Haskell libraries and tools. -category: Distribution -author: Isaac Jones <ijones@syntaxpolice.org> - Duncan Coutts <duncan@community.haskell.org> -exposed: True -exposed-modules: - Distribution.Compat.CreatePipe Distribution.Compat.Environment - Distribution.Compat.Exception Distribution.Compat.ReadP - Distribution.Compiler Distribution.InstalledPackageInfo - Distribution.License Distribution.Make Distribution.ModuleName - Distribution.Package Distribution.PackageDescription - Distribution.PackageDescription.Check - Distribution.PackageDescription.Configuration - Distribution.PackageDescription.Parse - Distribution.PackageDescription.PrettyPrint - Distribution.PackageDescription.Utils Distribution.ParseUtils - Distribution.ReadE Distribution.Simple Distribution.Simple.Bench - Distribution.Simple.Build Distribution.Simple.Build.Macros - Distribution.Simple.Build.PathsModule - Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget - Distribution.Simple.CCompiler Distribution.Simple.Command - Distribution.Simple.Compiler Distribution.Simple.Configure - Distribution.Simple.GHC Distribution.Simple.GHCJS - Distribution.Simple.Haddock Distribution.Simple.HaskellSuite - Distribution.Simple.Hpc Distribution.Simple.Install - Distribution.Simple.InstallDirs Distribution.Simple.JHC - Distribution.Simple.LHC Distribution.Simple.LocalBuildInfo - Distribution.Simple.PackageIndex Distribution.Simple.PreProcess - Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program - Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin - Distribution.Simple.Program.Db Distribution.Simple.Program.Find - Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg - Distribution.Simple.Program.Hpc Distribution.Simple.Program.Ld - Distribution.Simple.Program.Run Distribution.Simple.Program.Script - Distribution.Simple.Program.Strip Distribution.Simple.Program.Types - Distribution.Simple.Register Distribution.Simple.Setup - Distribution.Simple.SrcDist Distribution.Simple.Test - Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09 - Distribution.Simple.Test.Log Distribution.Simple.UHC - Distribution.Simple.UserHooks Distribution.Simple.Utils - Distribution.System Distribution.TestSuite Distribution.Text - Distribution.Utils.NubList Distribution.Verbosity - Distribution.Version Language.Haskell.Extension -hidden-modules: Distribution.Compat.Binary - Distribution.Compat.CopyFile Distribution.Compat.TempFile - Distribution.GetOpt Distribution.Simple.GHC.Internal - Distribution.Simple.GHC.IPI641 Distribution.Simple.GHC.IPI642 - Distribution.Simple.GHC.ImplInfo Paths_Cabal -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/Cabal_HWT8QvVfJLn2ubvobpycJY -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/Cabal_HWT8QvVfJLn2ubvobpycJY -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/Cabal-1.22.2.0 -hs-libraries: HSCabal-1.22.2.0-HWT8QvVfJLn2ubvobpycJY -depends: - array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - binary-0.7.3.0-0f543654a1ae447e0d4d0bbfc1bb704e - bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db - containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d - deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 - directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 - filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 - pretty-1.1.2.0-0d4e1eca3b0cfcebe20b9405f7bdaca9 - process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1 - time-1.5.0.1-e17a9220d438435579d2914e90774246 - unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/Cabal-1.22.2.0/Cabal.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/Cabal-1.22.2.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: binary -version: 0.7.3.0 -id: binary-0.7.3.0-0f543654a1ae447e0d4d0bbfc1bb704e -key: binar_EKE3c9Lmxb3DQpU0fPtru6 -license: BSD3 -maintainer: Lennart Kolmodin, Don Stewart <dons00@gmail.com> -stability: provisional -homepage: https://github.com/kolmodin/binary -synopsis: Binary serialisation for Haskell values using lazy ByteStrings -description: - Efficient, pure binary serialisation using lazy ByteStrings. - Haskell values may be encoded to and from binary formats, - written to disk as binary, or sent over the network. - The format used can be automatically generated, or - you can choose to implement a custom format if needed. - Serialisation speeds of over 1 G\/sec have been observed, - so this library should be suitable for high performance - scenarios. -category: Data, Parsing -author: Lennart Kolmodin <kolmodin@gmail.com> -exposed: True -exposed-modules: - Data.Binary Data.Binary.Put Data.Binary.Get - Data.Binary.Get.Internal Data.Binary.Builder - Data.Binary.Builder.Internal -hidden-modules: Data.Binary.Builder.Base Data.Binary.Class - Data.Binary.Generic -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binar_EKE3c9Lmxb3DQpU0fPtru6 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binar_EKE3c9Lmxb3DQpU0fPtru6 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/binary-0.7.3.0 -hs-libraries: HSbinary-0.7.3.0-EKE3c9Lmxb3DQpU0fPtru6 -depends: - array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db - containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/binary-0.7.3.0/binary.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/binary-0.7.3.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: template-haskell -version: 2.10.0.0 -id: template-haskell-2.10.0.0-e895139a0ffff267d412e3d0191ce93b -key: templ_BVMCZyLwIlfGfcqqzyUAI8 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Support library for Template Haskell -description: - This package provides modules containing facilities for manipulating - Haskell source code using Template Haskell. - . - See <http://www.haskell.org/haskellwiki/Template_Haskell> for more - information. -category: Template Haskell -exposed: True -exposed-modules: - Language.Haskell.TH Language.Haskell.TH.Lib Language.Haskell.TH.Ppr - Language.Haskell.TH.PprLib Language.Haskell.TH.Quote - Language.Haskell.TH.Syntax -hidden-modules: Language.Haskell.TH.Lib.Map -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/templ_BVMCZyLwIlfGfcqqzyUAI8 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/templ_BVMCZyLwIlfGfcqqzyUAI8 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/template-haskell-2.10.0.0 -hs-libraries: HStemplate-haskell-2.10.0.0-BVMCZyLwIlfGfcqqzyUAI8 -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - pretty-1.1.2.0-0d4e1eca3b0cfcebe20b9405f7bdaca9 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/template-haskell-2.10.0.0/template-haskell.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/template-haskell-2.10.0.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: pretty -version: 1.1.2.0 -id: pretty-1.1.2.0-0d4e1eca3b0cfcebe20b9405f7bdaca9 -key: prett_7jIfj8VCGFf1WS0tIQ1XSZ -license: BSD3 -maintainer: David Terei <code@davidterei.com> -stability: Stable -homepage: http://github.com/haskell/pretty -synopsis: Pretty-printing library -description: - This package contains a pretty-printing library, a set of API's - that provides a way to easily print out text in a consistent - format of your choosing. This is useful for compilers and related - tools. - . - This library was originally designed by John Hughes's and has since - been heavily modified by Simon Peyton Jones. -category: Text -exposed: True -exposed-modules: - Text.PrettyPrint Text.PrettyPrint.HughesPJ - Text.PrettyPrint.HughesPJClass -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/prett_7jIfj8VCGFf1WS0tIQ1XSZ -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/prett_7jIfj8VCGFf1WS0tIQ1XSZ -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/pretty-1.1.2.0 -hs-libraries: HSpretty-1.1.2.0-7jIfj8VCGFf1WS0tIQ1XSZ -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 - ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/pretty-1.1.2.0/pretty.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/pretty-1.1.2.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: hpc -version: 0.6.0.2 -id: hpc-0.6.0.2-ac9064885aa8cb08a93314222939ead4 -key: hpc_CmUUQl5bURfBueJrdYfNs3 -license: BSD3 -maintainer: ghc-devs@haskell.org -synopsis: Code Coverage Library for Haskell -description: - This package provides the code coverage library for Haskell. - . - See <http://www.haskell.org/haskellwiki/Haskell_program_coverage> for more - information. -category: Control -author: Andy Gill -exposed: True -exposed-modules: - Trace.Hpc.Util Trace.Hpc.Mix Trace.Hpc.Tix Trace.Hpc.Reflect -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hpc_CmUUQl5bURfBueJrdYfNs3 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hpc_CmUUQl5bURfBueJrdYfNs3 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/hpc-0.6.0.2 -hs-libraries: HShpc-0.6.0.2-CmUUQl5bURfBueJrdYfNs3 -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d - directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 - filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 - time-1.5.0.1-e17a9220d438435579d2914e90774246 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hpc-0.6.0.2/hpc.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hpc-0.6.0.2 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: process -version: 1.2.3.0 -id: process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1 -key: proce_0hwN3CTKynhHQqQkChnSdH -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Process libraries -description: - This package contains libraries for dealing with system processes. -category: System -exposed: True -exposed-modules: - System.Cmd System.Process System.Process.Internals -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/proce_0hwN3CTKynhHQqQkChnSdH -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/proce_0hwN3CTKynhHQqQkChnSdH -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/process-1.2.3.0 -hs-libraries: HSprocess-1.2.3.0-0hwN3CTKynhHQqQkChnSdH -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/proce_0hwN3CTKynhHQqQkChnSdH/include -includes: - runProcess.h -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 - directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 - filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 - unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/process-1.2.3.0/process.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/process-1.2.3.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: directory -version: 1.2.2.0 -id: directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 -key: direc_3TcTyYedch32o1zTH2MR00 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Platform-agnostic library for filesystem operations -description: - This library provides a basic set of operations for manipulating files and - directories in a portable way. -category: System -exposed: True -exposed-modules: - System.Directory -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/direc_3TcTyYedch32o1zTH2MR00 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/direc_3TcTyYedch32o1zTH2MR00 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/directory-1.2.2.0 -hs-libraries: HSdirectory-1.2.2.0-3TcTyYedch32o1zTH2MR00 -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/direc_3TcTyYedch32o1zTH2MR00/include -includes: - HsDirectory.h -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 - time-1.5.0.1-e17a9220d438435579d2914e90774246 - unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/directory-1.2.2.0/directory.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/directory-1.2.2.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: unix -version: 2.7.1.0 -id: unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f -key: unix_G4Yo1pNtYrk8nCq1cx8P9d -license: BSD3 -maintainer: libraries@haskell.org -homepage: https://github.com/haskell/unix -synopsis: POSIX functionality -description: - This package gives you access to the set of operating system - services standardised by POSIX 1003.1b (or the IEEE Portable - Operating System Interface for Computing Environments - - IEEE Std. 1003.1). - . - The package is not supported under Windows (except under Cygwin). -category: System -exposed: True -exposed-modules: - System.Posix System.Posix.ByteString System.Posix.Error - System.Posix.Resource System.Posix.Time System.Posix.Unistd - System.Posix.User System.Posix.Signals System.Posix.Signals.Exts - System.Posix.Semaphore System.Posix.SharedMem - System.Posix.ByteString.FilePath System.Posix.Directory - System.Posix.Directory.ByteString System.Posix.DynamicLinker.Module - System.Posix.DynamicLinker.Module.ByteString - System.Posix.DynamicLinker.Prim - System.Posix.DynamicLinker.ByteString System.Posix.DynamicLinker - System.Posix.Files System.Posix.Files.ByteString System.Posix.IO - System.Posix.IO.ByteString System.Posix.Env - System.Posix.Env.ByteString System.Posix.Fcntl System.Posix.Process - System.Posix.Process.Internals System.Posix.Process.ByteString - System.Posix.Temp System.Posix.Temp.ByteString - System.Posix.Terminal System.Posix.Terminal.ByteString -hidden-modules: System.Posix.Directory.Common - System.Posix.DynamicLinker.Common System.Posix.Files.Common - System.Posix.IO.Common System.Posix.Process.Common - System.Posix.Terminal.Common -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/unix_G4Yo1pNtYrk8nCq1cx8P9d -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/unix_G4Yo1pNtYrk8nCq1cx8P9d -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/unix-2.7.1.0 -hs-libraries: HSunix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d -extra-libraries: - rt util dl pthread -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/unix_G4Yo1pNtYrk8nCq1cx8P9d/include -includes: - HsUnix.h execvpe.h -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db - time-1.5.0.1-e17a9220d438435579d2914e90774246 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/unix-2.7.1.0/unix.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/unix-2.7.1.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: time -version: 1.5.0.1 -id: time-1.5.0.1-e17a9220d438435579d2914e90774246 -key: time_Hh2clZW6in4HpYHx5bLtb7 -license: BSD3 -maintainer: <ashley@semantic.org> -stability: stable -homepage: https://github.com/haskell/time -synopsis: A time library -description: - A time library -category: System -author: Ashley Yakeley -exposed: True -exposed-modules: - Data.Time.Calendar Data.Time.Calendar.MonthDay - Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate - Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Clock - Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime - Data.Time.Format Data.Time -hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days - Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay - Data.Time.Clock.Scale Data.Time.Clock.UTC Data.Time.Clock.CTimeval - Data.Time.Clock.UTCDiff Data.Time.LocalTime.TimeZone - Data.Time.LocalTime.TimeOfDay Data.Time.LocalTime.LocalTime - Data.Time.Format.Parse Data.Time.Format.Locale -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/time_Hh2clZW6in4HpYHx5bLtb7 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/time_Hh2clZW6in4HpYHx5bLtb7 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/time-1.5.0.1 -hs-libraries: HStime-1.5.0.1-Hh2clZW6in4HpYHx5bLtb7 -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/time_Hh2clZW6in4HpYHx5bLtb7/include -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/time-1.5.0.1/time.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/time-1.5.0.1 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: containers -version: 0.5.6.2 -id: containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d -key: conta_47ajk3tbda43DFWyeF3oHQ -license: BSD3 -maintainer: fox@ucw.cz -synopsis: Assorted concrete container types -description: - This package contains efficient general-purpose implementations - of various basic immutable container types. The declared cost of - each operation is either worst-case or amortized, but remains - valid even if structures are shared. -category: Data Structures -exposed: True -exposed-modules: - Data.IntMap Data.IntMap.Lazy Data.IntMap.Strict Data.IntSet - Data.Map Data.Map.Lazy Data.Map.Strict Data.Set Data.Graph - Data.Sequence Data.Tree -hidden-modules: Data.IntMap.Base Data.IntSet.Base Data.Map.Base - Data.Set.Base Data.Utils.BitUtil Data.Utils.StrictFold - Data.Utils.StrictPair -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/conta_47ajk3tbda43DFWyeF3oHQ -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/conta_47ajk3tbda43DFWyeF3oHQ -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/containers-0.5.6.2 -hs-libraries: HScontainers-0.5.6.2-47ajk3tbda43DFWyeF3oHQ -depends: - array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 - ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/containers.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: bytestring -version: 0.10.6.0 -id: bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db -key: bytes_6vj5EoliHgNHISHCVCb069 -license: BSD3 -copyright: Copyright (c) Don Stewart 2005-2009, - (c) Duncan Coutts 2006-2015, - (c) David Roundy 2003-2005, - (c) Jasper Van der Jeugt 2010, - (c) Simon Meier 2010-2013. -maintainer: Duncan Coutts <duncan@community.haskell.org> -homepage: https://github.com/haskell/bytestring -synopsis: Fast, compact, strict and lazy byte strings with a list interface -description: - An efficient compact, immutable byte string type (both strict and lazy) - suitable for binary or 8-bit character data. - . - The 'ByteString' type represents sequences of bytes or 8-bit characters. - It is suitable for high performance use, both in terms of large data - quantities, or high speed requirements. The 'ByteString' functions follow - the same style as Haskell\'s ordinary lists, so it is easy to convert code - from using 'String' to 'ByteString'. - . - Two 'ByteString' variants are provided: - . - * Strict 'ByteString's keep the string as a single large array. This - makes them convenient for passing data between C and Haskell. - . - * Lazy 'ByteString's use a lazy list of strict chunks which makes it - suitable for I\/O streaming tasks. - . - The @Char8@ modules provide a character-based view of the same - underlying 'ByteString' types. This makes it convenient to handle mixed - binary and 8-bit character content (which is common in many file formats - and network protocols). - . - The 'Builder' module provides an efficient way to build up 'ByteString's - in an ad-hoc way by repeated concatenation. This is ideal for fast - serialisation or pretty printing. - . - There is also a 'ShortByteString' type which has a lower memory overhead - and can be converted to or from a 'ByteString', but supports very few - other operations. It is suitable for keeping many short strings in memory. - . - 'ByteString's are not designed for Unicode. For Unicode strings you should - use the 'Text' type from the @text@ package. - . - These modules are intended to be imported qualified, to avoid name clashes - with "Prelude" functions, e.g. - . - > import qualified Data.ByteString as BS -category: Data -author: Don Stewart, - Duncan Coutts -exposed: True -exposed-modules: - Data.ByteString Data.ByteString.Char8 Data.ByteString.Unsafe - Data.ByteString.Internal Data.ByteString.Lazy - Data.ByteString.Lazy.Char8 Data.ByteString.Lazy.Internal - Data.ByteString.Short Data.ByteString.Short.Internal - Data.ByteString.Builder Data.ByteString.Builder.Extra - Data.ByteString.Builder.Prim Data.ByteString.Builder.Internal - Data.ByteString.Builder.Prim.Internal Data.ByteString.Lazy.Builder - Data.ByteString.Lazy.Builder.Extras - Data.ByteString.Lazy.Builder.ASCII -hidden-modules: Data.ByteString.Builder.ASCII - Data.ByteString.Builder.Prim.Binary - Data.ByteString.Builder.Prim.ASCII - Data.ByteString.Builder.Prim.Internal.Floating - Data.ByteString.Builder.Prim.Internal.UncheckedShifts - Data.ByteString.Builder.Prim.Internal.Base16 -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/bytes_6vj5EoliHgNHISHCVCb069 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/bytes_6vj5EoliHgNHISHCVCb069 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/bytestring-0.10.6.0 -hs-libraries: HSbytestring-0.10.6.0-6vj5EoliHgNHISHCVCb069 -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/bytes_6vj5EoliHgNHISHCVCb069/include -includes: - fpstring.h -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a - deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 - ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 - integer-gmp-1.0.0.0-3c947e5fb6dca14804d9b2793c521b67 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bytestring-0.10.6.0/bytestring.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bytestring-0.10.6.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: deepseq -version: 1.4.1.1 -id: deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 -key: deeps_FpR4obOZALU1lutWnrBldi -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Deep evaluation of data structures -description: - This package provides methods for fully evaluating data structures - (\"deep evaluation\"). Deep evaluation is often used for adding - strictness to a program, e.g. in order to force pending exceptions, - remove space leaks, or force lazy I/O to happen. It is also useful - in parallel programs, to ensure pending work does not migrate to the - wrong thread. - . - The primary use of this package is via the 'deepseq' function, a - \"deep\" version of 'seq'. It is implemented on top of an 'NFData' - typeclass (\"Normal Form Data\", data structures with no unevaluated - components) which defines strategies for fully evaluating different - data types. -category: Control -exposed: True -exposed-modules: - Control.DeepSeq -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/deeps_FpR4obOZALU1lutWnrBldi -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/deeps_FpR4obOZALU1lutWnrBldi -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/deepseq-1.4.1.1 -hs-libraries: HSdeepseq-1.4.1.1-FpR4obOZALU1lutWnrBldi -depends: - array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/deepseq-1.4.1.1/deepseq.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/deepseq-1.4.1.1 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: array -version: 0.5.1.0 -id: array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 -key: array_FaHmcBFfuRM8kmZLEY8D5S -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Mutable and immutable arrays -description: - In addition to providing the "Data.Array" module - <http://www.haskell.org/onlinereport/haskell2010/haskellch14.html as specified in the Haskell 2010 Language Report>, - this package also defines the classes 'IArray' of - immutable arrays and 'MArray' of arrays mutable within appropriate - monads, as well as some instances of these classes. -category: Data Structures -exposed: True -exposed-modules: - Data.Array Data.Array.Base Data.Array.IArray Data.Array.IO - Data.Array.IO.Safe Data.Array.IO.Internals Data.Array.MArray - Data.Array.MArray.Safe Data.Array.ST Data.Array.ST.Safe - Data.Array.Storable Data.Array.Storable.Safe - Data.Array.Storable.Internals Data.Array.Unboxed Data.Array.Unsafe -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/array_FaHmcBFfuRM8kmZLEY8D5S -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/array_FaHmcBFfuRM8kmZLEY8D5S -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/array-0.5.1.0 -hs-libraries: HSarray-0.5.1.0-FaHmcBFfuRM8kmZLEY8D5S -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/array-0.5.1.0/array.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/array-0.5.1.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: filepath -version: 1.4.0.0 -id: filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 -key: filep_5HhyRonfEZoDO205Wm9E4h -license: BSD3 -copyright: Neil Mitchell 2005-2015 -maintainer: Neil Mitchell <ndmitchell@gmail.com> -homepage: https://github.com/haskell/filepath#readme -synopsis: Library for manipulating FilePaths in a cross platform way. -description: - This package provides functionality for manipulating @FilePath@ values, and is shipped with both <https://www.haskell.org/ghc/ GHC> and the <https://www.haskell.org/platform/ Haskell Platform>. It provides three modules: - . - * "System.FilePath.Posix" manipulates POSIX\/Linux style @FilePath@ values (with @\/@ as the path separator). - . - * "System.FilePath.Windows" manipulates Windows style @FilePath@ values (with either @\\@ or @\/@ as the path separator, and deals with drives). - . - * "System.FilePath" is an alias for the module appropriate to your platform. - . - All three modules provide the same API, and the same documentation (calling out differences in the different variants). -category: System -author: Neil Mitchell <ndmitchell@gmail.com> -exposed: True -exposed-modules: - System.FilePath System.FilePath.Posix System.FilePath.Windows -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/filep_5HhyRonfEZoDO205Wm9E4h -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/filep_5HhyRonfEZoDO205Wm9E4h -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/filepath-1.4.0.0 -hs-libraries: HSfilepath-1.4.0.0-5HhyRonfEZoDO205Wm9E4h -depends: - base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/filepath-1.4.0.0/filepath.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/filepath-1.4.0.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: base -version: 4.8.0.0 -id: base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a -key: base_I5BErHzyOm07EBNpKBEeUv -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Basic libraries -description: - This package contains the "Prelude" and its support libraries, - and a large collection of useful libraries ranging from data - structures to parsing combinators and debugging utilities. -category: Prelude -exposed: True -exposed-modules: - Control.Applicative Control.Arrow Control.Category - Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar - Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception - Control.Exception.Base Control.Monad Control.Monad.Fix - Control.Monad.Instances Control.Monad.ST Control.Monad.ST.Lazy - Control.Monad.ST.Lazy.Safe Control.Monad.ST.Lazy.Unsafe - Control.Monad.ST.Safe Control.Monad.ST.Strict - Control.Monad.ST.Unsafe Control.Monad.Zip Data.Bifunctor Data.Bits - Data.Bool Data.Char Data.Coerce Data.Complex Data.Data Data.Dynamic - Data.Either Data.Eq Data.Fixed Data.Foldable Data.Function - Data.Functor Data.Functor.Identity Data.IORef Data.Int Data.Ix - Data.List Data.Maybe Data.Monoid Data.Ord Data.Proxy Data.Ratio - Data.STRef Data.STRef.Lazy Data.STRef.Strict Data.String - Data.Traversable Data.Tuple Data.Type.Bool Data.Type.Coercion - Data.Type.Equality Data.Typeable Data.Typeable.Internal Data.Unique - Data.Version Data.Void Data.Word Debug.Trace Foreign Foreign.C - Foreign.C.Error Foreign.C.String Foreign.C.Types Foreign.Concurrent - Foreign.ForeignPtr Foreign.ForeignPtr.Safe - Foreign.ForeignPtr.Unsafe Foreign.Marshal Foreign.Marshal.Alloc - Foreign.Marshal.Array Foreign.Marshal.Error Foreign.Marshal.Pool - Foreign.Marshal.Safe Foreign.Marshal.Unsafe Foreign.Marshal.Utils - Foreign.Ptr Foreign.Safe Foreign.StablePtr Foreign.Storable GHC.Arr - GHC.Base GHC.Char GHC.Conc GHC.Conc.IO GHC.Conc.Signal - GHC.Conc.Sync GHC.ConsoleHandler GHC.Constants GHC.Desugar GHC.Enum - GHC.Environment GHC.Err GHC.Exception GHC.Exts GHC.Fingerprint - GHC.Fingerprint.Type GHC.Float GHC.Float.ConversionUtils - GHC.Float.RealFracMethods GHC.Foreign GHC.ForeignPtr GHC.GHCi - GHC.Generics GHC.IO GHC.IO.Buffer GHC.IO.BufferedIO GHC.IO.Device - GHC.IO.Encoding GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure - GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types - GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 - GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD - GHC.IO.Handle.Internals GHC.IO.Handle.Text GHC.IO.Handle.Types - GHC.IO.IOMode GHC.IOArray GHC.IORef GHC.IP GHC.Int GHC.List - GHC.MVar GHC.Natural GHC.Num GHC.OldList GHC.PArr GHC.Pack - GHC.Profiling GHC.Ptr GHC.Read GHC.Real GHC.RTS.Flags GHC.ST - GHC.StaticPtr GHC.STRef GHC.Show GHC.Stable GHC.Stack GHC.Stats - GHC.Storable GHC.TopHandler GHC.TypeLits GHC.Unicode GHC.Weak - GHC.Word Numeric Numeric.Natural Prelude System.CPUTime - System.Console.GetOpt System.Environment System.Exit System.IO - System.IO.Error System.IO.Unsafe System.Info System.Mem - System.Mem.StableName System.Mem.Weak System.Posix.Internals - System.Posix.Types System.Timeout Text.ParserCombinators.ReadP - Text.ParserCombinators.ReadPrec Text.Printf Text.Read Text.Read.Lex - Text.Show Text.Show.Functions Unsafe.Coerce GHC.Event -hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp - Data.OldList Foreign.ForeignPtr.Imp - System.Environment.ExecutablePath GHC.Event.Arr GHC.Event.Array - GHC.Event.Clock GHC.Event.Control GHC.Event.EPoll - GHC.Event.IntTable GHC.Event.Internal GHC.Event.KQueue - GHC.Event.Manager GHC.Event.PSQ GHC.Event.Poll GHC.Event.Thread - GHC.Event.TimerManager GHC.Event.Unique -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/base_I5BErHzyOm07EBNpKBEeUv -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/base_I5BErHzyOm07EBNpKBEeUv -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/base-4.8.0.0 -hs-libraries: HSbase-4.8.0.0-I5BErHzyOm07EBNpKBEeUv -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/base_I5BErHzyOm07EBNpKBEeUv/include -includes: - HsBase.h -depends: - builtin_rts ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 - integer-gmp-1.0.0.0-3c947e5fb6dca14804d9b2793c521b67 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/base.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: integer-gmp -version: 1.0.0.0 -id: integer-gmp-1.0.0.0-3c947e5fb6dca14804d9b2793c521b67 -key: integ_2aU3IZNMF9a7mQ0OzsZ0dS -license: BSD3 -maintainer: hvr@gnu.org -synopsis: Integer library based on GMP -category: Numeric, Algebra -author: Herbert Valerio Riedel -exposed: True -exposed-modules: - GHC.Integer GHC.Integer.Logarithms GHC.Integer.Logarithms.Internals - GHC.Integer.GMP.Internals -hidden-modules: GHC.Integer.Type -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/integ_2aU3IZNMF9a7mQ0OzsZ0dS -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/integ_2aU3IZNMF9a7mQ0OzsZ0dS -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/integer-gmp-1.0.0.0 -hs-libraries: HSinteger-gmp-1.0.0.0-2aU3IZNMF9a7mQ0OzsZ0dS -extra-libraries: - gmp -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include -depends: - ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0/integer-gmp.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: ghc-prim -version: 0.4.0.0 -id: ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 -key: ghcpr_8TmvWUcS1U1IKHT0levwg3 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: GHC primitives -description: - GHC primitives. -category: GHC -exposed: True -exposed-modules: - GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 GHC.Magic - GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim -trusted: False -import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghcpr_8TmvWUcS1U1IKHT0levwg3 -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghcpr_8TmvWUcS1U1IKHT0levwg3 -data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/ghc-prim-0.4.0.0 -hs-libraries: HSghc-prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3 -depends: - builtin_rts -haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-prim-0.4.0.0/ghc-prim.haddock -haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-prim-0.4.0.0 -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" ---- -name: rts -version: 1.0 -id: builtin_rts -key: rts -license: BSD3 -maintainer: glasgow-haskell-users@haskell.org -exposed: True -trusted: False -library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/rts -hs-libraries: HSrts Cffi -extra-libraries: - m rt dl -include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/include -includes: - Stg.h -ld-options: "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info" - "-Wl,-u,base_GHCziPtr_Ptr_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info" - "-Wl,-u,base_GHCziInt_I8zh_static_info" - "-Wl,-u,base_GHCziInt_I16zh_static_info" - "-Wl,-u,base_GHCziInt_I32zh_static_info" - "-Wl,-u,base_GHCziInt_I64zh_static_info" - "-Wl,-u,base_GHCziWord_W8zh_static_info" - "-Wl,-u,base_GHCziWord_W16zh_static_info" - "-Wl,-u,base_GHCziWord_W32zh_static_info" - "-Wl,-u,base_GHCziWord_W64zh_static_info" - "-Wl,-u,base_GHCziStable_StablePtr_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" - "-Wl,-u,base_GHCziPtr_Ptr_con_info" - "-Wl,-u,base_GHCziPtr_FunPtr_con_info" - "-Wl,-u,base_GHCziStable_StablePtr_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_False_closure" - "-Wl,-u,ghczmprim_GHCziTypes_True_closure" - "-Wl,-u,base_GHCziPack_unpackCString_closure" - "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" - "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" - "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" - "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" - "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" - "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure" - "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" - "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure" - "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" - "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" - "-Wl,-u,base_GHCziTopHandler_runIO_closure" - "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" - "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" - "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" - "-Wl,-u,base_GHCziConcziSync_runSparks_closure" - "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure" -pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" -
@@ -1,67 +0,0 @@-name: hmatrix -version: 0.16.1.5 -id: hmatrix-0.16.1.5-12d5d21f26aa98774cdd8edbc343fbfe -license: BSD3 -copyright: -maintainer: Alberto Ruiz -stability: provisional -homepage: https://github.com/albertoruiz/hmatrix -package-url: -synopsis: Numeric Linear Algebra -description: Linear algebra based on BLAS and LAPACK. - . - The package is organized as follows: - . - ["Numeric.LinearAlgebra.HMatrix"] Starting point and recommended import module for most applications. - . - ["Numeric.LinearAlgebra.Static"] Experimental alternative interface. - . - ["Numeric.LinearAlgebra.Devel"] Tools for extending the library. - . - (Other modules are exposed with hidden documentation for backwards compatibility.) - . - Code examples: <http://dis.um.es/~alberto/hmatrix/hmatrix.html> -category: Math -author: Alberto Ruiz -exposed: True -exposed-modules: Data.Packed Data.Packed.Vector Data.Packed.Matrix - Data.Packed.Foreign Data.Packed.ST Data.Packed.Development - Numeric.LinearAlgebra Numeric.LinearAlgebra.LAPACK - Numeric.LinearAlgebra.Algorithms Numeric.Container - Numeric.LinearAlgebra.Util Numeric.LinearAlgebra.Devel - Numeric.LinearAlgebra.Data Numeric.LinearAlgebra.HMatrix - Numeric.LinearAlgebra.Static -hidden-modules: Data.Packed.Internal Data.Packed.Internal.Common - Data.Packed.Internal.Signatures Data.Packed.Internal.Vector - Data.Packed.Internal.Matrix Data.Packed.IO Numeric.Chain - Numeric.Vectorized Numeric.Vector Numeric.Matrix - Data.Packed.Internal.Numeric Data.Packed.Numeric - Numeric.LinearAlgebra.Util.Convolution - Numeric.LinearAlgebra.Util.CG Numeric.LinearAlgebra.Random - Numeric.Conversion Numeric.Sparse - Numeric.LinearAlgebra.Static.Internal -trusted: False -import-dirs: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/lib/x86_64-osx-ghc-7.8.4/hmatrix-0.16.1.5 -library-dirs: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/lib/x86_64-osx-ghc-7.8.4/hmatrix-0.16.1.5 - /opt/local/lib/ /usr/local/lib/ "C:/Program Files/Example/" -hs-libraries: HShmatrix-0.16.1.5 -extra-libraries: blas lapack -extra-ghci-libraries: -include-dirs: /opt/local/include/ /usr/local/include/ -includes: -depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-918c7ac27f65a87103264a9f51652d63 - binary-0.7.1.0-108d06eea2ef05e517f9c1facf10f63c - bytestring-0.10.4.0-78bc8f2c724c765c78c004a84acf6cc3 - deepseq-1.3.0.2-0ddc77716bd2515426e1ba39f6788a4f - random-1.1-822c19b7507b6ac1aaa4c66731e775ae - split-0.2.2-34cfb851cc3784e22bfae7a7bddda9c5 - storable-complex-0.2.2-e962c368d58acc1f5b41d41edc93da72 - vector-0.10.12.3-f4222db607fd5fdd7545d3e82419b307 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: Accelerate -haddock-interfaces: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html/hmatrix.haddock -haddock-html: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html
@@ -1,1529 +0,0 @@-name: haskell2010 -version: 1.1.2.0 -id: haskell2010-1.1.2.0-05c8dd51009e08c6371c82972d40f55a -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: http://www.haskell.org/onlinereport/haskell2010/ -package-url: -synopsis: Compatibility with Haskell 2010 -description: This package provides exactly the library modules defined by - the <http://www.haskell.org/onlinereport/haskell2010/ Haskell 2010 standard>. -category: Haskell2010, Prelude -author: -exposed: False -exposed-modules: Prelude Control.Monad Data.Array Data.Bits - Data.Char Data.Complex Data.Int Data.Ix Data.List Data.Maybe - Data.Ratio Data.Word Foreign Foreign.C Foreign.C.Error - Foreign.C.String Foreign.C.Types Foreign.ForeignPtr Foreign.Marshal - Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error - Foreign.Marshal.Utils Foreign.Ptr Foreign.StablePtr - Foreign.Storable Numeric System.Environment System.Exit System.IO - System.IO.Error -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell2010-1.1.2.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell2010-1.1.2.0 -hs-libraries: HShaskell2010-1.1.2.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0/haskell2010.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: haskell98 -version: 2.0.0.3 -id: haskell98-2.0.0.3-045e8778b656db76e2c729405eee707b -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: http://www.haskell.org/definition/ -package-url: -synopsis: Compatibility with Haskell 98 -description: This package provides compatibility with the modules of Haskell - 98 and the FFI addendum, by means of wrappers around modules from - the base package (which in many cases have additional features). - However "Prelude", "Numeric" and "Foreign" are provided directly by - the @base@ package. -category: Haskell98, Prelude -author: -exposed: False -exposed-modules: Prelude Array CPUTime Char Complex Directory IO Ix - List Locale Maybe Monad Numeric Random Ratio System Time Bits - CError CForeign CString CTypes ForeignPtr Int MarshalAlloc - MarshalArray MarshalError MarshalUtils Ptr StablePtr Storable Word -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell98-2.0.0.3 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell98-2.0.0.3 -hs-libraries: HShaskell98-2.0.0.3 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 - old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 - old-time-1.1.0.2-e3f776e97c1a6ff1770b04943a7ef7c6 - process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 - time-1.4.2-9b3076800c33f8382c38628f35717951 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell98-2.0.0.3/haskell98.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell98-2.0.0.3 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: old-time -version: 1.1.0.2 -id: old-time-1.1.0.2-e3f776e97c1a6ff1770b04943a7ef7c6 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Time library -description: This package provides the old time library. - . - For new projects, the newer - <http://hackage.haskell.org/package/time time library> - is recommended. -category: System -author: -exposed: True -exposed-modules: System.Time -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-time-1.1.0.2 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-time-1.1.0.2 -hs-libraries: HSold-time-1.1.0.2 -extra-libraries: -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-time-1.1.0.2/include -includes: HsTime.h -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-time-1.1.0.2/old-time.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-time-1.1.0.2 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: ghc -version: 7.8.4 -id: ghc-7.8.4-6c4818bc66adb23509058069f781d99a -license: BSD3 -copyright: -maintainer: glasgow-haskell-users@haskell.org -stability: -homepage: http://www.haskell.org/ghc/ -package-url: -synopsis: The GHC API -description: GHC's functionality can be useful for more things than just - compiling Haskell programs. Important use cases are programs - that analyse (and perhaps transform) Haskell code. Others - include loading Haskell code dynamically in a GHCi-like manner. - For this reason, a lot of GHC's functionality is made available - through this package. -category: Development -author: The GHC Team -exposed: False -exposed-modules: Avail BasicTypes ConLike DataCon PatSyn Demand - Exception GhcMonad Hooks Id IdInfo Literal Llvm Llvm.AbsSyn - Llvm.MetaData Llvm.PpLlvm Llvm.Types LlvmCodeGen LlvmCodeGen.Base - LlvmCodeGen.CodeGen LlvmCodeGen.Data LlvmCodeGen.Ppr - LlvmCodeGen.Regs LlvmMangler MkId Module Name NameEnv NameSet - OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet BlockId - CLabel Cmm CmmBuildInfoTables CmmPipeline CmmCallConv - CmmCommonBlockElim CmmContFlowOpt CmmExpr CmmInfo CmmLex CmmLint - CmmLive CmmMachOp CmmNode CmmOpt CmmParse CmmProcPoint - CmmRewriteAssignments CmmSink CmmType CmmUtils CmmLayoutStack - MkGraph PprBase PprC PprCmm PprCmmDecl PprCmmExpr Bitmap - CodeGen.Platform CodeGen.Platform.ARM CodeGen.Platform.NoRegs - CodeGen.Platform.PPC CodeGen.Platform.PPC_Darwin - CodeGen.Platform.SPARC CodeGen.Platform.X86 CodeGen.Platform.X86_64 - CgUtils StgCmm StgCmmBind StgCmmClosure StgCmmCon StgCmmEnv - StgCmmExpr StgCmmForeign StgCmmHeap StgCmmHpc StgCmmArgRep - StgCmmLayout StgCmmMonad StgCmmPrim StgCmmProf StgCmmTicky - StgCmmUtils StgCmmExtCode SMRep CoreArity CoreFVs CoreLint CorePrep - CoreSubst CoreSyn TrieMap CoreTidy CoreUnfold CoreUtils - ExternalCore MkCore MkExternalCore PprCore PprExternalCore Check - Coverage Desugar DsArrows DsBinds DsCCall DsExpr DsForeign DsGRHSs - DsListComp DsMonad DsUtils Match MatchCon MatchLit HsBinds HsDecls - HsDoc HsExpr HsImpExp HsLit HsPat HsSyn HsTypes HsUtils BinIface - BuildTyCl IfaceEnv IfaceSyn IfaceType LoadIface MkIface TcIface - FlagChecker Annotations BreakArray CmdLineParser CodeOutput Config - Constants DriverMkDepend DriverPhases PipelineMonad DriverPipeline - DynFlags ErrUtils Finder GHC GhcMake GhcPlugins DynamicLoading - HeaderInfo HscMain HscStats HscTypes InteractiveEval - InteractiveEvalTypes PackageConfig Packages PlatformConstants - PprTyThing StaticFlags SysTools TidyPgm Ctype HaddockUtils LexCore - Lexer OptCoercion Parser ParserCore ParserCoreUtils RdrHsSyn - ForeignCall PrelInfo PrelNames PrelRules PrimOp TysPrim TysWiredIn - CostCentre ProfInit SCCfinal RnBinds RnEnv RnExpr RnHsDoc RnNames - RnPat RnSource RnSplice RnTypes CoreMonad CSE FloatIn FloatOut - LiberateCase OccurAnal SAT SetLevels SimplCore SimplEnv SimplMonad - SimplUtils Simplify SimplStg StgStats UnariseStg Rules SpecConstr - Specialise CoreToStg StgLint StgSyn DmdAnal WorkWrap WwLib FamInst - Inst TcAnnotations TcArrows TcBinds TcClassDcl TcDefaults TcDeriv - TcEnv TcExpr TcForeign TcGenDeriv TcGenGenerics TcHsSyn TcHsType - TcInstDcls TcMType TcValidity TcMatches TcPat TcPatSyn TcRnDriver - TcRnMonad TcRnTypes TcRules TcSimplify TcErrors TcTyClsDecls - TcTyDecls TcType TcEvidence TcUnify TcInteract TcCanonical TcSMonad - TcTypeNats TcSplice Class Coercion FamInstEnv FunDeps InstEnv TyCon - CoAxiom Kind Type TypeRep Unify Bag Binary BooleanFormula BufWrite - Digraph Encoding FastBool FastFunctions FastMutInt FastString - FastTypes Fingerprint FiniteMap GraphBase GraphColor GraphOps - GraphPpr IOEnv ListSetOps Maybes MonadUtils OrdList Outputable Pair - Panic Pretty Serialized State Stream StringBuffer UniqFM UniqSet - Util ExtsCompat46 Vectorise.Builtins.Base - Vectorise.Builtins.Initialise Vectorise.Builtins - Vectorise.Monad.Base Vectorise.Monad.Naming Vectorise.Monad.Local - Vectorise.Monad.Global Vectorise.Monad.InstEnv Vectorise.Monad - Vectorise.Utils.Base Vectorise.Utils.Closure - Vectorise.Utils.Hoisting Vectorise.Utils.PADict - Vectorise.Utils.Poly Vectorise.Utils Vectorise.Generic.Description - Vectorise.Generic.PAMethods Vectorise.Generic.PADict - Vectorise.Generic.PData Vectorise.Type.Env Vectorise.Type.Type - Vectorise.Type.TyConDecl Vectorise.Type.Classify Vectorise.Convert - Vectorise.Vect Vectorise.Var Vectorise.Env Vectorise.Exp Vectorise - Hoopl.Dataflow Hoopl AsmCodeGen TargetReg NCGMonad Instruction Size - Reg RegClass PIC Platform CPrim X86.Regs X86.RegInfo X86.Instr - X86.Cond X86.Ppr X86.CodeGen PPC.Regs PPC.RegInfo PPC.Instr - PPC.Cond PPC.Ppr PPC.CodeGen SPARC.Base SPARC.Regs SPARC.Imm - SPARC.AddrMode SPARC.Cond SPARC.Instr SPARC.Stack - SPARC.ShortcutJump SPARC.Ppr SPARC.CodeGen SPARC.CodeGen.Amode - SPARC.CodeGen.Base SPARC.CodeGen.CondCode SPARC.CodeGen.Gen32 - SPARC.CodeGen.Gen64 SPARC.CodeGen.Sanity SPARC.CodeGen.Expand - RegAlloc.Liveness RegAlloc.Graph.Main RegAlloc.Graph.Stats - RegAlloc.Graph.ArchBase RegAlloc.Graph.ArchX86 - RegAlloc.Graph.Coalesce RegAlloc.Graph.Spill - RegAlloc.Graph.SpillClean RegAlloc.Graph.SpillCost - RegAlloc.Graph.TrivColorable RegAlloc.Linear.Main - RegAlloc.Linear.JoinToTargets RegAlloc.Linear.State - RegAlloc.Linear.Stats RegAlloc.Linear.FreeRegs - RegAlloc.Linear.StackMap RegAlloc.Linear.Base - RegAlloc.Linear.X86.FreeRegs RegAlloc.Linear.X86_64.FreeRegs - RegAlloc.Linear.PPC.FreeRegs RegAlloc.Linear.SPARC.FreeRegs DsMeta - Convert ByteCodeAsm ByteCodeGen ByteCodeInstr ByteCodeItbls - ByteCodeLink Debugger LibFFI Linker ObjLink RtClosureInspect - DebuggerUtils -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-7.8.4 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-7.8.4 -hs-libraries: HSghc-7.8.4 -extra-libraries: -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-7.8.4/include -includes: -depends: Cabal-1.18.1.5-6478013104bde01737bfd67d34bbee0a - array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - bin-package-db-0.0.0.0-0f3da03684207f2dc4dce793df1db62e - bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 - containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 - directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 - filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab - hoopl-3.10.0.1-267659e4b5b51c3d2e02f2a6d6f46936 - hpc-0.6.0.1-cca17f12dab542e09c423a74a4590c5d - process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 - template-haskell-2.9.0.0-6d27c2b362b15abb1822f2f34b9ae7f9 - time-1.4.2-9b3076800c33f8382c38628f35717951 - transformers-0.3.0.0-6458c21515cab7c1cf21e53141557a1c - unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-7.8.4/ghc.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-7.8.4 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: haskeline -version: 0.7.1.2 -id: haskeline-0.7.1.2-2dd2f2fb537352f5367ae77fe47ab211 -license: BSD3 -copyright: (c) Judah Jacobson -maintainer: Judah Jacobson <judah.jacobson@gmail.com> -stability: Experimental -homepage: http://trac.haskell.org/haskeline -package-url: -synopsis: A command-line interface for user input, written in Haskell. -description: Haskeline provides a user interface for line input in command-line - programs. This library is similar in purpose to readline, but since - it is written in Haskell it is (hopefully) more easily used in other - Haskell programs. - . - Haskeline runs both on POSIX-compatible systems and on Windows. -category: User Interfaces -author: Judah Jacobson -exposed: True -exposed-modules: System.Console.Haskeline - System.Console.Haskeline.Completion - System.Console.Haskeline.MonadException - System.Console.Haskeline.History System.Console.Haskeline.IO -hidden-modules: System.Console.Haskeline.Backend - System.Console.Haskeline.Backend.WCWidth - System.Console.Haskeline.Command - System.Console.Haskeline.Command.Completion - System.Console.Haskeline.Command.History - System.Console.Haskeline.Command.KillRing - System.Console.Haskeline.Directory System.Console.Haskeline.Emacs - System.Console.Haskeline.InputT System.Console.Haskeline.Key - System.Console.Haskeline.LineState System.Console.Haskeline.Monads - System.Console.Haskeline.Prefs System.Console.Haskeline.RunCommand - System.Console.Haskeline.Term System.Console.Haskeline.Command.Undo - System.Console.Haskeline.Vi System.Console.Haskeline.Recover - System.Console.Haskeline.Backend.Posix - System.Console.Haskeline.Backend.Posix.Encoder - System.Console.Haskeline.Backend.DumbTerm - System.Console.Haskeline.Backend.Terminfo -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskeline-0.7.1.2 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskeline-0.7.1.2 -hs-libraries: HShaskeline-0.7.1.2 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 - containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 - directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 - filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab - terminfo-0.4.0.0-c1d02a7210b0d1bc250d87463b38b8d1 - transformers-0.3.0.0-6458c21515cab7c1cf21e53141557a1c - unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskeline-0.7.1.2/haskeline.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskeline-0.7.1.2 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: terminfo -version: 0.4.0.0 -id: terminfo-0.4.0.0-c1d02a7210b0d1bc250d87463b38b8d1 -license: BSD3 -copyright: (c) Judah Jacobson -maintainer: Judah Jacobson <judah.jacobson@gmail.com> -stability: Stable -homepage: https://github.com/judah/terminfo -package-url: -synopsis: Haskell bindings to the terminfo library. -description: This library provides an interface to the terminfo database (via bindings to the - curses library). <http://en.wikipedia.org/wiki/Terminfo Terminfo> allows POSIX - systems to interact with a variety of terminals using a standard set of capabilities. -category: User Interfaces -author: Judah Jacobson -exposed: True -exposed-modules: System.Console.Terminfo - System.Console.Terminfo.Base System.Console.Terminfo.Cursor - System.Console.Terminfo.Color System.Console.Terminfo.Edit - System.Console.Terminfo.Effects System.Console.Terminfo.Keys -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/terminfo-0.4.0.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/terminfo-0.4.0.0 -hs-libraries: HSterminfo-0.4.0.0 -extra-libraries: tinfo -extra-ghci-libraries: -include-dirs: -includes: ncurses.h term.h -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/terminfo-0.4.0.0/terminfo.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/terminfo-0.4.0.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: xhtml -version: 3000.2.1 -id: xhtml-3000.2.1-6a3ed472b07e58fe29db22a5bc2bdb06 -license: BSD3 -copyright: Bjorn Bringert 2004-2006, Andy Gill and the Oregon - Graduate Institute of Science and Technology, 1999-2001 -maintainer: Chris Dornan <chris@chrisdornan.com> -stability: Stable -homepage: https://github.com/haskell/xhtml -package-url: -synopsis: An XHTML combinator library -description: This package provides combinators for producing - XHTML 1.0, including the Strict, Transitional and - Frameset variants. -category: Web, XML, Pretty Printer -author: Bjorn Bringert -exposed: True -exposed-modules: Text.XHtml Text.XHtml.Frameset Text.XHtml.Strict - Text.XHtml.Transitional Text.XHtml.Debug Text.XHtml.Table -hidden-modules: Text.XHtml.Strict.Attributes - Text.XHtml.Strict.Elements Text.XHtml.Frameset.Attributes - Text.XHtml.Frameset.Elements Text.XHtml.Transitional.Attributes - Text.XHtml.Transitional.Elements Text.XHtml.BlockTable - Text.XHtml.Extras Text.XHtml.Internals -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/xhtml-3000.2.1 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/xhtml-3000.2.1 -hs-libraries: HSxhtml-3000.2.1 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/xhtml-3000.2.1/xhtml.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/xhtml-3000.2.1 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: transformers -version: 0.3.0.0 -id: transformers-0.3.0.0-6458c21515cab7c1cf21e53141557a1c -license: BSD3 -copyright: -maintainer: Ross Paterson <ross@soi.city.ac.uk> -stability: -homepage: -package-url: -synopsis: Concrete functor and monad transformers -description: A portable library of functor and monad transformers, inspired by - the paper \"Functional Programming with Overloading and Higher-Order - Polymorphism\", by Mark P Jones, - in /Advanced School of Functional Programming/, 1995 - (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>). - . - This package contains: - . - * the monad transformer class (in "Control.Monad.Trans.Class") - . - * concrete functor and monad transformers, each with associated - operations and functions to lift operations associated with other - transformers. - . - It can be used on its own in portable Haskell code, or with the monad - classes in the @mtl@ or @monads-tf@ packages, which automatically - lift operations introduced by monad transformers through other - transformers. -category: Control -author: Andy Gill, Ross Paterson -exposed: True -exposed-modules: Control.Applicative.Backwards - Control.Applicative.Lift Control.Monad.IO.Class - Control.Monad.Trans.Class Control.Monad.Trans.Cont - Control.Monad.Trans.Error Control.Monad.Trans.Identity - Control.Monad.Trans.List Control.Monad.Trans.Maybe - Control.Monad.Trans.Reader Control.Monad.Trans.RWS - Control.Monad.Trans.RWS.Lazy Control.Monad.Trans.RWS.Strict - Control.Monad.Trans.State Control.Monad.Trans.State.Lazy - Control.Monad.Trans.State.Strict Control.Monad.Trans.Writer - Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict - Data.Functor.Compose Data.Functor.Constant Data.Functor.Identity - Data.Functor.Product Data.Functor.Reverse -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/transformers-0.3.0.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/transformers-0.3.0.0 -hs-libraries: HStransformers-0.3.0.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/transformers-0.3.0.0/transformers.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/transformers-0.3.0.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: hoopl -version: 3.10.0.1 -id: hoopl-3.10.0.1-267659e4b5b51c3d2e02f2a6d6f46936 -license: BSD3 -copyright: -maintainer: nr@cs.tufts.edu -stability: -homepage: http://ghc.cs.tufts.edu/hoopl/ -package-url: -synopsis: A library to support dataflow analysis and optimization -description: Higher-order optimization library - . - See /Norman Ramsey, Joao Dias, and Simon Peyton Jones./ - <http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"> /(2010)/ for more details. -category: Compilers/Interpreters -author: Norman Ramsey, Joao Dias, Simon Marlow and Simon Peyton Jones -exposed: True -exposed-modules: Compiler.Hoopl Compiler.Hoopl.Internals - Compiler.Hoopl.Wrappers Compiler.Hoopl.Passes.Dominator - Compiler.Hoopl.Passes.DList -hidden-modules: Compiler.Hoopl.Checkpoint - Compiler.Hoopl.Collections Compiler.Hoopl.Combinators - Compiler.Hoopl.Dataflow Compiler.Hoopl.Debug Compiler.Hoopl.Block - Compiler.Hoopl.Graph Compiler.Hoopl.Label Compiler.Hoopl.MkGraph - Compiler.Hoopl.Fuel Compiler.Hoopl.Pointed Compiler.Hoopl.Shape - Compiler.Hoopl.Show Compiler.Hoopl.Unique Compiler.Hoopl.XUtil -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hoopl-3.10.0.1 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hoopl-3.10.0.1 -hs-libraries: HShoopl-3.10.0.1 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hoopl-3.10.0.1/hoopl.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hoopl-3.10.0.1 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: bin-package-db -version: 0.0.0.0 -id: bin-package-db-0.0.0.0-0f3da03684207f2dc4dce793df1db62e -license: BSD3 -copyright: -maintainer: ghc-devs@haskell.org -stability: -homepage: -package-url: -synopsis: A binary format for the package database -description: -category: -author: -exposed: True -exposed-modules: Distribution.InstalledPackageInfo.Binary -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bin-package-db-0.0.0.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bin-package-db-0.0.0.0 -hs-libraries: HSbin-package-db-0.0.0.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: Cabal-1.18.1.5-6478013104bde01737bfd67d34bbee0a - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - binary-0.7.1.0-f867dbbb69966feb9f5c4ef7695a70a5 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0/bin-package-db.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: binary -version: 0.7.1.0 -id: binary-0.7.1.0-f867dbbb69966feb9f5c4ef7695a70a5 -license: BSD3 -copyright: -maintainer: Lennart Kolmodin, Don Stewart <dons00@gmail.com> -stability: provisional -homepage: https://github.com/kolmodin/binary -package-url: -synopsis: Binary serialisation for Haskell values using lazy ByteStrings -description: Efficient, pure binary serialisation using lazy ByteStrings. - Haskell values may be encoded to and from binary formats, - written to disk as binary, or sent over the network. - The format used can be automatically generated, or - you can choose to implement a custom format if needed. - Serialisation speeds of over 1 G\/sec have been observed, - so this library should be suitable for high performance - scenarios. -category: Data, Parsing -author: Lennart Kolmodin <kolmodin@gmail.com> -exposed: True -exposed-modules: Data.Binary Data.Binary.Put Data.Binary.Get - Data.Binary.Get.Internal Data.Binary.Builder - Data.Binary.Builder.Internal -hidden-modules: Data.Binary.Builder.Base Data.Binary.Class - Data.Binary.Generic -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/binary-0.7.1.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/binary-0.7.1.0 -hs-libraries: HSbinary-0.7.1.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 - containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/binary-0.7.1.0/binary.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/binary-0.7.1.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: Cabal -version: 1.18.1.5 -id: Cabal-1.18.1.5-6478013104bde01737bfd67d34bbee0a -license: BSD3 -copyright: 2003-2006, Isaac Jones - 2005-2011, Duncan Coutts -maintainer: cabal-devel@haskell.org -stability: -homepage: http://www.haskell.org/cabal/ -package-url: -synopsis: A framework for packaging Haskell software -description: The Haskell Common Architecture for Building Applications and - Libraries: a framework defining a common interface for authors to more - easily build their Haskell applications in a portable way. - . - The Haskell Cabal is part of a larger infrastructure for distributing, - organizing, and cataloging Haskell libraries and tools. -category: Distribution -author: Isaac Jones <ijones@syntaxpolice.org> - Duncan Coutts <duncan@community.haskell.org> -exposed: True -exposed-modules: Distribution.Compat.Environment - Distribution.Compat.Exception Distribution.Compat.ReadP - Distribution.Compiler Distribution.InstalledPackageInfo - Distribution.License Distribution.Make Distribution.ModuleName - Distribution.Package Distribution.PackageDescription - Distribution.PackageDescription.Check - Distribution.PackageDescription.Configuration - Distribution.PackageDescription.Parse - Distribution.PackageDescription.PrettyPrint - Distribution.PackageDescription.Utils Distribution.ParseUtils - Distribution.ReadE Distribution.Simple Distribution.Simple.Bench - Distribution.Simple.Build Distribution.Simple.Build.Macros - Distribution.Simple.Build.PathsModule - Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget - Distribution.Simple.CCompiler Distribution.Simple.Command - Distribution.Simple.Compiler Distribution.Simple.Configure - Distribution.Simple.GHC Distribution.Simple.Haddock - Distribution.Simple.Hpc Distribution.Simple.Hugs - Distribution.Simple.Install Distribution.Simple.InstallDirs - Distribution.Simple.JHC Distribution.Simple.LHC - Distribution.Simple.LocalBuildInfo Distribution.Simple.NHC - Distribution.Simple.PackageIndex Distribution.Simple.PreProcess - Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program - Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin - Distribution.Simple.Program.Db Distribution.Simple.Program.Find - Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg - Distribution.Simple.Program.Hpc Distribution.Simple.Program.Ld - Distribution.Simple.Program.Run Distribution.Simple.Program.Script - Distribution.Simple.Program.Types Distribution.Simple.Register - Distribution.Simple.Setup Distribution.Simple.SrcDist - Distribution.Simple.Test Distribution.Simple.UHC - Distribution.Simple.UserHooks Distribution.Simple.Utils - Distribution.System Distribution.TestSuite Distribution.Text - Distribution.Verbosity Distribution.Version - Language.Haskell.Extension -hidden-modules: Distribution.Compat.CopyFile - Distribution.Compat.TempFile Distribution.GetOpt - Distribution.Simple.GHC.IPI641 Distribution.Simple.GHC.IPI642 - Paths_Cabal -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/Cabal-1.18.1.5 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/Cabal-1.18.1.5 -hs-libraries: HSCabal-1.18.1.5 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 - containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 - deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 - directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 - filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab - pretty-1.1.1.1-0984f47ffe93ef3983c80b96280f1c3a - process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 - time-1.4.2-9b3076800c33f8382c38628f35717951 - unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/Cabal-1.18.1.5/Cabal.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/Cabal-1.18.1.5 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: template-haskell -version: 2.9.0.0 -id: template-haskell-2.9.0.0-6d27c2b362b15abb1822f2f34b9ae7f9 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Support library for Template Haskell -description: This package provides modules containing facilities for manipulating - Haskell source code using Template Haskell. - . - See <http://www.haskell.org/haskellwiki/Template_Haskell> for more - information. -category: Template Haskell -author: -exposed: True -exposed-modules: Language.Haskell.TH Language.Haskell.TH.Lib - Language.Haskell.TH.Ppr Language.Haskell.TH.PprLib - Language.Haskell.TH.Quote Language.Haskell.TH.Syntax -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/template-haskell-2.9.0.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/template-haskell-2.9.0.0 -hs-libraries: HStemplate-haskell-2.9.0.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 - pretty-1.1.1.1-0984f47ffe93ef3983c80b96280f1c3a -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/template-haskell-2.9.0.0/template-haskell.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/template-haskell-2.9.0.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: pretty -version: 1.1.1.1 -id: pretty-1.1.1.1-0984f47ffe93ef3983c80b96280f1c3a -license: BSD3 -copyright: -maintainer: David Terei <code@davidterei.com> -stability: Stable -homepage: http://github.com/haskell/pretty -package-url: -synopsis: Pretty-printing library -description: This package contains a pretty-printing library, a set of API's - that provides a way to easily print out text in a consistent - format of your choosing. This is useful for compilers and related - tools. - . - This library was originally designed by John Hughes's and has since - been heavily modified by Simon Peyton Jones. -category: Text -author: -exposed: True -exposed-modules: Text.PrettyPrint Text.PrettyPrint.HughesPJ -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/pretty-1.1.1.1 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/pretty-1.1.1.1 -hs-libraries: HSpretty-1.1.1.1 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/pretty-1.1.1.1/pretty.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/pretty-1.1.1.1 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: hpc -version: 0.6.0.1 -id: hpc-0.6.0.1-cca17f12dab542e09c423a74a4590c5d -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Code Coverage Library for Haskell -description: This package provides the code coverage library for Haskell. - . - See <http://www.haskell.org/haskellwiki/Haskell_program_coverage> for more - information. -category: Control -author: Andy Gill -exposed: True -exposed-modules: Trace.Hpc.Util Trace.Hpc.Mix Trace.Hpc.Tix - Trace.Hpc.Reflect -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hpc-0.6.0.1 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hpc-0.6.0.1 -hs-libraries: HShpc-0.6.0.1 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 - directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 - time-1.4.2-9b3076800c33f8382c38628f35717951 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hpc-0.6.0.1/hpc.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hpc-0.6.0.1 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: process -version: 1.2.0.0 -id: process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Process libraries -description: This package contains libraries for dealing with system processes. -category: System -author: -exposed: True -exposed-modules: System.Cmd System.Process System.Process.Internals -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/process-1.2.0.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/process-1.2.0.0 -hs-libraries: HSprocess-1.2.0.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/process-1.2.0.0/include -includes: runProcess.h -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 - directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 - filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab - unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/process-1.2.0.0/process.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/process-1.2.0.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: directory -version: 1.2.1.0 -id: directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: library for directory handling -description: This package provides a library for handling directories. -category: System -author: -exposed: True -exposed-modules: System.Directory -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/directory-1.2.1.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/directory-1.2.1.0 -hs-libraries: HSdirectory-1.2.1.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/directory-1.2.1.0/include -includes: HsDirectory.h -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab - time-1.4.2-9b3076800c33f8382c38628f35717951 - unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/directory-1.2.1.0/directory.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/directory-1.2.1.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: unix -version: 2.7.0.1 -id: unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: POSIX functionality -description: This package gives you access to the set of operating system - services standardised by POSIX 1003.1b (or the IEEE Portable - Operating System Interface for Computing Environments - - IEEE Std. 1003.1). - . - The package is not supported under Windows (except under Cygwin). -category: System -author: -exposed: True -exposed-modules: System.Posix System.Posix.ByteString - System.Posix.Error System.Posix.Resource System.Posix.Time - System.Posix.Unistd System.Posix.User System.Posix.Signals - System.Posix.Signals.Exts System.Posix.Semaphore - System.Posix.SharedMem System.Posix.ByteString.FilePath - System.Posix.Directory System.Posix.Directory.ByteString - System.Posix.DynamicLinker.Module - System.Posix.DynamicLinker.Module.ByteString - System.Posix.DynamicLinker.Prim - System.Posix.DynamicLinker.ByteString System.Posix.DynamicLinker - System.Posix.Files System.Posix.Files.ByteString System.Posix.IO - System.Posix.IO.ByteString System.Posix.Env - System.Posix.Env.ByteString System.Posix.Process - System.Posix.Process.Internals System.Posix.Process.ByteString - System.Posix.Temp System.Posix.Temp.ByteString - System.Posix.Terminal System.Posix.Terminal.ByteString -hidden-modules: System.Posix.Directory.Common - System.Posix.DynamicLinker.Common System.Posix.Files.Common - System.Posix.IO.Common System.Posix.Process.Common - System.Posix.Terminal.Common -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/unix-2.7.0.1 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/unix-2.7.0.1 -hs-libraries: HSunix-2.7.0.1 -extra-libraries: rt util dl pthread -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/unix-2.7.0.1/include -includes: HsUnix.h execvpe.h -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 - time-1.4.2-9b3076800c33f8382c38628f35717951 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/unix-2.7.0.1/unix.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/unix-2.7.0.1 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: time -version: 1.4.2 -id: time-1.4.2-9b3076800c33f8382c38628f35717951 -license: BSD3 -copyright: -maintainer: <ashley@semantic.org> -stability: stable -homepage: http://semantic.org/TimeLib/ -package-url: -synopsis: A time library -description: A time library -category: System -author: Ashley Yakeley -exposed: True -exposed-modules: Data.Time.Calendar Data.Time.Calendar.MonthDay - Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate - Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Clock - Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime - Data.Time.Format Data.Time -hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days - Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay - Data.Time.Clock.Scale Data.Time.Clock.UTC Data.Time.Clock.CTimeval - Data.Time.Clock.UTCDiff Data.Time.LocalTime.TimeZone - Data.Time.LocalTime.TimeOfDay Data.Time.LocalTime.LocalTime - Data.Time.Format.Parse -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/time-1.4.2 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/time-1.4.2 -hs-libraries: HStime-1.4.2 -extra-libraries: -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/time-1.4.2/include -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 - old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/time-1.4.2/time.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/time-1.4.2 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: old-locale -version: 1.0.0.6 -id: old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: locale library -description: This package provides the ability to adapt to - locale conventions such as date and time formats. -category: System -author: -exposed: True -exposed-modules: System.Locale -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-locale-1.0.0.6 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-locale-1.0.0.6 -hs-libraries: HSold-locale-1.0.0.6 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-locale-1.0.0.6/old-locale.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-locale-1.0.0.6 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: containers -version: 0.5.5.1 -id: containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 -license: BSD3 -copyright: -maintainer: fox@ucw.cz -stability: -homepage: -package-url: -synopsis: Assorted concrete container types -description: This package contains efficient general-purpose implementations - of various basic immutable container types. The declared cost of - each operation is either worst-case or amortized, but remains - valid even if structures are shared. -category: Data Structures -author: -exposed: True -exposed-modules: Data.IntMap Data.IntMap.Lazy Data.IntMap.Strict - Data.IntSet Data.Map Data.Map.Lazy Data.Map.Strict Data.Set - Data.Graph Data.Sequence Data.Tree -hidden-modules: Data.BitUtil Data.IntMap.Base Data.IntSet.Base - Data.Map.Base Data.Set.Base Data.StrictPair -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/containers-0.5.5.1 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/containers-0.5.5.1 -hs-libraries: HScontainers-0.5.5.1 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 - ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/containers-0.5.5.1/containers.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/containers-0.5.5.1 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: bytestring -version: 0.10.4.0 -id: bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 -license: BSD3 -copyright: Copyright (c) Don Stewart 2005-2009, - (c) Duncan Coutts 2006-2013, - (c) David Roundy 2003-2005, - (c) Jasper Van der Jeugt 2010, - (c) Simon Meier 2010-2013. -maintainer: Don Stewart <dons00@gmail.com>, - Duncan Coutts <duncan@community.haskell.org> -stability: -homepage: https://github.com/haskell/bytestring -package-url: -synopsis: Fast, compact, strict and lazy byte strings with a list interface -description: An efficient compact, immutable byte string type (both strict and lazy) - suitable for binary or 8-bit character data. - . - The 'ByteString' type represents sequences of bytes or 8-bit characters. - It is suitable for high performance use, both in terms of large data - quantities, or high speed requirements. The 'ByteString' functions follow - the same style as Haskell\'s ordinary lists, so it is easy to convert code - from using 'String' to 'ByteString'. - . - Two 'ByteString' variants are provided: - . - * Strict 'ByteString's keep the string as a single large array. This - makes them convenient for passing data between C and Haskell. - . - * Lazy 'ByteString's use a lazy list of strict chunks which makes it - suitable for I\/O streaming tasks. - . - The @Char8@ modules provide a character-based view of the same - underlying 'ByteString' types. This makes it convenient to handle mixed - binary and 8-bit character content (which is common in many file formats - and network protocols). - . - The 'Builder' module provides an efficient way to build up 'ByteString's - in an ad-hoc way by repeated concatenation. This is ideal for fast - serialisation or pretty printing. - . - There is also a 'ShortByteString' type which has a lower memory overhead - and can be converted to or from a 'ByteString', but supports very few - other operations. It is suitable for keeping many short strings in memory. - . - 'ByteString's are not designed for Unicode. For Unicode strings you should - use the 'Text' type from the @text@ package. - . - These modules are intended to be imported qualified, to avoid name clashes - with "Prelude" functions, e.g. - . - > import qualified Data.ByteString as BS -category: Data -author: Don Stewart, - Duncan Coutts -exposed: True -exposed-modules: Data.ByteString Data.ByteString.Char8 - Data.ByteString.Unsafe Data.ByteString.Internal - Data.ByteString.Lazy Data.ByteString.Lazy.Char8 - Data.ByteString.Lazy.Internal Data.ByteString.Short - Data.ByteString.Short.Internal Data.ByteString.Builder - Data.ByteString.Builder.Extra Data.ByteString.Builder.Prim - Data.ByteString.Builder.Internal - Data.ByteString.Builder.Prim.Internal Data.ByteString.Lazy.Builder - Data.ByteString.Lazy.Builder.Extras - Data.ByteString.Lazy.Builder.ASCII -hidden-modules: Data.ByteString.Builder.ASCII - Data.ByteString.Builder.Prim.Binary - Data.ByteString.Builder.Prim.ASCII - Data.ByteString.Builder.Prim.Internal.Floating - Data.ByteString.Builder.Prim.Internal.UncheckedShifts - Data.ByteString.Builder.Prim.Internal.Base16 -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bytestring-0.10.4.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bytestring-0.10.4.0 -hs-libraries: HSbytestring-0.10.4.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bytestring-0.10.4.0/include -includes: fpstring.h -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 - deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 - ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 - integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bytestring-0.10.4.0/bytestring.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bytestring-0.10.4.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: deepseq -version: 1.3.0.2 -id: deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Deep evaluation of data structures -description: This package provides methods for fully evaluating data structures - (\"deep evaluation\"). Deep evaluation is often used for adding - strictness to a program, e.g. in order to force pending exceptions, - remove space leaks, or force lazy I/O to happen. It is also useful - in parallel programs, to ensure pending work does not migrate to the - wrong thread. - . - The primary use of this package is via the 'deepseq' function, a - \"deep\" version of 'seq'. It is implemented on top of an 'NFData' - typeclass (\"Normal Form Data\", data structures with no unevaluated - components) which defines strategies for fully evaluating different - data types. - . - If you want to automatically derive 'NFData' instances via the - "GHC.Generics" facility, there is a companion package - <http://hackage.haskell.org/package/deepseq-generics deepseq-generics> - which builds on top of this package. -category: Control -author: -exposed: True -exposed-modules: Control.DeepSeq -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/deepseq-1.3.0.2 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/deepseq-1.3.0.2 -hs-libraries: HSdeepseq-1.3.0.2 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b - base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/deepseq-1.3.0.2/deepseq.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/deepseq-1.3.0.2 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: array -version: 0.5.0.0 -id: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Mutable and immutable arrays -description: In addition to providing the "Data.Array" module - <http://www.haskell.org/onlinereport/haskell2010/haskellch14.html as specified in the Haskell 2010 Language Report>, - this package also defines the classes 'IArray' of - immutable arrays and 'MArray' of arrays mutable within appropriate - monads, as well as some instances of these classes. -category: Data Structures -author: -exposed: True -exposed-modules: Data.Array Data.Array.Base Data.Array.IArray - Data.Array.IO Data.Array.IO.Safe Data.Array.IO.Internals - Data.Array.MArray Data.Array.MArray.Safe Data.Array.ST - Data.Array.ST.Safe Data.Array.Storable Data.Array.Storable.Safe - Data.Array.Storable.Internals Data.Array.Unboxed Data.Array.Unsafe -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/array-0.5.0.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/array-0.5.0.0 -hs-libraries: HSarray-0.5.0.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/array-0.5.0.0/array.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/array-0.5.0.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: filepath -version: 1.3.0.2 -id: filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: http://www-users.cs.york.ac.uk/~ndm/filepath/ -package-url: -synopsis: Library for manipulating FilePaths in a cross platform way. -description: A library for 'FilePath' manipulations, using Posix or Windows filepaths - depending on the platform. - . - Both "System.FilePath.Posix" and "System.FilePath.Windows" provide - the same interface. See either for examples and a list of the - available functions. -category: System -author: Neil Mitchell -exposed: True -exposed-modules: System.FilePath System.FilePath.Posix - System.FilePath.Windows -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/filepath-1.3.0.2 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/filepath-1.3.0.2 -hs-libraries: HSfilepath-1.3.0.2 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/filepath-1.3.0.2/filepath.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/filepath-1.3.0.2 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: base -version: 4.7.0.2 -id: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Basic libraries -description: This package contains the "Prelude" and its support libraries, - and a large collection of useful libraries ranging from data - structures to parsing combinators and debugging utilities. -category: Prelude -author: -exposed: True -exposed-modules: Control.Applicative Control.Arrow Control.Category - Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar - Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception - Control.Exception.Base Control.Monad Control.Monad.Fix - Control.Monad.Instances Control.Monad.ST Control.Monad.ST.Lazy - Control.Monad.ST.Lazy.Safe Control.Monad.ST.Lazy.Unsafe - Control.Monad.ST.Safe Control.Monad.ST.Strict - Control.Monad.ST.Unsafe Control.Monad.Zip Data.Bits Data.Bool - Data.Char Data.Coerce Data.Complex Data.Data Data.Dynamic - Data.Either Data.Eq Data.Fixed Data.Foldable Data.Function - Data.Functor Data.IORef Data.Int Data.Ix Data.List Data.Maybe - Data.Monoid Data.OldTypeable Data.OldTypeable.Internal Data.Ord - Data.Proxy Data.Ratio Data.STRef Data.STRef.Lazy Data.STRef.Strict - Data.String Data.Traversable Data.Tuple Data.Type.Bool - Data.Type.Coercion Data.Type.Equality Data.Typeable - Data.Typeable.Internal Data.Unique Data.Version Data.Word - Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String - Foreign.C.Types Foreign.Concurrent Foreign.ForeignPtr - Foreign.ForeignPtr.Safe Foreign.ForeignPtr.Unsafe Foreign.Marshal - Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error - Foreign.Marshal.Pool Foreign.Marshal.Safe Foreign.Marshal.Unsafe - Foreign.Marshal.Utils Foreign.Ptr Foreign.Safe Foreign.StablePtr - Foreign.Storable GHC.Arr GHC.Base GHC.Char GHC.Conc GHC.Conc.IO - GHC.Conc.Signal GHC.Conc.Sync GHC.ConsoleHandler GHC.Constants - GHC.Desugar GHC.Enum GHC.Environment GHC.Err GHC.Exception GHC.Exts - GHC.Fingerprint GHC.Fingerprint.Type GHC.Float - GHC.Float.ConversionUtils GHC.Float.RealFracMethods GHC.Foreign - GHC.ForeignPtr GHC.GHCi GHC.Generics GHC.IO GHC.IO.Buffer - GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding - GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure - GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types - GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 - GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD - GHC.IO.Handle.Internals GHC.IO.Handle.Text GHC.IO.Handle.Types - GHC.IO.IOMode GHC.IOArray GHC.IORef GHC.IP GHC.Int GHC.List - GHC.MVar GHC.Num GHC.PArr GHC.Pack GHC.Profiling GHC.Ptr GHC.Read - GHC.Real GHC.ST GHC.STRef GHC.Show GHC.Stable GHC.Stack GHC.Stats - GHC.Storable GHC.TopHandler GHC.TypeLits GHC.Unicode GHC.Weak - GHC.Word Numeric Prelude System.CPUTime System.Console.GetOpt - System.Environment System.Exit System.IO System.IO.Error - System.IO.Unsafe System.Info System.Mem System.Mem.StableName - System.Mem.Weak System.Posix.Internals System.Posix.Types - System.Timeout Text.ParserCombinators.ReadP - Text.ParserCombinators.ReadPrec Text.Printf Text.Read Text.Read.Lex - Text.Show Text.Show.Functions Unsafe.Coerce GHC.Event -hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp - Foreign.ForeignPtr.Imp System.Environment.ExecutablePath - GHC.Event.Arr GHC.Event.Array GHC.Event.Clock GHC.Event.Control - GHC.Event.EPoll GHC.Event.IntTable GHC.Event.Internal - GHC.Event.KQueue GHC.Event.Manager GHC.Event.PSQ GHC.Event.Poll - GHC.Event.Thread GHC.Event.TimerManager GHC.Event.Unique -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/base-4.7.0.2 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/base-4.7.0.2 -hs-libraries: HSbase-4.7.0.2 -extra-libraries: -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/base-4.7.0.2/include -includes: HsBase.h -depends: ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 - integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 builtin_rts -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/base-4.7.0.2/base.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/base-4.7.0.2 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: integer-gmp -version: 0.5.1.0 -id: integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: Integer library based on GMP -description: This package provides the low-level implementation of the standard - 'Integer' type based on the - <http://gmplib.org/ GNU Multiple Precision Arithmetic Library (GMP)>. - . - This package provides access to the internal representation of - 'Integer' as well as primitive operations with no proper error - handling, and should only be used directly with the utmost care. - . - For more details about the design of @integer-gmp@, see - <https://ghc.haskell.org/trac/ghc/wiki/Commentary/Libraries/Integer GHC Commentary: Libraries/Integer>. -category: Numerical -author: -exposed: True -exposed-modules: GHC.Integer GHC.Integer.GMP.Internals - GHC.Integer.GMP.Prim GHC.Integer.Logarithms - GHC.Integer.Logarithms.Internals -hidden-modules: GHC.Integer.Type -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/integer-gmp-0.5.1.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/integer-gmp-0.5.1.0 -hs-libraries: HSinteger-gmp-0.5.1.0 -extra-libraries: gmp -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/integer-gmp-0.5.1.0/include -includes: -depends: ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/integer-gmp-0.5.1.0/integer-gmp.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/integer-gmp-0.5.1.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: ghc-prim -version: 0.3.1.0 -id: ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 -license: BSD3 -copyright: -maintainer: libraries@haskell.org -stability: -homepage: -package-url: -synopsis: GHC primitives -description: GHC primitives. -category: GHC -author: -exposed: True -exposed-modules: GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 - GHC.Magic GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim -hidden-modules: -trusted: False -import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-prim-0.3.1.0 -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-prim-0.3.1.0 -hs-libraries: HSghc-prim-0.3.1.0 -extra-libraries: -extra-ghci-libraries: -include-dirs: -includes: -depends: builtin_rts -hugs-options: -cc-options: -ld-options: -framework-dirs: -frameworks: -haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-prim-0.3.1.0/ghc-prim.haddock -haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-prim-0.3.1.0 -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" ---- -name: rts -version: 1.0 -id: builtin_rts -license: BSD3 -copyright: -maintainer: glasgow-haskell-users@haskell.org -stability: -homepage: -package-url: -synopsis: -description: -category: -author: -exposed: True -exposed-modules: -hidden-modules: -trusted: False -import-dirs: -library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/rts-1.0 -hs-libraries: HSrts Cffi -extra-libraries: m rt dl -extra-ghci-libraries: -include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/include -includes: Stg.h -depends: -hugs-options: -cc-options: -ld-options: "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info" - "-Wl,-u,base_GHCziPtr_Ptr_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info" - "-Wl,-u,base_GHCziInt_I8zh_static_info" - "-Wl,-u,base_GHCziInt_I16zh_static_info" - "-Wl,-u,base_GHCziInt_I32zh_static_info" - "-Wl,-u,base_GHCziInt_I64zh_static_info" - "-Wl,-u,base_GHCziWord_W8zh_static_info" - "-Wl,-u,base_GHCziWord_W16zh_static_info" - "-Wl,-u,base_GHCziWord_W32zh_static_info" - "-Wl,-u,base_GHCziWord_W64zh_static_info" - "-Wl,-u,base_GHCziStable_StablePtr_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" - "-Wl,-u,base_GHCziPtr_Ptr_con_info" - "-Wl,-u,base_GHCziPtr_FunPtr_con_info" - "-Wl,-u,base_GHCziStable_StablePtr_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_False_closure" - "-Wl,-u,ghczmprim_GHCziTypes_True_closure" - "-Wl,-u,base_GHCziPack_unpackCString_closure" - "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" - "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" - "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" - "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" - "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" - "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" - "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" - "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" - "-Wl,-u,base_GHCziTopHandler_runIO_closure" - "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" - "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" - "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" - "-Wl,-u,base_GHCziConcziSync_runSparks_closure" - "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure" -framework-dirs: -frameworks: -haddock-interfaces: -haddock-html: -pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" -
@@ -1,1146 +0,0 @@-name: ghc-boot -version: 0.0.0.0 -id: ghc-boot-0.0.0.0 -key: ghc-boot-0.0.0.0 -license: BSD3 -maintainer: ghc-devs@haskell.org -synopsis: Shared functionality between GHC and its boot libraries -description: - This library is shared between GHC, ghc-pkg, and other boot - libraries. - . - A note about "GHC.PackageDb": it only deals with the subset of - the package database that the compiler cares about: modules - paths etc and not package metadata like description, authors - etc. It is thus not a library interface to ghc-pkg and is *not* - suitable for modifying GHC package databases. - . - The package database format and this library are constructed in - such a way that while ghc-pkg depends on Cabal, the GHC library - and program do not have to depend on Cabal. -exposed: True -exposed-modules: - GHC.Lexeme GHC.PackageDb -abi: 7a24014b606b3e9dd8b7b8aa4cf35acc -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-boot-0.0.0.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-boot-0.0.0.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/ghc-boot-0.0.0.0 -hs-libraries: HSghc-boot-0.0.0.0 -depends: - base-4.9.0.0 binary-0.7.5.0 bytestring-0.10.7.0 directory-1.2.5.0 - filepath-1.4.1.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0/ghc-boot.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0 ---- -name: ghc -version: 7.11.20151213 -id: ghc-7.11.20151213 -key: ghc-7.11.20151213 -license: BSD3 -maintainer: glasgow-haskell-users@haskell.org -homepage: http://www.haskell.org/ghc/ -synopsis: The GHC API -description: - GHC's functionality can be useful for more things than just - compiling Haskell programs. Important use cases are programs - that analyse (and perhaps transform) Haskell code. Others - include loading Haskell code dynamically in a GHCi-like manner. - For this reason, a lot of GHC's functionality is made available - through this package. -category: Development -author: The GHC Team -exposed: False -exposed-modules: - Avail BasicTypes ConLike DataCon PatSyn Demand Debug Exception - FieldLabel GhcMonad Hooks Id IdInfo Lexeme Literal Llvm Llvm.AbsSyn - Llvm.MetaData Llvm.PpLlvm Llvm.Types LlvmCodeGen LlvmCodeGen.Base - LlvmCodeGen.CodeGen LlvmCodeGen.Data LlvmCodeGen.Ppr - LlvmCodeGen.Regs LlvmMangler MkId Module Name NameEnv NameSet - OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet - UnVarGraph BlockId CLabel Cmm CmmBuildInfoTables CmmPipeline - CmmCallConv CmmCommonBlockElim CmmImplementSwitchPlans - CmmContFlowOpt CmmExpr CmmInfo CmmLex CmmLint CmmLive CmmMachOp - CmmSwitch CmmNode CmmOpt CmmParse CmmProcPoint CmmSink CmmType - CmmUtils CmmLayoutStack MkGraph PprBase PprC PprCmm PprCmmDecl - PprCmmExpr Bitmap CodeGen.Platform CodeGen.Platform.ARM - CodeGen.Platform.ARM64 CodeGen.Platform.NoRegs CodeGen.Platform.PPC - CodeGen.Platform.PPC_Darwin CodeGen.Platform.SPARC - CodeGen.Platform.X86 CodeGen.Platform.X86_64 CgUtils StgCmm - StgCmmBind StgCmmClosure StgCmmCon StgCmmEnv StgCmmExpr - StgCmmForeign StgCmmHeap StgCmmHpc StgCmmArgRep StgCmmLayout - StgCmmMonad StgCmmPrim StgCmmProf StgCmmTicky StgCmmUtils - StgCmmExtCode SMRep CoreArity CoreFVs CoreLint CorePrep CoreSubst - CoreSyn TrieMap CoreTidy CoreUnfold CoreUtils CoreSeq CoreStats - MkCore PprCore PmExpr TmOracle Check Coverage Desugar DsArrows - DsBinds DsCCall DsExpr DsForeign DsGRHSs DsListComp DsMonad DsUtils - Match MatchCon MatchLit HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit - PlaceHolder HsPat HsSyn HsTypes HsUtils BinIface BuildTyCl IfaceEnv - IfaceSyn IfaceType LoadIface MkIface TcIface FlagChecker - Annotations BreakArray CmdLineParser CodeOutput Config Constants - DriverMkDepend DriverPhases PipelineMonad DriverPipeline DynFlags - ErrUtils Finder GHC GhcMake GhcPlugins DynamicLoading HeaderInfo - HscMain HscStats HscTypes InteractiveEval InteractiveEvalTypes - PackageConfig Packages PlatformConstants Plugins TcPluginM - PprTyThing StaticFlags StaticPtrTable SysTools Elf TidyPgm Ctype - HaddockUtils Lexer OptCoercion Parser RdrHsSyn ApiAnnotation - ForeignCall PrelInfo PrelNames PrelRules PrimOp TysPrim TysWiredIn - CostCentre ProfInit SCCfinal RnBinds RnEnv RnExpr RnHsDoc RnNames - RnPat RnSource RnSplice RnTypes CoreMonad CSE FloatIn FloatOut - LiberateCase OccurAnal SAT SetLevels SimplCore SimplEnv SimplMonad - SimplUtils Simplify SimplStg StgStats UnariseStg Rules SpecConstr - Specialise CoreToStg StgLint StgSyn CallArity DmdAnal WorkWrap - WwLib FamInst Inst TcAnnotations TcArrows TcBinds TcClassDcl - TcDefaults TcDeriv TcEnv TcExpr TcForeign TcGenDeriv TcGenGenerics - TcHsSyn TcHsType TcInstDcls TcMType TcValidity TcMatches TcPat - TcPatSyn TcRnDriver TcRnMonad TcRnTypes TcRules TcSimplify TcErrors - TcTyClsDecls TcTyDecls TcTypeable TcType TcEvidence TcUnify - TcInteract TcCanonical TcFlatten TcSMonad TcTypeNats TcSplice Class - Coercion DsMeta THNames FamInstEnv FunDeps InstEnv TyCon CoAxiom - Kind Type TyCoRep Unify Bag Binary BooleanFormula BufWrite Digraph - Encoding FastFunctions FastMutInt FastString FastStringEnv - Fingerprint FiniteMap FV GraphBase GraphColor GraphOps GraphPpr - IOEnv ListSetOps Maybes MonadUtils OrdList Outputable Pair Panic - Pretty Serialized State Stream StringBuffer UniqDFM UniqDSet UniqFM - UniqSet Util Vectorise.Builtins.Base Vectorise.Builtins.Initialise - Vectorise.Builtins Vectorise.Monad.Base Vectorise.Monad.Naming - Vectorise.Monad.Local Vectorise.Monad.Global - Vectorise.Monad.InstEnv Vectorise.Monad Vectorise.Utils.Base - Vectorise.Utils.Closure Vectorise.Utils.Hoisting - Vectorise.Utils.PADict Vectorise.Utils.Poly Vectorise.Utils - Vectorise.Generic.Description Vectorise.Generic.PAMethods - Vectorise.Generic.PADict Vectorise.Generic.PData Vectorise.Type.Env - Vectorise.Type.Type Vectorise.Type.TyConDecl - Vectorise.Type.Classify Vectorise.Convert Vectorise.Vect - Vectorise.Var Vectorise.Env Vectorise.Exp Vectorise Hoopl.Dataflow - Hoopl AsmCodeGen TargetReg NCGMonad Instruction Format Reg RegClass - PIC Platform CPrim X86.Regs X86.RegInfo X86.Instr X86.Cond X86.Ppr - X86.CodeGen PPC.Regs PPC.RegInfo PPC.Instr PPC.Cond PPC.Ppr - PPC.CodeGen SPARC.Base SPARC.Regs SPARC.Imm SPARC.AddrMode - SPARC.Cond SPARC.Instr SPARC.Stack SPARC.ShortcutJump SPARC.Ppr - SPARC.CodeGen SPARC.CodeGen.Amode SPARC.CodeGen.Base - SPARC.CodeGen.CondCode SPARC.CodeGen.Gen32 SPARC.CodeGen.Gen64 - SPARC.CodeGen.Sanity SPARC.CodeGen.Expand RegAlloc.Liveness - RegAlloc.Graph.Main RegAlloc.Graph.Stats RegAlloc.Graph.ArchBase - RegAlloc.Graph.ArchX86 RegAlloc.Graph.Coalesce RegAlloc.Graph.Spill - RegAlloc.Graph.SpillClean RegAlloc.Graph.SpillCost - RegAlloc.Graph.TrivColorable RegAlloc.Linear.Main - RegAlloc.Linear.JoinToTargets RegAlloc.Linear.State - RegAlloc.Linear.Stats RegAlloc.Linear.FreeRegs - RegAlloc.Linear.StackMap RegAlloc.Linear.Base - RegAlloc.Linear.X86.FreeRegs RegAlloc.Linear.X86_64.FreeRegs - RegAlloc.Linear.PPC.FreeRegs RegAlloc.Linear.SPARC.FreeRegs Dwarf - Dwarf.Types Dwarf.Constants Convert ByteCodeAsm ByteCodeGen - ByteCodeInstr ByteCodeItbls ByteCodeLink Debugger LibFFI Linker - ObjLink RtClosureInspect DebuggerUtils -abi: bc2e1cb7cdee2089e52f007db59a253c -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-7.11.20151213 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-7.11.20151213 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/ghc-7.11.20151213 -hs-libraries: HSghc-7.11.20151213 -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-7.11.20151213/include -depends: - array-0.5.1.0 base-4.9.0.0 binary-0.7.5.0 bytestring-0.10.7.0 - containers-0.5.6.3 directory-1.2.5.0 filepath-1.4.1.0 - ghc-boot-0.0.0.0 hoopl-3.10.2.0 hpc-0.6.0.2 process-1.4.1.0 - template-haskell-2.11.0.0 time-1.5.0.1 transformers-0.4.3.0 - unix-2.7.1.1 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-7.11.20151213/ghc.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-7.11.20151213 ---- -name: haskeline -version: 0.7.2.1 -id: haskeline-0.7.2.1 -key: haskeline-0.7.2.1 -license: BSD3 -copyright: (c) Judah Jacobson -maintainer: Judah Jacobson <judah.jacobson@gmail.com> -stability: Experimental -homepage: http://trac.haskell.org/haskeline -synopsis: A command-line interface for user input, written in Haskell. -description: - Haskeline provides a user interface for line input in command-line - programs. This library is similar in purpose to readline, but since - it is written in Haskell it is (hopefully) more easily used in other - Haskell programs. - . - Haskeline runs both on POSIX-compatible systems and on Windows. -category: User Interfaces -author: Judah Jacobson -exposed: True -exposed-modules: - System.Console.Haskeline System.Console.Haskeline.Completion - System.Console.Haskeline.MonadException - System.Console.Haskeline.History System.Console.Haskeline.IO -hidden-modules: System.Console.Haskeline.Backend - System.Console.Haskeline.Backend.WCWidth - System.Console.Haskeline.Command - System.Console.Haskeline.Command.Completion - System.Console.Haskeline.Command.History - System.Console.Haskeline.Command.KillRing - System.Console.Haskeline.Directory System.Console.Haskeline.Emacs - System.Console.Haskeline.InputT System.Console.Haskeline.Key - System.Console.Haskeline.LineState System.Console.Haskeline.Monads - System.Console.Haskeline.Prefs System.Console.Haskeline.RunCommand - System.Console.Haskeline.Term System.Console.Haskeline.Command.Undo - System.Console.Haskeline.Vi System.Console.Haskeline.Recover - System.Console.Haskeline.Backend.Posix - System.Console.Haskeline.Backend.Posix.Encoder - System.Console.Haskeline.Backend.DumbTerm - System.Console.Haskeline.Backend.Terminfo -abi: 1084385e878ca046b1ba1b0149406b60 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/haskeline-0.7.2.1 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/haskeline-0.7.2.1 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/haskeline-0.7.2.1 -hs-libraries: HShaskeline-0.7.2.1 -depends: - base-4.9.0.0 bytestring-0.10.7.0 containers-0.5.6.3 - directory-1.2.5.0 filepath-1.4.1.0 terminfo-0.4.0.1 - transformers-0.4.3.0 unix-2.7.1.1 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/haskeline-0.7.2.1/haskeline.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/haskeline-0.7.2.1 ---- -name: terminfo -version: 0.4.0.1 -id: terminfo-0.4.0.1 -key: terminfo-0.4.0.1 -license: BSD3 -copyright: (c) Judah Jacobson -maintainer: Judah Jacobson <judah.jacobson@gmail.com> -stability: Stable -homepage: https://github.com/judah/terminfo -synopsis: Haskell bindings to the terminfo library. -description: - This library provides an interface to the terminfo database (via bindings to the - curses library). <http://en.wikipedia.org/wiki/Terminfo Terminfo> allows POSIX - systems to interact with a variety of terminals using a standard set of capabilities. -category: User Interfaces -author: Judah Jacobson -exposed: True -exposed-modules: - System.Console.Terminfo System.Console.Terminfo.Base - System.Console.Terminfo.Cursor System.Console.Terminfo.Color - System.Console.Terminfo.Edit System.Console.Terminfo.Effects - System.Console.Terminfo.Keys -abi: d0bd235d4bbae7f2cbb36b97e6bcfba9 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/terminfo-0.4.0.1 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/terminfo-0.4.0.1 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/terminfo-0.4.0.1 -hs-libraries: HSterminfo-0.4.0.1 -extra-libraries: - tinfo -includes: - ncurses.h term.h -depends: - base-4.9.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/terminfo-0.4.0.1/terminfo.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/terminfo-0.4.0.1 ---- -name: xhtml -version: 3000.2.1 -id: xhtml-3000.2.1 -key: xhtml-3000.2.1 -license: BSD3 -copyright: Bjorn Bringert 2004-2006, Andy Gill and the Oregon - Graduate Institute of Science and Technology, 1999-2001 -maintainer: Chris Dornan <chris@chrisdornan.com> -stability: Stable -homepage: https://github.com/haskell/xhtml -synopsis: An XHTML combinator library -description: - This package provides combinators for producing - XHTML 1.0, including the Strict, Transitional and - Frameset variants. -category: Web, XML, Pretty Printer -author: Bjorn Bringert -exposed: True -exposed-modules: - Text.XHtml Text.XHtml.Frameset Text.XHtml.Strict - Text.XHtml.Transitional Text.XHtml.Debug Text.XHtml.Table -hidden-modules: Text.XHtml.Strict.Attributes - Text.XHtml.Strict.Elements Text.XHtml.Frameset.Attributes - Text.XHtml.Frameset.Elements Text.XHtml.Transitional.Attributes - Text.XHtml.Transitional.Elements Text.XHtml.BlockTable - Text.XHtml.Extras Text.XHtml.Internals -abi: 932c4b6847d698115f4ad73b10e56807 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/xhtml-3000.2.1 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/xhtml-3000.2.1 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/xhtml-3000.2.1 -hs-libraries: HSxhtml-3000.2.1 -depends: - base-4.9.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/xhtml-3000.2.1/xhtml.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/xhtml-3000.2.1 ---- -name: transformers -version: 0.4.3.0 -id: transformers-0.4.3.0 -key: transformers-0.4.3.0 -license: BSD3 -maintainer: Ross Paterson <R.Paterson@city.ac.uk> -synopsis: Concrete functor and monad transformers -description: - A portable library of functor and monad transformers, inspired by - the paper \"Functional Programming with Overloading and Higher-Order - Polymorphism\", by Mark P Jones, - in /Advanced School of Functional Programming/, 1995 - (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>). - . - This package contains: - . - * the monad transformer class (in "Control.Monad.Trans.Class") - and IO monad class (in "Control.Monad.IO.Class") - . - * concrete functor and monad transformers, each with associated - operations and functions to lift operations associated with other - transformers. - . - The package can be used on its own in portable Haskell code, in - which case operations need to be manually lifted through transformer - stacks (see "Control.Monad.Trans.Class" for some examples). - Alternatively, it can be used with the non-portable monad classes in - the @mtl@ or @monads-tf@ packages, which automatically lift operations - introduced by monad transformers through other transformers. -category: Control -author: Andy Gill, Ross Paterson -exposed: True -exposed-modules: - Control.Applicative.Backwards Control.Applicative.Lift - Control.Monad.Signatures Control.Monad.Trans.Class - Control.Monad.Trans.Cont Control.Monad.Trans.Except - Control.Monad.Trans.Error Control.Monad.Trans.Identity - Control.Monad.Trans.List Control.Monad.Trans.Maybe - Control.Monad.Trans.Reader Control.Monad.Trans.RWS - Control.Monad.Trans.RWS.Lazy Control.Monad.Trans.RWS.Strict - Control.Monad.Trans.State Control.Monad.Trans.State.Lazy - Control.Monad.Trans.State.Strict Control.Monad.Trans.Writer - Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict - Data.Functor.Classes Data.Functor.Compose Data.Functor.Constant - Data.Functor.Product Data.Functor.Reverse Data.Functor.Sum -abi: d71166f18d2591685ff3ee72b17638c0 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/transformers-0.4.3.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/transformers-0.4.3.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/transformers-0.4.3.0 -hs-libraries: HStransformers-0.4.3.0 -depends: - base-4.9.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/transformers-0.4.3.0/transformers.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/transformers-0.4.3.0 ---- -name: hoopl -version: 3.10.2.0 -id: hoopl-3.10.2.0 -key: hoopl-3.10.2.0 -license: BSD3 -maintainer: nr@cs.tufts.edu, andreas.voellmy@gmail.com, email@ningwang.org -homepage: http://ghc.cs.tufts.edu/hoopl/ -synopsis: A library to support dataflow analysis and optimization -description: - Higher-order optimization library - . - See /Norman Ramsey, Joao Dias, and Simon Peyton Jones./ - <http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"> /(2010)/ for more details. -category: Compilers/Interpreters -author: Norman Ramsey, Joao Dias, Simon Marlow and Simon Peyton Jones -exposed: True -exposed-modules: - Compiler.Hoopl Compiler.Hoopl.Internals Compiler.Hoopl.Wrappers - Compiler.Hoopl.Passes.Dominator Compiler.Hoopl.Passes.DList -hidden-modules: Compiler.Hoopl.Checkpoint - Compiler.Hoopl.Collections Compiler.Hoopl.Combinators - Compiler.Hoopl.Dataflow Compiler.Hoopl.Debug Compiler.Hoopl.Block - Compiler.Hoopl.Graph Compiler.Hoopl.Label Compiler.Hoopl.MkGraph - Compiler.Hoopl.Fuel Compiler.Hoopl.Pointed Compiler.Hoopl.Shape - Compiler.Hoopl.Show Compiler.Hoopl.Unique Compiler.Hoopl.XUtil -abi: 719b00050240e530b78b62520193b342 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hoopl-3.10.2.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hoopl-3.10.2.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/hoopl-3.10.2.0 -hs-libraries: HShoopl-3.10.2.0 -depends: - base-4.9.0.0 containers-0.5.6.3 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/hoopl-3.10.2.0/hoopl.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/hoopl-3.10.2.0 ---- -name: template-haskell -version: 2.11.0.0 -id: template-haskell-2.11.0.0 -key: template-haskell-2.11.0.0 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Support library for Template Haskell -description: - This package provides modules containing facilities for manipulating - Haskell source code using Template Haskell. - . - See <http://www.haskell.org/haskellwiki/Template_Haskell> for more - information. -category: Template Haskell -exposed: True -exposed-modules: - Language.Haskell.TH Language.Haskell.TH.Lib Language.Haskell.TH.Ppr - Language.Haskell.TH.PprLib Language.Haskell.TH.Quote - Language.Haskell.TH.Syntax -hidden-modules: Language.Haskell.TH.Lib.Map -abi: 26855f7c84ab668b019a8d35abdb5276 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/template-haskell-2.11.0.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/template-haskell-2.11.0.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/template-haskell-2.11.0.0 -hs-libraries: HStemplate-haskell-2.11.0.0 -depends: - base-4.9.0.0 ghc-boot-0.0.0.0 pretty-1.1.2.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/template-haskell-2.11.0.0/template-haskell.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/template-haskell-2.11.0.0 ---- -name: Cabal -version: 1.23.0.0 -id: Cabal-1.23.0.0 -key: Cabal-1.23.0.0 -license: BSD3 -copyright: 2003-2006, Isaac Jones - 2005-2011, Duncan Coutts -maintainer: cabal-devel@haskell.org -homepage: http://www.haskell.org/cabal/ -synopsis: A framework for packaging Haskell software -description: - The Haskell Common Architecture for Building Applications and - Libraries: a framework defining a common interface for authors to more - easily build their Haskell applications in a portable way. - . - The Haskell Cabal is part of a larger infrastructure for distributing, - organizing, and cataloging Haskell libraries and tools. -category: Distribution -author: Isaac Jones <ijones@syntaxpolice.org> - Duncan Coutts <duncan@community.haskell.org> -exposed: True -exposed-modules: - Distribution.Compat.CreatePipe Distribution.Compat.Environment - Distribution.Compat.Exception Distribution.Compat.Internal.TempFile - Distribution.Compat.ReadP Distribution.Compiler - Distribution.InstalledPackageInfo Distribution.License - Distribution.Make Distribution.ModuleName Distribution.Package - Distribution.PackageDescription - Distribution.PackageDescription.Check - Distribution.PackageDescription.Configuration - Distribution.PackageDescription.Parse - Distribution.PackageDescription.PrettyPrint - Distribution.PackageDescription.Utils Distribution.ParseUtils - Distribution.ReadE Distribution.Simple Distribution.Simple.Bench - Distribution.Simple.Build Distribution.Simple.Build.Macros - Distribution.Simple.Build.PathsModule - Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget - Distribution.Simple.CCompiler Distribution.Simple.Command - Distribution.Simple.Compiler Distribution.Simple.Configure - Distribution.Simple.GHC Distribution.Simple.GHCJS - Distribution.Simple.Haddock Distribution.Simple.HaskellSuite - Distribution.Simple.Hpc Distribution.Simple.Install - Distribution.Simple.InstallDirs Distribution.Simple.JHC - Distribution.Simple.LHC Distribution.Simple.LocalBuildInfo - Distribution.Simple.PackageIndex Distribution.Simple.PreProcess - Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program - Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin - Distribution.Simple.Program.Db Distribution.Simple.Program.Find - Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg - Distribution.Simple.Program.Hpc - Distribution.Simple.Program.Internal Distribution.Simple.Program.Ld - Distribution.Simple.Program.Run Distribution.Simple.Program.Script - Distribution.Simple.Program.Strip Distribution.Simple.Program.Types - Distribution.Simple.Register Distribution.Simple.Setup - Distribution.Simple.SrcDist Distribution.Simple.Test - Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09 - Distribution.Simple.Test.Log Distribution.Simple.UHC - Distribution.Simple.UserHooks Distribution.Simple.Utils - Distribution.System Distribution.TestSuite Distribution.Text - Distribution.Utils.NubList Distribution.Verbosity - Distribution.Version Language.Haskell.Extension -hidden-modules: Distribution.Compat.Binary - Distribution.Compat.CopyFile Distribution.GetOpt Distribution.Lex - Distribution.Simple.GHC.Internal Distribution.Simple.GHC.IPI641 - Distribution.Simple.GHC.IPI642 Distribution.Simple.GHC.ImplInfo - Paths_Cabal -abi: 4b55984d7d0e5898df279f52ba75702f -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/Cabal-1.23.0.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/Cabal-1.23.0.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/Cabal-1.23.0.0 -hs-libraries: HSCabal-1.23.0.0 -depends: - array-0.5.1.0 base-4.9.0.0 binary-0.7.5.0 bytestring-0.10.7.0 - containers-0.5.6.3 deepseq-1.4.2.0 directory-1.2.5.0 - filepath-1.4.1.0 pretty-1.1.2.0 process-1.4.1.0 time-1.5.0.1 - unix-2.7.1.1 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/Cabal-1.23.0.0/Cabal.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/Cabal-1.23.0.0 ---- -name: binary -version: 0.7.5.0 -id: binary-0.7.5.0 -key: binary-0.7.5.0 -license: BSD3 -maintainer: Lennart Kolmodin, Don Stewart <dons00@gmail.com> -stability: provisional -homepage: https://github.com/kolmodin/binary -synopsis: Binary serialisation for Haskell values using lazy ByteStrings -description: - Efficient, pure binary serialisation using lazy ByteStrings. - Haskell values may be encoded to and from binary formats, - written to disk as binary, or sent over the network. - The format used can be automatically generated, or - you can choose to implement a custom format if needed. - Serialisation speeds of over 1 G\/sec have been observed, - so this library should be suitable for high performance - scenarios. -category: Data, Parsing -author: Lennart Kolmodin <kolmodin@gmail.com> -exposed: True -exposed-modules: - Data.Binary Data.Binary.Put Data.Binary.Get - Data.Binary.Get.Internal Data.Binary.Builder - Data.Binary.Builder.Internal -hidden-modules: Data.Binary.Builder.Base Data.Binary.Class - Data.Binary.Generic -abi: 023629bb1f3d2da077b9dfaec842d5d6 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/binary-0.7.5.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/binary-0.7.5.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/binary-0.7.5.0 -hs-libraries: HSbinary-0.7.5.0 -depends: - array-0.5.1.0 base-4.9.0.0 bytestring-0.10.7.0 containers-0.5.6.3 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/binary-0.7.5.0/binary.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/binary-0.7.5.0 ---- -name: pretty -version: 1.1.2.0 -id: pretty-1.1.2.0 -key: pretty-1.1.2.0 -license: BSD3 -maintainer: David Terei <code@davidterei.com> -stability: Stable -homepage: http://github.com/haskell/pretty -synopsis: Pretty-printing library -description: - This package contains a pretty-printing library, a set of API's - that provides a way to easily print out text in a consistent - format of your choosing. This is useful for compilers and related - tools. - . - This library was originally designed by John Hughes's and has since - been heavily modified by Simon Peyton Jones. -category: Text -exposed: True -exposed-modules: - Text.PrettyPrint Text.PrettyPrint.HughesPJ - Text.PrettyPrint.HughesPJClass -abi: ff204a4f63b87ec08dfb63935ab60346 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/pretty-1.1.2.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/pretty-1.1.2.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/pretty-1.1.2.0 -hs-libraries: HSpretty-1.1.2.0 -depends: - base-4.9.0.0 deepseq-1.4.2.0 ghc-prim-0.5.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/pretty-1.1.2.0/pretty.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/pretty-1.1.2.0 ---- -name: hpc -version: 0.6.0.2 -id: hpc-0.6.0.2 -key: hpc-0.6.0.2 -license: BSD3 -maintainer: ghc-devs@haskell.org -synopsis: Code Coverage Library for Haskell -description: - This package provides the code coverage library for Haskell. - . - See <http://www.haskell.org/haskellwiki/Haskell_program_coverage> for more - information. -category: Control -author: Andy Gill -exposed: True -exposed-modules: - Trace.Hpc.Util Trace.Hpc.Mix Trace.Hpc.Tix Trace.Hpc.Reflect -abi: b98013c17bf1741c790e3a830237e8bc -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hpc-0.6.0.2 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hpc-0.6.0.2 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/hpc-0.6.0.2 -hs-libraries: HShpc-0.6.0.2 -depends: - base-4.9.0.0 containers-0.5.6.3 directory-1.2.5.0 filepath-1.4.1.0 - time-1.5.0.1 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/hpc-0.6.0.2/hpc.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/hpc-0.6.0.2 ---- -name: process -version: 1.4.1.0 -id: process-1.4.1.0 -key: process-1.4.1.0 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Process libraries -description: - This package contains libraries for dealing with system processes. -category: System -exposed: True -exposed-modules: - System.Cmd System.Process System.Process.Internals -hidden-modules: System.Process.Common System.Process.Posix -abi: 483b4c1d894e8c880c567a1ee593790f -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/process-1.4.1.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/process-1.4.1.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/process-1.4.1.0 -hs-libraries: HSprocess-1.4.1.0 -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/process-1.4.1.0/include -includes: - runProcess.h -depends: - base-4.9.0.0 deepseq-1.4.2.0 directory-1.2.5.0 filepath-1.4.1.0 - unix-2.7.1.1 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/process-1.4.1.0/process.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/process-1.4.1.0 ---- -name: directory -version: 1.2.5.0 -id: directory-1.2.5.0 -key: directory-1.2.5.0 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Platform-agnostic library for filesystem operations -description: - This library provides a basic set of operations for manipulating files and - directories in a portable way. -category: System -exposed: True -exposed-modules: - System.Directory -hidden-modules: System.Directory.Internal - System.Directory.Internal.Config - System.Directory.Internal.C_utimensat - System.Directory.Internal.Posix System.Directory.Internal.Windows -abi: 73051d50bd0377c1f91d40ac29eafcde -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/directory-1.2.5.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/directory-1.2.5.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/directory-1.2.5.0 -hs-libraries: HSdirectory-1.2.5.0 -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/directory-1.2.5.0/include -includes: - HsDirectory.h -depends: - base-4.9.0.0 filepath-1.4.1.0 time-1.5.0.1 unix-2.7.1.1 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/directory-1.2.5.0/directory.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/directory-1.2.5.0 ---- -name: unix -version: 2.7.1.1 -id: unix-2.7.1.1 -key: unix-2.7.1.1 -license: BSD3 -maintainer: libraries@haskell.org -homepage: https://github.com/haskell/unix -synopsis: POSIX functionality -description: - This package gives you access to the set of operating system - services standardised by POSIX 1003.1b (or the IEEE Portable - Operating System Interface for Computing Environments - - IEEE Std. 1003.1). - . - The package is not supported under Windows (except under Cygwin). -category: System -exposed: True -exposed-modules: - System.Posix System.Posix.ByteString System.Posix.Error - System.Posix.Resource System.Posix.Time System.Posix.Unistd - System.Posix.User System.Posix.Signals System.Posix.Signals.Exts - System.Posix.Semaphore System.Posix.SharedMem - System.Posix.ByteString.FilePath System.Posix.Directory - System.Posix.Directory.ByteString System.Posix.DynamicLinker.Module - System.Posix.DynamicLinker.Module.ByteString - System.Posix.DynamicLinker.Prim - System.Posix.DynamicLinker.ByteString System.Posix.DynamicLinker - System.Posix.Files System.Posix.Files.ByteString System.Posix.IO - System.Posix.IO.ByteString System.Posix.Env - System.Posix.Env.ByteString System.Posix.Fcntl System.Posix.Process - System.Posix.Process.Internals System.Posix.Process.ByteString - System.Posix.Temp System.Posix.Temp.ByteString - System.Posix.Terminal System.Posix.Terminal.ByteString -hidden-modules: System.Posix.Directory.Common - System.Posix.DynamicLinker.Common System.Posix.Files.Common - System.Posix.IO.Common System.Posix.Process.Common - System.Posix.Terminal.Common -abi: 416bbf4a68812f768d46e0603efc98e6 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/unix-2.7.1.1 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/unix-2.7.1.1 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/unix-2.7.1.1 -hs-libraries: HSunix-2.7.1.1 -extra-libraries: - rt util dl pthread -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/unix-2.7.1.1/include -includes: - HsUnix.h execvpe.h -depends: - base-4.9.0.0 bytestring-0.10.7.0 time-1.5.0.1 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/unix-2.7.1.1/unix.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/unix-2.7.1.1 ---- -name: time -version: 1.5.0.1 -id: time-1.5.0.1 -key: time-1.5.0.1 -license: BSD3 -maintainer: <ashley@semantic.org> -stability: stable -homepage: https://github.com/haskell/time -synopsis: A time library -description: - A time library -category: System -author: Ashley Yakeley -exposed: True -exposed-modules: - Data.Time.Calendar Data.Time.Calendar.MonthDay - Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate - Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Clock - Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime - Data.Time.Format Data.Time -hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days - Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay - Data.Time.Clock.Scale Data.Time.Clock.UTC Data.Time.Clock.CTimeval - Data.Time.Clock.UTCDiff Data.Time.LocalTime.TimeZone - Data.Time.LocalTime.TimeOfDay Data.Time.LocalTime.LocalTime - Data.Time.Format.Parse Data.Time.Format.Locale -abi: fa14628fffb7d93741bb88caab63757e -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/time-1.5.0.1 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/time-1.5.0.1 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/time-1.5.0.1 -hs-libraries: HStime-1.5.0.1 -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/time-1.5.0.1/include -depends: - base-4.9.0.0 deepseq-1.4.2.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/time-1.5.0.1/time.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/time-1.5.0.1 ---- -name: containers -version: 0.5.6.3 -id: containers-0.5.6.3 -key: containers-0.5.6.3 -license: BSD3 -maintainer: fox@ucw.cz -synopsis: Assorted concrete container types -description: - This package contains efficient general-purpose implementations - of various basic immutable container types. The declared cost of - each operation is either worst-case or amortized, but remains - valid even if structures are shared. -category: Data Structures -exposed: True -exposed-modules: - Data.IntMap Data.IntMap.Lazy Data.IntMap.Strict Data.IntSet - Data.Map Data.Map.Lazy Data.Map.Strict Data.Set Data.Graph - Data.Sequence Data.Tree -hidden-modules: Data.IntMap.Base Data.IntSet.Base Data.Map.Base - Data.Set.Base Data.Utils.BitUtil Data.Utils.StrictFold - Data.Utils.StrictPair -abi: 4ae96ef90aaf7e7c342611448391c5cd -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/containers-0.5.6.3 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/containers-0.5.6.3 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/containers-0.5.6.3 -hs-libraries: HScontainers-0.5.6.3 -depends: - array-0.5.1.0 base-4.9.0.0 deepseq-1.4.2.0 ghc-prim-0.5.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/containers-0.5.6.3/containers.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/containers-0.5.6.3 ---- -name: bytestring -version: 0.10.7.0 -id: bytestring-0.10.7.0 -key: bytestring-0.10.7.0 -license: BSD3 -copyright: Copyright (c) Don Stewart 2005-2009, - (c) Duncan Coutts 2006-2015, - (c) David Roundy 2003-2005, - (c) Jasper Van der Jeugt 2010, - (c) Simon Meier 2010-2013. -maintainer: Duncan Coutts <duncan@community.haskell.org> -homepage: https://github.com/haskell/bytestring -synopsis: Fast, compact, strict and lazy byte strings with a list interface -description: - An efficient compact, immutable byte string type (both strict and lazy) - suitable for binary or 8-bit character data. - . - The 'ByteString' type represents sequences of bytes or 8-bit characters. - It is suitable for high performance use, both in terms of large data - quantities, or high speed requirements. The 'ByteString' functions follow - the same style as Haskell\'s ordinary lists, so it is easy to convert code - from using 'String' to 'ByteString'. - . - Two 'ByteString' variants are provided: - . - * Strict 'ByteString's keep the string as a single large array. This - makes them convenient for passing data between C and Haskell. - . - * Lazy 'ByteString's use a lazy list of strict chunks which makes it - suitable for I\/O streaming tasks. - . - The @Char8@ modules provide a character-based view of the same - underlying 'ByteString' types. This makes it convenient to handle mixed - binary and 8-bit character content (which is common in many file formats - and network protocols). - . - The 'Builder' module provides an efficient way to build up 'ByteString's - in an ad-hoc way by repeated concatenation. This is ideal for fast - serialisation or pretty printing. - . - There is also a 'ShortByteString' type which has a lower memory overhead - and can be converted to or from a 'ByteString', but supports very few - other operations. It is suitable for keeping many short strings in memory. - . - 'ByteString's are not designed for Unicode. For Unicode strings you should - use the 'Text' type from the @text@ package. - . - These modules are intended to be imported qualified, to avoid name clashes - with "Prelude" functions, e.g. - . - > import qualified Data.ByteString as BS -category: Data -author: Don Stewart, - Duncan Coutts -exposed: True -exposed-modules: - Data.ByteString Data.ByteString.Char8 Data.ByteString.Unsafe - Data.ByteString.Internal Data.ByteString.Lazy - Data.ByteString.Lazy.Char8 Data.ByteString.Lazy.Internal - Data.ByteString.Short Data.ByteString.Short.Internal - Data.ByteString.Builder Data.ByteString.Builder.Extra - Data.ByteString.Builder.Prim Data.ByteString.Builder.Internal - Data.ByteString.Builder.Prim.Internal Data.ByteString.Lazy.Builder - Data.ByteString.Lazy.Builder.Extras - Data.ByteString.Lazy.Builder.ASCII -hidden-modules: Data.ByteString.Builder.ASCII - Data.ByteString.Builder.Prim.Binary - Data.ByteString.Builder.Prim.ASCII - Data.ByteString.Builder.Prim.Internal.Floating - Data.ByteString.Builder.Prim.Internal.UncheckedShifts - Data.ByteString.Builder.Prim.Internal.Base16 -abi: d9206a8fe0d44e69be0c04076cabad23 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/bytestring-0.10.7.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/bytestring-0.10.7.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/bytestring-0.10.7.0 -hs-libraries: HSbytestring-0.10.7.0 -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/bytestring-0.10.7.0/include -includes: - fpstring.h -depends: - base-4.9.0.0 deepseq-1.4.2.0 ghc-prim-0.5.0.0 integer-gmp-1.0.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/bytestring-0.10.7.0/bytestring.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/bytestring-0.10.7.0 ---- -name: deepseq -version: 1.4.2.0 -id: deepseq-1.4.2.0 -key: deepseq-1.4.2.0 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Deep evaluation of data structures -description: - This package provides methods for fully evaluating data structures - (\"deep evaluation\"). Deep evaluation is often used for adding - strictness to a program, e.g. in order to force pending exceptions, - remove space leaks, or force lazy I/O to happen. It is also useful - in parallel programs, to ensure pending work does not migrate to the - wrong thread. - . - The primary use of this package is via the 'deepseq' function, a - \"deep\" version of 'seq'. It is implemented on top of an 'NFData' - typeclass (\"Normal Form Data\", data structures with no unevaluated - components) which defines strategies for fully evaluating different - data types. -category: Control -exposed: True -exposed-modules: - Control.DeepSeq -abi: 63c4c214c0c19484502b3c8b7e42ec69 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/deepseq-1.4.2.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/deepseq-1.4.2.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/deepseq-1.4.2.0 -hs-libraries: HSdeepseq-1.4.2.0 -depends: - array-0.5.1.0 base-4.9.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/deepseq-1.4.2.0/deepseq.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/deepseq-1.4.2.0 ---- -name: array -version: 0.5.1.0 -id: array-0.5.1.0 -key: array-0.5.1.0 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Mutable and immutable arrays -description: - In addition to providing the "Data.Array" module - <http://www.haskell.org/onlinereport/haskell2010/haskellch14.html as specified in the Haskell 2010 Language Report>, - this package also defines the classes 'IArray' of - immutable arrays and 'MArray' of arrays mutable within appropriate - monads, as well as some instances of these classes. -category: Data Structures -exposed: True -exposed-modules: - Data.Array Data.Array.Base Data.Array.IArray Data.Array.IO - Data.Array.IO.Safe Data.Array.IO.Internals Data.Array.MArray - Data.Array.MArray.Safe Data.Array.ST Data.Array.ST.Safe - Data.Array.Storable Data.Array.Storable.Safe - Data.Array.Storable.Internals Data.Array.Unboxed Data.Array.Unsafe -abi: 2b2b879a09eb81c865ac273803e08132 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/array-0.5.1.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/array-0.5.1.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/array-0.5.1.0 -hs-libraries: HSarray-0.5.1.0 -depends: - base-4.9.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/array-0.5.1.0/array.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/array-0.5.1.0 ---- -name: filepath -version: 1.4.1.0 -id: filepath-1.4.1.0 -key: filepath-1.4.1.0 -license: BSD3 -copyright: Neil Mitchell 2005-2015 -maintainer: Neil Mitchell <ndmitchell@gmail.com> -homepage: https://github.com/haskell/filepath#readme -synopsis: Library for manipulating FilePaths in a cross platform way. -description: - This package provides functionality for manipulating @FilePath@ values, and is shipped with both <https://www.haskell.org/ghc/ GHC> and the <https://www.haskell.org/platform/ Haskell Platform>. It provides three modules: - . - * "System.FilePath.Posix" manipulates POSIX\/Linux style @FilePath@ values (with @\/@ as the path separator). - . - * "System.FilePath.Windows" manipulates Windows style @FilePath@ values (with either @\\@ or @\/@ as the path separator, and deals with drives). - . - * "System.FilePath" is an alias for the module appropriate to your platform. - . - All three modules provide the same API, and the same documentation (calling out differences in the different variants). -category: System -author: Neil Mitchell <ndmitchell@gmail.com> -exposed: True -exposed-modules: - System.FilePath System.FilePath.Posix System.FilePath.Windows -abi: 1e3d9055afc6aa08b97f5ad5f8014ce4 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/filepath-1.4.1.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/filepath-1.4.1.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/filepath-1.4.1.0 -hs-libraries: HSfilepath-1.4.1.0 -depends: - base-4.9.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/filepath-1.4.1.0/filepath.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/filepath-1.4.1.0 ---- -name: base -version: 4.9.0.0 -id: base-4.9.0.0 -key: base-4.9.0.0 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: Basic libraries -description: - This package contains the "Prelude" and its support libraries, - and a large collection of useful libraries ranging from data - structures to parsing combinators and debugging utilities. -category: Prelude -exposed: True -exposed-modules: - Control.Applicative Control.Arrow Control.Category - Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar - Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception - Control.Exception.Base Control.Monad Control.Monad.Fail - Control.Monad.Fix Control.Monad.Instances Control.Monad.IO.Class - Control.Monad.ST Control.Monad.ST.Lazy Control.Monad.ST.Lazy.Safe - Control.Monad.ST.Lazy.Unsafe Control.Monad.ST.Safe - Control.Monad.ST.Strict Control.Monad.ST.Unsafe Control.Monad.Zip - Data.Bifunctor Data.Bits Data.Bool Data.Char Data.Coerce - Data.Complex Data.Data Data.Dynamic Data.Either Data.Eq Data.Fixed - Data.Foldable Data.Function Data.Functor Data.Functor.Identity - Data.IORef Data.Int Data.Ix Data.Kind Data.List Data.List.NonEmpty - Data.Maybe Data.Monoid Data.Ord Data.Proxy Data.Ratio - Data.Semigroup Data.STRef Data.STRef.Lazy Data.STRef.Strict - Data.String Data.Traversable Data.Tuple Data.Type.Bool - Data.Type.Coercion Data.Type.Equality Data.Typeable - Data.Typeable.Internal Data.Unique Data.Version Data.Void Data.Word - Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String - Foreign.C.Types Foreign.Concurrent Foreign.ForeignPtr - Foreign.ForeignPtr.Safe Foreign.ForeignPtr.Unsafe Foreign.Marshal - Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error - Foreign.Marshal.Pool Foreign.Marshal.Safe Foreign.Marshal.Unsafe - Foreign.Marshal.Utils Foreign.Ptr Foreign.Safe Foreign.StablePtr - Foreign.Storable GHC.Arr GHC.Base GHC.Char GHC.Conc GHC.Conc.IO - GHC.Conc.Signal GHC.Conc.Sync GHC.ConsoleHandler GHC.Constants - GHC.Desugar GHC.Enum GHC.Environment GHC.Err GHC.Exception - GHC.ExecutionStack GHC.ExecutionStack.Internal GHC.Exts - GHC.Fingerprint GHC.Fingerprint.Type GHC.Float - GHC.Float.ConversionUtils GHC.Float.RealFracMethods GHC.Foreign - GHC.ForeignPtr GHC.GHCi GHC.Generics GHC.IO GHC.IO.Buffer - GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding - GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure - GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types - GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 - GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD - GHC.IO.Handle.Internals GHC.IO.Handle.Text GHC.IO.Handle.Types - GHC.IO.IOMode GHC.IO.Unsafe GHC.IOArray GHC.IORef GHC.Int GHC.List - GHC.MVar GHC.Natural GHC.Num GHC.OldList GHC.OverloadedLabels - GHC.PArr GHC.Pack GHC.Profiling GHC.Ptr GHC.Read GHC.Real - GHC.RTS.Flags GHC.ST GHC.StaticPtr GHC.STRef GHC.Show GHC.Stable - GHC.Stack GHC.Stack.CCS GHC.Stack.Types GHC.Stats GHC.Storable - GHC.TopHandler GHC.TypeLits GHC.Unicode GHC.Weak GHC.Word Numeric - Numeric.Natural Prelude System.CPUTime System.Console.GetOpt - System.Environment System.Exit System.IO System.IO.Error - System.IO.Unsafe System.Info System.Mem System.Mem.StableName - System.Mem.Weak System.Posix.Internals System.Posix.Types - System.Timeout Text.ParserCombinators.ReadP - Text.ParserCombinators.ReadPrec Text.Printf Text.Read Text.Read.Lex - Text.Show Text.Show.Functions Unsafe.Coerce GHC.Event -hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp - Data.OldList Foreign.ForeignPtr.Imp - System.Environment.ExecutablePath GHC.Event.Arr GHC.Event.Array - GHC.Event.Clock GHC.Event.Control GHC.Event.EPoll - GHC.Event.IntTable GHC.Event.Internal GHC.Event.KQueue - GHC.Event.Manager GHC.Event.PSQ GHC.Event.Poll GHC.Event.Thread - GHC.Event.TimerManager GHC.Event.Unique -abi: 472df40e39128303d276cf121f250e89 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/base-4.9.0.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/base-4.9.0.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/base-4.9.0.0 -hs-libraries: HSbase-4.9.0.0 -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/base-4.9.0.0/include -includes: - HsBase.h -depends: - ghc-prim-0.5.0.0 integer-gmp-1.0.0.0 rts -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/base-4.9.0.0/base.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/base-4.9.0.0 ---- -name: integer-gmp -version: 1.0.0.0 -id: integer-gmp-1.0.0.0 -key: integer-gmp-1.0.0.0 -license: BSD3 -maintainer: hvr@gnu.org -synopsis: Integer library based on GMP -category: Numeric, Algebra -author: Herbert Valerio Riedel -exposed: True -exposed-modules: - GHC.Integer GHC.Integer.Logarithms GHC.Integer.Logarithms.Internals - GHC.Integer.GMP.Internals -hidden-modules: GHC.Integer.Type -abi: 32980bb533b4a3996f3424fd198cf767 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/integer-gmp-1.0.0.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/integer-gmp-1.0.0.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/integer-gmp-1.0.0.0 -hs-libraries: HSinteger-gmp-1.0.0.0 -extra-libraries: - gmp -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/integer-gmp-1.0.0.0/include -depends: - ghc-prim-0.5.0.0 -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0/integer-gmp.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0 ---- -name: ghc-prim -version: 0.5.0.0 -id: ghc-prim-0.5.0.0 -key: ghc-prim-0.5.0.0 -license: BSD3 -maintainer: libraries@haskell.org -synopsis: GHC primitives -description: - GHC primitives. -category: GHC -exposed: True -exposed-modules: - GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 GHC.Magic - GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim -abi: 9f5ec1125ba73d164ce53f7b537009e8 -trusted: False -import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-prim-0.5.0.0 -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-prim-0.5.0.0 -data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/ghc-prim-0.5.0.0 -hs-libraries: HSghc-prim-0.5.0.0 -depends: - rts -haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-prim-0.5.0.0/ghc-prim.haddock -haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-prim-0.5.0.0 ---- -name: rts -version: 1.0 -id: rts -key: rts -license: BSD3 -maintainer: glasgow-haskell-users@haskell.org -exposed: True -abi: -trusted: False -library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/rts -hs-libraries: HSrts Cffi -extra-libraries: - m rt dl -include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/include -includes: - Stg.h -ld-options: "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info" - "-Wl,-u,base_GHCziPtr_Ptr_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info" - "-Wl,-u,base_GHCziInt_I8zh_static_info" - "-Wl,-u,base_GHCziInt_I16zh_static_info" - "-Wl,-u,base_GHCziInt_I32zh_static_info" - "-Wl,-u,base_GHCziInt_I64zh_static_info" - "-Wl,-u,base_GHCziWord_W8zh_static_info" - "-Wl,-u,base_GHCziWord_W16zh_static_info" - "-Wl,-u,base_GHCziWord_W32zh_static_info" - "-Wl,-u,base_GHCziWord_W64zh_static_info" - "-Wl,-u,base_GHCziStable_StablePtr_static_info" - "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" - "-Wl,-u,base_GHCziPtr_Ptr_con_info" - "-Wl,-u,base_GHCziPtr_FunPtr_con_info" - "-Wl,-u,base_GHCziStable_StablePtr_con_info" - "-Wl,-u,ghczmprim_GHCziTypes_False_closure" - "-Wl,-u,ghczmprim_GHCziTypes_True_closure" - "-Wl,-u,base_GHCziPack_unpackCString_closure" - "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" - "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" - "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" - "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" - "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" - "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure" - "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" - "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure" - "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" - "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" - "-Wl,-u,base_GHCziTopHandler_runIO_closure" - "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" - "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" - "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" - "-Wl,-u,base_GHCziConcziSync_runSparks_closure" - "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure"
@@ -0,0 +1,273 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +import Conduit + ( (.|), connect, filterC, filterMC, foldMapC, mapM_C + , runConduit, runConduitRes, runResourceT, sourceDirectory + , sourceDirectoryDeep, stderrC, withSourceFile + ) +import Data.List ( stripPrefix ) +import Options.Generic + ( ParseField, ParseRecord (..), defaultModifiers + , fieldNameModifier, firstLetter, getRecord + , parseRecordWithModifiers, shortNameModifier + ) +import RIO +import RIO.Char ( toLower ) +import RIO.Directory + ( canonicalizePath, copyFile, createDirectoryIfMissing + , doesFileExist, getAppUserDataDirectory + ) +import RIO.FilePath + ( (</>), (<.>), isPathSeparator, takeDirectory + , takeExtensions, takeFileName + ) +import RIO.List ( isInfixOf, partition ) +import qualified RIO.Map as Map +import RIO.Process + ( HasProcessContext (..), closed, findExecutable, proc + , runProcess, runProcess_, setStderr, setStdin, setStdout + , useHandleOpen, withModifyEnvVars, withWorkingDir + ) +import qualified RIO.Set as Set +import qualified RIO.Text as T +import System.Environment ( getExecutablePath, lookupEnv ) +import System.Info ( os ) +import System.PosixCompat.Files ( createSymbolicLink ) + +-- This code does not use a test framework so that we get direct +-- control of how the output is displayed. + +main :: IO () +main = runSimpleApp $ do + logInfo "Initiating Stack integration test running" + + options <- getRecord "Stack integration tests" + results <- runApp options $ do + logInfo "Running with the following environment" + proc "env" [] runProcess_ + tests <- asks appTestDirs + let count = Set.size tests + loop !idx rest !accum = + case rest of + [] -> pure accum + next:rest' -> do + logInfo $ "Running integration test " + <> display idx + <> "/" + <> display count + <> ": " + <> fromString (takeFileName next) + res <- test next + loop (idx + 1) rest' (res <> accum) + + loop (1 :: Int) (Set.toList tests) mempty + + let (successes, failures) = partition ((== ExitSuccess) . snd) + $ Map.toList results + + unless (null successes) $ do + logInfo "Successful tests:" + for_ successes $ \(x, _) -> logInfo $ "- " <> display x + logInfo "" + + if null failures + then logInfo "No failures!" + else do + logInfo "Failed tests:" + for_ failures $ \(x, ec) -> logInfo $ "- " <> display x <> " - " <> displayShow ec + exitFailure + +data Options = Options + { optSpeed :: Maybe Speed + , optMatch :: Maybe String + , optNot :: [String] + } + deriving Generic + +instance ParseRecord Options where + parseRecord = parseRecordWithModifiers modifiers + where + optName = map toLower . drop 3 + modifiers = defaultModifiers { fieldNameModifier = optName + , shortNameModifier = firstLetter . optName + } + +data Speed = Fast | Normal | Superslow + deriving (Read, Generic) + +instance ParseField Speed + +exeExt :: String +exeExt = if isWindows then ".exe" else "" + +isWindows :: Bool +isWindows = os == "mingw32" + +runApp :: Options -> RIO App a -> RIO SimpleApp a +runApp options inner = do + let speed = fromMaybe Normal $ optSpeed options + simpleApp <- ask + runghc <- findExecutable "runghc" >>= either throwIO pure + srcDir <- canonicalizePath "" + testsRoot <- canonicalizePath $ srcDir </> "tests/integration" + libdir <- canonicalizePath $ testsRoot </> "lib" + myPath <- liftIO getExecutablePath + + stack <- canonicalizePath $ takeDirectory myPath </> "stack" ++ exeExt + logInfo $ "Using Stack located at " <> fromString stack + proc stack ["--version"] runProcess_ + logInfo $ "Using runghc located at " <> fromString runghc + proc runghc ["--version"] runProcess_ + + let matchTest = case (optMatch options, optNot options) of + (Just str, _) -> (str `isInfixOf`) + (_, []) -> const True + (_, nl) -> \a -> all (\b -> not $ b `isInfixOf` a) nl + testDirs + <- runConduitRes + $ sourceDirectory (testsRoot </> "tests") + .| filterMC (liftIO . hasTest) + .| filterC matchTest + .| foldMapC Set.singleton + + let modifyEnvCommon + = Map.insert "SRC_DIR" (fromString srcDir) + . Map.insert "STACK_EXE" (fromString stack) + . Map.delete "GHC_PACKAGE_PATH" + . Map.insert "STACK_TEST_SPEED" + (case speed of + Superslow -> "SUPERSLOW" + _ -> "NORMAL") + . Map.fromList + . map (first T.toUpper) + . Map.toList + + case speed of + Fast -> do + let app = App + { appSimpleApp = simpleApp + , appRunghc = runghc + , appLibDir = libdir + , appSetupHome = id + , appTestDirs = testDirs + } + runRIO app $ withModifyEnvVars modifyEnvCommon inner + _ -> do + morigStackRoot <- liftIO $ lookupEnv "STACK_ROOT" + origStackRoot <- + case morigStackRoot of + Nothing -> getAppUserDataDirectory "stack" + Just x -> pure x + + logInfo "Initializing/updating the original Pantry store" + proc stack ["update"] runProcess_ + + pantryRoot <- canonicalizePath $ origStackRoot </> "pantry" + let modifyEnv + = Map.insert "PANTRY_ROOT" (fromString pantryRoot) + . modifyEnvCommon + + app = App + { appSimpleApp = simpleApp + , appRunghc = runghc + , appLibDir = libdir + , appSetupHome = \inner' -> withSystemTempDirectory "home" $ \newHome -> do + let newStackRoot = newHome </> ".stack" + createDirectoryIfMissing True newStackRoot + let modifyEnv' + = Map.insert "HOME" (fromString newHome) + . Map.insert "APPDATA" (fromString newHome) + . Map.insert "STACK_ROOT" (fromString newStackRoot) + writeFileBinary (newStackRoot </> "config.yaml") "system-ghc: true\ninstall-ghc: false\n" + withModifyEnvVars modifyEnv' inner' + , appTestDirs = testDirs + } + + runRIO app $ withModifyEnvVars modifyEnv inner + + +hasTest :: FilePath -> IO Bool +hasTest dir = doesFileExist $ dir </> "Main.hs" + +data App = App + { appRunghc :: !FilePath + , appLibDir :: !FilePath + , appSetupHome :: !(forall a. RIO App a -> RIO App a) + , appSimpleApp :: !SimpleApp + , appTestDirs :: !(Set FilePath) + } +simpleAppL :: Lens' App SimpleApp +simpleAppL = lens appSimpleApp (\x y -> x { appSimpleApp = y }) +instance HasLogFunc App where + logFuncL = simpleAppL.logFuncL +instance HasProcessContext App where + processContextL = simpleAppL.processContextL + +-- | Call 'appSetupHome' on the inner action +withHome :: RIO App a -> RIO App a +withHome inner = do + app <- ask + appSetupHome app inner + +test :: FilePath -- ^ test dir + -> RIO App (Map Text ExitCode) +test testDir = withDir $ \dir -> withHome $ do + runghc <- asks appRunghc + libDir <- asks appLibDir + let mainFile = testDir </> "Main.hs" + + copyTree (testDir </> "files") dir + + withSystemTempFile (name <.> "log") $ \logfp logh -> do + ec <- withWorkingDir dir + $ withModifyEnvVars (Map.insert "TEST_DIR" $ fromString testDir) + $ proc runghc + [ "-clear-package-db" + , "-global-package-db" + , "-i" ++ libDir + , mainFile + ] + $ runProcess + . setStdin closed + . setStdout (useHandleOpen logh) + . setStderr (useHandleOpen logh) + hClose logh + + case ec of + ExitSuccess -> logInfo "Success!" + _ -> do + logError "Failure, dumping log\n\n" + withSourceFile logfp $ \src -> + runConduit $ src .| stderrC + logError $ "\n\nEnd of log for " <> fromString name + pure $ Map.singleton (fromString name) ec + where + name = takeFileName testDir + withDir = withSystemTempDirectory ("stack-integration-" ++ name) + +copyTree :: MonadIO m => FilePath -> FilePath -> m () +copyTree src dst = + liftIO $ + runResourceT (sourceDirectoryDeep False src `connect` mapM_C go) + `catch` \(_ :: IOException) -> pure () + where + go srcfp = liftIO $ do + Just suffix <- pure $ stripPrefix src srcfp + let dstfp = dst </> stripHeadSeparator suffix + createDirectoryIfMissing True $ takeDirectory dstfp + -- copying yaml files so lock files won't get created in + -- the source directory + if takeFileName srcfp /= "package.yaml" && + (takeExtensions srcfp == ".yaml" || takeExtensions srcfp == ".yml") + then + copyFile srcfp dstfp + else + createSymbolicLink srcfp dstfp `catch` \(_ :: IOException) -> + copyFile srcfp dstfp -- for Windows + + stripHeadSeparator :: FilePath -> FilePath + stripHeadSeparator [] = [] + stripHeadSeparator fp@(x:xs) = if isPathSeparator x + then xs + else fp
@@ -0,0 +1,409 @@+{-# LANGUAGE ScopedTypeVariables #-} + +module StackTest + ( run' + , run + , runShell + , runWithCwd + , stackExe + , stackSrc + , testDir + , stack' + , stack + , stackCleanFull + , stackIgnoreException + , stackErr + , Repl + , ReplConnection (..) + , nextPrompt + , replCommand + , replGetChar + , replGetLine + , runRepl + , repl + , stackStderr + , stackCheckStderr + , stackErrStderr + , runEx + , runEx' + , stackCheckStdout + , doesNotExist + , doesExist + , doesFileOrDirExist + , copy + , fileContentsMatch + , logInfo + , showProcessArgDebug + , exeExt + , isWindows + , isLinux + , getIsAlpine + , isARM + , isAarch64 + , isMacOSX + , defaultResolverArg + , removeFileIgnore + , removeDirIgnore + , withCwd + , withSourceDirectory + , superslow + ) where + +import Control.Monad ( forever, unless, void, when ) +import Control.Monad.IO.Class ( liftIO ) +import Control.Monad.Trans.Reader ( ReaderT, ask, runReaderT ) +import Control.Concurrent ( forkIO ) +import Control.Exception + ( Exception (..), IOException, bracket_, catch, throw + , throwIO + ) +import Data.Maybe ( fromMaybe ) +import GHC.Stack ( HasCallStack ) +import System.Environment ( getEnv, lookupEnv ) +import System.Directory + ( copyFile, doesDirectoryExist, doesFileExist + , getCurrentDirectory, removeDirectoryRecursive, removeFile + , setCurrentDirectory + ) +import System.IO + ( BufferMode (..), Handle, IOMode (..), hGetChar, hGetLine + , hPutChar, hPutStr, hPutStrLn, hSetBuffering, stderr + , withFile + ) +import System.IO.Error + ( isDoesNotExistError, isEOFError ) +import System.Process + ( CreateProcess (..), StdStream (..), createProcess, proc + , readCreateProcessWithExitCode, readProcessWithExitCode + , shell, waitForProcess + ) +import System.Exit ( ExitCode (..) ) +import System.Info ( arch, os ) + +run' :: HasCallStack => FilePath -> [String] -> IO ExitCode +run' cmd args = do + logInfo $ "Running: " ++ cmd ++ " " ++ unwords (map showProcessArgDebug args) + (Nothing, Nothing, Nothing, ph) <- createProcess (proc cmd args) + waitForProcess ph + +run :: HasCallStack => FilePath -> [String] -> IO () +run cmd args = do + ec <- run' cmd args + unless (ec == ExitSuccess) $ + error $ "Exited with exit code: " ++ displayException ec + +runShell :: HasCallStack => String -> IO () +runShell cmd = do + logInfo $ "Running: " ++ cmd + (Nothing, Nothing, Nothing, ph) <- createProcess (shell cmd) + ec <- waitForProcess ph + unless (ec == ExitSuccess) $ + error $ "Exited with exit code: " ++ displayException ec + +runWithCwd :: HasCallStack => FilePath -> String -> [String] -> IO String +runWithCwd cwdPath cmd args = do + logInfo $ "Running: " ++ cmd + let cp = proc cmd args + (ec, stdoutStr, _) <- readCreateProcessWithExitCode (cp { cwd = Just cwdPath }) "" + unless (ec == ExitSuccess) $ + error $ "Exited with exit code: " ++ displayException ec + pure stdoutStr + +stackExe :: IO String +stackExe = getEnv "STACK_EXE" + +stackSrc :: IO String +stackSrc = getEnv "SRC_DIR" + +testDir :: IO String +testDir = getEnv "TEST_DIR" + +stack' :: HasCallStack => [String] -> IO ExitCode +stack' args = do + stackEnv <- stackExe + run' stackEnv args + +stack :: HasCallStack => [String] -> IO () +stack args = do + ec <- stack' args + unless (ec == ExitSuccess) $ + error $ "Exited with exit code: " ++ displayException ec + +-- Temporary workaround for Windows to ignore exceptions arising out of Windows +-- when we do stack clean. More info here: +-- https://github.com/commercialhaskell/stack/issues/4936 +stackCleanFull :: HasCallStack => IO () +stackCleanFull = stackIgnoreException ["clean", "--full"] + +-- Temporary workaround for Windows to ignore exceptions arising out of Windows +-- when we do stack clean. More info here: +-- https://github.com/commercialhaskell/stack/issues/4936 +stackIgnoreException :: HasCallStack => [String] -> IO () +stackIgnoreException args = + if isWindows + then void (stack' args) `catch` (\(_e :: IOException) -> pure ()) + else stack args + +stackErr :: HasCallStack => [String] -> IO () +stackErr args = do + ec <- stack' args + when (ec == ExitSuccess) $ error "stack was supposed to fail, but didn't" + +type Repl = ReaderT ReplConnection IO + +data ReplConnection = ReplConnection + { replStdin :: Handle + , replStdout :: Handle + } + +nextPrompt :: Repl () +nextPrompt = do + (ReplConnection _ replStdoutHandle) <- ask + c <- liftIO $ hGetChar replStdoutHandle + if c == '>' + then do + -- Skip next character + _ <- liftIO $ hGetChar replStdoutHandle + pure () + else nextPrompt + +replCommand :: String -> Repl () +replCommand cmd = do + (ReplConnection replStdinHandle _) <- ask + liftIO $ hPutStrLn replStdinHandle cmd + +replGetLine :: Repl String +replGetLine = ask >>= liftIO . hGetLine . replStdout + +replGetChar :: Repl Char +replGetChar = ask >>= liftIO . hGetChar . replStdout + +runRepl :: + HasCallStack + => FilePath + -> [String] + -> ReaderT ReplConnection IO () + -> IO ExitCode +runRepl cmd args actions = do + logInfo $ "Running: " ++ cmd ++ " " ++ unwords (map showProcessArgDebug args) + (Just rStdin, Just rStdout, Just rStderr, ph) <- + createProcess (proc cmd args) + { std_in = CreatePipe + , std_out = CreatePipe + , std_err = CreatePipe + } + hSetBuffering rStdin NoBuffering + hSetBuffering rStdout NoBuffering + hSetBuffering rStderr NoBuffering + -- Log stack repl's standard error output + tempDir <- if isWindows + then fromMaybe "" <$> lookupEnv "TEMP" + else pure "/tmp" + let tempLogFile = tempDir ++ "/stderr" + _ <- forkIO $ withFile tempLogFile WriteMode $ \logFileHandle -> do + hSetBuffering logFileHandle NoBuffering + forever $ + catch + (hGetChar rStderr >>= hPutChar logFileHandle) + (\e -> unless (isEOFError e) $ throw e) + runReaderT actions (ReplConnection rStdin rStdout) + waitForProcess ph + +repl :: HasCallStack => [String] -> Repl () -> IO () +repl args action = do + stackExe' <- stackExe + ec <- runRepl stackExe' ("repl":args) action + unless (ec == ExitSuccess) $ pure () + -- TODO: Understand why the exit code is 1 despite running GHCi tests + -- successfully. + -- else error $ "Exited with exit code: " ++ show ec + +stackStderr :: HasCallStack => [String] -> IO (ExitCode, String) +stackStderr args = do + stackExe' <- stackExe + logInfo $ + "Running: " + ++ stackExe' + ++ " " + ++ unwords (map showProcessArgDebug args) + (ec, _, err) <- readProcessWithExitCode stackExe' args "" + hPutStr stderr err + pure (ec, err) + +-- | Run stack with arguments and apply a check to the resulting stderr output +-- if the process succeeded. +stackCheckStderr :: HasCallStack => [String] -> (String -> IO ()) -> IO () +stackCheckStderr args check = do + (ec, err) <- stackStderr args + if ec /= ExitSuccess + then error $ "Exited with exit code: " ++ displayException ec + else check err + +-- | Same as 'stackCheckStderr', but ensures that the Stack process +-- fails. +stackErrStderr :: HasCallStack => [String] -> (String -> IO ()) -> IO () +stackErrStderr args check = do + (ec, err) <- stackStderr args + if ec == ExitSuccess + then error "Stack process succeeded, but it shouldn't" + else check err + +runEx :: HasCallStack => FilePath -> String -> IO (ExitCode, String, String) +runEx cmd args = runEx' cmd $ words args + +runEx' :: HasCallStack => FilePath -> [String] -> IO (ExitCode, String, String) +runEx' cmd args = do + logInfo $ "Running: " ++ cmd ++ " " ++ unwords (map showProcessArgDebug args) + (ec, out, err) <- readProcessWithExitCode cmd args "" + putStr out + hPutStr stderr err + pure (ec, out, err) + +-- | Run stack with arguments and apply a check to the resulting stdout output +-- if the process succeeded. +-- +-- Take care with newlines; if the output includes a newline character that +-- should not be there, use 'Data.List.Extra.trimEnd' to remove it. +stackCheckStdout :: HasCallStack => [String] -> (String -> IO ()) -> IO () +stackCheckStdout args check = do + stackExe' <- stackExe + (ec, out, _) <- runEx' stackExe' args + if ec /= ExitSuccess + then error $ "Exited with exit code: " ++ displayException ec + else check out + +doesNotExist :: HasCallStack => FilePath -> IO () +doesNotExist fp = do + logInfo $ "doesNotExist " ++ fp + exists <- doesFileOrDirExist fp + case exists of + (Right msg) -> error msg + (Left _) -> pure () + +doesExist :: HasCallStack => FilePath -> IO () +doesExist fp = do + logInfo $ "doesExist " ++ fp + exists <- doesFileOrDirExist fp + case exists of + (Right _) -> pure () + (Left _) -> error "No file or directory exists" + +doesFileOrDirExist :: HasCallStack => FilePath -> IO (Either () String) +doesFileOrDirExist fp = do + isFile <- doesFileExist fp + if isFile + then pure (Right ("File exists: " ++ fp)) + else do + isDir <- doesDirectoryExist fp + if isDir + then pure (Right ("Directory exists: " ++ fp)) + else pure (Left ()) + +copy :: HasCallStack => FilePath -> FilePath -> IO () +copy src dest = do + logInfo ("Copy " ++ show src ++ " to " ++ show dest) + System.Directory.copyFile src dest + +fileContentsMatch :: HasCallStack => FilePath -> FilePath -> IO () +fileContentsMatch f1 f2 = do + doesExist f1 + doesExist f2 + f1Contents <- readFile f1 + f2Contents <- readFile f2 + unless (f1Contents == f2Contents) $ + error ("contents do not match for " ++ show f1 ++ " " ++ show f2) + +logInfo :: String -> IO () +logInfo = hPutStrLn stderr + +-- TODO: use Stack's process running utilities? (better logging) +-- for now just copy+modifying this one from System.Process.Log + +-- | Show a process arg including speechmarks when necessary. Just for +-- debugging purposes, not functionally important. +showProcessArgDebug :: String -> String +showProcessArgDebug x + | any special x = show x + | otherwise = x + where + special '"' = True + special ' ' = True + special _ = False + +-- | Extension of executables +exeExt :: String +exeExt = if isWindows then ".exe" else "" + +-- | Is the OS Windows? +isWindows :: Bool +isWindows = os == "mingw32" + +isLinux :: Bool +isLinux = os == "linux" + +-- | Is the OS Alpine Linux? +getIsAlpine :: IO Bool +getIsAlpine = doesFileExist "/etc/alpine-release" + +-- | Is the architecture ARM? +isARM :: Bool +isARM = arch == "arm" + +-- | Is the architecture Aarch64? +isAarch64 :: Bool +isAarch64 = arch == "aarch64" + +-- | Is the OS Mac OS X? +isMacOSX :: Bool +isMacOSX = os == "darwin" + +-- | To avoid problems with GHC version mismatch when a new LTS major +-- version is released, pass this argument to @stack@ when running in +-- a global context. The LTS major version here should match that of +-- the main @stack.yaml@. +-- +defaultResolverArg :: String +defaultResolverArg = "--resolver=lts-21.13" + +-- | Remove a file and ignore any warnings about missing files. +removeFileIgnore :: HasCallStack => FilePath -> IO () +removeFileIgnore fp = removeFile fp `catch` \e -> + if isDoesNotExistError e + then pure () + else throwIO e + +-- | Remove a directory and ignore any warnings about missing files. +removeDirIgnore :: HasCallStack => FilePath -> IO () +removeDirIgnore fp = removeDirectoryRecursive fp `catch` \e -> + if isDoesNotExistError e + then pure () + else throwIO e + +-- | Changes to the specified working directory. +withCwd :: HasCallStack => FilePath -> IO () -> IO () +withCwd dir action = do + currentDirectory <- getCurrentDirectory + let enterDir = setCurrentDirectory dir + exitDir = setCurrentDirectory currentDirectory + bracket_ enterDir exitDir action + +-- | Changes working directory to Stack source directory. +withSourceDirectory :: HasCallStack => IO () -> IO () +withSourceDirectory action = do + dir <- stackSrc + withCwd dir action + +-- | Mark a test as superslow, only to be run when explicitly requested. +superslow :: HasCallStack => IO () -> IO () +superslow inner = do + mres <- lookupEnv "STACK_TEST_SPEED" + case mres of + Just "NORMAL" -> logInfo "Skipping superslow test" + Just "SUPERSLOW" -> do + logInfo "Running superslow test, hold on to your butts" + inner + Nothing -> do + logInfo "No STACK_TEST_SPEED specified. Executing superslow test, hold \ + \on to your butts" + inner + Just x -> error $ "Invalid value for STACK_TEST_SPEED env var: " ++ show x
@@ -0,0 +1,2 @@+{-# OPTIONS_GHC -Wno-missing-export-lists #-} +{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
@@ -0,0 +1,174 @@+{-# LANGUAGE NoImplicitPrelude #-} + +-- | Args parser test suite. + +module Stack.ArgsSpec + ( spec + , argsSpec + , argsInputOutput + , interpreterArgsSpec + ) where + +import Data.Attoparsec.Args ( EscapingMode (..), parseArgsFromString ) +import Data.Attoparsec.Interpreter ( interpreterArgsParser ) +import qualified Data.Attoparsec.Text as P +import Data.Text ( pack ) +import Prelude ( head ) +import Stack.Constants ( stackProgName ) +import Stack.Prelude +import Test.Hspec ( Spec, describe, it ) + +-- | Test spec. +spec :: Spec +spec = do + argsSpec + interpreterArgsSpec + +argsSpec :: Spec +argsSpec = forM_ argsInputOutput + (\(input,output) -> it input (parseArgsFromString Escaping input == output)) + +-- | Fairly comprehensive checks. +argsInputOutput :: [(String, Either String [String])] +argsInputOutput = + [ ("x", Right ["x"]) + , ("x y z", Right ["x", "y", "z"]) + , ("aaa bbb ccc", Right ["aaa", "bbb", "ccc"]) + , (" aaa bbb ccc ", Right ["aaa", "bbb", "ccc"]) + , ("aaa\"", Left "unterminated string: endOfInput") + , ("\"", Left "unterminated string: endOfInput") + , ("\"\"", Right [""]) + , ("\"aaa", Left "unterminated string: endOfInput") + , ("\"aaa\" bbb ccc \"ddd\"", Right ["aaa", "bbb", "ccc", "ddd"]) + , ("\"aa\\\"a\" bbb ccc \"ddd\"", Right ["aa\"a", "bbb", "ccc", "ddd"]) + , ("\"aa\\\"a\" bb\\b ccc \"ddd\"", Right ["aa\"a", "bb\\b", "ccc", "ddd"]) + , ("\"\" \"\" c", Right ["","","c"])] + +interpreterArgsSpec :: Spec +interpreterArgsSpec = + describe "Script interpreter parser" $ do + describe "Success cases" $ do + describe "Line comments" $ do + checkLines "" + checkLines " --x" + checkLines " --x --y" + describe "Literate line comments" $ do + checkLiterateLines "" + checkLiterateLines " --x" + checkLiterateLines " --x --y" + describe "Block comments" $ do + checkBlocks "" + checkBlocks "\n" + checkBlocks " --x" + checkBlocks "\n--x" + checkBlocks " --x --y" + checkBlocks "\n--x\n--y" + checkBlocks "\n\t--x\n\t--y" + describe "Literate block comments" $ do + checkLiterateBlocks "" "" + checkLiterateBlocks "\n>" "" + checkLiterateBlocks " --x" " --x" + checkLiterateBlocks "\n>--x" "--x" + checkLiterateBlocks " --x --y " "--x --y" + checkLiterateBlocks "\n>--x\n>--y" "--x --y" + checkLiterateBlocks "\n>\t--x\n>\t--y" "--x --y" + describe "Failure cases" $ do + checkFailures + describe "Bare directives in literate files" $ do + forM_ (interpreterGenValid lineComment []) $ + testAndCheck (acceptFailure True) [] + forM_ (interpreterGenValid blockComment []) $ + testAndCheck (acceptFailure True) [] + where + parse isLiterate s = + P.parseOnly (interpreterArgsParser isLiterate stackProgName) (pack s) + + acceptSuccess :: Bool -> String -> String -> Bool + acceptSuccess isLiterate args s = case parse isLiterate s of + Right x | words x == words args -> True + _ -> False + + acceptFailure isLiterate _ s = case parse isLiterate s of + Left _ -> True + Right _ -> False + + testAndCheck checker out inp = it (show inp) $ checker out inp + + checkLines args = forM_ + (interpreterGenValid lineComment args) + (testAndCheck (acceptSuccess False) args) + + checkLiterateLines args = forM_ + (interpreterGenValid literateLineComment args) + (testAndCheck (acceptSuccess True) args) + + checkBlocks args = forM_ + (interpreterGenValid blockComment args) + (testAndCheck (acceptSuccess False) args) + + checkLiterateBlocks inp args = forM_ + (interpreterGenValid literateBlockComment inp) + (testAndCheck (acceptSuccess True) args) + + checkFailures = forM_ + interpreterGenInvalid + (testAndCheck (acceptFailure False) "unused") + + -- Generate a set of acceptable inputs for given format and args + interpreterGenValid fmt args = shebang <++> newLine <++> fmt args + + interpreterGenInvalid :: [String] + -- Generate a set of Invalid inputs + interpreterGenInvalid = + ["-stack\n"] -- random input + -- just the shebang + <|> shebang <++> ["\n"] + -- invalid shebang + <|> blockSpace <++> [head (interpreterGenValid lineComment args)] + -- something between shebang and Stack comment + <|> shebang + <++> newLine + <++> blockSpace + <++> ([head (lineComment args)] <|> [head (blockComment args)]) + -- unterminated block comment + -- just chop the closing chars from a valid block comment + <|> shebang + <++> ["\n"] + <++> let c = head (blockComment args) + l = length c - 2 + in [assert (drop l c == "-}") (take l c)] + -- nested block comment + <|> shebang + <++> ["\n"] + <++> [head (blockComment "--x {- nested -} --y")] + where + args = " --x --y" + (<++>) = liftA2 (++) + + -- Generative grammar for the interpreter comments + shebang = ["#!/usr/bin/env stack"] + newLine = ["\n"] <|> ["\r\n"] + + -- A comment may be the last line or followed by something else + postComment = [""] <|> newLine + + -- A command starts with zero or more whitespace followed by "stack" + makeComment maker space args = + let makePrefix s = (s <|> [""]) <++> [stackProgName] + in (maker <$> (makePrefix space <++> [args])) <++> postComment + + lineSpace = [" "] <|> ["\t"] + lineComment = makeComment makeLine lineSpace + where + makeLine s = "--" ++ s + + literateLineComment = makeComment ("> --" ++) lineSpace + + blockSpace = lineSpace <|> newLine + blockComment = makeComment makeBlock blockSpace + where + makeBlock s = "{-" ++ s ++ "-}" + + literateBlockComment = makeComment + (\s -> "> {-" ++ s ++ "-}") + (lineSpace <|> map (++ ">") newLine)
@@ -0,0 +1,15 @@+{-# LANGUAGE NoImplicitPrelude #-} + +module Stack.Build.ExecuteSpec + ( main + , spec + ) where + +import Stack.Prelude +import Test.Hspec + +main :: IO () +main = hspec spec + +spec :: Spec +spec = pure ()
@@ -0,0 +1,33 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +module Stack.Build.TargetSpec + ( main + , spec + ) where + +import qualified Data.Text as T +import Distribution.Types.PackageName (mkPackageName) +import Distribution.Version (mkVersion) +import Stack.Build.Target +import Stack.Prelude +import Stack.Types.NamedComponent +import Test.Hspec + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "parseRawTarget" $ do + let test s e = it s $ parseRawTarget (T.pack s) `shouldBe` e + test "foobar" $ Just $ RTPackage (mkPackageName "foobar") + test "foobar-1.2.3" $ Just $ RTPackageIdentifier $ PackageIdentifier + (mkPackageName "foobar") (mkVersion [1, 2, 3]) + test "./foobar" Nothing + test "foobar/" Nothing + test "/foobar" Nothing + test ":some-exe" $ Just $ RTComponent "some-exe" + test "foobar:some-exe" $ Just $ RTPackageComponent (mkPackageName "foobar") $ UnresolvedComponent "some-exe" + test "foobar:exe:some-exe" $ Just $ RTPackageComponent (mkPackageName "foobar") + $ ResolvedComponent $ CExe "some-exe"
@@ -0,0 +1,29 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +module Stack.Config.DockerSpec + ( spec + ) where + +import Test.Hspec +import Stack.Prelude +import Stack.Types.Resolver +import RIO.Time (fromGregorian) +import Stack.Config.Docker (addDefaultTag) + +spec :: Spec +spec = do + describe "addDefaultTag" $ do + it "succeeds fails no resolver" $ addDefaultTag "foo/bar" Nothing Nothing `shouldBe` Nothing + it "succeeds on LTS" $ + addDefaultTag + "foo/bar" + Nothing + (Just $ ARResolver $ RSLSynonym $ LTS 1 2) + `shouldBe` Just "foo/bar:lts-1.2" + it "fails on nightly" $ + addDefaultTag + "foo/bar" + Nothing + (Just $ ARResolver $ RSLSynonym $ Nightly $ fromGregorian 2018 1 1) + `shouldBe` Nothing
@@ -0,0 +1,259 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} + +module Stack.ConfigSpec + ( sampleConfig + , buildOptsConfig + , hpackConfig + , resolverConfig + , snapshotConfig + , resolverSnapshotConfig + , stackDotYaml + , setup + , noException + , spec + ) where + +import Control.Arrow ( left ) +import Data.Aeson.WarningParser ( WithJSONWarnings ) +import Data.Yaml ( decodeEither', parseEither ) +import Distribution.Verbosity ( verbose ) +import Pantry.Internal.Stackage ( pcHpackExecutable ) +import Path ( (</>), parent, parseAbsDir, parseRelDir, parseRelFile ) +import Path.IO ( getCurrentDir ) +import Stack.Config (defaultConfigYaml, loadConfig, loadConfigYaml ) +import Stack.Options.GlobalParser ( globalOptsFromMonoid ) +import Stack.Prelude +import Stack.Runners ( withBuildConfig, withRunnerGlobal ) +import Stack.Types.BuildConfig ( BuildConfig (..), projectRootL ) +import Stack.Types.BuildOpts + ( BenchmarkOpts (..), BuildOpts (..), CabalVerbosity (..) + , TestOpts (..) + ) +import Stack.Types.Config ( Config (..) ) +import Stack.Types.ConfigMonoid + ( ConfigMonoid (..), parseConfigMonoid ) +import Stack.Types.GlobalOpts ( GlobalOpts (..) ) +import Stack.Types.Project ( Project (..) ) +import Stack.Types.ProjectAndConfigMonoid + ( ProjectAndConfigMonoid (..), parseProjectAndConfigMonoid ) +import System.Directory + ( createDirectory, createDirectoryIfMissing + , getCurrentDirectory, setCurrentDirectory + ) +import System.Environment ( lookupEnv, setEnv, unsetEnv ) +import System.IO ( writeFile ) +import Test.Hspec + ( Selector, Spec, anyException, beforeAll, describe, example + , it, shouldBe, shouldThrow + ) + +sampleConfig :: String +sampleConfig = + "resolver: lts-19.22\n" ++ + "packages: ['.']\n" + +buildOptsConfig :: String +buildOptsConfig = + "resolver: lts-19.22\n" ++ + "packages: ['.']\n" ++ + "build:\n" ++ + " library-profiling: true\n" ++ + " executable-profiling: true\n" ++ + " haddock: true\n" ++ + " haddock-deps: true\n" ++ + " copy-bins: true\n" ++ + " prefetch: true\n" ++ + " force-dirty: true\n" ++ + " keep-going: true\n" ++ + " keep-tmp-files: true\n" ++ + " test: true\n" ++ + " test-arguments:\n" ++ + " rerun-tests: true\n" ++ + " additional-args: ['-fprof']\n" ++ + " coverage: true\n" ++ + " no-run-tests: true\n" ++ + " bench: true\n" ++ + " benchmark-opts:\n" ++ + " benchmark-arguments: -O2\n" ++ + " no-run-benchmarks: true\n" ++ + " reconfigure: true\n" ++ + " cabal-verbose: true\n" + +hpackConfig :: String +hpackConfig = + "resolver: lts-19.22\n" ++ + "with-hpack: /usr/local/bin/hpack\n" ++ + "packages: ['.']\n" + +resolverConfig :: String +resolverConfig = + "resolver: lts-19.22\n" ++ + "packages: ['.']\n" + +snapshotConfig :: String +snapshotConfig = + "snapshot: lts-19.22\n" ++ + "packages: ['.']\n" + +resolverSnapshotConfig :: String +resolverSnapshotConfig = + "resolver: lts-19.22\n" ++ + "snapshot: lts-19.22\n" ++ + "packages: ['.']\n" + +stackDotYaml :: Path Rel File +stackDotYaml = either impureThrow id (parseRelFile "stack.yaml") + +setup :: IO () +setup = unsetEnv "STACK_YAML" + +noException :: Selector SomeException +noException = const False + +spec :: Spec +spec = beforeAll setup $ do + let logLevel = LevelOther "silent" + -- TODO(danburton): not use inTempDir + let inTempDir action = do + currentDirectory <- getCurrentDirectory + withSystemTempDirectory "Stack_ConfigSpec" $ \tempDir -> do + let enterDir = setCurrentDirectory tempDir + let exitDir = setCurrentDirectory currentDirectory + bracket_ enterDir exitDir action + -- TODO(danburton): a safer version of this? + let withEnvVar name newValue action = do + originalValue <- fromMaybe "" <$> lookupEnv name + let setVar = setEnv name newValue + let resetVar = setEnv name originalValue + bracket_ setVar resetVar action + + describe "parseProjectAndConfigMonoid" $ do + let loadProject' fp inner = do + globalOpts <- globalOptsFromMonoid False mempty + withRunnerGlobal globalOpts { globalLogLevel = logLevel } $ do + iopc <- loadConfigYaml ( + parseProjectAndConfigMonoid (parent fp) + ) fp + ProjectAndConfigMonoid project _ <- liftIO iopc + liftIO $ inner project + + toAbsPath path = do + parentDir <- getCurrentDirectory >>= parseAbsDir + pure (parentDir </> path) + + loadProject config inner = do + yamlAbs <- toAbsPath stackDotYaml + writeFile (toFilePath yamlAbs) config + loadProject' yamlAbs inner + + it "parses snapshot using 'resolver'" $ inTempDir $ do + loadProject resolverConfig $ \Project{..} -> + projectResolver `shouldBe` RSLSynonym (LTS 19 22) + + it "parses snapshot using 'snapshot'" $ inTempDir $ do + loadProject snapshotConfig $ \Project{..} -> + projectResolver `shouldBe` RSLSynonym (LTS 19 22) + + it "throws if both 'resolver' and 'snapshot' are present" $ inTempDir $ do + loadProject resolverSnapshotConfig (const (pure ())) + `shouldThrow` anyException + + describe "loadConfig" $ do + let loadConfig' inner = do + globalOpts <- globalOptsFromMonoid False mempty + withRunnerGlobal globalOpts { globalLogLevel = logLevel } $ + loadConfig inner + -- TODO(danburton): make sure parent dirs also don't have config file + it "works even if no config file exists" $ example $ + loadConfig' $ const $ pure () + + it "works with a blank config file" $ inTempDir $ do + writeFile (toFilePath stackDotYaml) "" + -- TODO(danburton): more specific test for exception + loadConfig' (const (pure ())) `shouldThrow` anyException + + let configOverrideHpack = pcHpackExecutable . view pantryConfigL + + it "parses config option with-hpack" $ inTempDir $ do + writeFile (toFilePath stackDotYaml) hpackConfig + loadConfig' $ \config -> + liftIO $ configOverrideHpack config `shouldBe` + HpackCommand "/usr/local/bin/hpack" + + it "parses config bundled Hpack" $ inTempDir $ do + writeFile (toFilePath stackDotYaml) sampleConfig + loadConfig' $ \config -> + liftIO $ configOverrideHpack config `shouldBe` HpackBundled + + it "parses build config options" $ inTempDir $ do + writeFile (toFilePath stackDotYaml) buildOptsConfig + loadConfig' $ \config -> liftIO $ do + let BuildOpts{..} = configBuild config + boptsLibProfile `shouldBe` True + boptsExeProfile `shouldBe` True + boptsHaddock `shouldBe` True + boptsHaddockDeps `shouldBe` Just True + boptsInstallExes `shouldBe` True + boptsPreFetch `shouldBe` True + boptsKeepGoing `shouldBe` Just True + boptsKeepTmpFiles `shouldBe` True + boptsForceDirty `shouldBe` True + boptsTests `shouldBe` True + boptsTestOpts `shouldBe` TestOpts { toRerunTests = True + , toAdditionalArgs = ["-fprof"] + , toCoverage = True + , toDisableRun = True + , toMaximumTimeSeconds = Nothing + , toAllowStdin = True + } + boptsBenchmarks `shouldBe` True + boptsBenchmarkOpts `shouldBe` BenchmarkOpts { beoAdditionalArgs = Just "-O2" + , beoDisableRun = True + } + boptsReconfigure `shouldBe` True + boptsCabalVerbose `shouldBe` CabalVerbosity verbose + + it "finds the config file in a parent directory" $ inTempDir $ do + writeFile "package.yaml" "name: foo" + writeFile (toFilePath stackDotYaml) sampleConfig + parentDir <- getCurrentDirectory >>= parseAbsDir + let childDir = "child" + createDirectory childDir + setCurrentDirectory childDir + loadConfig' $ \config -> liftIO $ do + bc <- runRIO config $ withBuildConfig ask + view projectRootL bc `shouldBe` parentDir + + it "respects the STACK_YAML env variable" $ inTempDir $ do + withSystemTempDir "config-is-here" $ \dir -> do + let stackYamlFp = toFilePath (dir </> stackDotYaml) + writeFile stackYamlFp sampleConfig + writeFile (toFilePath dir ++ "/package.yaml") "name: foo" + withEnvVar "STACK_YAML" stackYamlFp $ loadConfig' $ \config -> liftIO $ do + BuildConfig{..} <- runRIO config $ withBuildConfig ask + bcStackYaml `shouldBe` dir </> stackDotYaml + parent bcStackYaml `shouldBe` dir + + it "STACK_YAML can be relative" $ inTempDir $ do + parentDir <- getCurrentDirectory >>= parseAbsDir + let childRel = either impureThrow id (parseRelDir "child") + yamlRel = childRel </> either impureThrow id (parseRelFile "some-other-name.config") + yamlAbs = parentDir </> yamlRel + packageYaml = childRel </> either impureThrow id (parseRelFile "package.yaml") + createDirectoryIfMissing True $ toFilePath $ parent yamlAbs + writeFile (toFilePath yamlAbs) "resolver: ghc-9.0" + writeFile (toFilePath packageYaml) "name: foo" + withEnvVar "STACK_YAML" (toFilePath yamlRel) $ loadConfig' $ \config -> liftIO $ do + BuildConfig{..} <- runRIO config $ withBuildConfig ask + bcStackYaml `shouldBe` yamlAbs + + describe "defaultConfigYaml" $ + it "is parseable" $ \_ -> do + curDir <- getCurrentDir + let parsed :: Either String (Either String (WithJSONWarnings ConfigMonoid)) + parsed = parseEither (parseConfigMonoid curDir) <$> left show (decodeEither' defaultConfigYaml) + case parsed of + Right (Right _) -> pure () :: IO () + _ -> fail "Failed to parse default config yaml"
@@ -0,0 +1,134 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +-- | Test suite for Stack.Dot +module Stack.DotSpec + ( dummyPayload + , spec + , sublistOf + , pkgName + , stubLoader + ) where + +import Data.List ((\\)) +import qualified Data.Map as Map +import qualified Data.Set as Set +import Distribution.License ( License (BSD3) ) +import qualified RIO.Text as T +import Stack.Dot ( DotPayload (..), pruneGraph, resolveDependencies ) +import Stack.Prelude hiding ( pkgName ) +import Test.Hspec ( Spec, describe, it, shouldBe ) +import Test.Hspec.QuickCheck ( prop ) +import Test.QuickCheck ( Gen, choose, forAll ) + +dummyPayload :: DotPayload +dummyPayload = DotPayload (parseVersion "0.0.0.0") (Just (Right BSD3)) Nothing + +spec :: Spec +spec = do + let graph = + Map.mapKeys pkgName + . fmap (\p -> (Set.map pkgName p, dummyPayload)) + . Map.fromList $ [("one",Set.fromList ["base","free"]) + ,("two",Set.fromList ["base","free","mtl","transformers","one"]) + ] + describe "Stack.Dot" $ do + it "does nothing if depth is 0" $ + resolveDependencies (Just 0) graph stubLoader `shouldBe` pure graph + + it "with depth 1, more dependencies are resolved" $ do + let graph' = Map.insert (pkgName "cycle") + (Set.singleton (pkgName "cycle"), dummyPayload) + graph + resultGraph = runIdentity (resolveDependencies (Just 0) graph stubLoader) + resultGraph' = runIdentity (resolveDependencies (Just 1) graph' stubLoader) + Map.size resultGraph < Map.size resultGraph' `shouldBe` True + + it "cycles are ignored" $ do + let graph' = Map.insert (pkgName "cycle") + (Set.singleton (pkgName "cycle"), dummyPayload) + graph + resultGraph = resolveDependencies Nothing graph stubLoader + resultGraph' = resolveDependencies Nothing graph' stubLoader + fmap Map.size resultGraph' `shouldBe` fmap ((+1) . Map.size) resultGraph + + let graphElem e = Set.member e . Set.unions . Map.elems + + prop "requested packages are pruned" $ do + let resolvedGraph = runIdentity (resolveDependencies Nothing graph stubLoader) + allPackages g = Map.keysSet g `Set.union` foldMap fst g + forAll (sublistOf (Set.toList (allPackages resolvedGraph))) $ \toPrune -> + let pruned = pruneGraph [pkgName "one", pkgName "two"] toPrune resolvedGraph + in Set.null (allPackages pruned `Set.intersection` Set.fromList toPrune) + + prop "pruning removes orphans" $ do + let resolvedGraph = runIdentity (resolveDependencies Nothing graph stubLoader) + allPackages g = Map.keysSet g `Set.union` foldMap fst g + orphans g = Map.filterWithKey (\k _ -> not (graphElem k g)) g + forAll (sublistOf (Set.toList (allPackages resolvedGraph))) $ \toPrune -> + let pruned = pruneGraph [pkgName "one", pkgName "two"] toPrune resolvedGraph + in null (Map.keys (orphans (fmap fst pruned)) \\ [pkgName "one", pkgName "two"]) + +{- Helper functions below -} +-- Backport from QuickCheck 2.8 to 2.7.6 +sublistOf :: [a] -> Gen [a] +sublistOf = filterM (\_ -> choose (False, True)) + +-- Unsafe internal helper to create a package name +pkgName :: Text -> PackageName +pkgName = fromMaybe failure . parsePackageName . T.unpack + where + failure = error "Internal error during package name creation in DotSpec.pkgName" + +-- Stub, simulates the function to load package dependencies +stubLoader :: PackageName -> Identity (Set PackageName, DotPayload) +stubLoader name = pure $ (, dummyPayload) . Set.fromList . map pkgName $ + case show name of + "StateVar" -> ["stm", "transformers"] + "array" -> [] + "bifunctors" -> ["semigroupoids", "semigroups", "tagged"] + "binary" -> ["array", "bytestring", "containers"] + "bytestring" -> ["deepseq", "ghc-prim", "integer-gmp"] + "comonad" -> [ "containers", "contravariant", "distributive", "semigroups" + , "tagged","transformers","transformers-compat" + ] + "cont" -> [ "StateVar", "semigroups", "transformers", "transformers-compat" + , "void" + ] + "containers" -> ["array", "deepseq", "ghc-prim"] + "deepseq" -> ["array"] + "distributive" -> [ "ghc-prim", "tagged", "transformers" + , "transformers-compat" + ] + "free" -> [ "bifunctors", "comonad", "distributive", "mtl", "prelude-extras" + , "profunctors", "semigroupoids", "semigroups", "template-haskell" + , "transformers" + ] + "ghc" -> [] + "hashable" -> ["bytestring", "ghc-prim", "integer-gmp", "text"] + "integer" -> [] + "mtl" -> ["transformers"] + "nats" -> [] + "one" -> ["free"] + "prelude" -> [] + "profunctors" -> [ "comonad", "distributive", "semigroupoids", "tagged" + , "transformers" + ] + "semigroupoids" -> [ "comonad", "containers", "contravariant" + , "distributive", "semigroups", "transformers" + , "transformers-compat" + ] + "semigroups" -> [ "bytestring", "containers", "deepseq", "hashable", "nats" + , "text", "unordered-containers" + ] + "stm" -> ["array"] + "tagged" -> ["template-haskell"] + "template" -> [] + "text" -> [ "array", "binary", "bytestring", "deepseq", "ghc-prim" + , "integer-gmp" + ] + "transformers" -> [] + "two" -> ["free", "mtl", "one", "transformers"] + "unordered" -> ["deepseq", "hashable"] + "void" -> ["ghc-prim", "hashable", "semigroups"] + _ -> []
@@ -0,0 +1,65 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE OverloadedLists #-} +{-# LANGUAGE TemplateHaskell #-} + +-- | Test suite for the GhciScript DSL +module Stack.Ghci.ScriptSpec + ( spec + ) where + +import qualified Data.Set as S +import Distribution.ModuleName +import Test.Hspec +import qualified System.FilePath as FP +import Stack.Ghci.FakePaths +import Stack.Prelude hiding (fromString) +import Path +import Path.Extra (pathToLazyByteString) + +import Stack.Ghci.Script + +spec :: Spec +spec = do + describe "GHCi" $ do + describe "Script DSL" $ do + + describe "script" $ do + it "should separate commands with a newline" $ do + let dir = $(mkAbsDir $ defaultDrive FP.</> "src" FP.</> "package-a") + script = cmdCdGhc dir + <> cmdAdd [Left (fromString "Lib.A")] + scriptToLazyByteString script `shouldBe` + ":cd-ghc " <> pathToLazyByteString dir <> "\n:add Lib.A\n" + + describe ":add" $ do + it "should not render empty add commands" $ do + let script = cmdAdd S.empty + scriptToLazyByteString script `shouldBe` "" + + it "should ensure that a space exists between each module in an add command" $ do + let script = cmdAdd (S.fromList [Left (fromString "Lib.A"), Left (fromString "Lib.B")]) + scriptToLazyByteString script `shouldBe` ":add Lib.A Lib.B\n" + + describe ":add (by file)" $ do + it "should render a full file path" $ do + let file = $(mkAbsFile $ defaultDrive FP.</> "Users" FP.</> "someone" FP.</> "src" FP.</> "project" FP.</> "package-a" FP.</> "src" FP.</> "Main.hs") + script = cmdAdd (S.fromList [Right file]) + scriptToLazyByteString script `shouldBe` + ":add " <> pathToLazyByteString file <> "\n" + + describe ":cd-ghc" $ do + it "should render a full absolute path" $ do + let dir = $(mkAbsDir $ defaultDrive FP.</> "Users" FP.</> "someone" FP.</> "src" FP.</> "project" FP.</> "package-a") + script = cmdCdGhc dir + scriptToLazyByteString script `shouldBe` + ":cd-ghc " <> pathToLazyByteString dir <> "\n" + + describe ":module" $ do + it "should render empty module as ':module +'" $ do + let script = cmdModule [] + scriptToLazyByteString script `shouldBe` ":module +\n" + + it "should ensure that a space exists between each module in a module command" $ do + let script = cmdModule [fromString "Lib.A", fromString "Lib.B"] + scriptToLazyByteString script `shouldBe` ":module + Lib.A Lib.B\n"
@@ -0,0 +1,309 @@+-- {-# LANGUAGE NoImplicitPrelude #-} +-- {-# LANGUAGE QuasiQuotes #-} +-- {-# LANGUAGE TemplateHaskell #-} + +-- | Test suite for GHCi like applications including both GHCi and Intero. +module Stack.GhciSpec + ( spec + ) where + +import Test.Hspec ( Spec ) + +spec :: Spec +spec = pure () + +{- Commented out as part of the fix for https://github.com/commercialhaskell/stack/issues/3309 + Not sure if maintaining this test is worth the effort. + +import qualified Data.ByteString.Lazy as LBS +import qualified Data.Map as M +import qualified Data.Set as S +import qualified Data.Text as T +import qualified Data.Text.Encoding as T +import Distribution.License (License (BSD3)) +import qualified Distribution.ModuleName as ModuleName +import Distribution.PackageDescription (BuildType(..)) +import Stack.Prelude +import Stack.Types.Package +import Stack.Types.PackageName +import Stack.Types.Version +import Test.Hspec +import NeatInterpolation +import Path +import Path.Extra (pathToText) +import qualified System.FilePath as FP + +import Stack.Ghci +import Stack.Ghci.Script (scriptToLazyByteString) +import Stack.Ghci.PortableFakePaths + +textToLazy :: Text -> LBS.ByteString +textToLazy = LBS.fromStrict . T.encodeUtf8 + +-- | Matches two strings, after converting line-ends in the second to Unix ones +-- (in a hacky way) and converting both to the same type. Workaround for +-- https://github.com/nikita-volkov/neat-interpolation/issues/14. +shouldBeLE :: LBS.ByteString -> Text -> Expectation +shouldBeLE actual expected = shouldBe actual (textToLazy $ T.filter (/= '\r') expected) + +baseProjDir, projDirA, projDirB :: Path Abs Dir +baseProjDir = $(mkAbsDir $ defaultDrive FP.</> "Users" FP.</> "someone" FP.</> "src") +projDirA = baseProjDir </> either impureThrow id (parseRelDir "project-a") +projDirB = baseProjDir </> either impureThrow id (parseRelDir "project-b") + +relFile :: Path Rel File +relFile = either impureThrow id (parseRelFile $ "exe" FP.</> "Main.hs") + +absFile :: Path Abs File +absFile = projDirA </> relFile + +projDirAT, projDirBT, relFileT, absFileT :: Text +projDirAT = pathToText projDirA +projDirBT = pathToText projDirB +relFileT = pathToText relFile +absFileT = pathToText absFile + +spec :: Spec +spec = do + describe "GHCi" $ do + describe "Script rendering" $ do + describe "should render GHCi scripts" $ do + it "with one library package" $ do + let res = scriptToLazyByteString $ renderScriptGhci packages_singlePackage Nothing [] + res `shouldBeLE` ghciScript_projectWithLib + + it "with one main package" $ do + let res = scriptToLazyByteString $ renderScriptGhci [] + (Just absFile) + [] + res `shouldBeLE` ghciScript_projectWithMain + + it "with one library and main package" $ do + let res = scriptToLazyByteString $ renderScriptGhci packages_singlePackage + (Just absFile) + [] + res `shouldBeLE` ghciScript_projectWithLibAndMain + + it "with multiple library packages" $ do + let res = scriptToLazyByteString $ renderScriptGhci packages_multiplePackages Nothing [] + res `shouldBeLE` ghciScript_multipleProjectsWithLib + + describe "should render intero scripts" $ do + it "with one library package" $ do + let res = scriptToLazyByteString $ renderScriptIntero packages_singlePackage Nothing [] + res `shouldBeLE` interoScript_projectWithLib + + it "with one main package" $ do + let res = scriptToLazyByteString $ renderScriptIntero packages_singlePackage + (Just absFile) + [] + res `shouldBeLE` interoScript_projectWithMain + + it "with one library and main package" $ do + let res = scriptToLazyByteString $ renderScriptIntero packages_singlePackage + (Just absFile) + [] + res `shouldBeLE` interoScript_projectWithLibAndMain + + it "with multiple library packages" $ do + let res = scriptToLazyByteString $ renderScriptIntero packages_multiplePackages Nothing [] + res `shouldBeLE` interoScript_multipleProjectsWithLib + +-- Expected Intero scripts + +interoScript_projectWithLib :: Text +interoScript_projectWithLib = [text| +:cd-ghc $projDirAT +:add Lib.A +:module + Lib.A + +|] + +interoScript_projectWithMain :: Text +interoScript_projectWithMain = [text| +:cd-ghc $projDirAT +:add Lib.A +:cd-ghc $projDirAT +:add $absFileT +:module + Lib.A + +|] + +interoScript_projectWithLibAndMain :: Text +interoScript_projectWithLibAndMain = [text| +:cd-ghc $projDirAT +:add Lib.A +:cd-ghc $projDirAT +:add $absFileT +:module + Lib.A + +|] + +interoScript_multipleProjectsWithLib :: Text +interoScript_multipleProjectsWithLib = [text| +:cd-ghc $projDirAT +:add Lib.A +:cd-ghc $projDirBT +:add Lib.B +:module + Lib.A Lib.B + +|] + +-- Expected GHCi Scripts + +ghciScript_projectWithLib :: Text +ghciScript_projectWithLib = [text| +:add Lib.A +:module + Lib.A + +|] + +ghciScript_projectWithMain :: Text +ghciScript_projectWithMain = [text| +:add $absFileT +:module + + +|] + +ghciScript_projectWithLibAndMain :: Text +ghciScript_projectWithLibAndMain = [text| +:add Lib.A +:add $absFileT +:module + Lib.A + +|] + +ghciScript_multipleProjectsWithLib :: Text +ghciScript_multipleProjectsWithLib = [text| +:add Lib.A +:add Lib.B +:module + Lib.A Lib.B + +|] + +-- Expected Legacy GHCi scripts + +ghciLegacyScript_projectWithMain :: Text +ghciLegacyScript_projectWithMain = [text| +:add +:add $absFileT +:module + +|] + +ghciLegacyScript_projectWithLibAndMain :: Text +ghciLegacyScript_projectWithLibAndMain = [text| +:add Lib.A +:add $absFileT +:module + Lib.A +|] + +ghciLegacyScript_multipleProjectsWithLib :: Text +ghciLegacyScript_multipleProjectsWithLib = [text| +:add Lib.A Lib.B + +:module + Lib.A Lib.B +|] + +-- Sample GHCi load configs + +packages_singlePackage :: [GhciPkgInfo] +packages_singlePackage = + [ GhciPkgInfo + { ghciPkgModules = S.fromList [ModuleName.fromString "Lib.A"] + , ghciPkgDir = projDirA + , ghciPkgName = $(mkPackageName "package-a") + , ghciPkgOpts = [] + , ghciPkgModFiles = S.empty + , ghciPkgCFiles = S.empty + , ghciPkgMainIs = M.empty + , ghciPkgTargetFiles = Nothing + , ghciPkgPackage = + Package + { packageName = $(mkPackageName "package-a") + , packageVersion = $(mkVersion "0.1.0.0") + , packageLicense = BSD3 + , packageFiles = GetPackageFiles undefined + , packageDeps = M.empty + , packageTools = [] + , packageAllDeps = S.empty + , packageGhcOptions = [] + , packageFlags = M.empty + , packageDefaultFlags = M.empty + , packageHasLibrary = True + , packageTests = M.empty + , packageBenchmarks = S.empty + , packageExes = S.empty + , packageOpts = GetPackageOpts undefined + , packageHasExposedModules = True + , packageBuildType = Just Simple + , packageSetupDeps = Nothing + } + } + ] + +packages_multiplePackages :: [GhciPkgInfo] +packages_multiplePackages = + [ GhciPkgInfo + { ghciPkgModules = S.fromList [ModuleName.fromString "Lib.A"] + , ghciPkgDir = projDirA + , ghciPkgName = $(mkPackageName "package-a") + , ghciPkgOpts = [] + , ghciPkgModFiles = S.empty + , ghciPkgCFiles = S.empty + , ghciPkgMainIs = M.empty + , ghciPkgTargetFiles = Nothing + , ghciPkgPackage = + Package + { packageName = $(mkPackageName "package-a") + , packageVersion = $(mkVersion "0.1.0.0") + , packageLicense = BSD3 + , packageFiles = GetPackageFiles undefined + , packageDeps = M.empty + , packageTools = [] + , packageAllDeps = S.empty + , packageGhcOptions = [] + , packageFlags = M.empty + , packageDefaultFlags = M.empty + , packageHasLibrary = True + , packageTests = M.empty + , packageBenchmarks = S.empty + , packageExes = S.empty + , packageOpts = GetPackageOpts undefined + , packageHasExposedModules = True + , packageBuildType = Just Simple + , packageSetupDeps = Nothing + } + } + , GhciPkgInfo + { ghciPkgModules = S.fromList [ModuleName.fromString "Lib.B"] + , ghciPkgDir = projDirB + , ghciPkgName = $(mkPackageName "package-b") + , ghciPkgOpts = [] + , ghciPkgModFiles = S.empty + , ghciPkgCFiles = S.empty + , ghciPkgMainIs = M.empty + , ghciPkgTargetFiles = Nothing + , ghciPkgPackage = + Package + { packageName = $(mkPackageName "package-b") + , packageVersion = $(mkVersion "0.1.0.0") + , packageLicense = BSD3 + , packageFiles = GetPackageFiles undefined + , packageDeps = M.empty + , packageTools = [] + , packageAllDeps = S.empty + , packageGhcOptions = [] + , packageFlags = M.empty + , packageDefaultFlags = M.empty + , packageHasLibrary = True + , packageTests = M.empty + , packageBenchmarks = S.empty + , packageExes = S.empty + , packageOpts = GetPackageOpts undefined + , packageHasExposedModules = True + , packageBuildType = Just Simple + , packageSetupDeps = Nothing + } + } + ] +-}
@@ -0,0 +1,166 @@+{-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE OverloadedStrings #-} + +module Stack.LockSpec + ( toBlobKey + , decodeSHA + , decodeLocked + , spec + ) where + +import Data.Aeson.WarningParser ( WithJSONWarnings (..) ) +import qualified Data.Yaml as Yaml +import Distribution.Types.PackageName ( mkPackageName ) +import Distribution.Types.Version ( mkVersion ) +import Pantry + ( BlobKey (..), FileSize (..), PackageIdentifier (..) + , PackageLocationImmutable (..), PackageMetadata (..) + , RawPackageLocationImmutable (..), RawPackageMetadata (..) + , Repo (..), RepoType (..), SHA256, TreeKey (..) + , resolvePaths + ) +import qualified Pantry.SHA256 as SHA256 +import RIO ( ByteString, displayException, throwIO, unless ) +import Stack.Lock ( Locked (..), LockedLocation (..) ) +import Test.Hspec ( Spec, it, shouldBe ) +import Text.RawString.QQ ( r ) + +toBlobKey :: ByteString -> Word -> BlobKey +toBlobKey string size = BlobKey (decodeSHA string) (FileSize size) + +decodeSHA :: ByteString -> SHA256 +decodeSHA string = + case SHA256.fromHexBytes string of + Right csha -> csha + Left err -> error $ "Failed decoding. Error: " <> displayException err + +decodeLocked :: ByteString -> IO Locked +decodeLocked bs = do + val <- Yaml.decodeThrow bs + case Yaml.parseEither Yaml.parseJSON val of + Left err -> throwIO $ Yaml.AesonException err + Right (WithJSONWarnings res warnings) -> do + unless (null warnings) $ + throwIO $ Yaml.AesonException $ "Unexpected warnings: " ++ show warnings + -- we just assume no file references + resolvePaths Nothing res + +spec :: Spec +spec = do + it "parses lock file (empty with GHC resolver)" $ do + let lockFile :: ByteString + lockFile = + [r|#some +snapshots: +- completed: + compiler: ghc-8.6.5 + original: + compiler: ghc-8.6.5 +packages: [] +|] + pkgImm <- lckPkgImmutableLocations <$> decodeLocked lockFile + pkgImm `shouldBe` [] + it "parses lock file (empty with LTS resolver)" $ do + let lockFile :: ByteString + lockFile = + [r|#some +snapshots: +- completed: + size: 527801 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/22.yaml + sha256: 7c8b1853da784bd7beb8728168bf4e879d8a2f6daf408ca0fa7933451864a96a + original: lts-14.27 +- completed: + compiler: ghc-8.6.5 + original: + compiler: ghc-8.6.5 +packages: [] +|] + pkgImm <- lckPkgImmutableLocations <$> decodeLocked lockFile + pkgImm `shouldBe` [] + it "parses lock file (LTS, wai + warp)" $ do + let lockFile :: ByteString + lockFile = + [r|#some +snapshots: +- completed: + size: 527801 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/22.yaml + sha256: 7c8b1853da784bd7beb8728168bf4e879d8a2f6daf408ca0fa7933451864a96a + original: lts-14.27 +- completed: + compiler: ghc-8.6.5 + original: + compiler: ghc-8.6.5 +packages: +- original: + subdir: wai + git: https://github.com/yesodweb/wai.git + commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 + completed: + subdir: wai + name: wai + version: 3.2.1.2 + git: https://github.com/yesodweb/wai.git + pantry-tree: + size: 714 + sha256: ecfd0b4b75f435a3f362394807b35e5ef0647b1a25005d44a3632c49db4833d2 + commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 +- original: + subdir: warp + git: https://github.com/yesodweb/wai.git + commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 + completed: + subdir: warp + name: warp + version: 3.2.25 + git: https://github.com/yesodweb/wai.git + pantry-tree: + size: 5103 + sha256: f808e075811b002563d24c393ce115be826bb66a317d38da22c513ee42b7443a + commit: d11d63f1a6a92db8c637a8d33e7953ce6194a3e0 +|] + pkgImm <- lckPkgImmutableLocations <$> decodeLocked lockFile + let waiSubdirRepo subdir = + Repo { repoType = RepoGit + , repoUrl = "https://github.com/yesodweb/wai.git" + , repoCommit = + "d11d63f1a6a92db8c637a8d33e7953ce6194a3e0" + , repoSubdir = subdir + } + emptyRPM = RawPackageMetadata { rpmName = Nothing + , rpmVersion = Nothing + , rpmTreeKey = Nothing + } + pkgImm `shouldBe` + [ LockedLocation + (RPLIRepo (waiSubdirRepo "wai") emptyRPM) + (PLIRepo (waiSubdirRepo "wai") + (PackageMetadata { pmIdent = + PackageIdentifier + { pkgName = mkPackageName "wai" + , pkgVersion = mkVersion [3, 2, 1, 2] + } + , pmTreeKey = + TreeKey + (BlobKey + (decodeSHA + "ecfd0b4b75f435a3f362394807b35e5ef0647b1a25005d44a3632c49db4833d2") + (FileSize 714)) + })) + , LockedLocation + (RPLIRepo (waiSubdirRepo "warp") emptyRPM) + (PLIRepo (waiSubdirRepo "warp") + (PackageMetadata { pmIdent = + PackageIdentifier + { pkgName = mkPackageName "warp" + , pkgVersion = mkVersion [3, 2, 25] + } + , pmTreeKey = + TreeKey + (BlobKey + (decodeSHA + "f808e075811b002563d24c393ce115be826bb66a317d38da22c513ee42b7443a") + (FileSize 5103)) + })) + ]
@@ -0,0 +1,113 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +module Stack.NixSpec + ( sampleConfigNixEnabled + , sampleConfigNixDisabled + , setup + , spec + ) where + +import Data.Maybe ( fromJust ) +import Options.Applicative + ( defaultPrefs, execParserPure, getParseResult, info ) +import Prelude ( writeFile ) +import Stack.Config ( loadConfig ) +import Stack.Config.Nix ( nixCompiler ) +import Stack.Constants ( osIsWindows, stackDotYaml ) +import Stack.Options.GlobalParser ( globalOptsFromMonoid ) +import Stack.Options.NixParser ( nixOptsParser ) +import Stack.Prelude +import Stack.Runners ( withRunnerGlobal ) +import Stack.Types.Config ( Config (..) ) +import Stack.Types.ConfigMonoid ( ConfigMonoid (..) ) +import Stack.Types.GlobalOpts ( GlobalOpts (..) ) +import Stack.Types.GlobalOptsMonoid ( GlobalOptsMonoid (..) ) +import Stack.Types.Nix ( NixOpts (..) ) +import System.Directory ( getCurrentDirectory, setCurrentDirectory ) +import System.Environment ( unsetEnv ) +import Test.Hspec ( Spec, around_, beforeAll, describe, it, shouldBe ) + +sampleConfigNixEnabled :: String +sampleConfigNixEnabled = + "resolver: lts-19.22\n" ++ + "packages: ['.']\n" ++ + "system-ghc: true\n" ++ + "nix:\n" ++ + " enable: True\n" ++ + " packages: [glpk]" + +sampleConfigNixDisabled :: String +sampleConfigNixDisabled = + "resolver: lts-19.22\n" ++ + "packages: ['.']\n" ++ + "nix:\n" ++ + " enable: False" + +setup :: IO () +setup = unsetEnv "STACK_YAML" + +spec :: Spec +spec = beforeAll setup $ do + let loadConfig' :: ConfigMonoid -> (Config -> IO ()) -> IO () + loadConfig' cmdLineArgs inner = do + globalOpts <- globalOptsFromMonoid False mempty { globalMonoidConfigMonoid = cmdLineArgs } + withRunnerGlobal globalOpts { globalLogLevel = LevelOther "silent" } $ + loadConfig (liftIO . inner) + inTempDir test = do + currentDirectory <- getCurrentDirectory + withSystemTempDirectory "Stack_ConfigSpec" $ \tempDir -> do + let enterDir = setCurrentDirectory tempDir + exitDir = setCurrentDirectory currentDirectory + bracket_ enterDir exitDir test + withStackDotYaml config test = inTempDir $ do + writeFile (toFilePath stackDotYaml) config + test + parseNixOpts cmdLineOpts = fromJust $ getParseResult $ execParserPure + defaultPrefs + (info (nixOptsParser False) mempty) + cmdLineOpts + parseOpts cmdLineOpts = mempty { configMonoidNixOpts = parseNixOpts cmdLineOpts } + let trueOnNonWindows = not osIsWindows + describe "nix disabled in config file" $ + around_ (withStackDotYaml sampleConfigNixDisabled) $ do + it "sees that the nix shell is not enabled" $ loadConfig' mempty $ \config -> + nixEnable (configNix config) `shouldBe` False + describe "--nix given on command line" $ + it "sees that the nix shell is enabled" $ + loadConfig' (parseOpts ["--nix"]) $ \config -> + nixEnable (configNix config) `shouldBe` trueOnNonWindows + describe "--nix-pure given on command line" $ + it "sees that the nix shell is enabled" $ + loadConfig' (parseOpts ["--nix-pure"]) $ \config -> + nixEnable (configNix config) `shouldBe` trueOnNonWindows + describe "--no-nix given on command line" $ + it "sees that the nix shell is not enabled" $ + loadConfig' (parseOpts ["--no-nix"]) $ \config -> + nixEnable (configNix config) `shouldBe` False + describe "--no-nix-pure given on command line" $ + it "sees that the nix shell is not enabled" $ + loadConfig' (parseOpts ["--no-nix-pure"]) $ \config -> + nixEnable (configNix config) `shouldBe` False + describe "nix enabled in config file" $ + around_ (withStackDotYaml sampleConfigNixEnabled) $ do + it "sees that the nix shell is enabled" $ + loadConfig' mempty $ \config -> + nixEnable (configNix config) `shouldBe` trueOnNonWindows + describe "--no-nix given on command line" $ + it "sees that the nix shell is not enabled" $ + loadConfig' (parseOpts ["--no-nix"]) $ \config -> + nixEnable (configNix config) `shouldBe` False + describe "--nix-pure given on command line" $ + it "sees that the nix shell is enabled" $ + loadConfig' (parseOpts ["--nix-pure"]) $ \config -> + nixEnable (configNix config) `shouldBe` trueOnNonWindows + describe "--no-nix-pure given on command line" $ + it "sees that the nix shell is enabled" $ + loadConfig' (parseOpts ["--no-nix-pure"]) $ \config -> + nixEnable (configNix config) `shouldBe` trueOnNonWindows + it "sees that the only package asked for is glpk and asks for the correct GHC derivation" $ loadConfig' mempty $ \config -> do + nixPackages (configNix config) `shouldBe` ["glpk"] + v <- parseVersionThrowing "9.0.2" + ghc <- either throwIO pure $ nixCompiler (WCGhc v) + ghc `shouldBe` "haskell.compiler.ghc902"
@@ -0,0 +1,284 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +module Stack.PackageDumpSpec + ( main + , spec + , bestPrune + , checkDepsPresent + , runEnvNoLogging + ) where + +import Conduit ( withSourceFile, yield ) +import qualified Data.Conduit.List as CL +import Data.Conduit.Text ( decodeUtf8 ) +import qualified Data.Map as Map +import qualified Data.Set as Set +import Distribution.License ( License (..) ) +import Distribution.Types.PackageName ( mkPackageName ) +import Distribution.Version ( mkVersion ) +import Path ( parseAbsFile ) +import RIO.PrettyPrint.Simple ( SimplePrettyApp, mkSimplePrettyApp ) +import RIO.Process + ( envVarsL, findExecutable, mkDefaultProcessContext + , mkProcessContext + ) +import Stack.PackageDump + ( DumpPackage (..), conduitDumpPackage, eachPair + , eachSection, ghcPkgDump, pruneDeps, sinkMatching + ) +import Stack.Prelude +import Stack.Types.CompilerPaths ( GhcPkgExe (..) ) +import Stack.Types.GhcPkgId ( parseGhcPkgId ) +import Test.Hspec + ( Spec, describe, hspec, it, shouldBe ) +import Test.Hspec.QuickCheck ( prop ) + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "eachSection" $ do + let test name content expected = it name $ do + actual <- runConduit $ yield content .| eachSection CL.consume .| CL.consume + actual `shouldBe` expected + test + "unix line endings" + "foo\nbar\n---\nbaz---\nbin\n---\n" + [ ["foo", "bar"] + , ["baz---", "bin"] + ] + test + "windows line endings" + "foo\r\nbar\r\n---\r\nbaz---\r\nbin\r\n---\r\n" + [ ["foo", "bar"] + , ["baz---", "bin"] + ] + + it "eachPair" $ do + let bss = + [ "key1: val1" + , "key2: val2a" + , " val2b" + , "key3:" + , "key4:" + , " val4a" + , " val4b" + ] + sink k = fmap (k, ) CL.consume + actual <- runConduit $ mapM_ yield bss .| eachPair sink .| CL.consume + actual `shouldBe` + [ ("key1", ["val1"]) + , ("key2", ["val2a", "val2b"]) + , ("key3", []) + , ("key4", ["val4a", "val4b"]) + ] + + describe "conduitDumpPackage" $ do + it "ghc 7.8" $ do + haskell2010:_ <- + withSourceFile "tests/unit/package-dump/ghc-7.8.txt" $ \src -> + runConduit + $ src + .| decodeUtf8 + .| conduitDumpPackage + .| CL.consume + ghcPkgId <- parseGhcPkgId "haskell2010-1.1.2.0-05c8dd51009e08c6371c82972d40f55a" + packageIdent <- maybe (fail "Not parsable package id") pure $ + parsePackageIdentifier "haskell2010-1.1.2.0" + depends <- mapM parseGhcPkgId + [ "array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b" + , "base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1" + , "ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37" + ] + haskell2010 { dpExposedModules = mempty } `shouldBe` DumpPackage + { dpGhcPkgId = ghcPkgId + , dpPackageIdent = packageIdent + , dpParentLibIdent = Nothing + , dpLicense = Just BSD3 + , dpLibDirs = ["/opt/ghc/7.8.4/lib/ghc-7.8.4/haskell2010-1.1.2.0"] + , dpDepends = depends + , dpLibraries = ["HShaskell2010-1.1.2.0"] + , dpHasExposedModules = True + , dpHaddockInterfaces = ["/opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0/haskell2010.haddock"] + , dpHaddockHtml = Just "/opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0" + , dpIsExposed = False + , dpExposedModules = mempty + } + + it "ghc 7.10" $ do + haskell2010:_ <- + withSourceFile "tests/unit/package-dump/ghc-7.10.txt" $ \src -> + runConduit + $ src + .| decodeUtf8 + .| conduitDumpPackage + .| CL.consume + ghcPkgId <- parseGhcPkgId "ghc-7.10.1-325809317787a897b7a97d646ceaa3a3" + pkgIdent <- maybe (fail "Not parsable package id") pure $ + parsePackageIdentifier "ghc-7.10.1" + depends <- mapM parseGhcPkgId + [ "array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9" + , "base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a" + , "bin-package-db-0.0.0.0-708fc7d634a370b311371a5bcde40b62" + , "bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db" + , "containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d" + , "directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0" + , "filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6" + , "hoopl-3.10.0.2-8c8dfc4c3140e5f7c982da224c3cb1f0" + , "hpc-0.6.0.2-ac9064885aa8cb08a93314222939ead4" + , "process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1" + , "template-haskell-2.10.0.0-e895139a0ffff267d412e3d0191ce93b" + , "time-1.5.0.1-e17a9220d438435579d2914e90774246" + , "transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f" + , "unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f" + ] + haskell2010 { dpExposedModules = mempty } `shouldBe` DumpPackage + { dpGhcPkgId = ghcPkgId + , dpPackageIdent = pkgIdent + , dpParentLibIdent = Nothing + , dpLicense = Just BSD3 + , dpLibDirs = ["/opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY"] + , dpHaddockInterfaces = ["/opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1/ghc.haddock"] + , dpHaddockHtml = Just "/opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1" + , dpDepends = depends + , dpLibraries = ["HSghc-7.10.1-EMlWrQ42XY0BNVbSrKixqY"] + , dpHasExposedModules = True + , dpIsExposed = False + , dpExposedModules = mempty + } + it "ghc 7.8.4 (osx)" $ do + hmatrix:_ <- + withSourceFile "tests/unit/package-dump/ghc-7.8.4-osx.txt" $ \src -> + runConduit + $ src + .| decodeUtf8 + .| conduitDumpPackage + .| CL.consume + ghcPkgId <- parseGhcPkgId "hmatrix-0.16.1.5-12d5d21f26aa98774cdd8edbc343fbfe" + pkgId <- maybe (fail "Not parsable package id") pure $ + parsePackageIdentifier "hmatrix-0.16.1.5" + depends <- mapM parseGhcPkgId + [ "array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b" + , "base-4.7.0.2-918c7ac27f65a87103264a9f51652d63" + , "binary-0.7.1.0-108d06eea2ef05e517f9c1facf10f63c" + , "bytestring-0.10.4.0-78bc8f2c724c765c78c004a84acf6cc3" + , "deepseq-1.3.0.2-0ddc77716bd2515426e1ba39f6788a4f" + , "random-1.1-822c19b7507b6ac1aaa4c66731e775ae" + , "split-0.2.2-34cfb851cc3784e22bfae7a7bddda9c5" + , "storable-complex-0.2.2-e962c368d58acc1f5b41d41edc93da72" + , "vector-0.10.12.3-f4222db607fd5fdd7545d3e82419b307"] + hmatrix `shouldBe` DumpPackage + { dpGhcPkgId = ghcPkgId + , dpPackageIdent = pkgId + , dpParentLibIdent = Nothing + , dpLicense = Just BSD3 + , dpLibDirs = + [ "/Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/lib/x86_64-osx-ghc-7.8.4/hmatrix-0.16.1.5" + , "/opt/local/lib/" + , "/usr/local/lib/" + , "C:/Program Files/Example/"] + , dpHaddockInterfaces = ["/Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html/hmatrix.haddock"] + , dpHaddockHtml = Just "/Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html" + , dpDepends = depends + , dpLibraries = ["HShmatrix-0.16.1.5"] + , dpHasExposedModules = True + , dpIsExposed = True + , dpExposedModules = Set.fromList ["Data.Packed","Data.Packed.Vector","Data.Packed.Matrix","Data.Packed.Foreign","Data.Packed.ST","Data.Packed.Development","Numeric.LinearAlgebra","Numeric.LinearAlgebra.LAPACK","Numeric.LinearAlgebra.Algorithms","Numeric.Container","Numeric.LinearAlgebra.Util","Numeric.LinearAlgebra.Devel","Numeric.LinearAlgebra.Data","Numeric.LinearAlgebra.HMatrix","Numeric.LinearAlgebra.Static"] + } + it "ghc HEAD" $ do + ghcBoot:_ <- + withSourceFile "tests/unit/package-dump/ghc-head.txt" $ \src -> + runConduit + $ src + .| decodeUtf8 + .| conduitDumpPackage + .| CL.consume + ghcPkgId <- parseGhcPkgId "ghc-boot-0.0.0.0" + pkgId <- maybe (fail "Not parsable package id") pure $ + parsePackageIdentifier "ghc-boot-0.0.0.0" + depends <- mapM parseGhcPkgId + [ "base-4.9.0.0" + , "binary-0.7.5.0" + , "bytestring-0.10.7.0" + , "directory-1.2.5.0" + , "filepath-1.4.1.0" + ] + ghcBoot `shouldBe` DumpPackage + { dpGhcPkgId = ghcPkgId + , dpPackageIdent = pkgId + , dpParentLibIdent = Nothing + , dpLicense = Just BSD3 + , dpLibDirs = + ["/opt/ghc/head/lib/ghc-7.11.20151213/ghc-boot-0.0.0.0"] + , dpHaddockInterfaces = ["/opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0/ghc-boot.haddock"] + , dpHaddockHtml = Just "/opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0" + , dpDepends = depends + , dpLibraries = ["HSghc-boot-0.0.0.0"] + , dpHasExposedModules = True + , dpIsExposed = True + , dpExposedModules = Set.fromList ["GHC.Lexeme", "GHC.PackageDb"] + } + + + it "sinkMatching" $ runEnvNoLogging $ \pkgexe -> do + m <- ghcPkgDump pkgexe [] + $ conduitDumpPackage + .| sinkMatching (Map.singleton (mkPackageName "transformers") (mkVersion [0, 0, 0, 0, 0, 0, 1])) + case Map.lookup (mkPackageName "base") m of + Nothing -> error "base not present" + Just _ -> pure () + liftIO $ do + Map.lookup (mkPackageName "transformers") m `shouldBe` Nothing + Map.lookup (mkPackageName "ghc") m `shouldBe` Nothing + + describe "pruneDeps" $ do + it "sanity check" $ do + let prunes = + [ ((1, 'a'), []) + , ((1, 'b'), []) + , ((2, 'a'), [(1, 'b')]) + , ((2, 'b'), [(1, 'a')]) + , ((3, 'a'), [(1, 'c')]) + , ((4, 'a'), [(2, 'a')]) + ] + actual = fst <$> pruneDeps fst fst snd bestPrune prunes + actual `shouldBe` Map.fromList + [ (1, (1, 'b')) + , (2, (2, 'a')) + , (4, (4, 'a')) + ] + + prop "invariant holds" $ \prunes' -> + -- Force uniqueness + let prunes = Map.toList $ Map.fromList prunes' + in checkDepsPresent prunes $ fst <$> pruneDeps fst fst snd bestPrune prunes + +type PruneCheck = ((Int, Char), [(Int, Char)]) + +bestPrune :: PruneCheck -> PruneCheck -> PruneCheck +bestPrune x y + | fst x > fst y = x + | otherwise = y + +checkDepsPresent :: [PruneCheck] -> Map Int (Int, Char) -> Bool +checkDepsPresent prunes selected = + all hasDeps $ Set.toList allIds + where + depMap = Map.fromList prunes + allIds = Set.fromList $ Map.elems selected + + hasDeps ident = + case Map.lookup ident depMap of + Nothing -> error "checkDepsPresent: missing in depMap" + Just deps -> Set.null $ Set.difference (Set.fromList deps) allIds + +runEnvNoLogging :: (GhcPkgExe -> RIO SimplePrettyApp a) -> IO a +runEnvNoLogging inner = do + envVars <- view envVarsL <$> mkDefaultProcessContext + menv <- mkProcessContext $ Map.delete "GHC_PACKAGE_PATH" envVars + let find name = runRIO menv (findExecutable name) >>= either throwIO parseAbsFile + pkg <- GhcPkgExe <$> find "ghc-pkg" + app <- mkSimplePrettyApp mempty (Just menv) True 80 mempty + runRIO app (inner pkg)
@@ -0,0 +1,52 @@+{-# LANGUAGE OverloadedStrings #-} + +module Stack.Types.TemplateNameSpec + ( spec + ) where + +import Stack.Types.TemplateName +import Path.Internal +import System.Info (os) +import Test.Hspec + +spec :: Spec +spec = + describe "TemplateName" $ do + describe "parseTemplateNameFromString" $ do + let pathOf s = either error templatePath (parseTemplateNameFromString s) + + it "parses out the TemplatePath" $ do + pathOf "github:user/name" `shouldBe` RepoPath (RepoTemplatePath GitHub "user" "name.hsfiles") + pathOf "bitbucket:user/name" `shouldBe` RepoPath (RepoTemplatePath Bitbucket "user" "name.hsfiles") + pathOf "gitlab:user/name" `shouldBe` RepoPath (RepoTemplatePath GitLab "user" "name.hsfiles") + + pathOf "http://www.com/file" `shouldBe` UrlPath "http://www.com/file" + pathOf "https://www.com/file" `shouldBe` UrlPath "https://www.com/file" + + pathOf "name" `shouldBe` RelPath "name.hsfiles" (Path "name.hsfiles") + pathOf "name.hsfile" `shouldBe` RelPath "name.hsfile.hsfiles" (Path "name.hsfile.hsfiles") + pathOf "name.hsfiles" `shouldBe` RelPath "name.hsfiles" (Path "name.hsfiles") + pathOf "" `shouldBe` RelPath ".hsfiles" (Path ".hsfiles") + + if os == "mingw32" + then do + pathOf "//home/file" `shouldBe` AbsPath (Path "\\\\home\\file.hsfiles") + pathOf "/home/file" `shouldBe` RelPath "/home/file.hsfiles" (Path "\\home\\file.hsfiles") + pathOf "/home/file.hsfiles" `shouldBe` RelPath "/home/file.hsfiles" (Path "\\home\\file.hsfiles") + + pathOf "c:\\home\\file" `shouldBe` AbsPath (Path "C:\\home\\file.hsfiles") + pathOf "with/slash" `shouldBe` RelPath "with/slash.hsfiles" (Path "with\\slash.hsfiles") + + let colonAction = + do + pure $! pathOf "with:colon" + colonAction `shouldThrow` anyErrorCall + + else do + pathOf "//home/file" `shouldBe` AbsPath (Path "/home/file.hsfiles") + pathOf "/home/file" `shouldBe` AbsPath (Path "/home/file.hsfiles") + pathOf "/home/file.hsfiles" `shouldBe` AbsPath (Path "/home/file.hsfiles") + + pathOf "c:\\home\\file" `shouldBe` RelPath "c:\\home\\file.hsfiles" (Path "c:\\home\\file.hsfiles") + pathOf "with/slash" `shouldBe` RelPath "with/slash.hsfiles" (Path "with/slash.hsfiles") + pathOf "with:colon" `shouldBe` RelPath "with:colon.hsfiles" (Path "with:colon.hsfiles")
binary file changed (absent → 273 bytes)
binary file changed (absent → 367 bytes)
@@ -0,0 +1,51 @@+{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} + +module Stack.UploadSpec + ( spec + ) where + +import Data.Bits ((.&.)) +import RIO + ( Bool (..), IO, IsString, Maybe (..), String, ($), finally + , readFileBinary, replicateM_, runRIO, unless + , withSystemTempDirectory + ) +import RIO.Directory + ( emptyPermissions, getPermissions, setOwnerReadable + , setOwnerWritable + ) +import RIO.FilePath ( (</>) ) +import Stack.Upload + ( HackageKey (..), maybeGetHackageKey, writeFilePrivate ) +import System.Environment ( setEnv, unsetEnv ) +import System.Permissions ( osIsWindows ) +import System.PosixCompat.Files ( getFileStatus, fileMode ) +import Test.Hspec ( Spec, example, it, shouldBe, shouldReturn ) + +spec :: Spec +spec = do + it "writeFilePrivate" $ example $ withSystemTempDirectory "writeFilePrivate" $ \dir -> replicateM_ 2 $ do + let fp = dir </> "filename" + contents :: IsString s => s + contents = "These are the contents" + writeFilePrivate fp contents + actual <- readFileBinary fp + actual `shouldBe` contents + perms <- getPermissions fp + perms `shouldBe` setOwnerWritable True (setOwnerReadable True emptyPermissions) + + unless osIsWindows $ do + status <- getFileStatus fp + (fileMode status .&. 0o777) `shouldBe` 0o600 + + it "finds a HACKAGE_KEY env variable" $ do + runRIO () maybeGetHackageKey `shouldReturn` Nothing + + withEnv "HACKAGE_KEY" "api_key" + $ runRIO () maybeGetHackageKey `shouldReturn` Just (HackageKey "api_key") + +withEnv :: String -> String -> IO a -> IO a +withEnv k v f = do + setEnv k v + f `finally` unsetEnv k
@@ -0,0 +1,1188 @@+name: ghc +version: 7.10.1 +id: ghc-7.10.1-325809317787a897b7a97d646ceaa3a3 +key: ghc_EMlWrQ42XY0BNVbSrKixqY +license: BSD3 +maintainer: glasgow-haskell-users@haskell.org +homepage: http://www.haskell.org/ghc/ +synopsis: The GHC API +description: + GHC's functionality can be useful for more things than just + compiling Haskell programs. Important use cases are programs + that analyse (and perhaps transform) Haskell code. Others + include loading Haskell code dynamically in a GHCi-like manner. + For this reason, a lot of GHC's functionality is made available + through this package. +category: Development +author: The GHC Team +exposed: False +exposed-modules: + Avail BasicTypes ConLike DataCon PatSyn Demand Debug Exception + GhcMonad Hooks Id IdInfo Lexeme Literal Llvm Llvm.AbsSyn + Llvm.MetaData Llvm.PpLlvm Llvm.Types LlvmCodeGen LlvmCodeGen.Base + LlvmCodeGen.CodeGen LlvmCodeGen.Data LlvmCodeGen.Ppr + LlvmCodeGen.Regs LlvmMangler MkId Module Name NameEnv NameSet + OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet + UnVarGraph BlockId CLabel Cmm CmmBuildInfoTables CmmPipeline + CmmCallConv CmmCommonBlockElim CmmContFlowOpt CmmExpr CmmInfo + CmmLex CmmLint CmmLive CmmMachOp CmmNode CmmOpt CmmParse + CmmProcPoint CmmSink CmmType CmmUtils CmmLayoutStack MkGraph + PprBase PprC PprCmm PprCmmDecl PprCmmExpr Bitmap CodeGen.Platform + CodeGen.Platform.ARM CodeGen.Platform.ARM64 CodeGen.Platform.NoRegs + CodeGen.Platform.PPC CodeGen.Platform.PPC_Darwin + CodeGen.Platform.SPARC CodeGen.Platform.X86 CodeGen.Platform.X86_64 + CgUtils StgCmm StgCmmBind StgCmmClosure StgCmmCon StgCmmEnv + StgCmmExpr StgCmmForeign StgCmmHeap StgCmmHpc StgCmmArgRep + StgCmmLayout StgCmmMonad StgCmmPrim StgCmmProf StgCmmTicky + StgCmmUtils StgCmmExtCode SMRep CoreArity CoreFVs CoreLint CorePrep + CoreSubst CoreSyn TrieMap CoreTidy CoreUnfold CoreUtils MkCore + PprCore Check Coverage Desugar DsArrows DsBinds DsCCall DsExpr + DsForeign DsGRHSs DsListComp DsMonad DsUtils Match MatchCon + MatchLit HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit PlaceHolder + HsPat HsSyn HsTypes HsUtils BinIface BuildTyCl IfaceEnv IfaceSyn + IfaceType LoadIface MkIface TcIface FlagChecker Annotations + BreakArray CmdLineParser CodeOutput Config Constants DriverMkDepend + DriverPhases PipelineMonad DriverPipeline DynFlags ErrUtils Finder + GHC GhcMake GhcPlugins DynamicLoading HeaderInfo HscMain HscStats + HscTypes InteractiveEval InteractiveEvalTypes PackageConfig + Packages PlatformConstants Plugins TcPluginM PprTyThing StaticFlags + StaticPtrTable SysTools TidyPgm Ctype HaddockUtils Lexer + OptCoercion Parser RdrHsSyn ApiAnnotation ForeignCall PrelInfo + PrelNames PrelRules PrimOp TysPrim TysWiredIn CostCentre ProfInit + SCCfinal RnBinds RnEnv RnExpr RnHsDoc RnNames RnPat RnSource + RnSplice RnTypes CoreMonad CSE FloatIn FloatOut LiberateCase + OccurAnal SAT SetLevels SimplCore SimplEnv SimplMonad SimplUtils + Simplify SimplStg StgStats UnariseStg Rules SpecConstr Specialise + CoreToStg StgLint StgSyn CallArity DmdAnal WorkWrap WwLib FamInst + Inst TcAnnotations TcArrows TcBinds TcClassDcl TcDefaults TcDeriv + TcEnv TcExpr TcForeign TcGenDeriv TcGenGenerics TcHsSyn TcHsType + TcInstDcls TcMType TcValidity TcMatches TcPat TcPatSyn TcRnDriver + TcRnMonad TcRnTypes TcRules TcSimplify TcErrors TcTyClsDecls + TcTyDecls TcType TcEvidence TcUnify TcInteract TcCanonical + TcFlatten TcSMonad TcTypeNats TcSplice Class Coercion FamInstEnv + FunDeps InstEnv TyCon CoAxiom Kind Type TypeRep Unify Bag Binary + BooleanFormula BufWrite Digraph Encoding FastBool FastFunctions + FastMutInt FastString FastTypes Fingerprint FiniteMap GraphBase + GraphColor GraphOps GraphPpr IOEnv ListSetOps Maybes MonadUtils + OrdList Outputable Pair Panic Pretty Serialized State Stream + StringBuffer UniqFM UniqSet Util ExtsCompat46 + Vectorise.Builtins.Base Vectorise.Builtins.Initialise + Vectorise.Builtins Vectorise.Monad.Base Vectorise.Monad.Naming + Vectorise.Monad.Local Vectorise.Monad.Global + Vectorise.Monad.InstEnv Vectorise.Monad Vectorise.Utils.Base + Vectorise.Utils.Closure Vectorise.Utils.Hoisting + Vectorise.Utils.PADict Vectorise.Utils.Poly Vectorise.Utils + Vectorise.Generic.Description Vectorise.Generic.PAMethods + Vectorise.Generic.PADict Vectorise.Generic.PData Vectorise.Type.Env + Vectorise.Type.Type Vectorise.Type.TyConDecl + Vectorise.Type.Classify Vectorise.Convert Vectorise.Vect + Vectorise.Var Vectorise.Env Vectorise.Exp Vectorise Hoopl.Dataflow + Hoopl AsmCodeGen TargetReg NCGMonad Instruction Size Reg RegClass + PIC Platform CPrim X86.Regs X86.RegInfo X86.Instr X86.Cond X86.Ppr + X86.CodeGen PPC.Regs PPC.RegInfo PPC.Instr PPC.Cond PPC.Ppr + PPC.CodeGen SPARC.Base SPARC.Regs SPARC.Imm SPARC.AddrMode + SPARC.Cond SPARC.Instr SPARC.Stack SPARC.ShortcutJump SPARC.Ppr + SPARC.CodeGen SPARC.CodeGen.Amode SPARC.CodeGen.Base + SPARC.CodeGen.CondCode SPARC.CodeGen.Gen32 SPARC.CodeGen.Gen64 + SPARC.CodeGen.Sanity SPARC.CodeGen.Expand RegAlloc.Liveness + RegAlloc.Graph.Main RegAlloc.Graph.Stats RegAlloc.Graph.ArchBase + RegAlloc.Graph.ArchX86 RegAlloc.Graph.Coalesce RegAlloc.Graph.Spill + RegAlloc.Graph.SpillClean RegAlloc.Graph.SpillCost + RegAlloc.Graph.TrivColorable RegAlloc.Linear.Main + RegAlloc.Linear.JoinToTargets RegAlloc.Linear.State + RegAlloc.Linear.Stats RegAlloc.Linear.FreeRegs + RegAlloc.Linear.StackMap RegAlloc.Linear.Base + RegAlloc.Linear.X86.FreeRegs RegAlloc.Linear.X86_64.FreeRegs + RegAlloc.Linear.PPC.FreeRegs RegAlloc.Linear.SPARC.FreeRegs Dwarf + Dwarf.Types Dwarf.Constants DsMeta Convert ByteCodeAsm ByteCodeGen + ByteCodeInstr ByteCodeItbls ByteCodeLink Debugger LibFFI Linker + ObjLink RtClosureInspect DebuggerUtils +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/ghc-7.10.1 +hs-libraries: HSghc-7.10.1-EMlWrQ42XY0BNVbSrKixqY +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghc_EMlWrQ42XY0BNVbSrKixqY/include +depends: + array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + bin-package-db-0.0.0.0-708fc7d634a370b311371a5bcde40b62 + bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db + containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d + directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 + filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 + hoopl-3.10.0.2-8c8dfc4c3140e5f7c982da224c3cb1f0 + hpc-0.6.0.2-ac9064885aa8cb08a93314222939ead4 + process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1 + template-haskell-2.10.0.0-e895139a0ffff267d412e3d0191ce93b + time-1.5.0.1-e17a9220d438435579d2914e90774246 + transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f + unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1/ghc.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-7.10.1 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: haskeline +version: 0.7.2.1 +id: haskeline-0.7.2.1-a646e1ddf1a755ca5b5775dcb2ef8d8b +key: haske_IlDhIe25uAn0WJY379Nu1M +license: BSD3 +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson <judah.jacobson@gmail.com> +stability: Experimental +homepage: http://trac.haskell.org/haskeline +synopsis: A command-line interface for user input, written in Haskell. +description: + Haskeline provides a user interface for line input in command-line + programs. This library is similar in purpose to readline, but since + it is written in Haskell it is (hopefully) more easily used in other + Haskell programs. + . + Haskeline runs both on POSIX-compatible systems and on Windows. +category: User Interfaces +author: Judah Jacobson +exposed: True +exposed-modules: + System.Console.Haskeline System.Console.Haskeline.Completion + System.Console.Haskeline.MonadException + System.Console.Haskeline.History System.Console.Haskeline.IO +hidden-modules: System.Console.Haskeline.Backend + System.Console.Haskeline.Backend.WCWidth + System.Console.Haskeline.Command + System.Console.Haskeline.Command.Completion + System.Console.Haskeline.Command.History + System.Console.Haskeline.Command.KillRing + System.Console.Haskeline.Directory System.Console.Haskeline.Emacs + System.Console.Haskeline.InputT System.Console.Haskeline.Key + System.Console.Haskeline.LineState System.Console.Haskeline.Monads + System.Console.Haskeline.Prefs System.Console.Haskeline.RunCommand + System.Console.Haskeline.Term System.Console.Haskeline.Command.Undo + System.Console.Haskeline.Vi System.Console.Haskeline.Recover + System.Console.Haskeline.Backend.Posix + System.Console.Haskeline.Backend.Posix.Encoder + System.Console.Haskeline.Backend.DumbTerm + System.Console.Haskeline.Backend.Terminfo +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/haske_IlDhIe25uAn0WJY379Nu1M +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/haske_IlDhIe25uAn0WJY379Nu1M +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/haskeline-0.7.2.1 +hs-libraries: HShaskeline-0.7.2.1-IlDhIe25uAn0WJY379Nu1M +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db + containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d + directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 + filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 + terminfo-0.4.0.1-75199801b414a3f4c9de438be2a4e967 + transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f + unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/haskeline-0.7.2.1/haskeline.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/haskeline-0.7.2.1 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: terminfo +version: 0.4.0.1 +id: terminfo-0.4.0.1-75199801b414a3f4c9de438be2a4e967 +key: termi_7qZwBlx3clR8sTBilJl253 +license: BSD3 +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson <judah.jacobson@gmail.com> +stability: Stable +homepage: https://github.com/judah/terminfo +synopsis: Haskell bindings to the terminfo library. +description: + This library provides an interface to the terminfo database (via bindings to the + curses library). <http://en.wikipedia.org/wiki/Terminfo Terminfo> allows POSIX + systems to interact with a variety of terminals using a standard set of capabilities. +category: User Interfaces +author: Judah Jacobson +exposed: True +exposed-modules: + System.Console.Terminfo System.Console.Terminfo.Base + System.Console.Terminfo.Cursor System.Console.Terminfo.Color + System.Console.Terminfo.Edit System.Console.Terminfo.Effects + System.Console.Terminfo.Keys +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/termi_7qZwBlx3clR8sTBilJl253 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/termi_7qZwBlx3clR8sTBilJl253 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/terminfo-0.4.0.1 +hs-libraries: HSterminfo-0.4.0.1-7qZwBlx3clR8sTBilJl253 +extra-libraries: + tinfo +includes: + ncurses.h term.h +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/terminfo-0.4.0.1/terminfo.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/terminfo-0.4.0.1 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: xhtml +version: 3000.2.1 +id: xhtml-3000.2.1-7de0560ea74b173b7313fc2303cc6c58 +key: xhtml_0mVDYvYGgNUBWShvlDofr1 +license: BSD3 +copyright: Bjorn Bringert 2004-2006, Andy Gill and the Oregon + Graduate Institute of Science and Technology, 1999-2001 +maintainer: Chris Dornan <chris@chrisdornan.com> +stability: Stable +homepage: https://github.com/haskell/xhtml +synopsis: An XHTML combinator library +description: + This package provides combinators for producing + XHTML 1.0, including the Strict, Transitional and + Frameset variants. +category: Web, XML, Pretty Printer +author: Bjorn Bringert +exposed: True +exposed-modules: + Text.XHtml Text.XHtml.Frameset Text.XHtml.Strict + Text.XHtml.Transitional Text.XHtml.Debug Text.XHtml.Table +hidden-modules: Text.XHtml.Strict.Attributes + Text.XHtml.Strict.Elements Text.XHtml.Frameset.Attributes + Text.XHtml.Frameset.Elements Text.XHtml.Transitional.Attributes + Text.XHtml.Transitional.Elements Text.XHtml.BlockTable + Text.XHtml.Extras Text.XHtml.Internals +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/xhtml_0mVDYvYGgNUBWShvlDofr1 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/xhtml_0mVDYvYGgNUBWShvlDofr1 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/xhtml-3000.2.1 +hs-libraries: HSxhtml-3000.2.1-0mVDYvYGgNUBWShvlDofr1 +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/xhtml-3000.2.1/xhtml.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/xhtml-3000.2.1 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: transformers +version: 0.4.2.0 +id: transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f +key: trans_ALYlebOVzVI4kxbFX5SGhm +license: BSD3 +maintainer: Ross Paterson <ross@soi.city.ac.uk> +synopsis: Concrete functor and monad transformers +description: + A portable library of functor and monad transformers, inspired by + the paper \"Functional Programming with Overloading and Higher-Order + Polymorphism\", by Mark P Jones, + in /Advanced School of Functional Programming/, 1995 + (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>). + . + This package contains: + . + * the monad transformer class (in "Control.Monad.Trans.Class") + and IO monad class (in "Control.Monad.IO.Class") + . + * concrete functor and monad transformers, each with associated + operations and functions to lift operations associated with other + transformers. + . + The package can be used on its own in portable Haskell code, in + which case operations need to be manually lifted through transformer + stacks (see "Control.Monad.Trans.Class" for some examples). + Alternatively, it can be used with the non-portable monad classes in + the @mtl@ or @monads-tf@ packages, which automatically lift operations + introduced by monad transformers through other transformers. +category: Control +author: Andy Gill, Ross Paterson +exposed: True +exposed-modules: + Control.Applicative.Backwards Control.Applicative.Lift + Control.Monad.IO.Class Control.Monad.Signatures + Control.Monad.Trans.Class Control.Monad.Trans.Cont + Control.Monad.Trans.Except Control.Monad.Trans.Error + Control.Monad.Trans.Identity Control.Monad.Trans.List + Control.Monad.Trans.Maybe Control.Monad.Trans.Reader + Control.Monad.Trans.RWS Control.Monad.Trans.RWS.Lazy + Control.Monad.Trans.RWS.Strict Control.Monad.Trans.State + Control.Monad.Trans.State.Lazy Control.Monad.Trans.State.Strict + Control.Monad.Trans.Writer Control.Monad.Trans.Writer.Lazy + Control.Monad.Trans.Writer.Strict Data.Functor.Classes + Data.Functor.Compose Data.Functor.Constant Data.Functor.Product + Data.Functor.Reverse Data.Functor.Sum +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/trans_ALYlebOVzVI4kxbFX5SGhm +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/trans_ALYlebOVzVI4kxbFX5SGhm +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/transformers-0.4.2.0 +hs-libraries: HStransformers-0.4.2.0-ALYlebOVzVI4kxbFX5SGhm +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/transformers-0.4.2.0/transformers.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/transformers-0.4.2.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: hoopl +version: 3.10.0.2 +id: hoopl-3.10.0.2-8c8dfc4c3140e5f7c982da224c3cb1f0 +key: hoopl_JxODiSRz1e84NbH6nnZuUk +license: BSD3 +maintainer: nr@cs.tufts.edu +homepage: http://ghc.cs.tufts.edu/hoopl/ +synopsis: A library to support dataflow analysis and optimization +description: + Higher-order optimization library + . + See /Norman Ramsey, Joao Dias, and Simon Peyton Jones./ + <http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"> /(2010)/ for more details. +category: Compilers/Interpreters +author: Norman Ramsey, Joao Dias, Simon Marlow and Simon Peyton Jones +exposed: True +exposed-modules: + Compiler.Hoopl Compiler.Hoopl.Internals Compiler.Hoopl.Wrappers + Compiler.Hoopl.Passes.Dominator Compiler.Hoopl.Passes.DList +hidden-modules: Compiler.Hoopl.Checkpoint + Compiler.Hoopl.Collections Compiler.Hoopl.Combinators + Compiler.Hoopl.Dataflow Compiler.Hoopl.Debug Compiler.Hoopl.Block + Compiler.Hoopl.Graph Compiler.Hoopl.Label Compiler.Hoopl.MkGraph + Compiler.Hoopl.Fuel Compiler.Hoopl.Pointed Compiler.Hoopl.Shape + Compiler.Hoopl.Show Compiler.Hoopl.Unique Compiler.Hoopl.XUtil +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hoopl_JxODiSRz1e84NbH6nnZuUk +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hoopl_JxODiSRz1e84NbH6nnZuUk +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/hoopl-3.10.0.2 +hs-libraries: HShoopl-3.10.0.2-JxODiSRz1e84NbH6nnZuUk +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hoopl-3.10.0.2/hoopl.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hoopl-3.10.0.2 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: bin-package-db +version: 0.0.0.0 +id: bin-package-db-0.0.0.0-708fc7d634a370b311371a5bcde40b62 +key: binpa_JNoexmBMuO8C771QaIy3YN +license: BSD3 +maintainer: ghc-devs@haskell.org +synopsis: The GHC compiler's view of the GHC package database format +description: + This library is shared between GHC and ghc-pkg and is used by + GHC to read package databases. + . + It only deals with the subset of the package database that the + compiler cares about: modules paths etc and not package + metadata like description, authors etc. It is thus not a + library interface to ghc-pkg and is *not* suitable for + modifying GHC package databases. + . + The package database format and this library are constructed in + such a way that while ghc-pkg depends on Cabal, the GHC library + and program do not have to depend on Cabal. +exposed: True +exposed-modules: + GHC.PackageDb +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binpa_JNoexmBMuO8C771QaIy3YN +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binpa_JNoexmBMuO8C771QaIy3YN +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/bin-package-db-0.0.0.0 +hs-libraries: HSbin-package-db-0.0.0.0-JNoexmBMuO8C771QaIy3YN +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + binary-0.7.3.0-0f543654a1ae447e0d4d0bbfc1bb704e + bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db + directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 + filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0/bin-package-db.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: Cabal +version: 1.22.2.0 +id: Cabal-1.22.2.0-9f7cae2e98cca225e3d159c1e1bc773c +key: Cabal_HWT8QvVfJLn2ubvobpycJY +license: BSD3 +copyright: 2003-2006, Isaac Jones + 2005-2011, Duncan Coutts +maintainer: cabal-devel@haskell.org +homepage: http://www.haskell.org/cabal/ +synopsis: A framework for packaging Haskell software +description: + The Haskell Common Architecture for Building Applications and + Libraries: a framework defining a common interface for authors to more + easily build their Haskell applications in a portable way. + . + The Haskell Cabal is part of a larger infrastructure for distributing, + organizing, and cataloging Haskell libraries and tools. +category: Distribution +author: Isaac Jones <ijones@syntaxpolice.org> + Duncan Coutts <duncan@community.haskell.org> +exposed: True +exposed-modules: + Distribution.Compat.CreatePipe Distribution.Compat.Environment + Distribution.Compat.Exception Distribution.Compat.ReadP + Distribution.Compiler Distribution.InstalledPackageInfo + Distribution.License Distribution.Make Distribution.ModuleName + Distribution.Package Distribution.PackageDescription + Distribution.PackageDescription.Check + Distribution.PackageDescription.Configuration + Distribution.PackageDescription.Parse + Distribution.PackageDescription.PrettyPrint + Distribution.PackageDescription.Utils Distribution.ParseUtils + Distribution.ReadE Distribution.Simple Distribution.Simple.Bench + Distribution.Simple.Build Distribution.Simple.Build.Macros + Distribution.Simple.Build.PathsModule + Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget + Distribution.Simple.CCompiler Distribution.Simple.Command + Distribution.Simple.Compiler Distribution.Simple.Configure + Distribution.Simple.GHC Distribution.Simple.GHCJS + Distribution.Simple.Haddock Distribution.Simple.HaskellSuite + Distribution.Simple.Hpc Distribution.Simple.Install + Distribution.Simple.InstallDirs Distribution.Simple.JHC + Distribution.Simple.LHC Distribution.Simple.LocalBuildInfo + Distribution.Simple.PackageIndex Distribution.Simple.PreProcess + Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program + Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin + Distribution.Simple.Program.Db Distribution.Simple.Program.Find + Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg + Distribution.Simple.Program.Hpc Distribution.Simple.Program.Ld + Distribution.Simple.Program.Run Distribution.Simple.Program.Script + Distribution.Simple.Program.Strip Distribution.Simple.Program.Types + Distribution.Simple.Register Distribution.Simple.Setup + Distribution.Simple.SrcDist Distribution.Simple.Test + Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09 + Distribution.Simple.Test.Log Distribution.Simple.UHC + Distribution.Simple.UserHooks Distribution.Simple.Utils + Distribution.System Distribution.TestSuite Distribution.Text + Distribution.Utils.NubList Distribution.Verbosity + Distribution.Version Language.Haskell.Extension +hidden-modules: Distribution.Compat.Binary + Distribution.Compat.CopyFile Distribution.Compat.TempFile + Distribution.GetOpt Distribution.Simple.GHC.Internal + Distribution.Simple.GHC.IPI641 Distribution.Simple.GHC.IPI642 + Distribution.Simple.GHC.ImplInfo Paths_Cabal +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/Cabal_HWT8QvVfJLn2ubvobpycJY +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/Cabal_HWT8QvVfJLn2ubvobpycJY +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/Cabal-1.22.2.0 +hs-libraries: HSCabal-1.22.2.0-HWT8QvVfJLn2ubvobpycJY +depends: + array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + binary-0.7.3.0-0f543654a1ae447e0d4d0bbfc1bb704e + bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db + containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d + deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 + directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 + filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 + pretty-1.1.2.0-0d4e1eca3b0cfcebe20b9405f7bdaca9 + process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1 + time-1.5.0.1-e17a9220d438435579d2914e90774246 + unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/Cabal-1.22.2.0/Cabal.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/Cabal-1.22.2.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: binary +version: 0.7.3.0 +id: binary-0.7.3.0-0f543654a1ae447e0d4d0bbfc1bb704e +key: binar_EKE3c9Lmxb3DQpU0fPtru6 +license: BSD3 +maintainer: Lennart Kolmodin, Don Stewart <dons00@gmail.com> +stability: provisional +homepage: https://github.com/kolmodin/binary +synopsis: Binary serialisation for Haskell values using lazy ByteStrings +description: + Efficient, pure binary serialisation using lazy ByteStrings. + Haskell values may be encoded to and from binary formats, + written to disk as binary, or sent over the network. + The format used can be automatically generated, or + you can choose to implement a custom format if needed. + Serialisation speeds of over 1 G\/sec have been observed, + so this library should be suitable for high performance + scenarios. +category: Data, Parsing +author: Lennart Kolmodin <kolmodin@gmail.com> +exposed: True +exposed-modules: + Data.Binary Data.Binary.Put Data.Binary.Get + Data.Binary.Get.Internal Data.Binary.Builder + Data.Binary.Builder.Internal +hidden-modules: Data.Binary.Builder.Base Data.Binary.Class + Data.Binary.Generic +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binar_EKE3c9Lmxb3DQpU0fPtru6 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/binar_EKE3c9Lmxb3DQpU0fPtru6 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/binary-0.7.3.0 +hs-libraries: HSbinary-0.7.3.0-EKE3c9Lmxb3DQpU0fPtru6 +depends: + array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db + containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/binary-0.7.3.0/binary.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/binary-0.7.3.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: template-haskell +version: 2.10.0.0 +id: template-haskell-2.10.0.0-e895139a0ffff267d412e3d0191ce93b +key: templ_BVMCZyLwIlfGfcqqzyUAI8 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Support library for Template Haskell +description: + This package provides modules containing facilities for manipulating + Haskell source code using Template Haskell. + . + See <http://www.haskell.org/haskellwiki/Template_Haskell> for more + information. +category: Template Haskell +exposed: True +exposed-modules: + Language.Haskell.TH Language.Haskell.TH.Lib Language.Haskell.TH.Ppr + Language.Haskell.TH.PprLib Language.Haskell.TH.Quote + Language.Haskell.TH.Syntax +hidden-modules: Language.Haskell.TH.Lib.Map +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/templ_BVMCZyLwIlfGfcqqzyUAI8 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/templ_BVMCZyLwIlfGfcqqzyUAI8 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/template-haskell-2.10.0.0 +hs-libraries: HStemplate-haskell-2.10.0.0-BVMCZyLwIlfGfcqqzyUAI8 +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + pretty-1.1.2.0-0d4e1eca3b0cfcebe20b9405f7bdaca9 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/template-haskell-2.10.0.0/template-haskell.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/template-haskell-2.10.0.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: pretty +version: 1.1.2.0 +id: pretty-1.1.2.0-0d4e1eca3b0cfcebe20b9405f7bdaca9 +key: prett_7jIfj8VCGFf1WS0tIQ1XSZ +license: BSD3 +maintainer: David Terei <code@davidterei.com> +stability: Stable +homepage: http://github.com/haskell/pretty +synopsis: Pretty-printing library +description: + This package contains a pretty-printing library, a set of API's + that provides a way to easily print out text in a consistent + format of your choosing. This is useful for compilers and related + tools. + . + This library was originally designed by John Hughes's and has since + been heavily modified by Simon Peyton Jones. +category: Text +exposed: True +exposed-modules: + Text.PrettyPrint Text.PrettyPrint.HughesPJ + Text.PrettyPrint.HughesPJClass +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/prett_7jIfj8VCGFf1WS0tIQ1XSZ +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/prett_7jIfj8VCGFf1WS0tIQ1XSZ +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/pretty-1.1.2.0 +hs-libraries: HSpretty-1.1.2.0-7jIfj8VCGFf1WS0tIQ1XSZ +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 + ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/pretty-1.1.2.0/pretty.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/pretty-1.1.2.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: hpc +version: 0.6.0.2 +id: hpc-0.6.0.2-ac9064885aa8cb08a93314222939ead4 +key: hpc_CmUUQl5bURfBueJrdYfNs3 +license: BSD3 +maintainer: ghc-devs@haskell.org +synopsis: Code Coverage Library for Haskell +description: + This package provides the code coverage library for Haskell. + . + See <http://www.haskell.org/haskellwiki/Haskell_program_coverage> for more + information. +category: Control +author: Andy Gill +exposed: True +exposed-modules: + Trace.Hpc.Util Trace.Hpc.Mix Trace.Hpc.Tix Trace.Hpc.Reflect +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hpc_CmUUQl5bURfBueJrdYfNs3 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/hpc_CmUUQl5bURfBueJrdYfNs3 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/hpc-0.6.0.2 +hs-libraries: HShpc-0.6.0.2-CmUUQl5bURfBueJrdYfNs3 +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d + directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 + filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 + time-1.5.0.1-e17a9220d438435579d2914e90774246 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hpc-0.6.0.2/hpc.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/hpc-0.6.0.2 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: process +version: 1.2.3.0 +id: process-1.2.3.0-3b1e9bca6ac38225806ff7bbf3f845b1 +key: proce_0hwN3CTKynhHQqQkChnSdH +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Process libraries +description: + This package contains libraries for dealing with system processes. +category: System +exposed: True +exposed-modules: + System.Cmd System.Process System.Process.Internals +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/proce_0hwN3CTKynhHQqQkChnSdH +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/proce_0hwN3CTKynhHQqQkChnSdH +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/process-1.2.3.0 +hs-libraries: HSprocess-1.2.3.0-0hwN3CTKynhHQqQkChnSdH +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/proce_0hwN3CTKynhHQqQkChnSdH/include +includes: + runProcess.h +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 + directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 + filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 + unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/process-1.2.3.0/process.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/process-1.2.3.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: directory +version: 1.2.2.0 +id: directory-1.2.2.0-b4959b472d9eee380c6b32291ade29e0 +key: direc_3TcTyYedch32o1zTH2MR00 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Platform-agnostic library for filesystem operations +description: + This library provides a basic set of operations for manipulating files and + directories in a portable way. +category: System +exposed: True +exposed-modules: + System.Directory +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/direc_3TcTyYedch32o1zTH2MR00 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/direc_3TcTyYedch32o1zTH2MR00 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/directory-1.2.2.0 +hs-libraries: HSdirectory-1.2.2.0-3TcTyYedch32o1zTH2MR00 +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/direc_3TcTyYedch32o1zTH2MR00/include +includes: + HsDirectory.h +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 + time-1.5.0.1-e17a9220d438435579d2914e90774246 + unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/directory-1.2.2.0/directory.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/directory-1.2.2.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: unix +version: 2.7.1.0 +id: unix-2.7.1.0-e5915eb989e568b732bc7286b0d0817f +key: unix_G4Yo1pNtYrk8nCq1cx8P9d +license: BSD3 +maintainer: libraries@haskell.org +homepage: https://github.com/haskell/unix +synopsis: POSIX functionality +description: + This package gives you access to the set of operating system + services standardised by POSIX 1003.1b (or the IEEE Portable + Operating System Interface for Computing Environments - + IEEE Std. 1003.1). + . + The package is not supported under Windows (except under Cygwin). +category: System +exposed: True +exposed-modules: + System.Posix System.Posix.ByteString System.Posix.Error + System.Posix.Resource System.Posix.Time System.Posix.Unistd + System.Posix.User System.Posix.Signals System.Posix.Signals.Exts + System.Posix.Semaphore System.Posix.SharedMem + System.Posix.ByteString.FilePath System.Posix.Directory + System.Posix.Directory.ByteString System.Posix.DynamicLinker.Module + System.Posix.DynamicLinker.Module.ByteString + System.Posix.DynamicLinker.Prim + System.Posix.DynamicLinker.ByteString System.Posix.DynamicLinker + System.Posix.Files System.Posix.Files.ByteString System.Posix.IO + System.Posix.IO.ByteString System.Posix.Env + System.Posix.Env.ByteString System.Posix.Fcntl System.Posix.Process + System.Posix.Process.Internals System.Posix.Process.ByteString + System.Posix.Temp System.Posix.Temp.ByteString + System.Posix.Terminal System.Posix.Terminal.ByteString +hidden-modules: System.Posix.Directory.Common + System.Posix.DynamicLinker.Common System.Posix.Files.Common + System.Posix.IO.Common System.Posix.Process.Common + System.Posix.Terminal.Common +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/unix_G4Yo1pNtYrk8nCq1cx8P9d +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/unix_G4Yo1pNtYrk8nCq1cx8P9d +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/unix-2.7.1.0 +hs-libraries: HSunix-2.7.1.0-G4Yo1pNtYrk8nCq1cx8P9d +extra-libraries: + rt util dl pthread +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/unix_G4Yo1pNtYrk8nCq1cx8P9d/include +includes: + HsUnix.h execvpe.h +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db + time-1.5.0.1-e17a9220d438435579d2914e90774246 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/unix-2.7.1.0/unix.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/unix-2.7.1.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: time +version: 1.5.0.1 +id: time-1.5.0.1-e17a9220d438435579d2914e90774246 +key: time_Hh2clZW6in4HpYHx5bLtb7 +license: BSD3 +maintainer: <ashley@semantic.org> +stability: stable +homepage: https://github.com/haskell/time +synopsis: A time library +description: + A time library +category: System +author: Ashley Yakeley +exposed: True +exposed-modules: + Data.Time.Calendar Data.Time.Calendar.MonthDay + Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate + Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Clock + Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime + Data.Time.Format Data.Time +hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days + Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay + Data.Time.Clock.Scale Data.Time.Clock.UTC Data.Time.Clock.CTimeval + Data.Time.Clock.UTCDiff Data.Time.LocalTime.TimeZone + Data.Time.LocalTime.TimeOfDay Data.Time.LocalTime.LocalTime + Data.Time.Format.Parse Data.Time.Format.Locale +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/time_Hh2clZW6in4HpYHx5bLtb7 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/time_Hh2clZW6in4HpYHx5bLtb7 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/time-1.5.0.1 +hs-libraries: HStime-1.5.0.1-Hh2clZW6in4HpYHx5bLtb7 +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/time_Hh2clZW6in4HpYHx5bLtb7/include +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/time-1.5.0.1/time.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/time-1.5.0.1 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: containers +version: 0.5.6.2 +id: containers-0.5.6.2-2114032c163425cc264e6e1169dc2f6d +key: conta_47ajk3tbda43DFWyeF3oHQ +license: BSD3 +maintainer: fox@ucw.cz +synopsis: Assorted concrete container types +description: + This package contains efficient general-purpose implementations + of various basic immutable container types. The declared cost of + each operation is either worst-case or amortized, but remains + valid even if structures are shared. +category: Data Structures +exposed: True +exposed-modules: + Data.IntMap Data.IntMap.Lazy Data.IntMap.Strict Data.IntSet + Data.Map Data.Map.Lazy Data.Map.Strict Data.Set Data.Graph + Data.Sequence Data.Tree +hidden-modules: Data.IntMap.Base Data.IntSet.Base Data.Map.Base + Data.Set.Base Data.Utils.BitUtil Data.Utils.StrictFold + Data.Utils.StrictPair +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/conta_47ajk3tbda43DFWyeF3oHQ +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/conta_47ajk3tbda43DFWyeF3oHQ +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/containers-0.5.6.2 +hs-libraries: HScontainers-0.5.6.2-47ajk3tbda43DFWyeF3oHQ +depends: + array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 + ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2/containers.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/containers-0.5.6.2 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: bytestring +version: 0.10.6.0 +id: bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db +key: bytes_6vj5EoliHgNHISHCVCb069 +license: BSD3 +copyright: Copyright (c) Don Stewart 2005-2009, + (c) Duncan Coutts 2006-2015, + (c) David Roundy 2003-2005, + (c) Jasper Van der Jeugt 2010, + (c) Simon Meier 2010-2013. +maintainer: Duncan Coutts <duncan@community.haskell.org> +homepage: https://github.com/haskell/bytestring +synopsis: Fast, compact, strict and lazy byte strings with a list interface +description: + An efficient compact, immutable byte string type (both strict and lazy) + suitable for binary or 8-bit character data. + . + The 'ByteString' type represents sequences of bytes or 8-bit characters. + It is suitable for high performance use, both in terms of large data + quantities, or high speed requirements. The 'ByteString' functions follow + the same style as Haskell\'s ordinary lists, so it is easy to convert code + from using 'String' to 'ByteString'. + . + Two 'ByteString' variants are provided: + . + * Strict 'ByteString's keep the string as a single large array. This + makes them convenient for passing data between C and Haskell. + . + * Lazy 'ByteString's use a lazy list of strict chunks which makes it + suitable for I\/O streaming tasks. + . + The @Char8@ modules provide a character-based view of the same + underlying 'ByteString' types. This makes it convenient to handle mixed + binary and 8-bit character content (which is common in many file formats + and network protocols). + . + The 'Builder' module provides an efficient way to build up 'ByteString's + in an ad-hoc way by repeated concatenation. This is ideal for fast + serialisation or pretty printing. + . + There is also a 'ShortByteString' type which has a lower memory overhead + and can be converted to or from a 'ByteString', but supports very few + other operations. It is suitable for keeping many short strings in memory. + . + 'ByteString's are not designed for Unicode. For Unicode strings you should + use the 'Text' type from the @text@ package. + . + These modules are intended to be imported qualified, to avoid name clashes + with "Prelude" functions, e.g. + . + > import qualified Data.ByteString as BS +category: Data +author: Don Stewart, + Duncan Coutts +exposed: True +exposed-modules: + Data.ByteString Data.ByteString.Char8 Data.ByteString.Unsafe + Data.ByteString.Internal Data.ByteString.Lazy + Data.ByteString.Lazy.Char8 Data.ByteString.Lazy.Internal + Data.ByteString.Short Data.ByteString.Short.Internal + Data.ByteString.Builder Data.ByteString.Builder.Extra + Data.ByteString.Builder.Prim Data.ByteString.Builder.Internal + Data.ByteString.Builder.Prim.Internal Data.ByteString.Lazy.Builder + Data.ByteString.Lazy.Builder.Extras + Data.ByteString.Lazy.Builder.ASCII +hidden-modules: Data.ByteString.Builder.ASCII + Data.ByteString.Builder.Prim.Binary + Data.ByteString.Builder.Prim.ASCII + Data.ByteString.Builder.Prim.Internal.Floating + Data.ByteString.Builder.Prim.Internal.UncheckedShifts + Data.ByteString.Builder.Prim.Internal.Base16 +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/bytes_6vj5EoliHgNHISHCVCb069 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/bytes_6vj5EoliHgNHISHCVCb069 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/bytestring-0.10.6.0 +hs-libraries: HSbytestring-0.10.6.0-6vj5EoliHgNHISHCVCb069 +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/bytes_6vj5EoliHgNHISHCVCb069/include +includes: + fpstring.h +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a + deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 + ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 + integer-gmp-1.0.0.0-3c947e5fb6dca14804d9b2793c521b67 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bytestring-0.10.6.0/bytestring.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/bytestring-0.10.6.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: deepseq +version: 1.4.1.1 +id: deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 +key: deeps_FpR4obOZALU1lutWnrBldi +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Deep evaluation of data structures +description: + This package provides methods for fully evaluating data structures + (\"deep evaluation\"). Deep evaluation is often used for adding + strictness to a program, e.g. in order to force pending exceptions, + remove space leaks, or force lazy I/O to happen. It is also useful + in parallel programs, to ensure pending work does not migrate to the + wrong thread. + . + The primary use of this package is via the 'deepseq' function, a + \"deep\" version of 'seq'. It is implemented on top of an 'NFData' + typeclass (\"Normal Form Data\", data structures with no unevaluated + components) which defines strategies for fully evaluating different + data types. +category: Control +exposed: True +exposed-modules: + Control.DeepSeq +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/deeps_FpR4obOZALU1lutWnrBldi +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/deeps_FpR4obOZALU1lutWnrBldi +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/deepseq-1.4.1.1 +hs-libraries: HSdeepseq-1.4.1.1-FpR4obOZALU1lutWnrBldi +depends: + array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/deepseq-1.4.1.1/deepseq.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/deepseq-1.4.1.1 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: array +version: 0.5.1.0 +id: array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 +key: array_FaHmcBFfuRM8kmZLEY8D5S +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Mutable and immutable arrays +description: + In addition to providing the "Data.Array" module + <http://www.haskell.org/onlinereport/haskell2010/haskellch14.html as specified in the Haskell 2010 Language Report>, + this package also defines the classes 'IArray' of + immutable arrays and 'MArray' of arrays mutable within appropriate + monads, as well as some instances of these classes. +category: Data Structures +exposed: True +exposed-modules: + Data.Array Data.Array.Base Data.Array.IArray Data.Array.IO + Data.Array.IO.Safe Data.Array.IO.Internals Data.Array.MArray + Data.Array.MArray.Safe Data.Array.ST Data.Array.ST.Safe + Data.Array.Storable Data.Array.Storable.Safe + Data.Array.Storable.Internals Data.Array.Unboxed Data.Array.Unsafe +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/array_FaHmcBFfuRM8kmZLEY8D5S +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/array_FaHmcBFfuRM8kmZLEY8D5S +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/array-0.5.1.0 +hs-libraries: HSarray-0.5.1.0-FaHmcBFfuRM8kmZLEY8D5S +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/array-0.5.1.0/array.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/array-0.5.1.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: filepath +version: 1.4.0.0 +id: filepath-1.4.0.0-40d643aa87258c186441a1f8f3e13ca6 +key: filep_5HhyRonfEZoDO205Wm9E4h +license: BSD3 +copyright: Neil Mitchell 2005-2015 +maintainer: Neil Mitchell <ndmitchell@gmail.com> +homepage: https://github.com/haskell/filepath#readme +synopsis: Library for manipulating FilePaths in a cross platform way. +description: + This package provides functionality for manipulating @FilePath@ values, and is shipped with both <https://www.haskell.org/ghc/ GHC> and the <https://www.haskell.org/platform/ Haskell Platform>. It provides three modules: + . + * "System.FilePath.Posix" manipulates POSIX\/Linux style @FilePath@ values (with @\/@ as the path separator). + . + * "System.FilePath.Windows" manipulates Windows style @FilePath@ values (with either @\\@ or @\/@ as the path separator, and deals with drives). + . + * "System.FilePath" is an alias for the module appropriate to your platform. + . + All three modules provide the same API, and the same documentation (calling out differences in the different variants). +category: System +author: Neil Mitchell <ndmitchell@gmail.com> +exposed: True +exposed-modules: + System.FilePath System.FilePath.Posix System.FilePath.Windows +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/filep_5HhyRonfEZoDO205Wm9E4h +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/filep_5HhyRonfEZoDO205Wm9E4h +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/filepath-1.4.0.0 +hs-libraries: HSfilepath-1.4.0.0-5HhyRonfEZoDO205Wm9E4h +depends: + base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/filepath-1.4.0.0/filepath.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/filepath-1.4.0.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: base +version: 4.8.0.0 +id: base-4.8.0.0-1b689eb8d72c4d4cc88f445839c1f01a +key: base_I5BErHzyOm07EBNpKBEeUv +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Basic libraries +description: + This package contains the "Prelude" and its support libraries, + and a large collection of useful libraries ranging from data + structures to parsing combinators and debugging utilities. +category: Prelude +exposed: True +exposed-modules: + Control.Applicative Control.Arrow Control.Category + Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar + Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception + Control.Exception.Base Control.Monad Control.Monad.Fix + Control.Monad.Instances Control.Monad.ST Control.Monad.ST.Lazy + Control.Monad.ST.Lazy.Safe Control.Monad.ST.Lazy.Unsafe + Control.Monad.ST.Safe Control.Monad.ST.Strict + Control.Monad.ST.Unsafe Control.Monad.Zip Data.Bifunctor Data.Bits + Data.Bool Data.Char Data.Coerce Data.Complex Data.Data Data.Dynamic + Data.Either Data.Eq Data.Fixed Data.Foldable Data.Function + Data.Functor Data.Functor.Identity Data.IORef Data.Int Data.Ix + Data.List Data.Maybe Data.Monoid Data.Ord Data.Proxy Data.Ratio + Data.STRef Data.STRef.Lazy Data.STRef.Strict Data.String + Data.Traversable Data.Tuple Data.Type.Bool Data.Type.Coercion + Data.Type.Equality Data.Typeable Data.Typeable.Internal Data.Unique + Data.Version Data.Void Data.Word Debug.Trace Foreign Foreign.C + Foreign.C.Error Foreign.C.String Foreign.C.Types Foreign.Concurrent + Foreign.ForeignPtr Foreign.ForeignPtr.Safe + Foreign.ForeignPtr.Unsafe Foreign.Marshal Foreign.Marshal.Alloc + Foreign.Marshal.Array Foreign.Marshal.Error Foreign.Marshal.Pool + Foreign.Marshal.Safe Foreign.Marshal.Unsafe Foreign.Marshal.Utils + Foreign.Ptr Foreign.Safe Foreign.StablePtr Foreign.Storable GHC.Arr + GHC.Base GHC.Char GHC.Conc GHC.Conc.IO GHC.Conc.Signal + GHC.Conc.Sync GHC.ConsoleHandler GHC.Constants GHC.Desugar GHC.Enum + GHC.Environment GHC.Err GHC.Exception GHC.Exts GHC.Fingerprint + GHC.Fingerprint.Type GHC.Float GHC.Float.ConversionUtils + GHC.Float.RealFracMethods GHC.Foreign GHC.ForeignPtr GHC.GHCi + GHC.Generics GHC.IO GHC.IO.Buffer GHC.IO.BufferedIO GHC.IO.Device + GHC.IO.Encoding GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure + GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types + GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 + GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD + GHC.IO.Handle.Internals GHC.IO.Handle.Text GHC.IO.Handle.Types + GHC.IO.IOMode GHC.IOArray GHC.IORef GHC.IP GHC.Int GHC.List + GHC.MVar GHC.Natural GHC.Num GHC.OldList GHC.PArr GHC.Pack + GHC.Profiling GHC.Ptr GHC.Read GHC.Real GHC.RTS.Flags GHC.ST + GHC.StaticPtr GHC.STRef GHC.Show GHC.Stable GHC.Stack GHC.Stats + GHC.Storable GHC.TopHandler GHC.TypeLits GHC.Unicode GHC.Weak + GHC.Word Numeric Numeric.Natural Prelude System.CPUTime + System.Console.GetOpt System.Environment System.Exit System.IO + System.IO.Error System.IO.Unsafe System.Info System.Mem + System.Mem.StableName System.Mem.Weak System.Posix.Internals + System.Posix.Types System.Timeout Text.ParserCombinators.ReadP + Text.ParserCombinators.ReadPrec Text.Printf Text.Read Text.Read.Lex + Text.Show Text.Show.Functions Unsafe.Coerce GHC.Event +hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp + Data.OldList Foreign.ForeignPtr.Imp + System.Environment.ExecutablePath GHC.Event.Arr GHC.Event.Array + GHC.Event.Clock GHC.Event.Control GHC.Event.EPoll + GHC.Event.IntTable GHC.Event.Internal GHC.Event.KQueue + GHC.Event.Manager GHC.Event.PSQ GHC.Event.Poll GHC.Event.Thread + GHC.Event.TimerManager GHC.Event.Unique +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/base_I5BErHzyOm07EBNpKBEeUv +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/base_I5BErHzyOm07EBNpKBEeUv +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/base-4.8.0.0 +hs-libraries: HSbase-4.8.0.0-I5BErHzyOm07EBNpKBEeUv +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/base_I5BErHzyOm07EBNpKBEeUv/include +includes: + HsBase.h +depends: + builtin_rts ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 + integer-gmp-1.0.0.0-3c947e5fb6dca14804d9b2793c521b67 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/base.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: integer-gmp +version: 1.0.0.0 +id: integer-gmp-1.0.0.0-3c947e5fb6dca14804d9b2793c521b67 +key: integ_2aU3IZNMF9a7mQ0OzsZ0dS +license: BSD3 +maintainer: hvr@gnu.org +synopsis: Integer library based on GMP +category: Numeric, Algebra +author: Herbert Valerio Riedel +exposed: True +exposed-modules: + GHC.Integer GHC.Integer.Logarithms GHC.Integer.Logarithms.Internals + GHC.Integer.GMP.Internals +hidden-modules: GHC.Integer.Type +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/integ_2aU3IZNMF9a7mQ0OzsZ0dS +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/integ_2aU3IZNMF9a7mQ0OzsZ0dS +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/integer-gmp-1.0.0.0 +hs-libraries: HSinteger-gmp-1.0.0.0-2aU3IZNMF9a7mQ0OzsZ0dS +extra-libraries: + gmp +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include +depends: + ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0/integer-gmp.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: ghc-prim +version: 0.4.0.0 +id: ghc-prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 +key: ghcpr_8TmvWUcS1U1IKHT0levwg3 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: GHC primitives +description: + GHC primitives. +category: GHC +exposed: True +exposed-modules: + GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 GHC.Magic + GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim +trusted: False +import-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghcpr_8TmvWUcS1U1IKHT0levwg3 +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/ghcpr_8TmvWUcS1U1IKHT0levwg3 +data-dir: /opt/ghc/7.10.1/share/x86_64-linux-ghc-7.10.1/ghc-prim-0.4.0.0 +hs-libraries: HSghc-prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3 +depends: + builtin_rts +haddock-interfaces: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-prim-0.4.0.0/ghc-prim.haddock +haddock-html: /opt/ghc/7.10.1/share/doc/ghc/html/libraries/ghc-prim-0.4.0.0 +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +--- +name: rts +version: 1.0 +id: builtin_rts +key: rts +license: BSD3 +maintainer: glasgow-haskell-users@haskell.org +exposed: True +trusted: False +library-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/rts +hs-libraries: HSrts Cffi +extra-libraries: + m rt dl +include-dirs: /opt/ghc/7.10.1/lib/ghc-7.10.1/include +includes: + Stg.h +ld-options: "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info" + "-Wl,-u,base_GHCziPtr_Ptr_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info" + "-Wl,-u,base_GHCziInt_I8zh_static_info" + "-Wl,-u,base_GHCziInt_I16zh_static_info" + "-Wl,-u,base_GHCziInt_I32zh_static_info" + "-Wl,-u,base_GHCziInt_I64zh_static_info" + "-Wl,-u,base_GHCziWord_W8zh_static_info" + "-Wl,-u,base_GHCziWord_W16zh_static_info" + "-Wl,-u,base_GHCziWord_W32zh_static_info" + "-Wl,-u,base_GHCziWord_W64zh_static_info" + "-Wl,-u,base_GHCziStable_StablePtr_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" + "-Wl,-u,base_GHCziPtr_Ptr_con_info" + "-Wl,-u,base_GHCziPtr_FunPtr_con_info" + "-Wl,-u,base_GHCziStable_StablePtr_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_False_closure" + "-Wl,-u,ghczmprim_GHCziTypes_True_closure" + "-Wl,-u,base_GHCziPack_unpackCString_closure" + "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" + "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" + "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" + "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure" + "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" + "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure" + "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" + "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" + "-Wl,-u,base_GHCziTopHandler_runIO_closure" + "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" + "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" + "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" + "-Wl,-u,base_GHCziConcziSync_runSparks_closure" + "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure" +pkgroot: "/opt/ghc/7.10.1/lib/ghc-7.10.1" +
@@ -0,0 +1,67 @@+name: hmatrix +version: 0.16.1.5 +id: hmatrix-0.16.1.5-12d5d21f26aa98774cdd8edbc343fbfe +license: BSD3 +copyright: +maintainer: Alberto Ruiz +stability: provisional +homepage: https://github.com/albertoruiz/hmatrix +package-url: +synopsis: Numeric Linear Algebra +description: Linear algebra based on BLAS and LAPACK. + . + The package is organized as follows: + . + ["Numeric.LinearAlgebra.HMatrix"] Starting point and recommended import module for most applications. + . + ["Numeric.LinearAlgebra.Static"] Experimental alternative interface. + . + ["Numeric.LinearAlgebra.Devel"] Tools for extending the library. + . + (Other modules are exposed with hidden documentation for backwards compatibility.) + . + Code examples: <http://dis.um.es/~alberto/hmatrix/hmatrix.html> +category: Math +author: Alberto Ruiz +exposed: True +exposed-modules: Data.Packed Data.Packed.Vector Data.Packed.Matrix + Data.Packed.Foreign Data.Packed.ST Data.Packed.Development + Numeric.LinearAlgebra Numeric.LinearAlgebra.LAPACK + Numeric.LinearAlgebra.Algorithms Numeric.Container + Numeric.LinearAlgebra.Util Numeric.LinearAlgebra.Devel + Numeric.LinearAlgebra.Data Numeric.LinearAlgebra.HMatrix + Numeric.LinearAlgebra.Static +hidden-modules: Data.Packed.Internal Data.Packed.Internal.Common + Data.Packed.Internal.Signatures Data.Packed.Internal.Vector + Data.Packed.Internal.Matrix Data.Packed.IO Numeric.Chain + Numeric.Vectorized Numeric.Vector Numeric.Matrix + Data.Packed.Internal.Numeric Data.Packed.Numeric + Numeric.LinearAlgebra.Util.Convolution + Numeric.LinearAlgebra.Util.CG Numeric.LinearAlgebra.Random + Numeric.Conversion Numeric.Sparse + Numeric.LinearAlgebra.Static.Internal +trusted: False +import-dirs: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/lib/x86_64-osx-ghc-7.8.4/hmatrix-0.16.1.5 +library-dirs: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/lib/x86_64-osx-ghc-7.8.4/hmatrix-0.16.1.5 + /opt/local/lib/ /usr/local/lib/ "C:/Program Files/Example/" +hs-libraries: HShmatrix-0.16.1.5 +extra-libraries: blas lapack +extra-ghci-libraries: +include-dirs: /opt/local/include/ /usr/local/include/ +includes: +depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-918c7ac27f65a87103264a9f51652d63 + binary-0.7.1.0-108d06eea2ef05e517f9c1facf10f63c + bytestring-0.10.4.0-78bc8f2c724c765c78c004a84acf6cc3 + deepseq-1.3.0.2-0ddc77716bd2515426e1ba39f6788a4f + random-1.1-822c19b7507b6ac1aaa4c66731e775ae + split-0.2.2-34cfb851cc3784e22bfae7a7bddda9c5 + storable-complex-0.2.2-e962c368d58acc1f5b41d41edc93da72 + vector-0.10.12.3-f4222db607fd5fdd7545d3e82419b307 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: Accelerate +haddock-interfaces: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html/hmatrix.haddock +haddock-html: /Users/alexbiehl/.stack/snapshots/x86_64-osx/lts-2.13/7.8.4/doc/html
@@ -0,0 +1,1529 @@+name: haskell2010 +version: 1.1.2.0 +id: haskell2010-1.1.2.0-05c8dd51009e08c6371c82972d40f55a +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: http://www.haskell.org/onlinereport/haskell2010/ +package-url: +synopsis: Compatibility with Haskell 2010 +description: This package provides exactly the library modules defined by + the <http://www.haskell.org/onlinereport/haskell2010/ Haskell 2010 standard>. +category: Haskell2010, Prelude +author: +exposed: False +exposed-modules: Prelude Control.Monad Data.Array Data.Bits + Data.Char Data.Complex Data.Int Data.Ix Data.List Data.Maybe + Data.Ratio Data.Word Foreign Foreign.C Foreign.C.Error + Foreign.C.String Foreign.C.Types Foreign.ForeignPtr Foreign.Marshal + Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error + Foreign.Marshal.Utils Foreign.Ptr Foreign.StablePtr + Foreign.Storable Numeric System.Environment System.Exit System.IO + System.IO.Error +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell2010-1.1.2.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell2010-1.1.2.0 +hs-libraries: HShaskell2010-1.1.2.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0/haskell2010.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell2010-1.1.2.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: haskell98 +version: 2.0.0.3 +id: haskell98-2.0.0.3-045e8778b656db76e2c729405eee707b +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: http://www.haskell.org/definition/ +package-url: +synopsis: Compatibility with Haskell 98 +description: This package provides compatibility with the modules of Haskell + 98 and the FFI addendum, by means of wrappers around modules from + the base package (which in many cases have additional features). + However "Prelude", "Numeric" and "Foreign" are provided directly by + the @base@ package. +category: Haskell98, Prelude +author: +exposed: False +exposed-modules: Prelude Array CPUTime Char Complex Directory IO Ix + List Locale Maybe Monad Numeric Random Ratio System Time Bits + CError CForeign CString CTypes ForeignPtr Int MarshalAlloc + MarshalArray MarshalError MarshalUtils Ptr StablePtr Storable Word +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell98-2.0.0.3 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskell98-2.0.0.3 +hs-libraries: HShaskell98-2.0.0.3 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 + old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 + old-time-1.1.0.2-e3f776e97c1a6ff1770b04943a7ef7c6 + process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 + time-1.4.2-9b3076800c33f8382c38628f35717951 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell98-2.0.0.3/haskell98.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskell98-2.0.0.3 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: old-time +version: 1.1.0.2 +id: old-time-1.1.0.2-e3f776e97c1a6ff1770b04943a7ef7c6 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Time library +description: This package provides the old time library. + . + For new projects, the newer + <http://hackage.haskell.org/package/time time library> + is recommended. +category: System +author: +exposed: True +exposed-modules: System.Time +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-time-1.1.0.2 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-time-1.1.0.2 +hs-libraries: HSold-time-1.1.0.2 +extra-libraries: +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-time-1.1.0.2/include +includes: HsTime.h +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-time-1.1.0.2/old-time.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-time-1.1.0.2 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: ghc +version: 7.8.4 +id: ghc-7.8.4-6c4818bc66adb23509058069f781d99a +license: BSD3 +copyright: +maintainer: glasgow-haskell-users@haskell.org +stability: +homepage: http://www.haskell.org/ghc/ +package-url: +synopsis: The GHC API +description: GHC's functionality can be useful for more things than just + compiling Haskell programs. Important use cases are programs + that analyse (and perhaps transform) Haskell code. Others + include loading Haskell code dynamically in a GHCi-like manner. + For this reason, a lot of GHC's functionality is made available + through this package. +category: Development +author: The GHC Team +exposed: False +exposed-modules: Avail BasicTypes ConLike DataCon PatSyn Demand + Exception GhcMonad Hooks Id IdInfo Literal Llvm Llvm.AbsSyn + Llvm.MetaData Llvm.PpLlvm Llvm.Types LlvmCodeGen LlvmCodeGen.Base + LlvmCodeGen.CodeGen LlvmCodeGen.Data LlvmCodeGen.Ppr + LlvmCodeGen.Regs LlvmMangler MkId Module Name NameEnv NameSet + OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet BlockId + CLabel Cmm CmmBuildInfoTables CmmPipeline CmmCallConv + CmmCommonBlockElim CmmContFlowOpt CmmExpr CmmInfo CmmLex CmmLint + CmmLive CmmMachOp CmmNode CmmOpt CmmParse CmmProcPoint + CmmRewriteAssignments CmmSink CmmType CmmUtils CmmLayoutStack + MkGraph PprBase PprC PprCmm PprCmmDecl PprCmmExpr Bitmap + CodeGen.Platform CodeGen.Platform.ARM CodeGen.Platform.NoRegs + CodeGen.Platform.PPC CodeGen.Platform.PPC_Darwin + CodeGen.Platform.SPARC CodeGen.Platform.X86 CodeGen.Platform.X86_64 + CgUtils StgCmm StgCmmBind StgCmmClosure StgCmmCon StgCmmEnv + StgCmmExpr StgCmmForeign StgCmmHeap StgCmmHpc StgCmmArgRep + StgCmmLayout StgCmmMonad StgCmmPrim StgCmmProf StgCmmTicky + StgCmmUtils StgCmmExtCode SMRep CoreArity CoreFVs CoreLint CorePrep + CoreSubst CoreSyn TrieMap CoreTidy CoreUnfold CoreUtils + ExternalCore MkCore MkExternalCore PprCore PprExternalCore Check + Coverage Desugar DsArrows DsBinds DsCCall DsExpr DsForeign DsGRHSs + DsListComp DsMonad DsUtils Match MatchCon MatchLit HsBinds HsDecls + HsDoc HsExpr HsImpExp HsLit HsPat HsSyn HsTypes HsUtils BinIface + BuildTyCl IfaceEnv IfaceSyn IfaceType LoadIface MkIface TcIface + FlagChecker Annotations BreakArray CmdLineParser CodeOutput Config + Constants DriverMkDepend DriverPhases PipelineMonad DriverPipeline + DynFlags ErrUtils Finder GHC GhcMake GhcPlugins DynamicLoading + HeaderInfo HscMain HscStats HscTypes InteractiveEval + InteractiveEvalTypes PackageConfig Packages PlatformConstants + PprTyThing StaticFlags SysTools TidyPgm Ctype HaddockUtils LexCore + Lexer OptCoercion Parser ParserCore ParserCoreUtils RdrHsSyn + ForeignCall PrelInfo PrelNames PrelRules PrimOp TysPrim TysWiredIn + CostCentre ProfInit SCCfinal RnBinds RnEnv RnExpr RnHsDoc RnNames + RnPat RnSource RnSplice RnTypes CoreMonad CSE FloatIn FloatOut + LiberateCase OccurAnal SAT SetLevels SimplCore SimplEnv SimplMonad + SimplUtils Simplify SimplStg StgStats UnariseStg Rules SpecConstr + Specialise CoreToStg StgLint StgSyn DmdAnal WorkWrap WwLib FamInst + Inst TcAnnotations TcArrows TcBinds TcClassDcl TcDefaults TcDeriv + TcEnv TcExpr TcForeign TcGenDeriv TcGenGenerics TcHsSyn TcHsType + TcInstDcls TcMType TcValidity TcMatches TcPat TcPatSyn TcRnDriver + TcRnMonad TcRnTypes TcRules TcSimplify TcErrors TcTyClsDecls + TcTyDecls TcType TcEvidence TcUnify TcInteract TcCanonical TcSMonad + TcTypeNats TcSplice Class Coercion FamInstEnv FunDeps InstEnv TyCon + CoAxiom Kind Type TypeRep Unify Bag Binary BooleanFormula BufWrite + Digraph Encoding FastBool FastFunctions FastMutInt FastString + FastTypes Fingerprint FiniteMap GraphBase GraphColor GraphOps + GraphPpr IOEnv ListSetOps Maybes MonadUtils OrdList Outputable Pair + Panic Pretty Serialized State Stream StringBuffer UniqFM UniqSet + Util ExtsCompat46 Vectorise.Builtins.Base + Vectorise.Builtins.Initialise Vectorise.Builtins + Vectorise.Monad.Base Vectorise.Monad.Naming Vectorise.Monad.Local + Vectorise.Monad.Global Vectorise.Monad.InstEnv Vectorise.Monad + Vectorise.Utils.Base Vectorise.Utils.Closure + Vectorise.Utils.Hoisting Vectorise.Utils.PADict + Vectorise.Utils.Poly Vectorise.Utils Vectorise.Generic.Description + Vectorise.Generic.PAMethods Vectorise.Generic.PADict + Vectorise.Generic.PData Vectorise.Type.Env Vectorise.Type.Type + Vectorise.Type.TyConDecl Vectorise.Type.Classify Vectorise.Convert + Vectorise.Vect Vectorise.Var Vectorise.Env Vectorise.Exp Vectorise + Hoopl.Dataflow Hoopl AsmCodeGen TargetReg NCGMonad Instruction Size + Reg RegClass PIC Platform CPrim X86.Regs X86.RegInfo X86.Instr + X86.Cond X86.Ppr X86.CodeGen PPC.Regs PPC.RegInfo PPC.Instr + PPC.Cond PPC.Ppr PPC.CodeGen SPARC.Base SPARC.Regs SPARC.Imm + SPARC.AddrMode SPARC.Cond SPARC.Instr SPARC.Stack + SPARC.ShortcutJump SPARC.Ppr SPARC.CodeGen SPARC.CodeGen.Amode + SPARC.CodeGen.Base SPARC.CodeGen.CondCode SPARC.CodeGen.Gen32 + SPARC.CodeGen.Gen64 SPARC.CodeGen.Sanity SPARC.CodeGen.Expand + RegAlloc.Liveness RegAlloc.Graph.Main RegAlloc.Graph.Stats + RegAlloc.Graph.ArchBase RegAlloc.Graph.ArchX86 + RegAlloc.Graph.Coalesce RegAlloc.Graph.Spill + RegAlloc.Graph.SpillClean RegAlloc.Graph.SpillCost + RegAlloc.Graph.TrivColorable RegAlloc.Linear.Main + RegAlloc.Linear.JoinToTargets RegAlloc.Linear.State + RegAlloc.Linear.Stats RegAlloc.Linear.FreeRegs + RegAlloc.Linear.StackMap RegAlloc.Linear.Base + RegAlloc.Linear.X86.FreeRegs RegAlloc.Linear.X86_64.FreeRegs + RegAlloc.Linear.PPC.FreeRegs RegAlloc.Linear.SPARC.FreeRegs DsMeta + Convert ByteCodeAsm ByteCodeGen ByteCodeInstr ByteCodeItbls + ByteCodeLink Debugger LibFFI Linker ObjLink RtClosureInspect + DebuggerUtils +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-7.8.4 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-7.8.4 +hs-libraries: HSghc-7.8.4 +extra-libraries: +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-7.8.4/include +includes: +depends: Cabal-1.18.1.5-6478013104bde01737bfd67d34bbee0a + array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + bin-package-db-0.0.0.0-0f3da03684207f2dc4dce793df1db62e + bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 + containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 + directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 + filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab + hoopl-3.10.0.1-267659e4b5b51c3d2e02f2a6d6f46936 + hpc-0.6.0.1-cca17f12dab542e09c423a74a4590c5d + process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 + template-haskell-2.9.0.0-6d27c2b362b15abb1822f2f34b9ae7f9 + time-1.4.2-9b3076800c33f8382c38628f35717951 + transformers-0.3.0.0-6458c21515cab7c1cf21e53141557a1c + unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-7.8.4/ghc.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-7.8.4 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: haskeline +version: 0.7.1.2 +id: haskeline-0.7.1.2-2dd2f2fb537352f5367ae77fe47ab211 +license: BSD3 +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson <judah.jacobson@gmail.com> +stability: Experimental +homepage: http://trac.haskell.org/haskeline +package-url: +synopsis: A command-line interface for user input, written in Haskell. +description: Haskeline provides a user interface for line input in command-line + programs. This library is similar in purpose to readline, but since + it is written in Haskell it is (hopefully) more easily used in other + Haskell programs. + . + Haskeline runs both on POSIX-compatible systems and on Windows. +category: User Interfaces +author: Judah Jacobson +exposed: True +exposed-modules: System.Console.Haskeline + System.Console.Haskeline.Completion + System.Console.Haskeline.MonadException + System.Console.Haskeline.History System.Console.Haskeline.IO +hidden-modules: System.Console.Haskeline.Backend + System.Console.Haskeline.Backend.WCWidth + System.Console.Haskeline.Command + System.Console.Haskeline.Command.Completion + System.Console.Haskeline.Command.History + System.Console.Haskeline.Command.KillRing + System.Console.Haskeline.Directory System.Console.Haskeline.Emacs + System.Console.Haskeline.InputT System.Console.Haskeline.Key + System.Console.Haskeline.LineState System.Console.Haskeline.Monads + System.Console.Haskeline.Prefs System.Console.Haskeline.RunCommand + System.Console.Haskeline.Term System.Console.Haskeline.Command.Undo + System.Console.Haskeline.Vi System.Console.Haskeline.Recover + System.Console.Haskeline.Backend.Posix + System.Console.Haskeline.Backend.Posix.Encoder + System.Console.Haskeline.Backend.DumbTerm + System.Console.Haskeline.Backend.Terminfo +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskeline-0.7.1.2 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/haskeline-0.7.1.2 +hs-libraries: HShaskeline-0.7.1.2 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 + containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 + directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 + filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab + terminfo-0.4.0.0-c1d02a7210b0d1bc250d87463b38b8d1 + transformers-0.3.0.0-6458c21515cab7c1cf21e53141557a1c + unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskeline-0.7.1.2/haskeline.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/haskeline-0.7.1.2 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: terminfo +version: 0.4.0.0 +id: terminfo-0.4.0.0-c1d02a7210b0d1bc250d87463b38b8d1 +license: BSD3 +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson <judah.jacobson@gmail.com> +stability: Stable +homepage: https://github.com/judah/terminfo +package-url: +synopsis: Haskell bindings to the terminfo library. +description: This library provides an interface to the terminfo database (via bindings to the + curses library). <http://en.wikipedia.org/wiki/Terminfo Terminfo> allows POSIX + systems to interact with a variety of terminals using a standard set of capabilities. +category: User Interfaces +author: Judah Jacobson +exposed: True +exposed-modules: System.Console.Terminfo + System.Console.Terminfo.Base System.Console.Terminfo.Cursor + System.Console.Terminfo.Color System.Console.Terminfo.Edit + System.Console.Terminfo.Effects System.Console.Terminfo.Keys +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/terminfo-0.4.0.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/terminfo-0.4.0.0 +hs-libraries: HSterminfo-0.4.0.0 +extra-libraries: tinfo +extra-ghci-libraries: +include-dirs: +includes: ncurses.h term.h +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/terminfo-0.4.0.0/terminfo.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/terminfo-0.4.0.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: xhtml +version: 3000.2.1 +id: xhtml-3000.2.1-6a3ed472b07e58fe29db22a5bc2bdb06 +license: BSD3 +copyright: Bjorn Bringert 2004-2006, Andy Gill and the Oregon + Graduate Institute of Science and Technology, 1999-2001 +maintainer: Chris Dornan <chris@chrisdornan.com> +stability: Stable +homepage: https://github.com/haskell/xhtml +package-url: +synopsis: An XHTML combinator library +description: This package provides combinators for producing + XHTML 1.0, including the Strict, Transitional and + Frameset variants. +category: Web, XML, Pretty Printer +author: Bjorn Bringert +exposed: True +exposed-modules: Text.XHtml Text.XHtml.Frameset Text.XHtml.Strict + Text.XHtml.Transitional Text.XHtml.Debug Text.XHtml.Table +hidden-modules: Text.XHtml.Strict.Attributes + Text.XHtml.Strict.Elements Text.XHtml.Frameset.Attributes + Text.XHtml.Frameset.Elements Text.XHtml.Transitional.Attributes + Text.XHtml.Transitional.Elements Text.XHtml.BlockTable + Text.XHtml.Extras Text.XHtml.Internals +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/xhtml-3000.2.1 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/xhtml-3000.2.1 +hs-libraries: HSxhtml-3000.2.1 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/xhtml-3000.2.1/xhtml.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/xhtml-3000.2.1 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: transformers +version: 0.3.0.0 +id: transformers-0.3.0.0-6458c21515cab7c1cf21e53141557a1c +license: BSD3 +copyright: +maintainer: Ross Paterson <ross@soi.city.ac.uk> +stability: +homepage: +package-url: +synopsis: Concrete functor and monad transformers +description: A portable library of functor and monad transformers, inspired by + the paper \"Functional Programming with Overloading and Higher-Order + Polymorphism\", by Mark P Jones, + in /Advanced School of Functional Programming/, 1995 + (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>). + . + This package contains: + . + * the monad transformer class (in "Control.Monad.Trans.Class") + . + * concrete functor and monad transformers, each with associated + operations and functions to lift operations associated with other + transformers. + . + It can be used on its own in portable Haskell code, or with the monad + classes in the @mtl@ or @monads-tf@ packages, which automatically + lift operations introduced by monad transformers through other + transformers. +category: Control +author: Andy Gill, Ross Paterson +exposed: True +exposed-modules: Control.Applicative.Backwards + Control.Applicative.Lift Control.Monad.IO.Class + Control.Monad.Trans.Class Control.Monad.Trans.Cont + Control.Monad.Trans.Error Control.Monad.Trans.Identity + Control.Monad.Trans.List Control.Monad.Trans.Maybe + Control.Monad.Trans.Reader Control.Monad.Trans.RWS + Control.Monad.Trans.RWS.Lazy Control.Monad.Trans.RWS.Strict + Control.Monad.Trans.State Control.Monad.Trans.State.Lazy + Control.Monad.Trans.State.Strict Control.Monad.Trans.Writer + Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict + Data.Functor.Compose Data.Functor.Constant Data.Functor.Identity + Data.Functor.Product Data.Functor.Reverse +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/transformers-0.3.0.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/transformers-0.3.0.0 +hs-libraries: HStransformers-0.3.0.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/transformers-0.3.0.0/transformers.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/transformers-0.3.0.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: hoopl +version: 3.10.0.1 +id: hoopl-3.10.0.1-267659e4b5b51c3d2e02f2a6d6f46936 +license: BSD3 +copyright: +maintainer: nr@cs.tufts.edu +stability: +homepage: http://ghc.cs.tufts.edu/hoopl/ +package-url: +synopsis: A library to support dataflow analysis and optimization +description: Higher-order optimization library + . + See /Norman Ramsey, Joao Dias, and Simon Peyton Jones./ + <http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"> /(2010)/ for more details. +category: Compilers/Interpreters +author: Norman Ramsey, Joao Dias, Simon Marlow and Simon Peyton Jones +exposed: True +exposed-modules: Compiler.Hoopl Compiler.Hoopl.Internals + Compiler.Hoopl.Wrappers Compiler.Hoopl.Passes.Dominator + Compiler.Hoopl.Passes.DList +hidden-modules: Compiler.Hoopl.Checkpoint + Compiler.Hoopl.Collections Compiler.Hoopl.Combinators + Compiler.Hoopl.Dataflow Compiler.Hoopl.Debug Compiler.Hoopl.Block + Compiler.Hoopl.Graph Compiler.Hoopl.Label Compiler.Hoopl.MkGraph + Compiler.Hoopl.Fuel Compiler.Hoopl.Pointed Compiler.Hoopl.Shape + Compiler.Hoopl.Show Compiler.Hoopl.Unique Compiler.Hoopl.XUtil +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hoopl-3.10.0.1 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hoopl-3.10.0.1 +hs-libraries: HShoopl-3.10.0.1 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hoopl-3.10.0.1/hoopl.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hoopl-3.10.0.1 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: bin-package-db +version: 0.0.0.0 +id: bin-package-db-0.0.0.0-0f3da03684207f2dc4dce793df1db62e +license: BSD3 +copyright: +maintainer: ghc-devs@haskell.org +stability: +homepage: +package-url: +synopsis: A binary format for the package database +description: +category: +author: +exposed: True +exposed-modules: Distribution.InstalledPackageInfo.Binary +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bin-package-db-0.0.0.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bin-package-db-0.0.0.0 +hs-libraries: HSbin-package-db-0.0.0.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: Cabal-1.18.1.5-6478013104bde01737bfd67d34bbee0a + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + binary-0.7.1.0-f867dbbb69966feb9f5c4ef7695a70a5 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0/bin-package-db.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bin-package-db-0.0.0.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: binary +version: 0.7.1.0 +id: binary-0.7.1.0-f867dbbb69966feb9f5c4ef7695a70a5 +license: BSD3 +copyright: +maintainer: Lennart Kolmodin, Don Stewart <dons00@gmail.com> +stability: provisional +homepage: https://github.com/kolmodin/binary +package-url: +synopsis: Binary serialisation for Haskell values using lazy ByteStrings +description: Efficient, pure binary serialisation using lazy ByteStrings. + Haskell values may be encoded to and from binary formats, + written to disk as binary, or sent over the network. + The format used can be automatically generated, or + you can choose to implement a custom format if needed. + Serialisation speeds of over 1 G\/sec have been observed, + so this library should be suitable for high performance + scenarios. +category: Data, Parsing +author: Lennart Kolmodin <kolmodin@gmail.com> +exposed: True +exposed-modules: Data.Binary Data.Binary.Put Data.Binary.Get + Data.Binary.Get.Internal Data.Binary.Builder + Data.Binary.Builder.Internal +hidden-modules: Data.Binary.Builder.Base Data.Binary.Class + Data.Binary.Generic +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/binary-0.7.1.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/binary-0.7.1.0 +hs-libraries: HSbinary-0.7.1.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 + containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/binary-0.7.1.0/binary.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/binary-0.7.1.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: Cabal +version: 1.18.1.5 +id: Cabal-1.18.1.5-6478013104bde01737bfd67d34bbee0a +license: BSD3 +copyright: 2003-2006, Isaac Jones + 2005-2011, Duncan Coutts +maintainer: cabal-devel@haskell.org +stability: +homepage: http://www.haskell.org/cabal/ +package-url: +synopsis: A framework for packaging Haskell software +description: The Haskell Common Architecture for Building Applications and + Libraries: a framework defining a common interface for authors to more + easily build their Haskell applications in a portable way. + . + The Haskell Cabal is part of a larger infrastructure for distributing, + organizing, and cataloging Haskell libraries and tools. +category: Distribution +author: Isaac Jones <ijones@syntaxpolice.org> + Duncan Coutts <duncan@community.haskell.org> +exposed: True +exposed-modules: Distribution.Compat.Environment + Distribution.Compat.Exception Distribution.Compat.ReadP + Distribution.Compiler Distribution.InstalledPackageInfo + Distribution.License Distribution.Make Distribution.ModuleName + Distribution.Package Distribution.PackageDescription + Distribution.PackageDescription.Check + Distribution.PackageDescription.Configuration + Distribution.PackageDescription.Parse + Distribution.PackageDescription.PrettyPrint + Distribution.PackageDescription.Utils Distribution.ParseUtils + Distribution.ReadE Distribution.Simple Distribution.Simple.Bench + Distribution.Simple.Build Distribution.Simple.Build.Macros + Distribution.Simple.Build.PathsModule + Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget + Distribution.Simple.CCompiler Distribution.Simple.Command + Distribution.Simple.Compiler Distribution.Simple.Configure + Distribution.Simple.GHC Distribution.Simple.Haddock + Distribution.Simple.Hpc Distribution.Simple.Hugs + Distribution.Simple.Install Distribution.Simple.InstallDirs + Distribution.Simple.JHC Distribution.Simple.LHC + Distribution.Simple.LocalBuildInfo Distribution.Simple.NHC + Distribution.Simple.PackageIndex Distribution.Simple.PreProcess + Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program + Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin + Distribution.Simple.Program.Db Distribution.Simple.Program.Find + Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg + Distribution.Simple.Program.Hpc Distribution.Simple.Program.Ld + Distribution.Simple.Program.Run Distribution.Simple.Program.Script + Distribution.Simple.Program.Types Distribution.Simple.Register + Distribution.Simple.Setup Distribution.Simple.SrcDist + Distribution.Simple.Test Distribution.Simple.UHC + Distribution.Simple.UserHooks Distribution.Simple.Utils + Distribution.System Distribution.TestSuite Distribution.Text + Distribution.Verbosity Distribution.Version + Language.Haskell.Extension +hidden-modules: Distribution.Compat.CopyFile + Distribution.Compat.TempFile Distribution.GetOpt + Distribution.Simple.GHC.IPI641 Distribution.Simple.GHC.IPI642 + Paths_Cabal +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/Cabal-1.18.1.5 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/Cabal-1.18.1.5 +hs-libraries: HSCabal-1.18.1.5 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 + containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 + deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 + directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 + filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab + pretty-1.1.1.1-0984f47ffe93ef3983c80b96280f1c3a + process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 + time-1.4.2-9b3076800c33f8382c38628f35717951 + unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/Cabal-1.18.1.5/Cabal.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/Cabal-1.18.1.5 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: template-haskell +version: 2.9.0.0 +id: template-haskell-2.9.0.0-6d27c2b362b15abb1822f2f34b9ae7f9 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Support library for Template Haskell +description: This package provides modules containing facilities for manipulating + Haskell source code using Template Haskell. + . + See <http://www.haskell.org/haskellwiki/Template_Haskell> for more + information. +category: Template Haskell +author: +exposed: True +exposed-modules: Language.Haskell.TH Language.Haskell.TH.Lib + Language.Haskell.TH.Ppr Language.Haskell.TH.PprLib + Language.Haskell.TH.Quote Language.Haskell.TH.Syntax +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/template-haskell-2.9.0.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/template-haskell-2.9.0.0 +hs-libraries: HStemplate-haskell-2.9.0.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 + pretty-1.1.1.1-0984f47ffe93ef3983c80b96280f1c3a +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/template-haskell-2.9.0.0/template-haskell.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/template-haskell-2.9.0.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: pretty +version: 1.1.1.1 +id: pretty-1.1.1.1-0984f47ffe93ef3983c80b96280f1c3a +license: BSD3 +copyright: +maintainer: David Terei <code@davidterei.com> +stability: Stable +homepage: http://github.com/haskell/pretty +package-url: +synopsis: Pretty-printing library +description: This package contains a pretty-printing library, a set of API's + that provides a way to easily print out text in a consistent + format of your choosing. This is useful for compilers and related + tools. + . + This library was originally designed by John Hughes's and has since + been heavily modified by Simon Peyton Jones. +category: Text +author: +exposed: True +exposed-modules: Text.PrettyPrint Text.PrettyPrint.HughesPJ +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/pretty-1.1.1.1 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/pretty-1.1.1.1 +hs-libraries: HSpretty-1.1.1.1 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/pretty-1.1.1.1/pretty.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/pretty-1.1.1.1 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: hpc +version: 0.6.0.1 +id: hpc-0.6.0.1-cca17f12dab542e09c423a74a4590c5d +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Code Coverage Library for Haskell +description: This package provides the code coverage library for Haskell. + . + See <http://www.haskell.org/haskellwiki/Haskell_program_coverage> for more + information. +category: Control +author: Andy Gill +exposed: True +exposed-modules: Trace.Hpc.Util Trace.Hpc.Mix Trace.Hpc.Tix + Trace.Hpc.Reflect +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hpc-0.6.0.1 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/hpc-0.6.0.1 +hs-libraries: HShpc-0.6.0.1 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 + directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 + time-1.4.2-9b3076800c33f8382c38628f35717951 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hpc-0.6.0.1/hpc.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/hpc-0.6.0.1 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: process +version: 1.2.0.0 +id: process-1.2.0.0-06c3215a79834ce4886ae686a0f81122 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Process libraries +description: This package contains libraries for dealing with system processes. +category: System +author: +exposed: True +exposed-modules: System.Cmd System.Process System.Process.Internals +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/process-1.2.0.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/process-1.2.0.0 +hs-libraries: HSprocess-1.2.0.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/process-1.2.0.0/include +includes: runProcess.h +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 + directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 + filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab + unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/process-1.2.0.0/process.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/process-1.2.0.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: directory +version: 1.2.1.0 +id: directory-1.2.1.0-07cd1f59e3c6cac5e3e180019c59a115 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: library for directory handling +description: This package provides a library for handling directories. +category: System +author: +exposed: True +exposed-modules: System.Directory +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/directory-1.2.1.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/directory-1.2.1.0 +hs-libraries: HSdirectory-1.2.1.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/directory-1.2.1.0/include +includes: HsDirectory.h +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab + time-1.4.2-9b3076800c33f8382c38628f35717951 + unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/directory-1.2.1.0/directory.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/directory-1.2.1.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: unix +version: 2.7.0.1 +id: unix-2.7.0.1-f8658ba9ec1c4fba8a371a8e0f42ec6c +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: POSIX functionality +description: This package gives you access to the set of operating system + services standardised by POSIX 1003.1b (or the IEEE Portable + Operating System Interface for Computing Environments - + IEEE Std. 1003.1). + . + The package is not supported under Windows (except under Cygwin). +category: System +author: +exposed: True +exposed-modules: System.Posix System.Posix.ByteString + System.Posix.Error System.Posix.Resource System.Posix.Time + System.Posix.Unistd System.Posix.User System.Posix.Signals + System.Posix.Signals.Exts System.Posix.Semaphore + System.Posix.SharedMem System.Posix.ByteString.FilePath + System.Posix.Directory System.Posix.Directory.ByteString + System.Posix.DynamicLinker.Module + System.Posix.DynamicLinker.Module.ByteString + System.Posix.DynamicLinker.Prim + System.Posix.DynamicLinker.ByteString System.Posix.DynamicLinker + System.Posix.Files System.Posix.Files.ByteString System.Posix.IO + System.Posix.IO.ByteString System.Posix.Env + System.Posix.Env.ByteString System.Posix.Process + System.Posix.Process.Internals System.Posix.Process.ByteString + System.Posix.Temp System.Posix.Temp.ByteString + System.Posix.Terminal System.Posix.Terminal.ByteString +hidden-modules: System.Posix.Directory.Common + System.Posix.DynamicLinker.Common System.Posix.Files.Common + System.Posix.IO.Common System.Posix.Process.Common + System.Posix.Terminal.Common +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/unix-2.7.0.1 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/unix-2.7.0.1 +hs-libraries: HSunix-2.7.0.1 +extra-libraries: rt util dl pthread +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/unix-2.7.0.1/include +includes: HsUnix.h execvpe.h +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 + time-1.4.2-9b3076800c33f8382c38628f35717951 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/unix-2.7.0.1/unix.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/unix-2.7.0.1 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: time +version: 1.4.2 +id: time-1.4.2-9b3076800c33f8382c38628f35717951 +license: BSD3 +copyright: +maintainer: <ashley@semantic.org> +stability: stable +homepage: http://semantic.org/TimeLib/ +package-url: +synopsis: A time library +description: A time library +category: System +author: Ashley Yakeley +exposed: True +exposed-modules: Data.Time.Calendar Data.Time.Calendar.MonthDay + Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate + Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Clock + Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime + Data.Time.Format Data.Time +hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days + Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay + Data.Time.Clock.Scale Data.Time.Clock.UTC Data.Time.Clock.CTimeval + Data.Time.Clock.UTCDiff Data.Time.LocalTime.TimeZone + Data.Time.LocalTime.TimeOfDay Data.Time.LocalTime.LocalTime + Data.Time.Format.Parse +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/time-1.4.2 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/time-1.4.2 +hs-libraries: HStime-1.4.2 +extra-libraries: +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/time-1.4.2/include +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 + old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/time-1.4.2/time.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/time-1.4.2 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: old-locale +version: 1.0.0.6 +id: old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: locale library +description: This package provides the ability to adapt to + locale conventions such as date and time formats. +category: System +author: +exposed: True +exposed-modules: System.Locale +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-locale-1.0.0.6 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/old-locale-1.0.0.6 +hs-libraries: HSold-locale-1.0.0.6 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-locale-1.0.0.6/old-locale.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/old-locale-1.0.0.6 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: containers +version: 0.5.5.1 +id: containers-0.5.5.1-d4bd887fb97aa3a46cbadc13709b7653 +license: BSD3 +copyright: +maintainer: fox@ucw.cz +stability: +homepage: +package-url: +synopsis: Assorted concrete container types +description: This package contains efficient general-purpose implementations + of various basic immutable container types. The declared cost of + each operation is either worst-case or amortized, but remains + valid even if structures are shared. +category: Data Structures +author: +exposed: True +exposed-modules: Data.IntMap Data.IntMap.Lazy Data.IntMap.Strict + Data.IntSet Data.Map Data.Map.Lazy Data.Map.Strict Data.Set + Data.Graph Data.Sequence Data.Tree +hidden-modules: Data.BitUtil Data.IntMap.Base Data.IntSet.Base + Data.Map.Base Data.Set.Base Data.StrictPair +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/containers-0.5.5.1 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/containers-0.5.5.1 +hs-libraries: HScontainers-0.5.5.1 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 + ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/containers-0.5.5.1/containers.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/containers-0.5.5.1 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: bytestring +version: 0.10.4.0 +id: bytestring-0.10.4.0-d6f1d17d717e8652498cab8269a0acd5 +license: BSD3 +copyright: Copyright (c) Don Stewart 2005-2009, + (c) Duncan Coutts 2006-2013, + (c) David Roundy 2003-2005, + (c) Jasper Van der Jeugt 2010, + (c) Simon Meier 2010-2013. +maintainer: Don Stewart <dons00@gmail.com>, + Duncan Coutts <duncan@community.haskell.org> +stability: +homepage: https://github.com/haskell/bytestring +package-url: +synopsis: Fast, compact, strict and lazy byte strings with a list interface +description: An efficient compact, immutable byte string type (both strict and lazy) + suitable for binary or 8-bit character data. + . + The 'ByteString' type represents sequences of bytes or 8-bit characters. + It is suitable for high performance use, both in terms of large data + quantities, or high speed requirements. The 'ByteString' functions follow + the same style as Haskell\'s ordinary lists, so it is easy to convert code + from using 'String' to 'ByteString'. + . + Two 'ByteString' variants are provided: + . + * Strict 'ByteString's keep the string as a single large array. This + makes them convenient for passing data between C and Haskell. + . + * Lazy 'ByteString's use a lazy list of strict chunks which makes it + suitable for I\/O streaming tasks. + . + The @Char8@ modules provide a character-based view of the same + underlying 'ByteString' types. This makes it convenient to handle mixed + binary and 8-bit character content (which is common in many file formats + and network protocols). + . + The 'Builder' module provides an efficient way to build up 'ByteString's + in an ad-hoc way by repeated concatenation. This is ideal for fast + serialisation or pretty printing. + . + There is also a 'ShortByteString' type which has a lower memory overhead + and can be converted to or from a 'ByteString', but supports very few + other operations. It is suitable for keeping many short strings in memory. + . + 'ByteString's are not designed for Unicode. For Unicode strings you should + use the 'Text' type from the @text@ package. + . + These modules are intended to be imported qualified, to avoid name clashes + with "Prelude" functions, e.g. + . + > import qualified Data.ByteString as BS +category: Data +author: Don Stewart, + Duncan Coutts +exposed: True +exposed-modules: Data.ByteString Data.ByteString.Char8 + Data.ByteString.Unsafe Data.ByteString.Internal + Data.ByteString.Lazy Data.ByteString.Lazy.Char8 + Data.ByteString.Lazy.Internal Data.ByteString.Short + Data.ByteString.Short.Internal Data.ByteString.Builder + Data.ByteString.Builder.Extra Data.ByteString.Builder.Prim + Data.ByteString.Builder.Internal + Data.ByteString.Builder.Prim.Internal Data.ByteString.Lazy.Builder + Data.ByteString.Lazy.Builder.Extras + Data.ByteString.Lazy.Builder.ASCII +hidden-modules: Data.ByteString.Builder.ASCII + Data.ByteString.Builder.Prim.Binary + Data.ByteString.Builder.Prim.ASCII + Data.ByteString.Builder.Prim.Internal.Floating + Data.ByteString.Builder.Prim.Internal.UncheckedShifts + Data.ByteString.Builder.Prim.Internal.Base16 +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bytestring-0.10.4.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bytestring-0.10.4.0 +hs-libraries: HSbytestring-0.10.4.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/bytestring-0.10.4.0/include +includes: fpstring.h +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 + deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 + ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 + integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bytestring-0.10.4.0/bytestring.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/bytestring-0.10.4.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: deepseq +version: 1.3.0.2 +id: deepseq-1.3.0.2-63a1ab91b7017a28bb5d04cb1b5d2d02 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Deep evaluation of data structures +description: This package provides methods for fully evaluating data structures + (\"deep evaluation\"). Deep evaluation is often used for adding + strictness to a program, e.g. in order to force pending exceptions, + remove space leaks, or force lazy I/O to happen. It is also useful + in parallel programs, to ensure pending work does not migrate to the + wrong thread. + . + The primary use of this package is via the 'deepseq' function, a + \"deep\" version of 'seq'. It is implemented on top of an 'NFData' + typeclass (\"Normal Form Data\", data structures with no unevaluated + components) which defines strategies for fully evaluating different + data types. + . + If you want to automatically derive 'NFData' instances via the + "GHC.Generics" facility, there is a companion package + <http://hackage.haskell.org/package/deepseq-generics deepseq-generics> + which builds on top of this package. +category: Control +author: +exposed: True +exposed-modules: Control.DeepSeq +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/deepseq-1.3.0.2 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/deepseq-1.3.0.2 +hs-libraries: HSdeepseq-1.3.0.2 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b + base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/deepseq-1.3.0.2/deepseq.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/deepseq-1.3.0.2 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: array +version: 0.5.0.0 +id: array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Mutable and immutable arrays +description: In addition to providing the "Data.Array" module + <http://www.haskell.org/onlinereport/haskell2010/haskellch14.html as specified in the Haskell 2010 Language Report>, + this package also defines the classes 'IArray' of + immutable arrays and 'MArray' of arrays mutable within appropriate + monads, as well as some instances of these classes. +category: Data Structures +author: +exposed: True +exposed-modules: Data.Array Data.Array.Base Data.Array.IArray + Data.Array.IO Data.Array.IO.Safe Data.Array.IO.Internals + Data.Array.MArray Data.Array.MArray.Safe Data.Array.ST + Data.Array.ST.Safe Data.Array.Storable Data.Array.Storable.Safe + Data.Array.Storable.Internals Data.Array.Unboxed Data.Array.Unsafe +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/array-0.5.0.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/array-0.5.0.0 +hs-libraries: HSarray-0.5.0.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/array-0.5.0.0/array.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/array-0.5.0.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: filepath +version: 1.3.0.2 +id: filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: http://www-users.cs.york.ac.uk/~ndm/filepath/ +package-url: +synopsis: Library for manipulating FilePaths in a cross platform way. +description: A library for 'FilePath' manipulations, using Posix or Windows filepaths + depending on the platform. + . + Both "System.FilePath.Posix" and "System.FilePath.Windows" provide + the same interface. See either for examples and a list of the + available functions. +category: System +author: Neil Mitchell +exposed: True +exposed-modules: System.FilePath System.FilePath.Posix + System.FilePath.Windows +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/filepath-1.3.0.2 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/filepath-1.3.0.2 +hs-libraries: HSfilepath-1.3.0.2 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/filepath-1.3.0.2/filepath.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/filepath-1.3.0.2 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: base +version: 4.7.0.2 +id: base-4.7.0.2-bfd89587617e381ae01b8dd7b6c7f1c1 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Basic libraries +description: This package contains the "Prelude" and its support libraries, + and a large collection of useful libraries ranging from data + structures to parsing combinators and debugging utilities. +category: Prelude +author: +exposed: True +exposed-modules: Control.Applicative Control.Arrow Control.Category + Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar + Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception + Control.Exception.Base Control.Monad Control.Monad.Fix + Control.Monad.Instances Control.Monad.ST Control.Monad.ST.Lazy + Control.Monad.ST.Lazy.Safe Control.Monad.ST.Lazy.Unsafe + Control.Monad.ST.Safe Control.Monad.ST.Strict + Control.Monad.ST.Unsafe Control.Monad.Zip Data.Bits Data.Bool + Data.Char Data.Coerce Data.Complex Data.Data Data.Dynamic + Data.Either Data.Eq Data.Fixed Data.Foldable Data.Function + Data.Functor Data.IORef Data.Int Data.Ix Data.List Data.Maybe + Data.Monoid Data.OldTypeable Data.OldTypeable.Internal Data.Ord + Data.Proxy Data.Ratio Data.STRef Data.STRef.Lazy Data.STRef.Strict + Data.String Data.Traversable Data.Tuple Data.Type.Bool + Data.Type.Coercion Data.Type.Equality Data.Typeable + Data.Typeable.Internal Data.Unique Data.Version Data.Word + Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String + Foreign.C.Types Foreign.Concurrent Foreign.ForeignPtr + Foreign.ForeignPtr.Safe Foreign.ForeignPtr.Unsafe Foreign.Marshal + Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error + Foreign.Marshal.Pool Foreign.Marshal.Safe Foreign.Marshal.Unsafe + Foreign.Marshal.Utils Foreign.Ptr Foreign.Safe Foreign.StablePtr + Foreign.Storable GHC.Arr GHC.Base GHC.Char GHC.Conc GHC.Conc.IO + GHC.Conc.Signal GHC.Conc.Sync GHC.ConsoleHandler GHC.Constants + GHC.Desugar GHC.Enum GHC.Environment GHC.Err GHC.Exception GHC.Exts + GHC.Fingerprint GHC.Fingerprint.Type GHC.Float + GHC.Float.ConversionUtils GHC.Float.RealFracMethods GHC.Foreign + GHC.ForeignPtr GHC.GHCi GHC.Generics GHC.IO GHC.IO.Buffer + GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding + GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure + GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types + GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 + GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD + GHC.IO.Handle.Internals GHC.IO.Handle.Text GHC.IO.Handle.Types + GHC.IO.IOMode GHC.IOArray GHC.IORef GHC.IP GHC.Int GHC.List + GHC.MVar GHC.Num GHC.PArr GHC.Pack GHC.Profiling GHC.Ptr GHC.Read + GHC.Real GHC.ST GHC.STRef GHC.Show GHC.Stable GHC.Stack GHC.Stats + GHC.Storable GHC.TopHandler GHC.TypeLits GHC.Unicode GHC.Weak + GHC.Word Numeric Prelude System.CPUTime System.Console.GetOpt + System.Environment System.Exit System.IO System.IO.Error + System.IO.Unsafe System.Info System.Mem System.Mem.StableName + System.Mem.Weak System.Posix.Internals System.Posix.Types + System.Timeout Text.ParserCombinators.ReadP + Text.ParserCombinators.ReadPrec Text.Printf Text.Read Text.Read.Lex + Text.Show Text.Show.Functions Unsafe.Coerce GHC.Event +hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp + Foreign.ForeignPtr.Imp System.Environment.ExecutablePath + GHC.Event.Arr GHC.Event.Array GHC.Event.Clock GHC.Event.Control + GHC.Event.EPoll GHC.Event.IntTable GHC.Event.Internal + GHC.Event.KQueue GHC.Event.Manager GHC.Event.PSQ GHC.Event.Poll + GHC.Event.Thread GHC.Event.TimerManager GHC.Event.Unique +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/base-4.7.0.2 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/base-4.7.0.2 +hs-libraries: HSbase-4.7.0.2 +extra-libraries: +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/base-4.7.0.2/include +includes: HsBase.h +depends: ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 + integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 builtin_rts +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/base-4.7.0.2/base.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/base-4.7.0.2 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: integer-gmp +version: 0.5.1.0 +id: integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: Integer library based on GMP +description: This package provides the low-level implementation of the standard + 'Integer' type based on the + <http://gmplib.org/ GNU Multiple Precision Arithmetic Library (GMP)>. + . + This package provides access to the internal representation of + 'Integer' as well as primitive operations with no proper error + handling, and should only be used directly with the utmost care. + . + For more details about the design of @integer-gmp@, see + <https://ghc.haskell.org/trac/ghc/wiki/Commentary/Libraries/Integer GHC Commentary: Libraries/Integer>. +category: Numerical +author: +exposed: True +exposed-modules: GHC.Integer GHC.Integer.GMP.Internals + GHC.Integer.GMP.Prim GHC.Integer.Logarithms + GHC.Integer.Logarithms.Internals +hidden-modules: GHC.Integer.Type +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/integer-gmp-0.5.1.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/integer-gmp-0.5.1.0 +hs-libraries: HSinteger-gmp-0.5.1.0 +extra-libraries: gmp +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/integer-gmp-0.5.1.0/include +includes: +depends: ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/integer-gmp-0.5.1.0/integer-gmp.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/integer-gmp-0.5.1.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: ghc-prim +version: 0.3.1.0 +id: ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 +license: BSD3 +copyright: +maintainer: libraries@haskell.org +stability: +homepage: +package-url: +synopsis: GHC primitives +description: GHC primitives. +category: GHC +author: +exposed: True +exposed-modules: GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 + GHC.Magic GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim +hidden-modules: +trusted: False +import-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-prim-0.3.1.0 +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/ghc-prim-0.3.1.0 +hs-libraries: HSghc-prim-0.3.1.0 +extra-libraries: +extra-ghci-libraries: +include-dirs: +includes: +depends: builtin_rts +hugs-options: +cc-options: +ld-options: +framework-dirs: +frameworks: +haddock-interfaces: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-prim-0.3.1.0/ghc-prim.haddock +haddock-html: /opt/ghc/7.8.4/share/doc/ghc/html/libraries/ghc-prim-0.3.1.0 +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +--- +name: rts +version: 1.0 +id: builtin_rts +license: BSD3 +copyright: +maintainer: glasgow-haskell-users@haskell.org +stability: +homepage: +package-url: +synopsis: +description: +category: +author: +exposed: True +exposed-modules: +hidden-modules: +trusted: False +import-dirs: +library-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/rts-1.0 +hs-libraries: HSrts Cffi +extra-libraries: m rt dl +extra-ghci-libraries: +include-dirs: /opt/ghc/7.8.4/lib/ghc-7.8.4/include +includes: Stg.h +depends: +hugs-options: +cc-options: +ld-options: "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info" + "-Wl,-u,base_GHCziPtr_Ptr_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info" + "-Wl,-u,base_GHCziInt_I8zh_static_info" + "-Wl,-u,base_GHCziInt_I16zh_static_info" + "-Wl,-u,base_GHCziInt_I32zh_static_info" + "-Wl,-u,base_GHCziInt_I64zh_static_info" + "-Wl,-u,base_GHCziWord_W8zh_static_info" + "-Wl,-u,base_GHCziWord_W16zh_static_info" + "-Wl,-u,base_GHCziWord_W32zh_static_info" + "-Wl,-u,base_GHCziWord_W64zh_static_info" + "-Wl,-u,base_GHCziStable_StablePtr_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" + "-Wl,-u,base_GHCziPtr_Ptr_con_info" + "-Wl,-u,base_GHCziPtr_FunPtr_con_info" + "-Wl,-u,base_GHCziStable_StablePtr_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_False_closure" + "-Wl,-u,ghczmprim_GHCziTypes_True_closure" + "-Wl,-u,base_GHCziPack_unpackCString_closure" + "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" + "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" + "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" + "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" + "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" + "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" + "-Wl,-u,base_GHCziTopHandler_runIO_closure" + "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" + "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" + "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" + "-Wl,-u,base_GHCziConcziSync_runSparks_closure" + "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure" +framework-dirs: +frameworks: +haddock-interfaces: +haddock-html: +pkgroot: "/opt/ghc/7.8.4/lib/ghc-7.8.4" +
@@ -0,0 +1,1146 @@+name: ghc-boot +version: 0.0.0.0 +id: ghc-boot-0.0.0.0 +key: ghc-boot-0.0.0.0 +license: BSD3 +maintainer: ghc-devs@haskell.org +synopsis: Shared functionality between GHC and its boot libraries +description: + This library is shared between GHC, ghc-pkg, and other boot + libraries. + . + A note about "GHC.PackageDb": it only deals with the subset of + the package database that the compiler cares about: modules + paths etc and not package metadata like description, authors + etc. It is thus not a library interface to ghc-pkg and is *not* + suitable for modifying GHC package databases. + . + The package database format and this library are constructed in + such a way that while ghc-pkg depends on Cabal, the GHC library + and program do not have to depend on Cabal. +exposed: True +exposed-modules: + GHC.Lexeme GHC.PackageDb +abi: 7a24014b606b3e9dd8b7b8aa4cf35acc +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-boot-0.0.0.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-boot-0.0.0.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/ghc-boot-0.0.0.0 +hs-libraries: HSghc-boot-0.0.0.0 +depends: + base-4.9.0.0 binary-0.7.5.0 bytestring-0.10.7.0 directory-1.2.5.0 + filepath-1.4.1.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0/ghc-boot.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-boot-0.0.0.0 +--- +name: ghc +version: 7.11.20151213 +id: ghc-7.11.20151213 +key: ghc-7.11.20151213 +license: BSD3 +maintainer: glasgow-haskell-users@haskell.org +homepage: http://www.haskell.org/ghc/ +synopsis: The GHC API +description: + GHC's functionality can be useful for more things than just + compiling Haskell programs. Important use cases are programs + that analyse (and perhaps transform) Haskell code. Others + include loading Haskell code dynamically in a GHCi-like manner. + For this reason, a lot of GHC's functionality is made available + through this package. +category: Development +author: The GHC Team +exposed: False +exposed-modules: + Avail BasicTypes ConLike DataCon PatSyn Demand Debug Exception + FieldLabel GhcMonad Hooks Id IdInfo Lexeme Literal Llvm Llvm.AbsSyn + Llvm.MetaData Llvm.PpLlvm Llvm.Types LlvmCodeGen LlvmCodeGen.Base + LlvmCodeGen.CodeGen LlvmCodeGen.Data LlvmCodeGen.Ppr + LlvmCodeGen.Regs LlvmMangler MkId Module Name NameEnv NameSet + OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet + UnVarGraph BlockId CLabel Cmm CmmBuildInfoTables CmmPipeline + CmmCallConv CmmCommonBlockElim CmmImplementSwitchPlans + CmmContFlowOpt CmmExpr CmmInfo CmmLex CmmLint CmmLive CmmMachOp + CmmSwitch CmmNode CmmOpt CmmParse CmmProcPoint CmmSink CmmType + CmmUtils CmmLayoutStack MkGraph PprBase PprC PprCmm PprCmmDecl + PprCmmExpr Bitmap CodeGen.Platform CodeGen.Platform.ARM + CodeGen.Platform.ARM64 CodeGen.Platform.NoRegs CodeGen.Platform.PPC + CodeGen.Platform.PPC_Darwin CodeGen.Platform.SPARC + CodeGen.Platform.X86 CodeGen.Platform.X86_64 CgUtils StgCmm + StgCmmBind StgCmmClosure StgCmmCon StgCmmEnv StgCmmExpr + StgCmmForeign StgCmmHeap StgCmmHpc StgCmmArgRep StgCmmLayout + StgCmmMonad StgCmmPrim StgCmmProf StgCmmTicky StgCmmUtils + StgCmmExtCode SMRep CoreArity CoreFVs CoreLint CorePrep CoreSubst + CoreSyn TrieMap CoreTidy CoreUnfold CoreUtils CoreSeq CoreStats + MkCore PprCore PmExpr TmOracle Check Coverage Desugar DsArrows + DsBinds DsCCall DsExpr DsForeign DsGRHSs DsListComp DsMonad DsUtils + Match MatchCon MatchLit HsBinds HsDecls HsDoc HsExpr HsImpExp HsLit + PlaceHolder HsPat HsSyn HsTypes HsUtils BinIface BuildTyCl IfaceEnv + IfaceSyn IfaceType LoadIface MkIface TcIface FlagChecker + Annotations BreakArray CmdLineParser CodeOutput Config Constants + DriverMkDepend DriverPhases PipelineMonad DriverPipeline DynFlags + ErrUtils Finder GHC GhcMake GhcPlugins DynamicLoading HeaderInfo + HscMain HscStats HscTypes InteractiveEval InteractiveEvalTypes + PackageConfig Packages PlatformConstants Plugins TcPluginM + PprTyThing StaticFlags StaticPtrTable SysTools Elf TidyPgm Ctype + HaddockUtils Lexer OptCoercion Parser RdrHsSyn ApiAnnotation + ForeignCall PrelInfo PrelNames PrelRules PrimOp TysPrim TysWiredIn + CostCentre ProfInit SCCfinal RnBinds RnEnv RnExpr RnHsDoc RnNames + RnPat RnSource RnSplice RnTypes CoreMonad CSE FloatIn FloatOut + LiberateCase OccurAnal SAT SetLevels SimplCore SimplEnv SimplMonad + SimplUtils Simplify SimplStg StgStats UnariseStg Rules SpecConstr + Specialise CoreToStg StgLint StgSyn CallArity DmdAnal WorkWrap + WwLib FamInst Inst TcAnnotations TcArrows TcBinds TcClassDcl + TcDefaults TcDeriv TcEnv TcExpr TcForeign TcGenDeriv TcGenGenerics + TcHsSyn TcHsType TcInstDcls TcMType TcValidity TcMatches TcPat + TcPatSyn TcRnDriver TcRnMonad TcRnTypes TcRules TcSimplify TcErrors + TcTyClsDecls TcTyDecls TcTypeable TcType TcEvidence TcUnify + TcInteract TcCanonical TcFlatten TcSMonad TcTypeNats TcSplice Class + Coercion DsMeta THNames FamInstEnv FunDeps InstEnv TyCon CoAxiom + Kind Type TyCoRep Unify Bag Binary BooleanFormula BufWrite Digraph + Encoding FastFunctions FastMutInt FastString FastStringEnv + Fingerprint FiniteMap FV GraphBase GraphColor GraphOps GraphPpr + IOEnv ListSetOps Maybes MonadUtils OrdList Outputable Pair Panic + Pretty Serialized State Stream StringBuffer UniqDFM UniqDSet UniqFM + UniqSet Util Vectorise.Builtins.Base Vectorise.Builtins.Initialise + Vectorise.Builtins Vectorise.Monad.Base Vectorise.Monad.Naming + Vectorise.Monad.Local Vectorise.Monad.Global + Vectorise.Monad.InstEnv Vectorise.Monad Vectorise.Utils.Base + Vectorise.Utils.Closure Vectorise.Utils.Hoisting + Vectorise.Utils.PADict Vectorise.Utils.Poly Vectorise.Utils + Vectorise.Generic.Description Vectorise.Generic.PAMethods + Vectorise.Generic.PADict Vectorise.Generic.PData Vectorise.Type.Env + Vectorise.Type.Type Vectorise.Type.TyConDecl + Vectorise.Type.Classify Vectorise.Convert Vectorise.Vect + Vectorise.Var Vectorise.Env Vectorise.Exp Vectorise Hoopl.Dataflow + Hoopl AsmCodeGen TargetReg NCGMonad Instruction Format Reg RegClass + PIC Platform CPrim X86.Regs X86.RegInfo X86.Instr X86.Cond X86.Ppr + X86.CodeGen PPC.Regs PPC.RegInfo PPC.Instr PPC.Cond PPC.Ppr + PPC.CodeGen SPARC.Base SPARC.Regs SPARC.Imm SPARC.AddrMode + SPARC.Cond SPARC.Instr SPARC.Stack SPARC.ShortcutJump SPARC.Ppr + SPARC.CodeGen SPARC.CodeGen.Amode SPARC.CodeGen.Base + SPARC.CodeGen.CondCode SPARC.CodeGen.Gen32 SPARC.CodeGen.Gen64 + SPARC.CodeGen.Sanity SPARC.CodeGen.Expand RegAlloc.Liveness + RegAlloc.Graph.Main RegAlloc.Graph.Stats RegAlloc.Graph.ArchBase + RegAlloc.Graph.ArchX86 RegAlloc.Graph.Coalesce RegAlloc.Graph.Spill + RegAlloc.Graph.SpillClean RegAlloc.Graph.SpillCost + RegAlloc.Graph.TrivColorable RegAlloc.Linear.Main + RegAlloc.Linear.JoinToTargets RegAlloc.Linear.State + RegAlloc.Linear.Stats RegAlloc.Linear.FreeRegs + RegAlloc.Linear.StackMap RegAlloc.Linear.Base + RegAlloc.Linear.X86.FreeRegs RegAlloc.Linear.X86_64.FreeRegs + RegAlloc.Linear.PPC.FreeRegs RegAlloc.Linear.SPARC.FreeRegs Dwarf + Dwarf.Types Dwarf.Constants Convert ByteCodeAsm ByteCodeGen + ByteCodeInstr ByteCodeItbls ByteCodeLink Debugger LibFFI Linker + ObjLink RtClosureInspect DebuggerUtils +abi: bc2e1cb7cdee2089e52f007db59a253c +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-7.11.20151213 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-7.11.20151213 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/ghc-7.11.20151213 +hs-libraries: HSghc-7.11.20151213 +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-7.11.20151213/include +depends: + array-0.5.1.0 base-4.9.0.0 binary-0.7.5.0 bytestring-0.10.7.0 + containers-0.5.6.3 directory-1.2.5.0 filepath-1.4.1.0 + ghc-boot-0.0.0.0 hoopl-3.10.2.0 hpc-0.6.0.2 process-1.4.1.0 + template-haskell-2.11.0.0 time-1.5.0.1 transformers-0.4.3.0 + unix-2.7.1.1 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-7.11.20151213/ghc.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-7.11.20151213 +--- +name: haskeline +version: 0.7.2.1 +id: haskeline-0.7.2.1 +key: haskeline-0.7.2.1 +license: BSD3 +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson <judah.jacobson@gmail.com> +stability: Experimental +homepage: http://trac.haskell.org/haskeline +synopsis: A command-line interface for user input, written in Haskell. +description: + Haskeline provides a user interface for line input in command-line + programs. This library is similar in purpose to readline, but since + it is written in Haskell it is (hopefully) more easily used in other + Haskell programs. + . + Haskeline runs both on POSIX-compatible systems and on Windows. +category: User Interfaces +author: Judah Jacobson +exposed: True +exposed-modules: + System.Console.Haskeline System.Console.Haskeline.Completion + System.Console.Haskeline.MonadException + System.Console.Haskeline.History System.Console.Haskeline.IO +hidden-modules: System.Console.Haskeline.Backend + System.Console.Haskeline.Backend.WCWidth + System.Console.Haskeline.Command + System.Console.Haskeline.Command.Completion + System.Console.Haskeline.Command.History + System.Console.Haskeline.Command.KillRing + System.Console.Haskeline.Directory System.Console.Haskeline.Emacs + System.Console.Haskeline.InputT System.Console.Haskeline.Key + System.Console.Haskeline.LineState System.Console.Haskeline.Monads + System.Console.Haskeline.Prefs System.Console.Haskeline.RunCommand + System.Console.Haskeline.Term System.Console.Haskeline.Command.Undo + System.Console.Haskeline.Vi System.Console.Haskeline.Recover + System.Console.Haskeline.Backend.Posix + System.Console.Haskeline.Backend.Posix.Encoder + System.Console.Haskeline.Backend.DumbTerm + System.Console.Haskeline.Backend.Terminfo +abi: 1084385e878ca046b1ba1b0149406b60 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/haskeline-0.7.2.1 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/haskeline-0.7.2.1 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/haskeline-0.7.2.1 +hs-libraries: HShaskeline-0.7.2.1 +depends: + base-4.9.0.0 bytestring-0.10.7.0 containers-0.5.6.3 + directory-1.2.5.0 filepath-1.4.1.0 terminfo-0.4.0.1 + transformers-0.4.3.0 unix-2.7.1.1 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/haskeline-0.7.2.1/haskeline.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/haskeline-0.7.2.1 +--- +name: terminfo +version: 0.4.0.1 +id: terminfo-0.4.0.1 +key: terminfo-0.4.0.1 +license: BSD3 +copyright: (c) Judah Jacobson +maintainer: Judah Jacobson <judah.jacobson@gmail.com> +stability: Stable +homepage: https://github.com/judah/terminfo +synopsis: Haskell bindings to the terminfo library. +description: + This library provides an interface to the terminfo database (via bindings to the + curses library). <http://en.wikipedia.org/wiki/Terminfo Terminfo> allows POSIX + systems to interact with a variety of terminals using a standard set of capabilities. +category: User Interfaces +author: Judah Jacobson +exposed: True +exposed-modules: + System.Console.Terminfo System.Console.Terminfo.Base + System.Console.Terminfo.Cursor System.Console.Terminfo.Color + System.Console.Terminfo.Edit System.Console.Terminfo.Effects + System.Console.Terminfo.Keys +abi: d0bd235d4bbae7f2cbb36b97e6bcfba9 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/terminfo-0.4.0.1 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/terminfo-0.4.0.1 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/terminfo-0.4.0.1 +hs-libraries: HSterminfo-0.4.0.1 +extra-libraries: + tinfo +includes: + ncurses.h term.h +depends: + base-4.9.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/terminfo-0.4.0.1/terminfo.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/terminfo-0.4.0.1 +--- +name: xhtml +version: 3000.2.1 +id: xhtml-3000.2.1 +key: xhtml-3000.2.1 +license: BSD3 +copyright: Bjorn Bringert 2004-2006, Andy Gill and the Oregon + Graduate Institute of Science and Technology, 1999-2001 +maintainer: Chris Dornan <chris@chrisdornan.com> +stability: Stable +homepage: https://github.com/haskell/xhtml +synopsis: An XHTML combinator library +description: + This package provides combinators for producing + XHTML 1.0, including the Strict, Transitional and + Frameset variants. +category: Web, XML, Pretty Printer +author: Bjorn Bringert +exposed: True +exposed-modules: + Text.XHtml Text.XHtml.Frameset Text.XHtml.Strict + Text.XHtml.Transitional Text.XHtml.Debug Text.XHtml.Table +hidden-modules: Text.XHtml.Strict.Attributes + Text.XHtml.Strict.Elements Text.XHtml.Frameset.Attributes + Text.XHtml.Frameset.Elements Text.XHtml.Transitional.Attributes + Text.XHtml.Transitional.Elements Text.XHtml.BlockTable + Text.XHtml.Extras Text.XHtml.Internals +abi: 932c4b6847d698115f4ad73b10e56807 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/xhtml-3000.2.1 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/xhtml-3000.2.1 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/xhtml-3000.2.1 +hs-libraries: HSxhtml-3000.2.1 +depends: + base-4.9.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/xhtml-3000.2.1/xhtml.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/xhtml-3000.2.1 +--- +name: transformers +version: 0.4.3.0 +id: transformers-0.4.3.0 +key: transformers-0.4.3.0 +license: BSD3 +maintainer: Ross Paterson <R.Paterson@city.ac.uk> +synopsis: Concrete functor and monad transformers +description: + A portable library of functor and monad transformers, inspired by + the paper \"Functional Programming with Overloading and Higher-Order + Polymorphism\", by Mark P Jones, + in /Advanced School of Functional Programming/, 1995 + (<http://web.cecs.pdx.edu/~mpj/pubs/springschool.html>). + . + This package contains: + . + * the monad transformer class (in "Control.Monad.Trans.Class") + and IO monad class (in "Control.Monad.IO.Class") + . + * concrete functor and monad transformers, each with associated + operations and functions to lift operations associated with other + transformers. + . + The package can be used on its own in portable Haskell code, in + which case operations need to be manually lifted through transformer + stacks (see "Control.Monad.Trans.Class" for some examples). + Alternatively, it can be used with the non-portable monad classes in + the @mtl@ or @monads-tf@ packages, which automatically lift operations + introduced by monad transformers through other transformers. +category: Control +author: Andy Gill, Ross Paterson +exposed: True +exposed-modules: + Control.Applicative.Backwards Control.Applicative.Lift + Control.Monad.Signatures Control.Monad.Trans.Class + Control.Monad.Trans.Cont Control.Monad.Trans.Except + Control.Monad.Trans.Error Control.Monad.Trans.Identity + Control.Monad.Trans.List Control.Monad.Trans.Maybe + Control.Monad.Trans.Reader Control.Monad.Trans.RWS + Control.Monad.Trans.RWS.Lazy Control.Monad.Trans.RWS.Strict + Control.Monad.Trans.State Control.Monad.Trans.State.Lazy + Control.Monad.Trans.State.Strict Control.Monad.Trans.Writer + Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict + Data.Functor.Classes Data.Functor.Compose Data.Functor.Constant + Data.Functor.Product Data.Functor.Reverse Data.Functor.Sum +abi: d71166f18d2591685ff3ee72b17638c0 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/transformers-0.4.3.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/transformers-0.4.3.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/transformers-0.4.3.0 +hs-libraries: HStransformers-0.4.3.0 +depends: + base-4.9.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/transformers-0.4.3.0/transformers.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/transformers-0.4.3.0 +--- +name: hoopl +version: 3.10.2.0 +id: hoopl-3.10.2.0 +key: hoopl-3.10.2.0 +license: BSD3 +maintainer: nr@cs.tufts.edu, andreas.voellmy@gmail.com, email@ningwang.org +homepage: http://ghc.cs.tufts.edu/hoopl/ +synopsis: A library to support dataflow analysis and optimization +description: + Higher-order optimization library + . + See /Norman Ramsey, Joao Dias, and Simon Peyton Jones./ + <http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation"> /(2010)/ for more details. +category: Compilers/Interpreters +author: Norman Ramsey, Joao Dias, Simon Marlow and Simon Peyton Jones +exposed: True +exposed-modules: + Compiler.Hoopl Compiler.Hoopl.Internals Compiler.Hoopl.Wrappers + Compiler.Hoopl.Passes.Dominator Compiler.Hoopl.Passes.DList +hidden-modules: Compiler.Hoopl.Checkpoint + Compiler.Hoopl.Collections Compiler.Hoopl.Combinators + Compiler.Hoopl.Dataflow Compiler.Hoopl.Debug Compiler.Hoopl.Block + Compiler.Hoopl.Graph Compiler.Hoopl.Label Compiler.Hoopl.MkGraph + Compiler.Hoopl.Fuel Compiler.Hoopl.Pointed Compiler.Hoopl.Shape + Compiler.Hoopl.Show Compiler.Hoopl.Unique Compiler.Hoopl.XUtil +abi: 719b00050240e530b78b62520193b342 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hoopl-3.10.2.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hoopl-3.10.2.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/hoopl-3.10.2.0 +hs-libraries: HShoopl-3.10.2.0 +depends: + base-4.9.0.0 containers-0.5.6.3 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/hoopl-3.10.2.0/hoopl.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/hoopl-3.10.2.0 +--- +name: template-haskell +version: 2.11.0.0 +id: template-haskell-2.11.0.0 +key: template-haskell-2.11.0.0 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Support library for Template Haskell +description: + This package provides modules containing facilities for manipulating + Haskell source code using Template Haskell. + . + See <http://www.haskell.org/haskellwiki/Template_Haskell> for more + information. +category: Template Haskell +exposed: True +exposed-modules: + Language.Haskell.TH Language.Haskell.TH.Lib Language.Haskell.TH.Ppr + Language.Haskell.TH.PprLib Language.Haskell.TH.Quote + Language.Haskell.TH.Syntax +hidden-modules: Language.Haskell.TH.Lib.Map +abi: 26855f7c84ab668b019a8d35abdb5276 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/template-haskell-2.11.0.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/template-haskell-2.11.0.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/template-haskell-2.11.0.0 +hs-libraries: HStemplate-haskell-2.11.0.0 +depends: + base-4.9.0.0 ghc-boot-0.0.0.0 pretty-1.1.2.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/template-haskell-2.11.0.0/template-haskell.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/template-haskell-2.11.0.0 +--- +name: Cabal +version: 1.23.0.0 +id: Cabal-1.23.0.0 +key: Cabal-1.23.0.0 +license: BSD3 +copyright: 2003-2006, Isaac Jones + 2005-2011, Duncan Coutts +maintainer: cabal-devel@haskell.org +homepage: http://www.haskell.org/cabal/ +synopsis: A framework for packaging Haskell software +description: + The Haskell Common Architecture for Building Applications and + Libraries: a framework defining a common interface for authors to more + easily build their Haskell applications in a portable way. + . + The Haskell Cabal is part of a larger infrastructure for distributing, + organizing, and cataloging Haskell libraries and tools. +category: Distribution +author: Isaac Jones <ijones@syntaxpolice.org> + Duncan Coutts <duncan@community.haskell.org> +exposed: True +exposed-modules: + Distribution.Compat.CreatePipe Distribution.Compat.Environment + Distribution.Compat.Exception Distribution.Compat.Internal.TempFile + Distribution.Compat.ReadP Distribution.Compiler + Distribution.InstalledPackageInfo Distribution.License + Distribution.Make Distribution.ModuleName Distribution.Package + Distribution.PackageDescription + Distribution.PackageDescription.Check + Distribution.PackageDescription.Configuration + Distribution.PackageDescription.Parse + Distribution.PackageDescription.PrettyPrint + Distribution.PackageDescription.Utils Distribution.ParseUtils + Distribution.ReadE Distribution.Simple Distribution.Simple.Bench + Distribution.Simple.Build Distribution.Simple.Build.Macros + Distribution.Simple.Build.PathsModule + Distribution.Simple.BuildPaths Distribution.Simple.BuildTarget + Distribution.Simple.CCompiler Distribution.Simple.Command + Distribution.Simple.Compiler Distribution.Simple.Configure + Distribution.Simple.GHC Distribution.Simple.GHCJS + Distribution.Simple.Haddock Distribution.Simple.HaskellSuite + Distribution.Simple.Hpc Distribution.Simple.Install + Distribution.Simple.InstallDirs Distribution.Simple.JHC + Distribution.Simple.LHC Distribution.Simple.LocalBuildInfo + Distribution.Simple.PackageIndex Distribution.Simple.PreProcess + Distribution.Simple.PreProcess.Unlit Distribution.Simple.Program + Distribution.Simple.Program.Ar Distribution.Simple.Program.Builtin + Distribution.Simple.Program.Db Distribution.Simple.Program.Find + Distribution.Simple.Program.GHC Distribution.Simple.Program.HcPkg + Distribution.Simple.Program.Hpc + Distribution.Simple.Program.Internal Distribution.Simple.Program.Ld + Distribution.Simple.Program.Run Distribution.Simple.Program.Script + Distribution.Simple.Program.Strip Distribution.Simple.Program.Types + Distribution.Simple.Register Distribution.Simple.Setup + Distribution.Simple.SrcDist Distribution.Simple.Test + Distribution.Simple.Test.ExeV10 Distribution.Simple.Test.LibV09 + Distribution.Simple.Test.Log Distribution.Simple.UHC + Distribution.Simple.UserHooks Distribution.Simple.Utils + Distribution.System Distribution.TestSuite Distribution.Text + Distribution.Utils.NubList Distribution.Verbosity + Distribution.Version Language.Haskell.Extension +hidden-modules: Distribution.Compat.Binary + Distribution.Compat.CopyFile Distribution.GetOpt Distribution.Lex + Distribution.Simple.GHC.Internal Distribution.Simple.GHC.IPI641 + Distribution.Simple.GHC.IPI642 Distribution.Simple.GHC.ImplInfo + Paths_Cabal +abi: 4b55984d7d0e5898df279f52ba75702f +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/Cabal-1.23.0.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/Cabal-1.23.0.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/Cabal-1.23.0.0 +hs-libraries: HSCabal-1.23.0.0 +depends: + array-0.5.1.0 base-4.9.0.0 binary-0.7.5.0 bytestring-0.10.7.0 + containers-0.5.6.3 deepseq-1.4.2.0 directory-1.2.5.0 + filepath-1.4.1.0 pretty-1.1.2.0 process-1.4.1.0 time-1.5.0.1 + unix-2.7.1.1 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/Cabal-1.23.0.0/Cabal.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/Cabal-1.23.0.0 +--- +name: binary +version: 0.7.5.0 +id: binary-0.7.5.0 +key: binary-0.7.5.0 +license: BSD3 +maintainer: Lennart Kolmodin, Don Stewart <dons00@gmail.com> +stability: provisional +homepage: https://github.com/kolmodin/binary +synopsis: Binary serialisation for Haskell values using lazy ByteStrings +description: + Efficient, pure binary serialisation using lazy ByteStrings. + Haskell values may be encoded to and from binary formats, + written to disk as binary, or sent over the network. + The format used can be automatically generated, or + you can choose to implement a custom format if needed. + Serialisation speeds of over 1 G\/sec have been observed, + so this library should be suitable for high performance + scenarios. +category: Data, Parsing +author: Lennart Kolmodin <kolmodin@gmail.com> +exposed: True +exposed-modules: + Data.Binary Data.Binary.Put Data.Binary.Get + Data.Binary.Get.Internal Data.Binary.Builder + Data.Binary.Builder.Internal +hidden-modules: Data.Binary.Builder.Base Data.Binary.Class + Data.Binary.Generic +abi: 023629bb1f3d2da077b9dfaec842d5d6 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/binary-0.7.5.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/binary-0.7.5.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/binary-0.7.5.0 +hs-libraries: HSbinary-0.7.5.0 +depends: + array-0.5.1.0 base-4.9.0.0 bytestring-0.10.7.0 containers-0.5.6.3 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/binary-0.7.5.0/binary.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/binary-0.7.5.0 +--- +name: pretty +version: 1.1.2.0 +id: pretty-1.1.2.0 +key: pretty-1.1.2.0 +license: BSD3 +maintainer: David Terei <code@davidterei.com> +stability: Stable +homepage: http://github.com/haskell/pretty +synopsis: Pretty-printing library +description: + This package contains a pretty-printing library, a set of API's + that provides a way to easily print out text in a consistent + format of your choosing. This is useful for compilers and related + tools. + . + This library was originally designed by John Hughes's and has since + been heavily modified by Simon Peyton Jones. +category: Text +exposed: True +exposed-modules: + Text.PrettyPrint Text.PrettyPrint.HughesPJ + Text.PrettyPrint.HughesPJClass +abi: ff204a4f63b87ec08dfb63935ab60346 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/pretty-1.1.2.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/pretty-1.1.2.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/pretty-1.1.2.0 +hs-libraries: HSpretty-1.1.2.0 +depends: + base-4.9.0.0 deepseq-1.4.2.0 ghc-prim-0.5.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/pretty-1.1.2.0/pretty.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/pretty-1.1.2.0 +--- +name: hpc +version: 0.6.0.2 +id: hpc-0.6.0.2 +key: hpc-0.6.0.2 +license: BSD3 +maintainer: ghc-devs@haskell.org +synopsis: Code Coverage Library for Haskell +description: + This package provides the code coverage library for Haskell. + . + See <http://www.haskell.org/haskellwiki/Haskell_program_coverage> for more + information. +category: Control +author: Andy Gill +exposed: True +exposed-modules: + Trace.Hpc.Util Trace.Hpc.Mix Trace.Hpc.Tix Trace.Hpc.Reflect +abi: b98013c17bf1741c790e3a830237e8bc +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hpc-0.6.0.2 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/hpc-0.6.0.2 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/hpc-0.6.0.2 +hs-libraries: HShpc-0.6.0.2 +depends: + base-4.9.0.0 containers-0.5.6.3 directory-1.2.5.0 filepath-1.4.1.0 + time-1.5.0.1 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/hpc-0.6.0.2/hpc.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/hpc-0.6.0.2 +--- +name: process +version: 1.4.1.0 +id: process-1.4.1.0 +key: process-1.4.1.0 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Process libraries +description: + This package contains libraries for dealing with system processes. +category: System +exposed: True +exposed-modules: + System.Cmd System.Process System.Process.Internals +hidden-modules: System.Process.Common System.Process.Posix +abi: 483b4c1d894e8c880c567a1ee593790f +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/process-1.4.1.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/process-1.4.1.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/process-1.4.1.0 +hs-libraries: HSprocess-1.4.1.0 +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/process-1.4.1.0/include +includes: + runProcess.h +depends: + base-4.9.0.0 deepseq-1.4.2.0 directory-1.2.5.0 filepath-1.4.1.0 + unix-2.7.1.1 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/process-1.4.1.0/process.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/process-1.4.1.0 +--- +name: directory +version: 1.2.5.0 +id: directory-1.2.5.0 +key: directory-1.2.5.0 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Platform-agnostic library for filesystem operations +description: + This library provides a basic set of operations for manipulating files and + directories in a portable way. +category: System +exposed: True +exposed-modules: + System.Directory +hidden-modules: System.Directory.Internal + System.Directory.Internal.Config + System.Directory.Internal.C_utimensat + System.Directory.Internal.Posix System.Directory.Internal.Windows +abi: 73051d50bd0377c1f91d40ac29eafcde +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/directory-1.2.5.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/directory-1.2.5.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/directory-1.2.5.0 +hs-libraries: HSdirectory-1.2.5.0 +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/directory-1.2.5.0/include +includes: + HsDirectory.h +depends: + base-4.9.0.0 filepath-1.4.1.0 time-1.5.0.1 unix-2.7.1.1 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/directory-1.2.5.0/directory.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/directory-1.2.5.0 +--- +name: unix +version: 2.7.1.1 +id: unix-2.7.1.1 +key: unix-2.7.1.1 +license: BSD3 +maintainer: libraries@haskell.org +homepage: https://github.com/haskell/unix +synopsis: POSIX functionality +description: + This package gives you access to the set of operating system + services standardised by POSIX 1003.1b (or the IEEE Portable + Operating System Interface for Computing Environments - + IEEE Std. 1003.1). + . + The package is not supported under Windows (except under Cygwin). +category: System +exposed: True +exposed-modules: + System.Posix System.Posix.ByteString System.Posix.Error + System.Posix.Resource System.Posix.Time System.Posix.Unistd + System.Posix.User System.Posix.Signals System.Posix.Signals.Exts + System.Posix.Semaphore System.Posix.SharedMem + System.Posix.ByteString.FilePath System.Posix.Directory + System.Posix.Directory.ByteString System.Posix.DynamicLinker.Module + System.Posix.DynamicLinker.Module.ByteString + System.Posix.DynamicLinker.Prim + System.Posix.DynamicLinker.ByteString System.Posix.DynamicLinker + System.Posix.Files System.Posix.Files.ByteString System.Posix.IO + System.Posix.IO.ByteString System.Posix.Env + System.Posix.Env.ByteString System.Posix.Fcntl System.Posix.Process + System.Posix.Process.Internals System.Posix.Process.ByteString + System.Posix.Temp System.Posix.Temp.ByteString + System.Posix.Terminal System.Posix.Terminal.ByteString +hidden-modules: System.Posix.Directory.Common + System.Posix.DynamicLinker.Common System.Posix.Files.Common + System.Posix.IO.Common System.Posix.Process.Common + System.Posix.Terminal.Common +abi: 416bbf4a68812f768d46e0603efc98e6 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/unix-2.7.1.1 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/unix-2.7.1.1 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/unix-2.7.1.1 +hs-libraries: HSunix-2.7.1.1 +extra-libraries: + rt util dl pthread +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/unix-2.7.1.1/include +includes: + HsUnix.h execvpe.h +depends: + base-4.9.0.0 bytestring-0.10.7.0 time-1.5.0.1 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/unix-2.7.1.1/unix.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/unix-2.7.1.1 +--- +name: time +version: 1.5.0.1 +id: time-1.5.0.1 +key: time-1.5.0.1 +license: BSD3 +maintainer: <ashley@semantic.org> +stability: stable +homepage: https://github.com/haskell/time +synopsis: A time library +description: + A time library +category: System +author: Ashley Yakeley +exposed: True +exposed-modules: + Data.Time.Calendar Data.Time.Calendar.MonthDay + Data.Time.Calendar.OrdinalDate Data.Time.Calendar.WeekDate + Data.Time.Calendar.Julian Data.Time.Calendar.Easter Data.Time.Clock + Data.Time.Clock.POSIX Data.Time.Clock.TAI Data.Time.LocalTime + Data.Time.Format Data.Time +hidden-modules: Data.Time.Calendar.Private Data.Time.Calendar.Days + Data.Time.Calendar.Gregorian Data.Time.Calendar.JulianYearDay + Data.Time.Clock.Scale Data.Time.Clock.UTC Data.Time.Clock.CTimeval + Data.Time.Clock.UTCDiff Data.Time.LocalTime.TimeZone + Data.Time.LocalTime.TimeOfDay Data.Time.LocalTime.LocalTime + Data.Time.Format.Parse Data.Time.Format.Locale +abi: fa14628fffb7d93741bb88caab63757e +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/time-1.5.0.1 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/time-1.5.0.1 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/time-1.5.0.1 +hs-libraries: HStime-1.5.0.1 +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/time-1.5.0.1/include +depends: + base-4.9.0.0 deepseq-1.4.2.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/time-1.5.0.1/time.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/time-1.5.0.1 +--- +name: containers +version: 0.5.6.3 +id: containers-0.5.6.3 +key: containers-0.5.6.3 +license: BSD3 +maintainer: fox@ucw.cz +synopsis: Assorted concrete container types +description: + This package contains efficient general-purpose implementations + of various basic immutable container types. The declared cost of + each operation is either worst-case or amortized, but remains + valid even if structures are shared. +category: Data Structures +exposed: True +exposed-modules: + Data.IntMap Data.IntMap.Lazy Data.IntMap.Strict Data.IntSet + Data.Map Data.Map.Lazy Data.Map.Strict Data.Set Data.Graph + Data.Sequence Data.Tree +hidden-modules: Data.IntMap.Base Data.IntSet.Base Data.Map.Base + Data.Set.Base Data.Utils.BitUtil Data.Utils.StrictFold + Data.Utils.StrictPair +abi: 4ae96ef90aaf7e7c342611448391c5cd +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/containers-0.5.6.3 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/containers-0.5.6.3 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/containers-0.5.6.3 +hs-libraries: HScontainers-0.5.6.3 +depends: + array-0.5.1.0 base-4.9.0.0 deepseq-1.4.2.0 ghc-prim-0.5.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/containers-0.5.6.3/containers.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/containers-0.5.6.3 +--- +name: bytestring +version: 0.10.7.0 +id: bytestring-0.10.7.0 +key: bytestring-0.10.7.0 +license: BSD3 +copyright: Copyright (c) Don Stewart 2005-2009, + (c) Duncan Coutts 2006-2015, + (c) David Roundy 2003-2005, + (c) Jasper Van der Jeugt 2010, + (c) Simon Meier 2010-2013. +maintainer: Duncan Coutts <duncan@community.haskell.org> +homepage: https://github.com/haskell/bytestring +synopsis: Fast, compact, strict and lazy byte strings with a list interface +description: + An efficient compact, immutable byte string type (both strict and lazy) + suitable for binary or 8-bit character data. + . + The 'ByteString' type represents sequences of bytes or 8-bit characters. + It is suitable for high performance use, both in terms of large data + quantities, or high speed requirements. The 'ByteString' functions follow + the same style as Haskell\'s ordinary lists, so it is easy to convert code + from using 'String' to 'ByteString'. + . + Two 'ByteString' variants are provided: + . + * Strict 'ByteString's keep the string as a single large array. This + makes them convenient for passing data between C and Haskell. + . + * Lazy 'ByteString's use a lazy list of strict chunks which makes it + suitable for I\/O streaming tasks. + . + The @Char8@ modules provide a character-based view of the same + underlying 'ByteString' types. This makes it convenient to handle mixed + binary and 8-bit character content (which is common in many file formats + and network protocols). + . + The 'Builder' module provides an efficient way to build up 'ByteString's + in an ad-hoc way by repeated concatenation. This is ideal for fast + serialisation or pretty printing. + . + There is also a 'ShortByteString' type which has a lower memory overhead + and can be converted to or from a 'ByteString', but supports very few + other operations. It is suitable for keeping many short strings in memory. + . + 'ByteString's are not designed for Unicode. For Unicode strings you should + use the 'Text' type from the @text@ package. + . + These modules are intended to be imported qualified, to avoid name clashes + with "Prelude" functions, e.g. + . + > import qualified Data.ByteString as BS +category: Data +author: Don Stewart, + Duncan Coutts +exposed: True +exposed-modules: + Data.ByteString Data.ByteString.Char8 Data.ByteString.Unsafe + Data.ByteString.Internal Data.ByteString.Lazy + Data.ByteString.Lazy.Char8 Data.ByteString.Lazy.Internal + Data.ByteString.Short Data.ByteString.Short.Internal + Data.ByteString.Builder Data.ByteString.Builder.Extra + Data.ByteString.Builder.Prim Data.ByteString.Builder.Internal + Data.ByteString.Builder.Prim.Internal Data.ByteString.Lazy.Builder + Data.ByteString.Lazy.Builder.Extras + Data.ByteString.Lazy.Builder.ASCII +hidden-modules: Data.ByteString.Builder.ASCII + Data.ByteString.Builder.Prim.Binary + Data.ByteString.Builder.Prim.ASCII + Data.ByteString.Builder.Prim.Internal.Floating + Data.ByteString.Builder.Prim.Internal.UncheckedShifts + Data.ByteString.Builder.Prim.Internal.Base16 +abi: d9206a8fe0d44e69be0c04076cabad23 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/bytestring-0.10.7.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/bytestring-0.10.7.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/bytestring-0.10.7.0 +hs-libraries: HSbytestring-0.10.7.0 +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/bytestring-0.10.7.0/include +includes: + fpstring.h +depends: + base-4.9.0.0 deepseq-1.4.2.0 ghc-prim-0.5.0.0 integer-gmp-1.0.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/bytestring-0.10.7.0/bytestring.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/bytestring-0.10.7.0 +--- +name: deepseq +version: 1.4.2.0 +id: deepseq-1.4.2.0 +key: deepseq-1.4.2.0 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Deep evaluation of data structures +description: + This package provides methods for fully evaluating data structures + (\"deep evaluation\"). Deep evaluation is often used for adding + strictness to a program, e.g. in order to force pending exceptions, + remove space leaks, or force lazy I/O to happen. It is also useful + in parallel programs, to ensure pending work does not migrate to the + wrong thread. + . + The primary use of this package is via the 'deepseq' function, a + \"deep\" version of 'seq'. It is implemented on top of an 'NFData' + typeclass (\"Normal Form Data\", data structures with no unevaluated + components) which defines strategies for fully evaluating different + data types. +category: Control +exposed: True +exposed-modules: + Control.DeepSeq +abi: 63c4c214c0c19484502b3c8b7e42ec69 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/deepseq-1.4.2.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/deepseq-1.4.2.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/deepseq-1.4.2.0 +hs-libraries: HSdeepseq-1.4.2.0 +depends: + array-0.5.1.0 base-4.9.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/deepseq-1.4.2.0/deepseq.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/deepseq-1.4.2.0 +--- +name: array +version: 0.5.1.0 +id: array-0.5.1.0 +key: array-0.5.1.0 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Mutable and immutable arrays +description: + In addition to providing the "Data.Array" module + <http://www.haskell.org/onlinereport/haskell2010/haskellch14.html as specified in the Haskell 2010 Language Report>, + this package also defines the classes 'IArray' of + immutable arrays and 'MArray' of arrays mutable within appropriate + monads, as well as some instances of these classes. +category: Data Structures +exposed: True +exposed-modules: + Data.Array Data.Array.Base Data.Array.IArray Data.Array.IO + Data.Array.IO.Safe Data.Array.IO.Internals Data.Array.MArray + Data.Array.MArray.Safe Data.Array.ST Data.Array.ST.Safe + Data.Array.Storable Data.Array.Storable.Safe + Data.Array.Storable.Internals Data.Array.Unboxed Data.Array.Unsafe +abi: 2b2b879a09eb81c865ac273803e08132 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/array-0.5.1.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/array-0.5.1.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/array-0.5.1.0 +hs-libraries: HSarray-0.5.1.0 +depends: + base-4.9.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/array-0.5.1.0/array.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/array-0.5.1.0 +--- +name: filepath +version: 1.4.1.0 +id: filepath-1.4.1.0 +key: filepath-1.4.1.0 +license: BSD3 +copyright: Neil Mitchell 2005-2015 +maintainer: Neil Mitchell <ndmitchell@gmail.com> +homepage: https://github.com/haskell/filepath#readme +synopsis: Library for manipulating FilePaths in a cross platform way. +description: + This package provides functionality for manipulating @FilePath@ values, and is shipped with both <https://www.haskell.org/ghc/ GHC> and the <https://www.haskell.org/platform/ Haskell Platform>. It provides three modules: + . + * "System.FilePath.Posix" manipulates POSIX\/Linux style @FilePath@ values (with @\/@ as the path separator). + . + * "System.FilePath.Windows" manipulates Windows style @FilePath@ values (with either @\\@ or @\/@ as the path separator, and deals with drives). + . + * "System.FilePath" is an alias for the module appropriate to your platform. + . + All three modules provide the same API, and the same documentation (calling out differences in the different variants). +category: System +author: Neil Mitchell <ndmitchell@gmail.com> +exposed: True +exposed-modules: + System.FilePath System.FilePath.Posix System.FilePath.Windows +abi: 1e3d9055afc6aa08b97f5ad5f8014ce4 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/filepath-1.4.1.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/filepath-1.4.1.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/filepath-1.4.1.0 +hs-libraries: HSfilepath-1.4.1.0 +depends: + base-4.9.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/filepath-1.4.1.0/filepath.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/filepath-1.4.1.0 +--- +name: base +version: 4.9.0.0 +id: base-4.9.0.0 +key: base-4.9.0.0 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: Basic libraries +description: + This package contains the "Prelude" and its support libraries, + and a large collection of useful libraries ranging from data + structures to parsing combinators and debugging utilities. +category: Prelude +exposed: True +exposed-modules: + Control.Applicative Control.Arrow Control.Category + Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar + Control.Concurrent.QSem Control.Concurrent.QSemN Control.Exception + Control.Exception.Base Control.Monad Control.Monad.Fail + Control.Monad.Fix Control.Monad.Instances Control.Monad.IO.Class + Control.Monad.ST Control.Monad.ST.Lazy Control.Monad.ST.Lazy.Safe + Control.Monad.ST.Lazy.Unsafe Control.Monad.ST.Safe + Control.Monad.ST.Strict Control.Monad.ST.Unsafe Control.Monad.Zip + Data.Bifunctor Data.Bits Data.Bool Data.Char Data.Coerce + Data.Complex Data.Data Data.Dynamic Data.Either Data.Eq Data.Fixed + Data.Foldable Data.Function Data.Functor Data.Functor.Identity + Data.IORef Data.Int Data.Ix Data.Kind Data.List Data.List.NonEmpty + Data.Maybe Data.Monoid Data.Ord Data.Proxy Data.Ratio + Data.Semigroup Data.STRef Data.STRef.Lazy Data.STRef.Strict + Data.String Data.Traversable Data.Tuple Data.Type.Bool + Data.Type.Coercion Data.Type.Equality Data.Typeable + Data.Typeable.Internal Data.Unique Data.Version Data.Void Data.Word + Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String + Foreign.C.Types Foreign.Concurrent Foreign.ForeignPtr + Foreign.ForeignPtr.Safe Foreign.ForeignPtr.Unsafe Foreign.Marshal + Foreign.Marshal.Alloc Foreign.Marshal.Array Foreign.Marshal.Error + Foreign.Marshal.Pool Foreign.Marshal.Safe Foreign.Marshal.Unsafe + Foreign.Marshal.Utils Foreign.Ptr Foreign.Safe Foreign.StablePtr + Foreign.Storable GHC.Arr GHC.Base GHC.Char GHC.Conc GHC.Conc.IO + GHC.Conc.Signal GHC.Conc.Sync GHC.ConsoleHandler GHC.Constants + GHC.Desugar GHC.Enum GHC.Environment GHC.Err GHC.Exception + GHC.ExecutionStack GHC.ExecutionStack.Internal GHC.Exts + GHC.Fingerprint GHC.Fingerprint.Type GHC.Float + GHC.Float.ConversionUtils GHC.Float.RealFracMethods GHC.Foreign + GHC.ForeignPtr GHC.GHCi GHC.Generics GHC.IO GHC.IO.Buffer + GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding + GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure + GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types + GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 + GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD + GHC.IO.Handle.Internals GHC.IO.Handle.Text GHC.IO.Handle.Types + GHC.IO.IOMode GHC.IO.Unsafe GHC.IOArray GHC.IORef GHC.Int GHC.List + GHC.MVar GHC.Natural GHC.Num GHC.OldList GHC.OverloadedLabels + GHC.PArr GHC.Pack GHC.Profiling GHC.Ptr GHC.Read GHC.Real + GHC.RTS.Flags GHC.ST GHC.StaticPtr GHC.STRef GHC.Show GHC.Stable + GHC.Stack GHC.Stack.CCS GHC.Stack.Types GHC.Stats GHC.Storable + GHC.TopHandler GHC.TypeLits GHC.Unicode GHC.Weak GHC.Word Numeric + Numeric.Natural Prelude System.CPUTime System.Console.GetOpt + System.Environment System.Exit System.IO System.IO.Error + System.IO.Unsafe System.Info System.Mem System.Mem.StableName + System.Mem.Weak System.Posix.Internals System.Posix.Types + System.Timeout Text.ParserCombinators.ReadP + Text.ParserCombinators.ReadPrec Text.Printf Text.Read Text.Read.Lex + Text.Show Text.Show.Functions Unsafe.Coerce GHC.Event +hidden-modules: Control.Monad.ST.Imp Control.Monad.ST.Lazy.Imp + Data.OldList Foreign.ForeignPtr.Imp + System.Environment.ExecutablePath GHC.Event.Arr GHC.Event.Array + GHC.Event.Clock GHC.Event.Control GHC.Event.EPoll + GHC.Event.IntTable GHC.Event.Internal GHC.Event.KQueue + GHC.Event.Manager GHC.Event.PSQ GHC.Event.Poll GHC.Event.Thread + GHC.Event.TimerManager GHC.Event.Unique +abi: 472df40e39128303d276cf121f250e89 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/base-4.9.0.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/base-4.9.0.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/base-4.9.0.0 +hs-libraries: HSbase-4.9.0.0 +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/base-4.9.0.0/include +includes: + HsBase.h +depends: + ghc-prim-0.5.0.0 integer-gmp-1.0.0.0 rts +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/base-4.9.0.0/base.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/base-4.9.0.0 +--- +name: integer-gmp +version: 1.0.0.0 +id: integer-gmp-1.0.0.0 +key: integer-gmp-1.0.0.0 +license: BSD3 +maintainer: hvr@gnu.org +synopsis: Integer library based on GMP +category: Numeric, Algebra +author: Herbert Valerio Riedel +exposed: True +exposed-modules: + GHC.Integer GHC.Integer.Logarithms GHC.Integer.Logarithms.Internals + GHC.Integer.GMP.Internals +hidden-modules: GHC.Integer.Type +abi: 32980bb533b4a3996f3424fd198cf767 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/integer-gmp-1.0.0.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/integer-gmp-1.0.0.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/integer-gmp-1.0.0.0 +hs-libraries: HSinteger-gmp-1.0.0.0 +extra-libraries: + gmp +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/integer-gmp-1.0.0.0/include +depends: + ghc-prim-0.5.0.0 +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0/integer-gmp.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/integer-gmp-1.0.0.0 +--- +name: ghc-prim +version: 0.5.0.0 +id: ghc-prim-0.5.0.0 +key: ghc-prim-0.5.0.0 +license: BSD3 +maintainer: libraries@haskell.org +synopsis: GHC primitives +description: + GHC primitives. +category: GHC +exposed: True +exposed-modules: + GHC.CString GHC.Classes GHC.Debug GHC.IntWord64 GHC.Magic + GHC.PrimopWrappers GHC.Tuple GHC.Types GHC.Prim +abi: 9f5ec1125ba73d164ce53f7b537009e8 +trusted: False +import-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-prim-0.5.0.0 +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/ghc-prim-0.5.0.0 +data-dir: /opt/ghc/head/share/x86_64-linux-ghc-7.11.20151213/ghc-prim-0.5.0.0 +hs-libraries: HSghc-prim-0.5.0.0 +depends: + rts +haddock-interfaces: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-prim-0.5.0.0/ghc-prim.haddock +haddock-html: /opt/ghc/head/share/doc/ghc/html/libraries/ghc-prim-0.5.0.0 +--- +name: rts +version: 1.0 +id: rts +key: rts +license: BSD3 +maintainer: glasgow-haskell-users@haskell.org +exposed: True +abi: +trusted: False +library-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/rts +hs-libraries: HSrts Cffi +extra-libraries: + m rt dl +include-dirs: /opt/ghc/head/lib/ghc-7.11.20151213/include +includes: + Stg.h +ld-options: "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_static_info" + "-Wl,-u,base_GHCziPtr_Ptr_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Wzh_static_info" + "-Wl,-u,base_GHCziInt_I8zh_static_info" + "-Wl,-u,base_GHCziInt_I16zh_static_info" + "-Wl,-u,base_GHCziInt_I32zh_static_info" + "-Wl,-u,base_GHCziInt_I64zh_static_info" + "-Wl,-u,base_GHCziWord_W8zh_static_info" + "-Wl,-u,base_GHCziWord_W16zh_static_info" + "-Wl,-u,base_GHCziWord_W32zh_static_info" + "-Wl,-u,base_GHCziWord_W64zh_static_info" + "-Wl,-u,base_GHCziStable_StablePtr_static_info" + "-Wl,-u,ghczmprim_GHCziTypes_Izh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Czh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info" + "-Wl,-u,base_GHCziPtr_Ptr_con_info" + "-Wl,-u,base_GHCziPtr_FunPtr_con_info" + "-Wl,-u,base_GHCziStable_StablePtr_con_info" + "-Wl,-u,ghczmprim_GHCziTypes_False_closure" + "-Wl,-u,ghczmprim_GHCziTypes_True_closure" + "-Wl,-u,base_GHCziPack_unpackCString_closure" + "-Wl,-u,base_GHCziIOziException_stackOverflow_closure" + "-Wl,-u,base_GHCziIOziException_heapOverflow_closure" + "-Wl,-u,base_ControlziExceptionziBase_nonTermination_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure" + "-Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure" + "-Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure" + "-Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure" + "-Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure" + "-Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure" + "-Wl,-u,base_GHCziTopHandler_flushStdHandles_closure" + "-Wl,-u,base_GHCziTopHandler_runIO_closure" + "-Wl,-u,base_GHCziTopHandler_runNonIO_closure" + "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure" + "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure" + "-Wl,-u,base_GHCziConcziSync_runSparks_closure" + "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure"
@@ -0,0 +1,8 @@+module Stack.Ghci.FakePaths + ( defaultDrive + ) where + +-- | Helpers for writing fake paths for test suite for the GhciScript DSL. This +-- must be a separate module because it is used in Template Haskell splices. +defaultDrive :: FilePath +defaultDrive = "/"
@@ -0,0 +1,8 @@+module Stack.Ghci.FakePaths + ( defaultDrive + ) where + +-- | Helpers for writing fake paths for test suite for the GhciScript DSL. This +-- must be a separate module because it is used in Template Haskell splices. +defaultDrive :: FilePath +defaultDrive = "C:\\"