├── .devcontainer ├── .gitignore ├── GHC.Dockerfile ├── LICENSE ├── README.md ├── assets │ └── cradles │ │ ├── cabal │ │ └── hie.yaml │ │ └── stack │ │ └── hie.yaml ├── conf │ ├── shell │ │ └── var │ │ │ └── tmp │ │ │ └── snippets │ │ │ ├── rc.sh │ │ │ └── rc2.sh │ └── stack │ │ └── etc │ │ └── stack │ │ └── config.yaml ├── devcontainer.json ├── ghc-9.10.1 │ └── devcontainer.json ├── ghc-9.12.1 │ └── devcontainer.json └── scripts │ └── usr │ └── local │ └── bin │ ├── fix-chsh.sh │ ├── onCreateCommand.sh │ └── postCreateCommand.sh ├── .dockerignore ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── docs_report.md │ ├── feature_request.md │ └── question.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── integration-tests.yml │ ├── lint.yml │ ├── stan.yml │ ├── tmate.yml │ └── unit-tests.yml ├── .gitignore ├── .hlint-test.yaml ├── .hlint.yaml ├── .readthedocs.yaml ├── .stan.toml ├── .yamllint.yaml ├── CONTRIBUTING.md ├── ChangeLog.md ├── LICENSE ├── Makefile ├── README.md ├── Setup.hs ├── SetupHooks.hs ├── app └── Main.hs ├── cabal.config ├── cabal.project ├── doc ├── CONTRIBUTING.md ├── ChangeLog.md ├── Makefile ├── README.md ├── SIGNING_KEY.md ├── azure │ ├── azure-linux-template.yml │ ├── azure-osx-template.yml │ ├── azure-pipelines.yml │ ├── azure-simple.yml │ └── azure-windows-template.yml ├── build_overview.md ├── commands │ ├── bench_command.md │ ├── build_command.md │ ├── clean_command.md │ ├── config_command.md │ ├── docker_command.md │ ├── dot_command.md │ ├── eval_command.md │ ├── exec_command.md │ ├── ghc_command.md │ ├── ghci_command.md │ ├── haddock_command.md │ ├── hoogle_command.md │ ├── hpc_command.md │ ├── ide_command.md │ ├── index.md │ ├── init_command.md │ ├── install_command.md │ ├── list_command.md │ ├── ls_command.md │ ├── new_command.md │ ├── path_command.md │ ├── purge_command.md │ ├── query_command.md │ ├── repl_command.md │ ├── run_command.md │ ├── runghc_command.md │ ├── runhaskell_command.md │ ├── script_command.md │ ├── sdist_command.md │ ├── setup_command.md │ ├── templates_command.md │ ├── test_command.md │ ├── uninstall_command.md │ ├── unpack_command.md │ ├── update_command.md │ ├── upgrade_command.md │ └── upload_command.md ├── community │ └── index.md ├── configure │ ├── customisation_scripts.md │ ├── environment_variables.md │ ├── global_flags.md │ ├── index.md │ └── yaml │ │ ├── index.md │ │ ├── non-project.md │ │ └── project.md ├── css │ └── extra.css ├── dev_containers.md ├── faq.md ├── glossary.md ├── img │ ├── hidden-warning.svg │ ├── manageHLS.png │ ├── stack-favicon.svg │ ├── stack-logo-white.svg │ ├── stack-open-graph.png │ └── stack-open-graph.svg ├── install_and_upgrade.md ├── js │ └── searchhack.js ├── maintainers │ ├── 7zip.md │ ├── archive │ │ ├── README.md │ │ ├── docker.md │ │ ├── docker_images.md │ │ └── releases.md │ ├── ghc.md │ ├── haskellstack.org.md │ ├── msys.md │ ├── releases.md │ ├── self-hosted_runners.md │ ├── stack_errors.md │ ├── team_process.md │ └── version_scheme.md ├── other_resources.md ├── requirements.txt ├── resources │ ├── appveyor.yml │ ├── stack-and-stackage-avatar.svg │ ├── travis-complex.yml │ └── travis-simple.yml ├── topics │ ├── CI.md │ ├── Stack_and_VS_Code.md │ ├── azure_ci.md │ ├── custom_snapshot.md │ ├── debugging.md │ ├── developing_on_windows.md │ ├── docker_integration.md │ ├── editor_integration.md │ ├── haskell_and_c_code.md │ ├── index.md │ ├── lock_files.md │ ├── nix_integration.md │ ├── nonstandard_project_init.md │ ├── package_location.md │ ├── scripts.md │ ├── shell_autocompletion.md │ ├── snapshot_location.md │ ├── stack_root.md │ ├── stack_work.md │ ├── stack_yaml_vs_cabal_package_file.md │ └── travis_ci.md └── tutorial │ ├── building_existing_projects.md │ ├── building_your_project.md │ ├── cabal_flags_and_ghc_options.md │ ├── executing_commands.md │ ├── hello_world_example.md │ ├── index.md │ ├── installed_package_databases.md │ ├── locations_used_by_stack.md │ ├── multi-package_projects.md │ ├── package_description.md │ ├── project_configuration.md │ ├── stack_build_synonyms.md │ ├── stack_build_targets.md │ ├── stack_configuration.md │ ├── tutorial_conclusion.md │ └── using_ghc_interactively.md ├── dot-dir-locals.el ├── etc ├── dockerfiles │ ├── arm64.Dockerfile │ └── stack-build │ │ └── README.md └── scripts │ ├── LICENSE │ ├── README.md │ ├── Setup.hs │ ├── build-stack-installer.hs │ ├── ci-setup.sh │ ├── get-hlint.sh │ ├── get-stack.sh │ ├── hlint.sh │ ├── install-many-stack-releases.hs │ ├── integration-tests.sh │ ├── ls-deps-as-cabal-constraints.sh │ ├── mirror-ghc-bindists-to-github.sh │ ├── package.yaml │ ├── release-linux-aarch64.hs │ ├── release.hs │ ├── sdist-with-bounds.sh │ ├── stack.yaml │ ├── upload-haddocks.sh │ └── with-vagrant.sh ├── mkdocs.yml ├── package.yaml ├── src ├── Control │ └── Concurrent │ │ └── Execute.hs ├── Data │ ├── Attoparsec │ │ ├── Args.hs │ │ ├── Combinators.hs │ │ └── Interpreter.hs │ └── Monoid │ │ └── Map.hs ├── GHC │ └── Utils │ │ └── GhcPkg │ │ └── Main │ │ └── Compat.hs ├── Network │ └── HTTP │ │ └── StackClient.hs ├── Options │ └── Applicative │ │ ├── Args.hs │ │ ├── Builder │ │ └── Extra.hs │ │ └── Complicated.hs ├── Path │ ├── CheckInstall.hs │ ├── Extra.hs │ └── Find.hs ├── Stack.hs ├── Stack │ ├── Build.hs │ ├── Build │ │ ├── Cache.hs │ │ ├── ConstructPlan.hs │ │ ├── Execute.hs │ │ ├── ExecuteEnv.hs │ │ ├── ExecutePackage.hs │ │ ├── Haddock.hs │ │ ├── Installed.hs │ │ ├── Source.hs │ │ └── Target.hs │ ├── BuildInfo.hs │ ├── BuildOpts.hs │ ├── BuildPlan.hs │ ├── CLI.hs │ ├── Clean.hs │ ├── Component.hs │ ├── ComponentFile.hs │ ├── Config.hs │ ├── Config │ │ ├── Build.hs │ │ ├── ConfigureScript.hs │ │ ├── Docker.hs │ │ └── Nix.hs │ ├── ConfigCmd.hs │ ├── Constants.hs │ ├── Constants │ │ ├── Config.hs │ │ └── StackProgName.hs │ ├── Coverage.hs │ ├── DefaultColorWhen.hs │ ├── DependencyGraph.hs │ ├── Docker.hs │ ├── DockerCmd.hs │ ├── Dot.hs │ ├── Eval.hs │ ├── Exec.hs │ ├── FileWatch.hs │ ├── GhcPkg.hs │ ├── Ghci.hs │ ├── Ghci │ │ └── Script.hs │ ├── Hoogle.hs │ ├── IDE.hs │ ├── Init.hs │ ├── List.hs │ ├── Lock.hs │ ├── Ls.hs │ ├── New.hs │ ├── Nix.hs │ ├── Options │ │ ├── BenchParser.hs │ │ ├── BuildMonoidParser.hs │ │ ├── BuildParser.hs │ │ ├── CleanParser.hs │ │ ├── Completion.hs │ │ ├── ConfigEnvParser.hs │ │ ├── ConfigParser.hs │ │ ├── ConfigSetParser.hs │ │ ├── DockerParser.hs │ │ ├── DotParser.hs │ │ ├── EvalParser.hs │ │ ├── ExecParser.hs │ │ ├── FlagsParser.hs │ │ ├── GhcBuildParser.hs │ │ ├── GhcVariantParser.hs │ │ ├── GhciParser.hs │ │ ├── GlobalParser.hs │ │ ├── HaddockParser.hs │ │ ├── HpcReportParser.hs │ │ ├── IdeParser.hs │ │ ├── InitParser.hs │ │ ├── LogLevelParser.hs │ │ ├── LsParser.hs │ │ ├── NewParser.hs │ │ ├── NixParser.hs │ │ ├── PackageParser.hs │ │ ├── PackagesParser.hs │ │ ├── PathParser.hs │ │ ├── PvpBoundsParser.hs │ │ ├── SDistParser.hs │ │ ├── ScriptParser.hs │ │ ├── SetupParser.hs │ │ ├── SnapshotParser.hs │ │ ├── TestParser.hs │ │ ├── UnpackParser.hs │ │ ├── UpgradeParser.hs │ │ ├── UploadParser.hs │ │ └── Utils.hs │ ├── Package.hs │ ├── PackageDump.hs │ ├── PackageFile.hs │ ├── Path.hs │ ├── Prelude.hs │ ├── Query.hs │ ├── Runners.hs │ ├── SDist.hs │ ├── Script.hs │ ├── Setup.hs │ ├── Setup │ │ └── Installed.hs │ ├── SetupCmd.hs │ ├── SourceMap.hs │ ├── Storage │ │ ├── Project.hs │ │ ├── User.hs │ │ └── Util.hs │ ├── Templates.hs │ ├── Types │ │ ├── AddCommand.hs │ │ ├── AllowNewerDeps.hs │ │ ├── ApplyGhcOptions.hs │ │ ├── ApplyProgOptions.hs │ │ ├── Build.hs │ │ ├── Build │ │ │ ├── ConstructPlan.hs │ │ │ └── Exception.hs │ │ ├── BuildConfig.hs │ │ ├── BuildOpts.hs │ │ ├── BuildOptsCLI.hs │ │ ├── BuildOptsMonoid.hs │ │ ├── CabalConfigKey.hs │ │ ├── Cache.hs │ │ ├── Casa.hs │ │ ├── ColorWhen.hs │ │ ├── CompCollection.hs │ │ ├── Compiler.hs │ │ ├── CompilerBuild.hs │ │ ├── CompilerPaths.hs │ │ ├── Component.hs │ │ ├── ComponentUtils.hs │ │ ├── Config.hs │ │ ├── Config │ │ │ └── Exception.hs │ │ ├── ConfigMonoid.hs │ │ ├── ConfigSetOpts.hs │ │ ├── ConfigureOpts.hs │ │ ├── Curator.hs │ │ ├── Dependency.hs │ │ ├── DependencyTree.hs │ │ ├── Docker.hs │ │ ├── DockerEntrypoint.hs │ │ ├── DotConfig.hs │ │ ├── DotOpts.hs │ │ ├── DownloadInfo.hs │ │ ├── DumpLogs.hs │ │ ├── DumpPackage.hs │ │ ├── EnvConfig.hs │ │ ├── EnvSettings.hs │ │ ├── ExtraDirs.hs │ │ ├── FileDigestCache.hs │ │ ├── GHCDownloadInfo.hs │ │ ├── GHCVariant.hs │ │ ├── GhcOptionKey.hs │ │ ├── GhcOptions.hs │ │ ├── GhcPkgExe.hs │ │ ├── GhcPkgId.hs │ │ ├── GhciOpts.hs │ │ ├── GlobalOpts.hs │ │ ├── GlobalOptsMonoid.hs │ │ ├── HpcReportOpts.hs │ │ ├── IdeOpts.hs │ │ ├── Installed.hs │ │ ├── InterfaceOpt.hs │ │ ├── IsMutable.hs │ │ ├── LockFileBehavior.hs │ │ ├── LsOpts.hs │ │ ├── MsysEnvironment.hs │ │ ├── NamedComponent.hs │ │ ├── Nix.hs │ │ ├── Package.hs │ │ ├── PackageFile.hs │ │ ├── PackageName.hs │ │ ├── ParentMap.hs │ │ ├── Platform.hs │ │ ├── Project.hs │ │ ├── ProjectAndConfigMonoid.hs │ │ ├── ProjectConfig.hs │ │ ├── PvpBounds.hs │ │ ├── Runner.hs │ │ ├── SCM.hs │ │ ├── SDistOpts.hs │ │ ├── SetupInfo.hs │ │ ├── SetupOpts.hs │ │ ├── Snapshot.hs │ │ ├── SourceMap.hs │ │ ├── StackYamlLoc.hs │ │ ├── Storage.hs │ │ ├── TemplateName.hs │ │ ├── UnusedFlags.hs │ │ ├── UpgradeOpts.hs │ │ ├── UploadOpts.hs │ │ ├── Version.hs │ │ ├── VersionedDownloadInfo.hs │ │ └── WantedCompilerSetter.hs │ ├── Uninstall.hs │ ├── Unpack.hs │ ├── Update.hs │ ├── Upgrade.hs │ └── Upload.hs ├── System │ └── Process │ │ └── Pager.hs ├── setup-shim │ └── StackSetupShim.hs ├── unix │ ├── Stack │ │ ├── Constants │ │ │ └── UsrLibDirs.hs │ │ └── Docker │ │ │ └── Handlers.hs │ ├── System │ │ ├── Info │ │ │ └── ShortPathName.hs │ │ ├── Permissions.hs │ │ ├── Terminal.hsc │ │ └── Uname.hsc │ └── cbits │ │ └── uname.c └── windows │ ├── Stack │ ├── Constants │ │ └── UsrLibDirs.hs │ └── Docker │ │ └── Handlers.hs │ └── System │ ├── Info │ └── ShortPathName.hs │ ├── Permissions.hs │ ├── Posix │ └── User.hs │ ├── Terminal.hs │ └── Uname.hs ├── stack-ghc-9.10.1.yaml ├── stack-ghc-9.10.1.yaml.lock ├── stack-ghc-9.12.2.yaml ├── stack-ghc-9.12.2.yaml.lock ├── stack.cabal ├── stack.yaml ├── stack.yaml.lock └── tests ├── integration ├── .gitignore ├── IntegrationSpec.hs ├── README.md ├── lib │ ├── StackTest.hs │ └── StackTest │ │ └── Repl.hs ├── run-single-test.sh ├── run-sort-tests.sh └── tests │ ├── 111-custom-snapshot │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── my-snapshot.yaml │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 1198-multiple-exes-with-same-name │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── also-has-exe-foo │ │ ├── also-has-exe-foo.cabal │ │ └── app │ │ │ └── Main.hs │ │ ├── app │ │ └── Main.hs │ │ ├── has-exe-foo-too │ │ ├── app │ │ │ └── Main.hs │ │ └── has-exe-foo-too.cabal │ │ └── has-exe-foo.cabal │ ├── 1265-extensible-snapshots │ ├── Main.hs │ └── files │ │ ├── snapshot-2.yaml │ │ ├── snapshot-modify-lts.yaml │ │ ├── snapshot.yaml │ │ ├── snapshots │ │ ├── local-snapshot.yaml │ │ ├── package-0.1.2.3.tar.gz │ │ └── remote-snapshot.yaml │ │ ├── stack-local-snapshot.yaml │ │ ├── stack-modify-lts.yaml │ │ ├── stack-remote-snapshot.yaml │ │ └── stack.yaml │ ├── 1336-1337-new-package-names │ ├── .gitignore │ └── Main.hs │ ├── 1337-unicode-everywhere │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── app │ │ └── Main.hs │ │ ├── stack.yaml │ │ ├── ארץ │ │ └── Пσε.hs │ │ ├── いろは-LICENSE │ │ └── 以.cabal │ ├── 1438-configure-options │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ ├── stack-everything.yaml │ │ ├── stack-everything.yaml.lock │ │ ├── stack-locals.yaml │ │ ├── stack-locals.yaml.lock │ │ ├── stack-name.yaml │ │ └── stack-targets.yaml │ ├── 1659-skip-component │ ├── Main.hs │ └── files │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Setup.hs │ │ ├── app │ │ ├── Main.hs │ │ └── MainFail.hs │ │ ├── bench │ │ └── Bench.hs │ │ ├── skip-component.cabal │ │ ├── src │ │ └── Lib.hs │ │ ├── stack.yaml │ │ └── test │ │ └── Spec.hs │ ├── 1884-url-to-tarball │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ └── stack.yaml │ ├── 2195-depend-on-exe │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ └── stack.yaml │ ├── 2433-ghc-by-version │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── fake-path │ │ ├── ghc │ │ └── ghc-pkg │ │ ├── foo.hs │ │ └── run.sh │ ├── 2465-init-no-packages │ ├── Main.hs │ └── files │ │ └── .gitignore │ ├── 2643-copy-compiler-tool │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── Bar.hs │ │ ├── Baz.hs │ │ ├── Foo.hs │ │ ├── LICENSE │ │ ├── Setup.hs │ │ └── copy-compiler-tool-test.cabal │ ├── 2781-shadow-bug │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── bar │ │ ├── bar.cabal │ │ ├── bench │ │ │ └── bench.hs │ │ └── src │ │ │ └── Bar.hs │ │ ├── foo │ │ ├── foo.cabal │ │ ├── v1 │ │ │ └── Foo.hs │ │ └── v2 │ │ │ └── Foo.hs │ │ └── stack.yaml │ ├── 2997-ensure-warnings-output │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── bar │ │ ├── package.yaml │ │ └── src │ │ │ └── Bar.hs │ │ ├── foo │ │ ├── package.yaml │ │ └── src │ │ │ └── Foo.hs │ │ └── stack.yaml │ ├── 32-unlisted-module │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── embed_FAIL.txt │ │ ├── embed_OK.txt │ │ ├── files.cabal │ │ ├── src │ │ ├── Main.hs │ │ ├── Unlisted_FAIL.hs │ │ ├── Unlisted_OK.hs │ │ └── main │ │ │ └── Main.hs │ │ └── stack.yaml │ ├── 3229-exe-targets │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── app │ │ ├── Alpha.hs │ │ └── Beta.hs │ │ ├── foo.cabal │ │ └── src │ │ └── Foo.hs │ ├── 3315-multi-ghc-options │ ├── Main.hs │ └── files │ │ ├── multi-ghc-options.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 335-multi-package-flags │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── new-template.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 3390-unbuildable-test │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ ├── stack.yaml │ │ └── test │ │ └── Spec.hs │ ├── 3431-precompiled-works │ ├── Main.hs │ └── files │ │ ├── custom1 │ │ ├── custom1.yaml │ │ └── stack.yaml │ │ └── custom2 │ │ ├── custom2.yaml │ │ └── stack.yaml │ ├── 345-override-bytestring │ ├── Main.hs │ └── files │ │ ├── Foo.hs │ │ ├── foo.cabal │ │ └── stack.yaml │ ├── 3520-revision-matching │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── bad-stack.yaml │ │ ├── good-stack.yaml │ │ ├── package.yaml │ │ └── src │ │ └── Foo.hs │ ├── 3533-extra-deps-solver │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── local-mmorph │ │ ├── package.yaml │ │ └── src │ │ │ └── Lib.hs │ │ ├── orig-stack.yaml │ │ └── uses-mmorph │ │ ├── package.yaml │ │ └── src │ │ └── Lib.hs │ ├── 3574-extra-dep-local │ ├── Main.hs │ └── files │ │ ├── foo │ │ ├── Foo.hs │ │ └── foo.cabal │ │ └── stack.yaml │ ├── 3591-cabal-warnings-once │ ├── Main.hs │ └── files │ │ ├── foo.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 3631-build-http2 │ └── Main.hs │ ├── 365-invalid-success │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── app │ │ └── Main.hs │ │ ├── new-template.cabal │ │ └── stack.yaml │ ├── 366-non-root-dir │ ├── Main.hs │ └── files │ │ ├── app │ │ └── Main.hs │ │ ├── new-template.cabal │ │ └── stack.yaml │ ├── 3685-config-yaml-for-allow-newer │ ├── Main.hs │ └── files │ │ └── .gitignore │ ├── 370-invalid-setup-hs │ ├── Main.hs │ └── files │ │ ├── LICENSE │ │ ├── Setup.hs │ │ ├── new-template.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 3787-internal-libs-with-no-main-lib │ ├── Main.hs │ └── files │ │ ├── exe │ │ └── Main.hs │ │ ├── files.cabal │ │ ├── src-sublib │ │ └── B.hs │ │ ├── stack.yaml │ │ └── stack.yaml.lock │ ├── 384-local-deps │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── dir1 │ │ ├── dir1.cabal │ │ └── src │ │ │ └── Lib.hs │ │ └── dir2 │ │ ├── dir2.cabal │ │ └── src │ │ └── Lib.hs │ ├── 3850-cached-templates-network-errors │ └── Main.hs │ ├── 3861-ignore-bounds-in-snapshots │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── bad-bounds.tar │ │ ├── package.yaml │ │ ├── snapshot.yaml │ │ ├── stack-bad.yaml │ │ └── stack-good.yaml │ ├── 3863-purge-command │ ├── Main.hs │ └── files │ │ ├── new-template.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 3899-dont-rebuild-sublibraries │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── files.cabal │ │ ├── src-exe │ │ └── Main.hs │ │ ├── src-internal │ │ └── Internal.hs │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 3926-ghci-with-sublibraries │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── Setup.hs │ │ ├── files.cabal │ │ ├── src-exe │ │ └── Main.hs │ │ ├── src-internal │ │ ├── Internal.v1 │ │ └── Internal.v2 │ │ ├── src │ │ ├── Lib.v1 │ │ └── Lib.v2 │ │ └── stack.yaml │ ├── 3940-base-upgrade-warning │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── no-base-upgrade.yaml │ │ ├── src │ │ └── .gitkeep │ │ └── unattainable-base.yaml │ ├── 3942-solver-error-output │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── no-deps │ │ └── package.yaml │ │ ├── one-deps │ │ └── package.yaml │ │ ├── script.hs │ │ └── test-stack.yml │ ├── 3959-order-of-flags │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ ├── stack.yaml │ │ └── test │ │ └── Spec.hs │ ├── 397-case-insensitive-flags │ ├── Main.hs │ └── files │ │ ├── new-template.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 3996-sublib-not-depended-upon │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── files.cabal │ │ ├── src-internal │ │ └── Internal.hs │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 3997-coverage-with-cabal-3 │ ├── Main.hs │ └── files │ │ ├── package.yaml │ │ ├── src │ │ └── Lib.hs │ │ ├── stack.yaml │ │ └── test │ │ └── Main.hs │ ├── 4001-excess-recompilation │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── bench │ │ ├── Main1.hs │ │ └── Main2.hs │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ ├── stack.yaml │ │ └── test │ │ ├── Main1.hs │ │ └── Main2.hs │ ├── 4044-no-run-tests-config │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── Test.hs │ │ ├── package.yaml │ │ └── stack.yaml │ ├── 4085-insufficient-error-message │ ├── Dockerfile │ └── Main.hs │ ├── 4095-utf8-pure-nix │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── ShowUnicode.hs │ │ ├── package.yaml │ │ └── stack.yaml │ ├── 4101-dependency-tree │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Main.hs │ │ ├── stack.yaml │ │ └── subproject │ │ ├── src │ │ └── Main.hs │ │ └── subproject.cabal │ ├── 4105-test-coverage-of-internal-lib │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src-sublib │ │ └── B.hs │ │ ├── src │ │ └── Src.hs │ │ ├── stack.yaml │ │ └── test │ │ └── Main.hs │ ├── 4181-clean-wo-dl-ghc │ ├── Main.hs │ └── files │ │ ├── foo.cabal │ │ └── stack.yaml │ ├── 4215-missing-unregister │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── stack1.yaml │ │ ├── stack2.yaml │ │ ├── v1 │ │ └── package.yaml │ │ └── v2 │ │ └── package.yaml │ ├── 4270-files-order │ ├── Main.hs │ └── files │ │ ├── cbits-ordering.cabal │ │ ├── cbits │ │ ├── a_dependent.c │ │ ├── a_dependent.h │ │ └── the_dependency.c │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 4324-dot-includes-boot-packages │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ └── stack.yaml │ ├── 4390-dot-no-ghc │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ └── stack.yaml │ ├── 4408-init-internal-libs │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ └── foo.cabal │ ├── 443-specify-path │ ├── .gitignore │ └── Main.hs │ ├── 444-package-option │ ├── Main.hs │ └── files │ │ └── Test.hs │ ├── 4453-detailed │ ├── Main.hs │ └── files │ │ ├── src │ │ └── Lib.hs │ │ ├── stack.yaml │ │ ├── test-detailed-example.cabal │ │ └── test │ │ └── Spec.hs │ ├── 4488-newer-cabal-version │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── foo.cabal │ │ ├── stack-bad.yaml │ │ └── stack-good.yaml │ ├── 4706-ignore-ghc-env-files │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── Main.hs │ │ └── package.yaml │ ├── 4754-rebuild-haddocks │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ ├── src │ │ └── Foo.hs │ │ └── stack.yaml │ ├── 4783-doctest-deps │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── acme-dont-copy │ │ ├── Acme │ │ │ └── Dont.hs │ │ ├── COPYRIGHT │ │ ├── Setup.hs │ │ └── acme-dont-copy.cabal │ │ ├── package.yaml │ │ ├── snapshot.yaml │ │ ├── src │ │ └── Foo.hs │ │ ├── stack.yaml │ │ └── test │ │ └── Main.hs │ ├── 4897-boot-package-pruned │ ├── Main.hs │ └── files │ │ ├── directory │ │ └── directory.cabal │ │ ├── files.cabal │ │ └── stack.yaml │ ├── 4938-non-ascii-module-names │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── Lib.hs │ │ ├── Täst.hs │ │ ├── app │ │ └── Main.hs │ │ ├── package.yaml │ │ └── stack.yaml │ ├── 5180-ghc-rts-flags │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 5272-only-locals │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ ├── src │ │ └── Foo.hs │ │ └── stack.yaml │ ├── 5680-share-package-across-projects │ ├── Main.hs │ └── files │ │ ├── package-a │ │ ├── package.yaml │ │ ├── src │ │ │ └── Lib.hs │ │ └── stack.yaml │ │ ├── package-b │ │ ├── package.yaml │ │ ├── src │ │ │ └── Lib.hs │ │ └── stack.yaml │ │ └── package-c │ │ ├── package.yaml │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 6046-missing-sublib-unregister │ ├── Main.hs │ └── files │ │ ├── foo.cabal1 │ │ ├── foo.cabal2 │ │ ├── src │ │ ├── Lib.hs │ │ └── Sub.hs │ │ └── stack.yaml │ ├── 606-local-version-not-exist │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 617-extra-dep-flag │ ├── Main.hs │ └── files │ │ └── stack.yaml │ ├── 617-unused-flag-cli │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 617-unused-flag-name-yaml │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 617-unused-flag-yaml │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── 620-env-command │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── Main.hs │ │ └── run.sh │ ├── 6372-sdist-unicode-test │ ├── .gitignore │ ├── Main.hs │ └── files │ │ ├── package.yaml │ │ ├── src │ │ └── Libαβγ.hs │ │ ├── stack.yaml │ │ └── test١٢٣.cabal │ ├── 6465-msys-environment │ ├── Main.hs │ └── files │ │ ├── Main.hs │ │ ├── Setup.hs │ │ ├── foo.cabal │ │ └── stack.yaml │ ├── 717-sdist-test │ ├── Main.hs │ └── files │ │ ├── package-with-failing-test │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Setup.hs │ │ ├── files │ │ │ └── file.txt │ │ ├── package-with-failing-test.cabal │ │ ├── src │ │ │ └── Lib.hs │ │ └── test │ │ │ └── Test.hs │ │ ├── package-with-th │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Setup.hs │ │ ├── files │ │ │ └── file.txt │ │ ├── package-with-th.cabal │ │ └── src │ │ │ ├── Lib.hs │ │ │ └── TH.hs │ │ ├── package-with-working-th │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Setup.hs │ │ ├── files │ │ │ └── file.txt │ │ ├── package-with-working-th.cabal │ │ └── src │ │ │ ├── Lib.hs │ │ │ └── TH.hs │ │ ├── stack.yaml │ │ └── subdirs │ │ ├── dependent-on-failing-packages │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Setup.hs │ │ ├── dependent-on-failing-packages.cabal │ │ ├── files │ │ │ └── file.txt │ │ └── src │ │ │ └── LibD.hs │ │ └── failing-in-subdir │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Setup.hs │ │ ├── failing-in-subdir.cabal │ │ ├── files │ │ └── file.txt │ │ └── src │ │ ├── LibC.hs │ │ └── THInSubdir.hs │ ├── 763-buildable-false │ ├── Main.hs │ └── files │ │ ├── app │ │ └── Main.hs │ │ ├── files.cabal │ │ └── stack.yaml │ ├── 796-ghc-options │ ├── Main.hs │ └── files │ │ ├── ghc-options.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── allow-newer-specific-packages │ ├── Main.hs │ └── files │ │ ├── foo.cabal │ │ ├── package.yaml │ │ ├── src │ │ └── Foo.hs │ │ └── stack.yaml │ ├── basic-install │ └── Main.hs │ ├── build-ghc │ └── Main.hs │ ├── cabal-non-buildable-bug │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ └── package.yaml │ ├── cabal-public-sublibraries │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── files.cabal │ │ ├── src │ │ ├── Lib.hs │ │ └── Sub.hs │ │ ├── stack.yaml │ │ └── stack.yaml.lock │ ├── cabal-sublibrary-dependency │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ ├── stack.yaml │ │ ├── stack.yaml.lock │ │ └── subproject │ │ ├── src │ │ └── Subproject │ │ │ ├── Lib.hs │ │ │ └── SubLib.hs │ │ └── subproject.cabal │ ├── copy-bins-works │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ ├── src │ │ └── Main.hs │ │ └── stack.yaml │ ├── cyclic-test-deps │ ├── .gitignore │ └── Main.hs │ ├── drop-packages │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ └── stack.yaml │ ├── duplicate-package-ids │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── stack1.yaml │ │ └── stack2.yaml │ ├── ghc-install-hooks │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── foo.hs │ │ └── run.sh │ ├── git-submodules │ ├── Main.hs │ └── files │ │ └── .gitignore │ ├── haddock-options │ ├── Main.hs │ └── files │ │ ├── haddock-options.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── hpack-repo │ ├── Main.hs │ └── files │ │ ├── files.cabal │ │ ├── src │ │ └── Lib.hs │ │ └── stack.yaml │ ├── init-omit-packages │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── bad │ │ ├── Bad.hs │ │ └── bad.cabal │ │ └── good │ │ ├── Good.hs │ │ └── good.cabal │ ├── internal-libraries │ ├── Main.hs │ └── files │ │ ├── Setup.hs │ │ ├── files.cabal │ │ ├── src-bar │ │ └── Main.hs │ │ ├── src-baz │ │ └── Baz.hs │ │ ├── src-foo │ │ └── Foo.hs │ │ ├── src │ │ └── Files.hs │ │ └── stack.yaml │ ├── lock-files │ ├── Main.hs │ └── files │ │ ├── Lib.hs │ │ ├── package.yaml │ │ ├── stack-1-extra │ │ └── stack-2-extras │ ├── module-added-multiple-times │ ├── Main.hs │ └── files │ │ ├── LICENSE │ │ ├── Setup.hs │ │ ├── exe │ │ └── Main.hs │ │ ├── project-a.cabal │ │ ├── src │ │ └── Lib │ │ │ └── A.hs │ │ └── stack.yaml │ ├── multi-test │ ├── Main.hs │ └── files │ │ ├── LICENSE │ │ ├── Setup.hs │ │ ├── app │ │ └── Main.hs │ │ ├── cyclic │ │ ├── Cyclic.hs │ │ ├── LICENSE │ │ ├── Setup.hs │ │ ├── Spec.hs │ │ └── cyclic.cabal │ │ ├── multi-test-suite.cabal │ │ ├── src │ │ └── Lib.hs │ │ ├── stack.yaml │ │ ├── sub-package │ │ ├── src │ │ │ ├── Lib2.hs │ │ │ └── main.hs │ │ ├── sub-package.cabal │ │ └── test │ │ │ └── Spec.hs │ │ ├── test-2 │ │ └── Spec.hs │ │ ├── test-3 │ │ └── Spec.hs │ │ └── test │ │ ├── OtherModule.hs │ │ └── Spec.hs │ ├── mutable-deps │ ├── Main.hs │ └── files │ │ ├── app │ │ └── Main.hs │ │ ├── filepath-1.4.100.4 │ │ ├── LICENSE │ │ ├── Setup.hs │ │ ├── System │ │ │ ├── FilePath.hs │ │ │ ├── FilePath │ │ │ │ ├── Internal.hs │ │ │ │ ├── Posix.hs │ │ │ │ └── Windows.hs │ │ │ ├── OsPath.hs │ │ │ ├── OsPath.hs-boot │ │ │ ├── OsPath │ │ │ │ ├── Common.hs │ │ │ │ ├── Data │ │ │ │ │ └── ByteString │ │ │ │ │ │ ├── Short.hs │ │ │ │ │ │ └── Short │ │ │ │ │ │ ├── Internal.hs │ │ │ │ │ │ └── Word16.hs │ │ │ │ ├── Encoding.hs │ │ │ │ ├── Encoding │ │ │ │ │ └── Internal.hs │ │ │ │ ├── Internal.hs │ │ │ │ ├── Posix.hs │ │ │ │ ├── Posix │ │ │ │ │ └── Internal.hs │ │ │ │ ├── Types.hs │ │ │ │ ├── Windows.hs │ │ │ │ └── Windows │ │ │ │ │ └── Internal.hs │ │ │ ├── OsString.hs │ │ │ └── OsString │ │ │ │ ├── Common.hs │ │ │ │ ├── Internal.hs │ │ │ │ ├── Internal │ │ │ │ └── Types.hs │ │ │ │ ├── Posix.hs │ │ │ │ └── Windows.hs │ │ └── filepath.cabal │ │ ├── files.cabal │ │ ├── src │ │ └── Files.hs │ │ └── stack.yaml │ ├── nice-resolver-names │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ └── package.yaml │ ├── no-rerun-tests │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── package.yaml │ │ ├── stack.yaml │ │ └── test │ │ └── Spec.hs │ ├── override-compiler │ ├── Main.hs │ └── files │ │ └── stack.yaml │ ├── proper-rebuilds │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── app │ │ └── Main.hs │ │ ├── files.cabal │ │ ├── src │ │ ├── Lib.hs.v1 │ │ └── Lib.hs.v2 │ │ └── stack.yaml │ ├── relative-script-snapshots │ ├── Main.hs │ └── files │ │ └── subdir │ │ ├── script.hs │ │ └── snapshot.yaml │ ├── sanity │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── foo.bat │ │ └── foo.sh │ ├── script-extra-dep │ ├── Main.hs │ └── files │ │ └── script.hs │ ├── skip-unreachable-dirs │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ └── foo.cabal │ ├── stackage-3185-ignore-bounds-in-snapshot │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ ├── README.md │ │ ├── as-extra-dep.yaml │ │ ├── as-snapshot.yaml │ │ ├── package.yaml │ │ └── snapshot.yaml │ ├── upload │ ├── Main.hs │ └── files │ │ ├── FakeHackage.hs │ │ ├── FakeHackageStart.hs │ │ ├── Foo.hs │ │ ├── gpg-disabled │ │ ├── gpg │ │ ├── gpg.bat │ │ ├── gpg2 │ │ └── gpg2.bat │ │ ├── stack.yaml │ │ └── uploadtest.cabal │ ├── variables-in-template-file-names │ ├── Main.hs │ └── files │ │ ├── .gitignore │ │ └── template.hsfiles │ └── watched-files │ ├── Main.hs │ └── files │ ├── .gitignore │ ├── Main.hs │ ├── package.yaml │ └── stack.yaml └── unit ├── Spec.hs ├── Stack ├── ArgsSpec.hs ├── Build │ ├── ExecuteSpec.hs │ └── TargetSpec.hs ├── Config │ └── DockerSpec.hs ├── ConfigSpec.hs ├── DotSpec.hs ├── Ghci │ └── ScriptSpec.hs ├── GhciSpec.hs ├── LockSpec.hs ├── NixSpec.hs ├── PackageDumpSpec.hs ├── Types │ └── TemplateNameSpec.hs ├── Untar │ ├── README.md │ ├── createFiles.sh │ ├── test1.tar.gz │ └── test2.tar.gz └── UploadSpec.hs ├── package-dump ├── ghc-7.10.txt ├── ghc-7.8.4-osx.txt ├── ghc-7.8.txt └── ghc-head.txt ├── unix └── Stack │ └── Ghci │ └── FakePaths.hs └── windows └── Stack └── Ghci └── FakePaths.hs /.devcontainer/README.md: -------------------------------------------------------------------------------- 1 | # Dev Containers 2 | 3 | For further information, see 4 | [haskellstack.org](https://docs.haskellstack.org): Stack's code (advanced) \> 5 | Contributors \> Dev Containers or 6 | [../doc/dev_containers.md](../doc/dev_containers.md). 7 | 8 | ## License 9 | 10 | The code in this directory is not part of Stack (the software) and, with the 11 | exceptions noted in [LICENSE](LICENSE), is distributed under the terms of the 12 | MIT License. 13 | -------------------------------------------------------------------------------- /.devcontainer/assets/cradles/cabal/hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | multi: 3 | - path: "./Setup.hs" 4 | config: 5 | cradle: 6 | direct: 7 | arguments: [] 8 | - path: "./" 9 | config: 10 | cradle: 11 | cabal: 12 | - path: "./src" 13 | component: "lib:stack" 14 | - path: "./app" 15 | component: "stack:exe:stack" 16 | - path: "./tests/integration" 17 | component: "stack:exe:stack-integration-test" 18 | - path: "./tests/unit" 19 | component: "stack:test:stack-unit-test" 20 | -------------------------------------------------------------------------------- /.devcontainer/assets/cradles/stack/hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | multi: 3 | - path: "./Setup.hs" 4 | config: 5 | cradle: 6 | direct: 7 | arguments: [] 8 | - path: "./" 9 | config: 10 | cradle: 11 | stack: 12 | - path: "./src" 13 | component: "stack:lib" 14 | - path: "./app" 15 | component: "stack:exe:stack" 16 | - path: "./tests/integration" 17 | component: "stack:exe:stack-integration-test" 18 | - path: "./tests/unit" 19 | component: "stack:test:stack-unit-test" 20 | -------------------------------------------------------------------------------- /.devcontainer/conf/shell/var/tmp/snippets/rc.sh: -------------------------------------------------------------------------------- 1 | 2 | # remove potentially appended $HOME/.local/bin from PATH 3 | PATH="${PATH%:$HOME/.local/bin}" 4 | 5 | # set PATH so it includes user's private bin if it exists 6 | if [ -d "$HOME/bin" ] && [[ "$PATH" != *"$HOME/bin"* ]] ; then 7 | PATH="$HOME/bin:$PATH" 8 | fi 9 | 10 | # set PATH so it includes user's private bin if it exists 11 | if [ -d "$HOME/.local/bin" ] && [[ "$PATH" != *"$HOME/.local/bin"* ]] ; then 12 | PATH="$HOME/.local/bin:$PATH" 13 | fi 14 | -------------------------------------------------------------------------------- /.devcontainer/conf/shell/var/tmp/snippets/rc2.sh: -------------------------------------------------------------------------------- 1 | 2 | # set PATH so it includes cabal's bin if it exists 3 | if [ -d "$HOME/.cabal/bin" ] && [[ "$PATH" != *"$HOME/.cabal/bin"* ]] ; then 4 | PATH="$HOME/.cabal/bin:$PATH" 5 | fi 6 | -------------------------------------------------------------------------------- /.devcontainer/conf/stack/etc/stack/config.yaml: -------------------------------------------------------------------------------- 1 | # Use only the GHC available on the PATH 2 | system-ghc: true 3 | # Do not automatically install GHC when necessary 4 | install-ghc: false 5 | -------------------------------------------------------------------------------- /.devcontainer/scripts/usr/local/bin/postCreateCommand.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) 2023 b-data GmbH. 3 | # Distributed under the terms of the MIT License. 4 | 5 | set -e 6 | 7 | # Change ownership of the stack folder 8 | sudo chown "$(id -u)":"$(id -g)" /workspaces/stack 9 | 10 | # Updates list of known packages 11 | cabal update 12 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /.cabal-sandbox 2 | /cabal*.config 3 | /dist 4 | /target 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/docs_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation Report 3 | about: Report if Stack's documentation appears inaccurate or incomplete 4 | --- 5 | 6 | Please report problems with Stack's in-app help and error messages as a Stack 7 | bug. Please follow the schema below for reporting if Stack's online 8 | documentation appears inaccurate or incomplete: 9 | 10 | ### Location of the documentation 11 | 12 | Please provide the link to the documentation in question. All headings have 13 | permanent links associated with them. 14 | 15 | ### Is it inaccurate? 16 | 17 | Why do you think the documentation is wrong? 18 | 19 | ### Is it incomplete? 20 | 21 | What do you think is missing from the documentation? 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Request a feature be added to Stack, or discuss such a feature 4 | --- 5 | 6 | Make sure that you are using the latest release (currently Stack 3.5.1). See the 7 | [upgrade instructions](http://docs.haskellstack.org/en/stable/install_and_upgrade/#upgrade) 8 | to upgrade. 9 | 10 | Please state as clearly as you can what feature you are recommending, and the 11 | motivation for adding the feature. 12 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Note: Fixes for the online documentation of the current Stack release 2 | (https://docs.haskellstack.org/en/stable/) should target the 'stable' branch, 3 | not the 'master' branch. 4 | 5 | Please include the following checklist in your pull request: 6 | 7 | * [ ] Any changes that could be relevant to users have been recorded in ChangeLog.md. 8 | * [ ] The documentation has been updated, if necessary 9 | 10 | Please also shortly describe how you tested your change. Bonus points for added tests! 11 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the version of Python and other tools you might need 9 | build: 10 | os: ubuntu-20.04 11 | tools: 12 | python: "3.9" 13 | 14 | mkdocs: 15 | configuration: mkdocs.yml 16 | 17 | # Optionally declare the Python requirements required to build your docs 18 | python: 19 | install: 20 | - requirements: doc/requirements.txt 21 | -------------------------------------------------------------------------------- /.yamllint.yaml: -------------------------------------------------------------------------------- 1 | # Configuration file for yamllint 2 | extends: default 3 | rules: 4 | comments: 5 | min-spaces-from-content: 1 6 | document-start: disable 7 | indentation: 8 | spaces: 2 9 | indent-sequences: false 10 | line-length: disable 11 | new-lines: 12 | type: platform 13 | truthy: 14 | check-keys: false 15 | 16 | # .github/workflows/arm64-release.yml 17 | # .github/workflows/integration-tests.yml 18 | # .github/workflows/unit-tests.yml 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # With the other prerequisites, this file allows users of the 'make' tool to 2 | # automate the use of the 'mkdocs' tool to preview or build Stack's online 3 | # documentation. See CONTRIBUTING.md for more information. 4 | 5 | # Preview Stack's online documentation with `make docs-serve`: 6 | .PHONY: docs-serve 7 | docs-serve: 8 | $(MAKE) -C doc docs-serve 9 | 10 | # Build Stack's online documentation with `make _site/index.html`: 11 | _site/index.html: doc/*.md 12 | $(MAKE) -C doc docs-build 13 | -------------------------------------------------------------------------------- /app/Main.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | module Main 4 | ( main 5 | ) where 6 | 7 | import RIO ( IO ) 8 | import qualified Stack 9 | 10 | -- | The entry point for the Stack executable. 11 | main :: IO () 12 | main = Stack.main 13 | -------------------------------------------------------------------------------- /doc/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../CONTRIBUTING.md -------------------------------------------------------------------------------- /doc/ChangeLog.md: -------------------------------------------------------------------------------- 1 | ../ChangeLog.md -------------------------------------------------------------------------------- /doc/commands/clean_command.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # The `stack clean` command 4 | 5 | Either 6 | 7 | ~~~text 8 | stack clean [PACKAGE] 9 | ~~~ 10 | 11 | or 12 | 13 | ~~~text 14 | stack clean --full 15 | ~~~ 16 | 17 | `stack clean` deletes build artefacts for one or more project packages specified 18 | as arguments. If no project packages are specified, all project packages are 19 | cleaned. 20 | 21 | `stack clean --full` deletes the project's Stack working directory. 22 | -------------------------------------------------------------------------------- /doc/commands/purge_command.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # The `stack purge` command 4 | 5 | ~~~text 6 | stack purge 7 | ~~~ 8 | 9 | `stack purge` has the same effect as, and is provided as a shorthand for, 10 | [`stack clean --full`](clean_command.md). 11 | -------------------------------------------------------------------------------- /doc/commands/runhaskell_command.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # The `stack runhaskell` command 4 | 5 | ~~~text 6 | stack runhaskell [-- ARGUMENT(S) (e.g. stack runghc -- X.hs)] 7 | [--[no-]ghc-package-path] [--[no-]stack-exe] 8 | [--package PACKAGE] [--rts-options RTSFLAG] [--cwd DIR] 9 | ~~~ 10 | 11 | The `stack runhaskell` command is equivalent to the `stack runghc` command. For 12 | further information, see the [`stack runghc`](runghc_command.md) documentation. 13 | -------------------------------------------------------------------------------- /doc/commands/uninstall_command.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # The `stack uninstall` command 4 | 5 | ~~~text 6 | stack uninstall 7 | ~~~ 8 | 9 | `stack uninstall` provides information to the standard output stream about how 10 | to uninstall Stack or a Stack-supplied tool (such as GHC or, on Windows, MSYS2). 11 | It does not itself uninstall Stack or a Stack-supplied tool. 12 | -------------------------------------------------------------------------------- /doc/commands/update_command.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # The `stack update` command 4 | 5 | ~~~text 6 | stack update 7 | ~~~ 8 | 9 | Generally, Stack automatically updates the package index when necessary. 10 | 11 | `stack update` will download the most recent set of packages from your package 12 | indices (e.g. Hackage). 13 | -------------------------------------------------------------------------------- /doc/css/extra.css: -------------------------------------------------------------------------------- 1 | .hidden-warning { 2 | display: none 3 | } 4 | 5 | /* The Read the Docs flyout is formatted with a font-size that is 90% of the 6 | body's. Material for MkDocs has a body font-size that is 0.5rem. This body 7 | font-size will result in the flyout having a font-size of 0.7rem, consistent 8 | with the font-size of other elements in the theme. 9 | */ 10 | body { 11 | font-size: 0.777778rem; 12 | } 13 | -------------------------------------------------------------------------------- /doc/img/manageHLS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/commercialhaskell/stack/ee20e91a3e6054661bdbd06c5835daea3c8c95ea/doc/img/manageHLS.png -------------------------------------------------------------------------------- /doc/img/stack-open-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/commercialhaskell/stack/ee20e91a3e6054661bdbd06c5835daea3c8c95ea/doc/img/stack-open-graph.png -------------------------------------------------------------------------------- /doc/maintainers/archive/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | The `doc/maintainers/archive` directory contains documentation that appears to 4 | have been superceded but is preserved in case it is, in fact, useful. 5 | -------------------------------------------------------------------------------- /doc/topics/CI.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Continuous integration (CI) 4 | 5 | ## GitHub Actions 6 | 7 | The Stack repository uses GitHub Actions for its own CI. For further 8 | information, see the guide to 9 | [contributing](../CONTRIBUTING.md#continuous-integration-ci). 10 | 11 | ## Azure 12 | 13 | For further information, see the [Azure CI](azure_ci.md) documentation. 14 | 15 | ## Travis 16 | 17 | For further information, see the [Travis CI](travis_ci.md) documentation. 18 | -------------------------------------------------------------------------------- /dot-dir-locals.el: -------------------------------------------------------------------------------- 1 | ((haskell-mode 2 | . ((haskell-indent-spaces . 4) 3 | (haskell-process-type . ghci) 4 | (haskell-process-path-ghci . "stack") 5 | (haskell-process-args-ghci . ("ghci")))) 6 | (haskell-cabal-mode 7 | . ((haskell-process-type . ghci) 8 | (haskell-process-path-ghci . "stack") 9 | (haskell-process-args-ghci . ("ghci"))))) 10 | -------------------------------------------------------------------------------- /etc/dockerfiles/stack-build/README.md: -------------------------------------------------------------------------------- 1 | dockerfiles/stack-build 2 | ======================= 3 | 4 | The contents of this directory have been moved to the [Stackage repo](https://github.com/commercialhaskell/stackage/tree/master/automated/dockerfiles#readme). 5 | -------------------------------------------------------------------------------- /etc/scripts/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /etc/scripts/hlint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | 5 | cd "$(dirname "$0")/../.." 6 | hlint src/ 7 | hlint src/ --cpp-define=WINDOWS=1 8 | hlint test/ --cpp-simple 9 | -------------------------------------------------------------------------------- /etc/scripts/integration-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec stack build --flag stack:integration-tests stack --exec stack-integration-test 4 | -------------------------------------------------------------------------------- /etc/scripts/ls-deps-as-cabal-constraints.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Lists the dependencies as exact (==) Cabal constraints for use with a Cabal 4 | # `cabal.project` file, and pipes to the specified location (typically a file): 5 | # 6 | set -eu 7 | 8 | stack ls dependencies cabal > "$1" 9 | -------------------------------------------------------------------------------- /etc/scripts/stack.yaml: -------------------------------------------------------------------------------- 1 | # Added as part of the work around for: 2 | # https://github.com/commercialhaskell/stack/issues/6711 3 | # 4 | # On Windows only, for some unidentified reason, stack script can fail when 5 | # using a pre-compiled package. This can affect the script 6 | # build-stack-installer.hs. The work around is to build the package required for 7 | # that script using the same Stack configuration as used by the script. 8 | 9 | snapshot: lts-23.17 10 | -------------------------------------------------------------------------------- /src/Stack/Constants/StackProgName.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | {-| 4 | Module : Stack.Constants.StackProgName 5 | License : BSD-3-Clause 6 | 7 | 'stackProgName' is defined in this module rather than in "Stack.Constants", due 8 | to GHC stage restrictions and the use of Template Haskell. 9 | -} 10 | 11 | module Stack.Constants.StackProgName 12 | ( stackProgName 13 | ) where 14 | 15 | import Stack.Prelude ( String ) 16 | 17 | -- | Name of the Stack program. 18 | stackProgName :: String 19 | stackProgName = "stack" 20 | -------------------------------------------------------------------------------- /src/Stack/Types/HpcReportOpts.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | {-# LANGUAGE NoFieldSelectors #-} 3 | 4 | {-| 5 | Module : Stack.Types.HpcReportOpts 6 | Description : Types related to Stack's @hpc report@ command. 7 | License : BSD-3-Clause 8 | 9 | Types related to Stack's @hpc report@ command. 10 | -} 11 | 12 | module Stack.Types.HpcReportOpts 13 | ( HpcReportOpts (..) 14 | ) where 15 | 16 | import Stack.Prelude 17 | 18 | -- | Type representing command line options for the @stack hpc report@ command. 19 | data HpcReportOpts = HpcReportOpts 20 | { inputs :: [Text] 21 | , all :: Bool 22 | , destDir :: Maybe String 23 | , openBrowser :: Bool 24 | } 25 | deriving Show 26 | -------------------------------------------------------------------------------- /src/Stack/Types/IsMutable.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | {-| 4 | Module : Stack.Types.IsMutable 5 | License : BSD-3-Clause 6 | -} 7 | 8 | module Stack.Types.IsMutable 9 | ( IsMutable (..) 10 | ) where 11 | 12 | import Stack.Prelude 13 | 14 | data IsMutable 15 | = Mutable 16 | | Immutable 17 | deriving (Eq, Show) 18 | 19 | instance Semigroup IsMutable where 20 | Mutable <> _ = Mutable 21 | _ <> Mutable = Mutable 22 | Immutable <> Immutable = Immutable 23 | 24 | instance Monoid IsMutable where 25 | mempty = Immutable 26 | mappend = (<>) 27 | -------------------------------------------------------------------------------- /src/Stack/Types/SCM.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | {-# LANGUAGE OverloadedStrings #-} 3 | 4 | {-| 5 | Module : Stack.Types.SCM 6 | License : BSD-3-Clause 7 | -} 8 | 9 | module Stack.Types.SCM 10 | ( SCM (..) 11 | ) where 12 | 13 | import Data.Aeson.Types ( FromJSON (..), ToJSON (..) ) 14 | import Stack.Prelude 15 | 16 | -- | A software control system. 17 | data SCM 18 | = Git 19 | deriving Show 20 | 21 | instance FromJSON SCM where 22 | parseJSON v = do 23 | s <- parseJSON v 24 | case s of 25 | "git" -> pure Git 26 | _ -> fail ("Unknown or unsupported SCM: " <> s) 27 | 28 | instance ToJSON SCM where 29 | toJSON Git = toJSON ("git" :: Text) 30 | -------------------------------------------------------------------------------- /src/Stack/Types/UnusedFlags.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | {-| 4 | Module : Stack.Types.UnusedFlags 5 | License : BSD-3-Clause 6 | -} 7 | 8 | module Stack.Types.UnusedFlags 9 | ( UnusedFlags (..) 10 | , FlagSource (..) 11 | ) where 12 | 13 | import Stack.Prelude 14 | 15 | data FlagSource 16 | = FSCommandLine 17 | | FSStackYaml 18 | deriving (Eq, Ord, Show) 19 | 20 | data UnusedFlags 21 | = UFNoPackage FlagSource PackageName 22 | | UFFlagsNotDefined 23 | FlagSource 24 | PackageName 25 | (Set FlagName) -- defined in package 26 | (Set FlagName) -- not defined 27 | | UFSnapshot PackageName 28 | deriving (Eq, Ord, Show) 29 | -------------------------------------------------------------------------------- /src/Stack/Update.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | {-| 4 | Module : Stack.Update 5 | Description : Functions related to Stack's @update@ command. 6 | License : BSD-3-Clause 7 | 8 | Functions related to Stack's @update@ command. 9 | -} 10 | 11 | module Stack.Update 12 | ( updateCmd 13 | ) where 14 | 15 | import Stack.Prelude 16 | import Stack.Runners ( ShouldReexec (..), withConfig ) 17 | import Stack.Types.Runner ( Runner ) 18 | 19 | -- | Function underlying the @stack update@ command. Update the package index. 20 | updateCmd :: () -> RIO Runner () 21 | updateCmd () = withConfig NoReexec (void (updateHackageIndex Nothing)) 22 | -------------------------------------------------------------------------------- /src/unix/System/Info/ShortPathName.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | {-| 4 | Module : System.Info.ShortPathName 5 | License : BSD-3-Clause 6 | 7 | The module of this name differs as between Windows and non-Windows builds. This 8 | is the non-Windows version. 9 | -} 10 | 11 | module System.Info.ShortPathName 12 | ( getShortPathName 13 | ) where 14 | 15 | import RIO.FilePath ( FilePath ) 16 | import RIO.Prelude ( pure ) 17 | import RIO.Prelude.Types ( IO ) 18 | 19 | getShortPathName :: FilePath -> IO FilePath 20 | getShortPathName = pure 21 | -------------------------------------------------------------------------------- /src/unix/cbits/uname.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int haskell_uname(struct utsname *name) 4 | { 5 | return uname(name); 6 | } 7 | -------------------------------------------------------------------------------- /src/windows/Stack/Constants/UsrLibDirs.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | {-| 4 | Module : Stack.Constants.UsrLibDirs 5 | License : BSD-3-Clause 6 | 7 | The module of this name differs as between Windows and non-Windows builds. This 8 | is the Windows version. 9 | -} 10 | 11 | module Stack.Constants.UsrLibDirs 12 | ( libDirs 13 | , usrLibDirs 14 | ) where 15 | 16 | import Stack.Prelude 17 | 18 | -- | Used in Stack.Setup for detecting libc.musl-x86_64.so.1, see comments at 19 | -- use site 20 | libDirs :: [Path Abs Dir] 21 | libDirs = [] 22 | 23 | -- | Used in Stack.Setup for detecting libtinfo, see comments at use site 24 | usrLibDirs :: [Path Abs Dir] 25 | usrLibDirs = [] 26 | -------------------------------------------------------------------------------- /src/windows/System/Info/ShortPathName.hs: -------------------------------------------------------------------------------- 1 | {-| 2 | Module : System.Info.ShortPathName 3 | License : BSD-3-Clause 4 | 5 | The module of this name differs as between Windows and non-Windows builds. This 6 | is the Windows version. 7 | -} 8 | 9 | module System.Info.ShortPathName 10 | ( getShortPathName 11 | ) where 12 | 13 | import System.Win32.Info ( getShortPathName ) 14 | -------------------------------------------------------------------------------- /src/windows/System/Permissions.hs: -------------------------------------------------------------------------------- 1 | {-| 2 | Module : System.Permissions 3 | License : BSD-3-Clause 4 | 5 | The module of this name differs as between Windows and non-Windows builds. This 6 | is the Windows version. 7 | -} 8 | 9 | module System.Permissions 10 | ( osIsMacOS 11 | , osIsWindows 12 | , setFileExecutable 13 | , setScriptPerms 14 | ) where 15 | 16 | -- | False if using Windows. 17 | osIsMacOS :: Bool 18 | osIsMacOS = False 19 | 20 | -- | True if using Windows. 21 | osIsWindows :: Bool 22 | osIsWindows = True 23 | 24 | setFileExecutable :: Monad m => FilePath -> m () 25 | setFileExecutable _ = pure () 26 | 27 | setScriptPerms :: Monad m => FilePath -> m () 28 | setScriptPerms _ = pure () 29 | -------------------------------------------------------------------------------- /src/windows/System/Uname.hs: -------------------------------------------------------------------------------- 1 | {-| 2 | Module : System.Uname 3 | License : BSD-3-Clause 4 | 5 | The module of this name differs as between Windows and non-Windows builds. This 6 | is the Windows version. 7 | -} 8 | 9 | module System.Uname 10 | ( getRelease 11 | ) where 12 | 13 | getRelease :: IO String 14 | getRelease = error "getRelease not supported on Windows" 15 | -------------------------------------------------------------------------------- /stack-ghc-9.10.1.yaml: -------------------------------------------------------------------------------- 1 | # This is an experimental project-level configuration, to see if Stack can be 2 | # built with GHC 9.10.1. 3 | # 4 | # Currently, Stack cannot be built with GHC 9.10.1 because: 5 | # * Cabal-3.12.0.0 has changed the type of 6 | # Distribution.PackageDescription.Check.checkPackage. 7 | 8 | snapshot: nightly-2025-04-03 # GHC 9.10.1 9 | 10 | allow-newer: true 11 | allow-newer-deps: 12 | # Added to ignore upper bound on Cabal. 13 | - stack 14 | 15 | docker: 16 | enable: false 17 | repo: quay.io/benz0li/ghc-musl:9.10.1 18 | 19 | nix: 20 | # --nix on the command-line to enable. 21 | packages: 22 | - zlib 23 | - unzip 24 | 25 | flags: 26 | stack: 27 | developer-mode: true 28 | -------------------------------------------------------------------------------- /stack-ghc-9.10.1.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/topics/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | sha256: 47a4c110af9a5c55e3135bbf7cec3a6e5451ba3bfa50a06f0443012a2642fbc0 10 | size: 674536 11 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2025/4/3.yaml 12 | original: nightly-2025-04-03 13 | -------------------------------------------------------------------------------- /stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 # GHC 9.8.4 2 | 3 | extra-deps: 4 | # lts-23.17 provides hpack-0.37.0 5 | - hpack-0.38.1@rev:0 6 | # lts-23.17 provides pantry-0.10.0. 7 | - pantry-0.10.1@rev:0 8 | # lts-23.17 provides tls-2.1.1 9 | - tls-2.1.8@rev:0 10 | 11 | docker: 12 | enable: false 13 | repo: quay.io/benz0li/ghc-musl:9.8.4 14 | # See LICENSE. In order to build a statically-linked Stack executable for Linux 15 | # that is not linked against GMP, use this alternative Docker image: 16 | # repo: quay.io/benz0li/ghc-musl:9.8.4-int-native 17 | 18 | nix: 19 | # --nix on the command-line to enable. 20 | packages: 21 | - zlib 22 | - unzip 23 | 24 | flags: 25 | stack: 26 | developer-mode: true 27 | -------------------------------------------------------------------------------- /tests/integration/.gitignore: -------------------------------------------------------------------------------- 1 | logs/ 2 | tests-fail/ 3 | tests-success/ 4 | -------------------------------------------------------------------------------- /tests/integration/run-single-test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -uo pipefail 4 | 5 | cd "$( dirname "${BASH_SOURCE[0]}" )" 6 | 7 | export STACK_ROOT=$HOME/.stack 8 | unset GHC_PACKAGE_PATH 9 | 10 | DIR=$(pwd) 11 | STACK=$(stack exec which stack) 12 | 13 | export SRC_DIR=$DIR/../../ 14 | export TEST_DIR=$DIR/tests/$1 15 | 16 | if [[ ! -d "tests/$1" ]] 17 | then 18 | echo Test does not exist: $1 19 | exit 1 20 | fi 21 | 22 | mkdir -p tests/$1/files 23 | cd tests/$1/files 24 | echo Running test $1 25 | exec $STACK --stack-yaml $DIR/../../stack.yaml runghc --no-ghc-package-path -- -i../../../lib ../Main.hs 26 | -------------------------------------------------------------------------------- /tests/integration/tests/111-custom-snapshot/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["build"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/111-custom-snapshot/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5, mtl 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/111-custom-snapshot/files/my-snapshot.yaml: -------------------------------------------------------------------------------- 1 | compiler: ghc-9.8.4 2 | name: my-snapshot 3 | packages: 4 | - mtl-2.3.1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/111-custom-snapshot/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | import Control.Monad.Reader () 6 | 7 | someFunc :: IO () 8 | someFunc = putStrLn "someFunc" 9 | -------------------------------------------------------------------------------- /tests/integration/tests/111-custom-snapshot/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: my-snapshot.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1198-multiple-exes-with-same-name/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1198-multiple-exes-with-same-name/files/also-has-exe-foo/also-has-exe-foo.cabal: -------------------------------------------------------------------------------- 1 | name: also-has-exe-foo 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | executable foo 7 | hs-source-dirs: app 8 | main-is: Main.hs 9 | ghc-options: -threaded -rtsopts -with-rtsopts=-N 10 | build-depends: base 11 | default-language: Haskell2010 12 | -------------------------------------------------------------------------------- /tests/integration/tests/1198-multiple-exes-with-same-name/files/also-has-exe-foo/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = putStrLn "This is foo from also-has-exe-foo" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1198-multiple-exes-with-same-name/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = putStrLn "This is foo from has-exe-foo" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1198-multiple-exes-with-same-name/files/has-exe-foo-too/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = putStrLn "This is foo from has-exe-foo-too" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1198-multiple-exes-with-same-name/files/has-exe-foo-too/has-exe-foo-too.cabal: -------------------------------------------------------------------------------- 1 | name: has-exe-foo-too 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | executable foo 7 | hs-source-dirs: app 8 | main-is: Main.hs 9 | ghc-options: -threaded -rtsopts -with-rtsopts=-N 10 | build-depends: base 11 | default-language: Haskell2010 12 | -------------------------------------------------------------------------------- /tests/integration/tests/1198-multiple-exes-with-same-name/files/has-exe-foo.cabal: -------------------------------------------------------------------------------- 1 | name: has-exe-foo 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | executable foo 7 | hs-source-dirs: app 8 | main-is: Main.hs 9 | ghc-options: -threaded -rtsopts -with-rtsopts=-N 10 | build-depends: base 11 | default-language: Haskell2010 12 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build", "async"] 6 | stackErr ["build", "zlib-bindings"] 7 | stack ["build", "--stack-yaml", "stack-modify-lts.yaml", "async"] 8 | stack ["build", "--stack-yaml", "stack-local-snapshot.yaml", "async"] 9 | stack ["build", "--stack-yaml", "stack-remote-snapshot.yaml", "acme-missiles"] 10 | stackErr ["build", "--stack-yaml", "stack-modify-lts.yaml", "zlib-bindings"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/snapshot-2.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | name: test-snapshot-2 3 | packages: 4 | - async-2.2.5 5 | - hashable-1.4.7.0 6 | - os-string-2.0.7 7 | - stm-2.5.3.1 8 | - zlib-0.7.1.0@rev:2 9 | # FIXME: test these here 10 | flags: {} 11 | ghc-options: {} 12 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/snapshot-modify-lts.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | name: snapshot-modify-lts 3 | drop-packages: 4 | - zlib 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshot-2.yaml 2 | name: test-snapshot 3 | packages: 4 | - microlens-0.4.3.0 5 | drop-packages: 6 | - zlib 7 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/snapshots/local-snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | name: local-snapshot 3 | packages: 4 | - archive: package-0.1.2.3.tar.gz 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/snapshots/package-0.1.2.3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/commercialhaskell/stack/ee20e91a3e6054661bdbd06c5835daea3c8c95ea/tests/integration/tests/1265-extensible-snapshots/files/snapshots/package-0.1.2.3.tar.gz -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/snapshots/remote-snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | name: remote-snapshot 3 | packages: 4 | - archive: https://s3.amazonaws.com/hackage.fpcomplete.com/package/acme-missiles-0.3.tar.gz 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/stack-local-snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshots/local-snapshot.yaml 2 | packages: [] 3 | allow-newer: true 4 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/stack-modify-lts.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshot-modify-lts.yaml 2 | packages: [] 3 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/stack-remote-snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshots/remote-snapshot.yaml 2 | packages: [] 3 | allow-newer: true 4 | -------------------------------------------------------------------------------- /tests/integration/tests/1265-extensible-snapshots/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshot.yaml 2 | packages: [] 3 | allow-newer: true 4 | -------------------------------------------------------------------------------- /tests/integration/tests/1336-1337-new-package-names/.gitignore: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1337-unicode-everywhere/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | {-# ANN module "HLint: ignore Use unless" #-} 4 | main :: IO () 5 | main = 6 | if isWindows 7 | then logInfo "Disabled on Windows (see https://github.com/commercialhaskell/stack/issues/1337#issuecomment-166118678)" 8 | else do 9 | stack ["build"] 10 | stack ["exec", "以-exe"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/1337-unicode-everywhere/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/1337-unicode-everywhere/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Пσε 4 | 5 | main :: IO () 6 | main = putStrLn θυπε 7 | -------------------------------------------------------------------------------- /tests/integration/tests/1337-unicode-everywhere/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1337-unicode-everywhere/files/ארץ/Пσε.hs: -------------------------------------------------------------------------------- 1 | module Пσε 2 | ( θυπε 3 | ) where 4 | 5 | θυπε :: String 6 | θυπε = "以呂波耳本部止" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/1337-unicode-everywhere/files/いろは-LICENSE: -------------------------------------------------------------------------------- 1 | Whatever license. This is a project that only exists for integration testing and all rights are granted to it to whoever wants to do anything with it. It's mostly automatically generated content anyway. 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/.gitignore: -------------------------------------------------------------------------------- 1 | name.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: name 2 | version: 0 3 | 4 | dependencies: base 5 | library: {} 6 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/stack-everything.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | 3 | extra-deps: 4 | - acme-dont-1.1@rev:0 5 | 6 | configure-options: 7 | $everything: 8 | - this is an invalid option 9 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/stack-everything.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: 7 | - completed: 8 | hackage: acme-dont-1.1@sha256:8264ad3e5113d3e0417b46e71d5a9c0914a1f03b5b81319cc329f1dc0f49b96c,602 9 | pantry-tree: 10 | sha256: 79dbeddaf0fd507611687cefe9511c8fda489849fb0cac3894925716936290b2 11 | size: 206 12 | original: 13 | hackage: acme-dont-1.1@rev:0 14 | snapshots: [] 15 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/stack-locals.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | 3 | extra-deps: 4 | - acme-dont-1.1@rev:0 5 | 6 | configure-options: 7 | $locals: 8 | - this is an invalid option 9 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/stack-locals.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: 7 | - completed: 8 | hackage: acme-dont-1.1@sha256:8264ad3e5113d3e0417b46e71d5a9c0914a1f03b5b81319cc329f1dc0f49b96c,602 9 | pantry-tree: 10 | sha256: 79dbeddaf0fd507611687cefe9511c8fda489849fb0cac3894925716936290b2 11 | size: 206 12 | original: 13 | hackage: acme-dont-1.1@rev:0 14 | snapshots: [] 15 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/stack-name.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | 3 | extra-deps: 4 | - acme-dont-1.1@rev:0 5 | 6 | configure-options: 7 | name: 8 | - this is an invalid option 9 | acme-dont: 10 | - this is an invalid option 11 | -------------------------------------------------------------------------------- /tests/integration/tests/1438-configure-options/files/stack-targets.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | 3 | extra-deps: 4 | - acme-dont-1.1@rev:0 5 | 6 | configure-options: 7 | $targets: 8 | - this is an invalid option 9 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/README.md: -------------------------------------------------------------------------------- 1 | # files 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = pure () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/app/MainFail.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = pure () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/bench/Bench.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = asdf 3 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1659-skip-component/files/test/Spec.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = asdf 3 | -------------------------------------------------------------------------------- /tests/integration/tests/1884-url-to-tarball/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackCleanFull 6 | stack ["build", "--dry-run"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/1884-url-to-tarball/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/1884-url-to-tarball/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | dependencies: 3 | - base 4 | - half 5 | library: {} 6 | -------------------------------------------------------------------------------- /tests/integration/tests/1884-url-to-tarball/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | extra-deps: 3 | - location: https://hackage.haskell.org/package/half-0.2.2.3/half-0.2.2.3.tar.gz 4 | sha256: 85c244c80d1c889a3d79073a6f5a99d9e769dbe3c574ca11d992b2b4f7599a5c 5 | size: 6050 6 | -------------------------------------------------------------------------------- /tests/integration/tests/2195-depend-on-exe/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | 5 | main :: IO () 6 | main = stackErrStderr ["build"] (expectMessage "package provides no library") 7 | 8 | expectMessage :: String -> String -> IO () 9 | expectMessage msg stderr = 10 | unless (msg `isInfixOf` stderr) 11 | (error $ "Expected a warning: \n" ++ show msg) 12 | -------------------------------------------------------------------------------- /tests/integration/tests/2195-depend-on-exe/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | build-depends: happy 8 | -------------------------------------------------------------------------------- /tests/integration/tests/2195-depend-on-exe/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2433-ghc-by-version/Main.hs: -------------------------------------------------------------------------------- 1 | import System.Process (rawSystem) 2 | import Control.Exception (throwIO) 3 | import StackTest 4 | import Control.Monad (unless) 5 | 6 | main :: IO () 7 | main = unless isWindows $ rawSystem "bash" ["run.sh"] >>= throwIO 8 | -------------------------------------------------------------------------------- /tests/integration/tests/2433-ghc-by-version/files/.gitignore: -------------------------------------------------------------------------------- 1 | /fake-root/ 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2433-ghc-by-version/files/fake-path/ghc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo I should not be used! 4 | exit 1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/2433-ghc-by-version/files/fake-path/ghc-pkg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo I should not be used! 4 | exit 1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/2433-ghc-by-version/files/foo.hs: -------------------------------------------------------------------------------- 1 | main = putStrLn "Looks like everything is working!" 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2433-ghc-by-version/files/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -exuo pipefail 4 | 5 | export PATH=$(pwd)/fake-path:$("$STACK_EXE" path --resolver ghc-9.8.4 --compiler-bin):$PATH 6 | export STACK_ROOT=$(pwd)/fake-root 7 | 8 | which ghc 9 | 10 | "$STACK_EXE" --system-ghc --no-install-ghc --resolver ghc-9.8.4 ghc -- --info 11 | "$STACK_EXE" --system-ghc --no-install-ghc --resolver ghc-9.8.4 runghc foo.hs 12 | -------------------------------------------------------------------------------- /tests/integration/tests/2465-init-no-packages/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | import Control.Monad (unless) 4 | 5 | main :: IO () 6 | main = do 7 | removeFileIgnore "stack.yaml" 8 | stack ["init", "--snapshot", "ghc-9.2.4"] 9 | exists <- doesFileExist "stack.yaml" 10 | unless exists $ error "stack.yaml not created!" 11 | -------------------------------------------------------------------------------- /tests/integration/tests/2465-init-no-packages/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2643-copy-compiler-tool/files/.gitignore: -------------------------------------------------------------------------------- 1 | binny/ 2 | stack.yaml 3 | -------------------------------------------------------------------------------- /tests/integration/tests/2643-copy-compiler-tool/files/Bar.hs: -------------------------------------------------------------------------------- 1 | main = putStrLn "twotwotwo" 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2643-copy-compiler-tool/files/Baz.hs: -------------------------------------------------------------------------------- 1 | main = putStrLn "threethreethree" 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2643-copy-compiler-tool/files/Foo.hs: -------------------------------------------------------------------------------- 1 | main = putStrLn "oneoneone" 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2643-copy-compiler-tool/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | 4 | main :: IO () 5 | main = do 6 | createDirectoryIfMissing True "foo/src" 7 | readFile "foo/v1/Foo.hs" >>= writeFile "foo/src/Foo.hs" 8 | stack ["bench"] 9 | readFile "foo/v2/Foo.hs" >>= writeFile "foo/src/Foo.hs" 10 | stack ["bench"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/.gitignore: -------------------------------------------------------------------------------- 1 | foo/src/ 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/bar/bar.cabal: -------------------------------------------------------------------------------- 1 | name: bar 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Bar 9 | build-depends: base, foo 10 | default-language: Haskell2010 11 | 12 | benchmark bench 13 | type: exitcode-stdio-1.0 14 | hs-source-dirs: bench 15 | main-is: bench.hs 16 | build-depends: base 17 | , bar 18 | default-language: Haskell2010 19 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/bar/bench/bench.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = pure () 3 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/bar/src/Bar.hs: -------------------------------------------------------------------------------- 1 | module Bar 2 | ( bar 3 | ) where 4 | 5 | import Foo 6 | 7 | bar :: IO () 8 | bar = foo 9 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/foo/foo.cabal: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Foo 9 | build-depends: base 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/foo/v1/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo 2 | ( foo 3 | ) where 4 | 5 | foo :: IO () 6 | foo = putStrLn "foo1" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/foo/v2/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo 2 | ( foo 3 | ) where 4 | 5 | foo :: IO () 6 | foo = putStrLn "foo2" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/2781-shadow-bug/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | packages: 3 | - foo 4 | - bar 5 | -------------------------------------------------------------------------------- /tests/integration/tests/2997-ensure-warnings-output/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Data.List (isInfixOf) 3 | 4 | main :: IO () 5 | main = do 6 | stackCleanFull 7 | stackCheckStderr ["build", "--terminal", "--color=always"] $ \str -> 8 | if "no type signature" `isInfixOf` str 9 | then pure () 10 | else error "Warnings are not being shown" 11 | -------------------------------------------------------------------------------- /tests/integration/tests/2997-ensure-warnings-output/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/2997-ensure-warnings-output/files/bar/package.yaml: -------------------------------------------------------------------------------- 1 | name: bar 2 | version: 0 3 | 4 | dependencies: 5 | - base 6 | 7 | library: 8 | source-dirs: src 9 | ghc-options: -Wall 10 | -------------------------------------------------------------------------------- /tests/integration/tests/2997-ensure-warnings-output/files/bar/src/Bar.hs: -------------------------------------------------------------------------------- 1 | module Bar where 2 | 3 | bar = () 4 | -------------------------------------------------------------------------------- /tests/integration/tests/2997-ensure-warnings-output/files/foo/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | 4 | dependencies: 5 | - base 6 | 7 | library: 8 | source-dirs: src 9 | ghc-options: -Wall 10 | -------------------------------------------------------------------------------- /tests/integration/tests/2997-ensure-warnings-output/files/foo/src/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | 3 | foo = () 4 | -------------------------------------------------------------------------------- /tests/integration/tests/2997-ensure-warnings-output/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | packages: 3 | - foo 4 | - bar 5 | dump-logs: warning 6 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/.gitignore: -------------------------------------------------------------------------------- 1 | embed.txt 2 | src/Unlisted.hs 3 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/embed_FAIL.txt: -------------------------------------------------------------------------------- 1 | FAIL 2 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/embed_OK.txt: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | synopsis: Initial project template from stack 4 | description: Please see README.md 5 | homepage: http://github.com/githubuser/files#readme 6 | license: BSD3 7 | build-type: Simple 8 | -- extra-source-files: 9 | cabal-version: >=1.10 10 | 11 | executable files-exe 12 | hs-source-dirs: src/../src 13 | main-is: Main.hs 14 | build-depends: base >= 4.7 && < 5 15 | , bytestring 16 | , file-embed 17 | default-language: Haskell2010 18 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/src/Main.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | {-# LANGUAGE OverloadedStrings #-} 3 | module Main where 4 | 5 | import Control.Monad 6 | import qualified Data.ByteString.Char8 as C8 7 | import Data.FileEmbed 8 | import Data.List 9 | import Unlisted 10 | 11 | main :: IO () 12 | main = do 13 | putStrLn ("main " ++ show foo ++ " " ++ show embedded) 14 | when ("FAIL" `C8.isPrefixOf` embedded) $ error "embedded contains FAIL" 15 | 16 | embedded = $(embedFile "embed.txt") 17 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/src/Unlisted_FAIL.hs: -------------------------------------------------------------------------------- 1 | -- | Version of Unlisted with different export that causes failure to compile. 2 | module Unlisted where 3 | 4 | fooRenamed :: String 5 | fooRenamed = "foo" 6 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/src/Unlisted_OK.hs: -------------------------------------------------------------------------------- 1 | module Unlisted where 2 | 3 | foo :: String 4 | foo = "foo" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/src/main/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main = do putStrLn "Hello, world." 4 | -------------------------------------------------------------------------------- /tests/integration/tests/32-unlisted-module/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3229-exe-targets/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3229-exe-targets/files/app/Alpha.hs: -------------------------------------------------------------------------------- 1 | main = pure () 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3229-exe-targets/files/app/Beta.hs: -------------------------------------------------------------------------------- 1 | main = pure () 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3229-exe-targets/files/foo.cabal: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Foo 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | 12 | executable alpha 13 | hs-source-dirs: app 14 | main-is: Alpha.hs 15 | build-depends: base, foo 16 | default-language: Haskell2010 17 | 18 | executable beta 19 | hs-source-dirs: app 20 | main-is: Beta.hs 21 | build-depends: base, foo 22 | default-language: Haskell2010 23 | -------------------------------------------------------------------------------- /tests/integration/tests/3229-exe-targets/files/src/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3315-multi-ghc-options/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest.Repl 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build", "--ghc-options=-ddump-simpl -ddump-asm -DBAR -DBAZ"] 6 | stackRepl ["--ghc-options=-ddump-simpl -ddump-asm"] (pure ()) 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3315-multi-ghc-options/files/multi-ghc-options.cabal: -------------------------------------------------------------------------------- 1 | name: multi-ghc-options 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3315-multi-ghc-options/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | 3 | module Lib where 4 | 5 | -- Avoid problems with CPP and HLint 6 | #ifndef __HLINT__ 7 | 8 | #ifndef BAR 9 | #error BAR isn't defined 10 | #endif 11 | 12 | #ifndef BAZ 13 | #error BAZ isn't defined 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tests/integration/tests/3315-multi-ghc-options/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/335-multi-package-flags/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackErr ["build"] 6 | stack ["build", "--flag", "new-template:necessary"] 7 | stackErr ["build"] 8 | stack ["build", "--flag", "*:necessary"] 9 | -------------------------------------------------------------------------------- /tests/integration/tests/335-multi-package-flags/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/335-multi-package-flags/files/new-template.cabal: -------------------------------------------------------------------------------- 1 | name: new-template 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | flag necessary 7 | manual: True 8 | default: False 9 | description: Won't build without this flag on 10 | 11 | library 12 | hs-source-dirs: src 13 | exposed-modules: Lib 14 | build-depends: base 15 | default-language: Haskell2010 16 | if flag(necessary) 17 | cpp-options: -DWORK 18 | -------------------------------------------------------------------------------- /tests/integration/tests/335-multi-package-flags/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | module Lib 3 | ( someFunc 4 | ) where 5 | 6 | someFunc :: IO () 7 | someFunc = putStrLn "someFunc" 8 | 9 | -- Avoid problems with CPP and HLint 10 | #ifndef __HLINT__ 11 | 12 | #if !WORK 13 | #error Not going to work, sorry 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /tests/integration/tests/335-multi-package-flags/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3390-unbuildable-test/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["test"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3390-unbuildable-test/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base 10 | default-language: Haskell2010 11 | 12 | test-suite test 13 | type: exitcode-stdio-1.0 14 | hs-source-dirs: test 15 | main-is: Spec.hs 16 | build-depends: base 17 | default-language: Haskell2010 18 | buildable: False -------------------------------------------------------------------------------- /tests/integration/tests/3390-unbuildable-test/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib () where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3390-unbuildable-test/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3390-unbuildable-test/files/test/Spec.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = error "This should not be run" 3 | -------------------------------------------------------------------------------- /tests/integration/tests/3431-precompiled-works/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Control.Monad 3 | import Data.List 4 | 5 | main :: IO () 6 | main = do 7 | stack ["build", "random-1.1", "--stack-yaml", "custom1/stack.yaml"] 8 | stackCheckStderr ["build", "random-1.1", "--stack-yaml", "custom2/stack.yaml"] $ \out -> do 9 | print out 10 | unless ("precompiled" `isInfixOf` out) $ error "Didn't use precompiled!" 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3431-precompiled-works/files/custom1/custom1.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | name: custom1 3 | packages: 4 | - acme-missiles-0.3 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3431-precompiled-works/files/custom1/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: custom1.yaml 2 | packages: [] 3 | -------------------------------------------------------------------------------- /tests/integration/tests/3431-precompiled-works/files/custom2/custom2.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | name: custom2 3 | packages: 4 | - acme-missiles-0.2 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3431-precompiled-works/files/custom2/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: custom2.yaml 2 | packages: [] 3 | -------------------------------------------------------------------------------- /tests/integration/tests/345-override-bytestring/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build", "--dry-run"] -- for useful error output 6 | stack ["build"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/345-override-bytestring/files/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | 3 | import Data.Binary () 4 | import Data.ByteString () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/345-override-bytestring/files/foo.cabal: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0.0.0 3 | synopsis: foo 4 | build-type: Simple 5 | cabal-version: >=1.10 6 | 7 | library 8 | exposed-modules: Foo 9 | build-depends: base, bytestring, binary 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/345-override-bytestring/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | extra-deps: 3 | - bytestring-0.11.3.1 4 | - binary-0.8.9.0 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3520-revision-matching/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Control.Monad 3 | import Data.List 4 | import System.Directory 5 | 6 | main :: IO () 7 | main = do 8 | putStrLn "Test disabled due to switch to pantry" 9 | {- 10 | copyFile "bad-stack.yaml" "stack.yaml" 11 | stackErrStderr ["build", "--dry-run"] $ \msg -> 12 | unless ("legacy 00-index.tar.gz" `isInfixOf` msg) $ 13 | error "Expected a warning about 00-index usage" 14 | copyFile "good-stack.yaml" "stack.yaml" 15 | stack ["build", "--dry-run"] 16 | -} 17 | -------------------------------------------------------------------------------- /tests/integration/tests/3520-revision-matching/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | *.cabal 3 | -------------------------------------------------------------------------------- /tests/integration/tests/3520-revision-matching/files/bad-stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-10.10 2 | 3 | package-indices: 4 | - name: Hackage00 5 | download-prefix: https://hackage.haskell.org/package 6 | http: https://hackage.haskell.org/00-index.tar.gz 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3520-revision-matching/files/good-stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-10.10 2 | 3 | package-indices: 4 | - name: Hackage00 5 | download-prefix: https://hackage.haskell.org/package 6 | http: https://hackage.haskell.org/00-index.tar.gz 7 | 8 | ignore-revision-mismatch: true 9 | -------------------------------------------------------------------------------- /tests/integration/tests/3520-revision-matching/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: issue3520 2 | version: 0.1.0.0 3 | 4 | dependencies: 5 | - base 6 | - mtl 7 | 8 | library: 9 | source-dirs: src 10 | -------------------------------------------------------------------------------- /tests/integration/tests/3520-revision-matching/files/src/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3533-extra-deps-solver/Main.hs: -------------------------------------------------------------------------------- 1 | {-- 2 | 3 | import StackTest 4 | import System.Directory 5 | 6 | main :: IO () 7 | main = do 8 | copyFile "orig-stack.yaml" "stack.yaml" 9 | stack [defaultResolverArg, "solver", "--update-config"] 10 | stack ["build"] 11 | 12 | // --} 13 | 14 | main :: IO () 15 | main = putStrLn "This test is disabled (see https://github.com/commercialhaskell/stack/issues/4410)." 16 | -------------------------------------------------------------------------------- /tests/integration/tests/3533-extra-deps-solver/files/.gitignore: -------------------------------------------------------------------------------- 1 | .stack-work/ 2 | *.cabal 3 | stack.yaml 4 | -------------------------------------------------------------------------------- /tests/integration/tests/3533-extra-deps-solver/files/local-mmorph/package.yaml: -------------------------------------------------------------------------------- 1 | name: mmorph 2 | version: 1.2.0 3 | 4 | dependencies: 5 | - base 6 | - acme-missiles 7 | 8 | library: 9 | source-dirs: 10 | - src 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3533-extra-deps-solver/files/local-mmorph/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3533-extra-deps-solver/files/orig-stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | 3 | packages: 4 | - ./local-mmorph 5 | - ./uses-mmorph 6 | -------------------------------------------------------------------------------- /tests/integration/tests/3533-extra-deps-solver/files/uses-mmorph/package.yaml: -------------------------------------------------------------------------------- 1 | name: uses-mmorph 2 | version: 1.2.0 3 | 4 | dependencies: 5 | - base 6 | - mmorph >= 1.1 7 | 8 | library: 9 | source-dirs: 10 | - src 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3533-extra-deps-solver/files/uses-mmorph/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3574-extra-dep-local/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["build", "foo"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3574-extra-dep-local/files/foo/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo(foo) where 2 | 3 | foo = "foo" 4 | -------------------------------------------------------------------------------- /tests/integration/tests/3574-extra-dep-local/files/foo/foo.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: >= 1.2 2 | build-type: Simple 3 | name: foo 4 | version: 0 5 | 6 | library 7 | build-depends: base 8 | exposed-modules: Foo 9 | -------------------------------------------------------------------------------- /tests/integration/tests/3574-extra-dep-local/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | 3 | packages: [] 4 | 5 | extra-deps: 6 | - foo 7 | 8 | ghc-options: 9 | $locals: -bob 10 | -------------------------------------------------------------------------------- /tests/integration/tests/3591-cabal-warnings-once/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Data.List (isInfixOf) 3 | 4 | main :: IO () 5 | main = do 6 | stackCheckStderr ["build", "--dry-run"] $ \str -> 7 | case filter ("unknown-field-name" `isInfixOf`) (lines str) of 8 | [] -> error "unknown-field-name didn't appear once" 9 | [_] -> pure () 10 | _:_:_ -> error "unknown-field-name appeared multiple times" 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3591-cabal-warnings-once/files/foo.cabal: -------------------------------------------------------------------------------- 1 | -- This file has been generated from package.yaml by hpack version 0.20.0. 2 | -- 3 | -- see: https://github.com/sol/hpack 4 | -- 5 | -- hash: 43a4e1612fc5dee2ab88c588fee639840be01569a600ab2955961c341b89058d 6 | 7 | name: foo 8 | version: 0.1.0.0 9 | build-type: Simple 10 | cabal-version: >= 1.10 11 | 12 | unknown-field-name: makes a warning! 13 | 14 | library 15 | hs-source-dirs: src 16 | exposed-modules: Lib 17 | -------------------------------------------------------------------------------- /tests/integration/tests/3591-cabal-warnings-once/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3591-cabal-warnings-once/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3631-build-http2/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build", defaultSnapshotArg, "--dry-run", "http2"] 6 | stack ["build", defaultSnapshotArg, "http2"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/365-invalid-success/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackErr ["build"] 6 | stackErr ["build"] 7 | writeFile "app/Foo.hs" "module Foo where" 8 | stack ["build"] 9 | writeFile "app/Foo.hs" "module Foo wher e" 10 | stackErr ["build"] 11 | stackErr ["build"] 12 | -------------------------------------------------------------------------------- /tests/integration/tests/365-invalid-success/files/.gitignore: -------------------------------------------------------------------------------- 1 | app/Foo.hs 2 | -------------------------------------------------------------------------------- /tests/integration/tests/365-invalid-success/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | import Foo 2 | 3 | main :: IO () 4 | main = pure () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/365-invalid-success/files/new-template.cabal: -------------------------------------------------------------------------------- 1 | name: new-template 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | executable new-template-exe 7 | hs-source-dirs: app 8 | main-is: Main.hs 9 | ghc-options: -threaded -rtsopts -with-rtsopts=-N 10 | build-depends: base 11 | default-language: Haskell2010 12 | other-modules: Foo 13 | -------------------------------------------------------------------------------- /tests/integration/tests/365-invalid-success/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/366-non-root-dir/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | 4 | main :: IO () 5 | main = do 6 | removeDirIgnore ".stack-work" 7 | stackErr ["exec", "hello-world"] 8 | setCurrentDirectory "app" 9 | stack ["build"] 10 | stack ["exec", "hello-world"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/366-non-root-dir/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = pure () 3 | -------------------------------------------------------------------------------- /tests/integration/tests/366-non-root-dir/files/new-template.cabal: -------------------------------------------------------------------------------- 1 | name: new-template 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | executable hello-world 7 | hs-source-dirs: app 8 | main-is: Main.hs 9 | ghc-options: -threaded -rtsopts -with-rtsopts=-N 10 | build-depends: base 11 | default-language: Haskell2010 12 | -------------------------------------------------------------------------------- /tests/integration/tests/366-non-root-dir/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3685-config-yaml-for-allow-newer/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/370-invalid-setup-hs/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["build"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/370-invalid-setup-hs/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Make (defaultMain) 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/370-invalid-setup-hs/files/new-template.cabal: -------------------------------------------------------------------------------- 1 | name: new-template 2 | version: 0.1.0.0 3 | synopsis: Initial project template from stack 4 | description: Please see README.md 5 | homepage: http://github.com/name/project 6 | license: BSD3 7 | license-file: LICENSE 8 | author: Your name here 9 | maintainer: your.address@example.com 10 | category: Web 11 | build-type: Simple 12 | cabal-version: >=1.10 13 | 14 | library 15 | hs-source-dirs: src 16 | exposed-modules: Lib 17 | build-depends: base >= 4.7 && < 5 18 | default-language: Haskell2010 19 | -------------------------------------------------------------------------------- /tests/integration/tests/370-invalid-setup-hs/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/370-invalid-setup-hs/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3787-internal-libs-with-no-main-lib/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["clean"] 6 | stack ["build"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3787-internal-libs-with-no-main-lib/files/exe/Main.hs: -------------------------------------------------------------------------------- 1 | main = putStrLn "OK" 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3787-internal-libs-with-no-main-lib/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >= 2.0 5 | 6 | library sublib 7 | exposed-modules: B 8 | hs-source-dirs: src-sublib 9 | build-depends: base 10 | default-language: Haskell2010 11 | 12 | executable exe 13 | main-is: Main.hs 14 | hs-source-dirs: exe 15 | build-depends: base, sublib 16 | default-language: Haskell2010 17 | -------------------------------------------------------------------------------- /tests/integration/tests/3787-internal-libs-with-no-main-lib/files/src-sublib/B.hs: -------------------------------------------------------------------------------- 1 | module B where 2 | 3 | -- | A function of the internal library 4 | funInternal :: Int -> Int 5 | funInternal = pred 6 | -------------------------------------------------------------------------------- /tests/integration/tests/3787-internal-libs-with-no-main-lib/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3787-internal-libs-with-no-main-lib/files/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | sha256: bfafe5735ccb74527d754b1f9999ded72d7c3a6c3a88529449661431ccfbd6cc 10 | size: 649327 11 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/20/8.yaml 12 | original: lts-20.8 13 | -------------------------------------------------------------------------------- /tests/integration/tests/384-local-deps/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | removeFileIgnore "stack.yaml" 6 | stack ["init", defaultSnapshotArg] 7 | stack ["test"] 8 | -------------------------------------------------------------------------------- /tests/integration/tests/384-local-deps/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/384-local-deps/files/dir1/dir1.cabal: -------------------------------------------------------------------------------- 1 | name: dir1 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/384-local-deps/files/dir1/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/384-local-deps/files/dir2/dir2.cabal: -------------------------------------------------------------------------------- 1 | name: dir2 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5, dir1 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/384-local-deps/files/dir2/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3861-ignore-bounds-in-snapshots/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackIgnoreException ["clean", "--stack-yaml", "stack-good.yaml", "--full"] 6 | stackErr ["build", "--stack-yaml", "stack-bad.yaml"] 7 | stack ["build", "--stack-yaml", "stack-good.yaml"] 8 | -------------------------------------------------------------------------------- /tests/integration/tests/3861-ignore-bounds-in-snapshots/files/.gitignore: -------------------------------------------------------------------------------- 1 | foo.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3861-ignore-bounds-in-snapshots/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | 4 | dependencies: 5 | - base 6 | - bad-bounds 7 | 8 | library: {} 9 | -------------------------------------------------------------------------------- /tests/integration/tests/3861-ignore-bounds-in-snapshots/files/snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | packages: 3 | - ./bad-bounds.tar 4 | 5 | # Include a flag to get a different snapshot hash 6 | flags: 7 | bad-bounds: 8 | unimportant: false 9 | -------------------------------------------------------------------------------- /tests/integration/tests/3861-ignore-bounds-in-snapshots/files/stack-bad.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | extra-deps: 3 | - ./bad-bounds.tar 4 | 5 | # Include a flag to get a different snapshot hash 6 | flags: 7 | bad-bounds: 8 | unimportant: true 9 | -------------------------------------------------------------------------------- /tests/integration/tests/3861-ignore-bounds-in-snapshots/files/stack-good.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshot.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3863-purge-command/files/new-template.cabal: -------------------------------------------------------------------------------- 1 | name: new-template 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | 7 | library 8 | hs-source-dirs: src 9 | exposed-modules: Lib 10 | build-depends: base >= 4.7 && < 5 11 | default-language: Haskell2010 12 | -------------------------------------------------------------------------------- /tests/integration/tests/3863-purge-command/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | someFunc :: () 4 | someFunc = () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3863-purge-command/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3899-dont-rebuild-sublibraries/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | 5 | main :: IO () 6 | main = do 7 | stack ["clean"] 8 | stack ["build"] 9 | res <- compilingModulesLines . snd <$> stackStderr ["build"] 10 | unless (null res) $ fail "Stack recompiled code" 11 | 12 | -- Returns the lines where a module is compiled 13 | compilingModulesLines :: String -> [String] 14 | compilingModulesLines = filter (isInfixOf " Compiling ") . lines 15 | -------------------------------------------------------------------------------- /tests/integration/tests/3899-dont-rebuild-sublibraries/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/3899-dont-rebuild-sublibraries/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >= 2.0 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base, lib 10 | default-language: Haskell2010 11 | 12 | library lib 13 | hs-source-dirs: src-internal 14 | exposed-modules: Internal 15 | build-depends: base 16 | default-language: Haskell2010 17 | 18 | executable exe 19 | hs-source-dirs: src-exe 20 | main-is: Main.hs 21 | build-depends: base, files 22 | default-language: Haskell2010 23 | -------------------------------------------------------------------------------- /tests/integration/tests/3899-dont-rebuild-sublibraries/files/src-exe/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Lib 4 | 5 | main :: IO () 6 | main = do 7 | putStrLn "hello world" 8 | -------------------------------------------------------------------------------- /tests/integration/tests/3899-dont-rebuild-sublibraries/files/src-internal/Internal.hs: -------------------------------------------------------------------------------- 1 | module Internal where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3899-dont-rebuild-sublibraries/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | import Internal 4 | -------------------------------------------------------------------------------- /tests/integration/tests/3899-dont-rebuild-sublibraries/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | extra-deps: 3 | - stm-2.4.4.1 4 | - mtl-2.2.1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/.gitignore: -------------------------------------------------------------------------------- 1 | src/Lib.hs 2 | src-internal/Internal.hs 3 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/files.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 2.0 2 | 3 | name: files 4 | version: 0.1.0.0 5 | build-type: Simple 6 | 7 | library 8 | hs-source-dirs: src 9 | exposed-modules: Lib 10 | build-depends: base, lib 11 | default-language: Haskell2010 12 | 13 | library lib 14 | hs-source-dirs: src-internal 15 | exposed-modules: Internal 16 | build-depends: base 17 | default-language: Haskell2010 18 | 19 | executable exe 20 | hs-source-dirs: src-exe 21 | main-is: Main.hs 22 | build-depends: base, files 23 | default-language: Haskell2010 24 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/src-exe/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Lib 4 | 5 | main :: IO () 6 | main = do 7 | putStrLn "hello world" 8 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/src-internal/Internal.v1: -------------------------------------------------------------------------------- 1 | module Internal where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/src-internal/Internal.v2: -------------------------------------------------------------------------------- 1 | module Internal where 2 | 3 | testInt :: Int 4 | testInt = 42 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/src/Lib.v1: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | import Internal 4 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/src/Lib.v2: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | import Internal 4 | 5 | testStr :: String 6 | testStr = "OK" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3926-ghci-with-sublibraries/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | extra-deps: 3 | - stm-2.5.1.0 4 | - mtl-2.2.2 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3940-base-upgrade-warning/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.0.1.0 3 | build-type: Simple 4 | cabal-version: >= 1.18 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base < 4.10 && >= 4.6.0.1 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3940-base-upgrade-warning/files/no-base-upgrade.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | extra-deps: 3 | - base-4.10.1.0 4 | -------------------------------------------------------------------------------- /tests/integration/tests/3940-base-upgrade-warning/files/src/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/commercialhaskell/stack/ee20e91a3e6054661bdbd06c5835daea3c8c95ea/tests/integration/tests/3940-base-upgrade-warning/files/src/.gitkeep -------------------------------------------------------------------------------- /tests/integration/tests/3940-base-upgrade-warning/files/unattainable-base.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3942-solver-error-output/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | 5 | -- | Stack's error code for failing to construct a build plan. 6 | planFailure :: String 7 | planFailure = 8 | "[S-4804]" 9 | 10 | main :: IO () 11 | main = do 12 | stackErrStderr ["./script.hs"] (expectMessage planFailure) 13 | 14 | expectMessage :: String -> String -> IO () 15 | expectMessage msg stderr = do 16 | unless (words msg `isInfixOf` words stderr) 17 | (error $ "Expected a warning: \n" ++ show msg) 18 | -------------------------------------------------------------------------------- /tests/integration/tests/3942-solver-error-output/files/.gitignore: -------------------------------------------------------------------------------- 1 | .stack-work/ 2 | *.cabal 3 | stack.yaml 4 | -------------------------------------------------------------------------------- /tests/integration/tests/3942-solver-error-output/files/no-deps/package.yaml: -------------------------------------------------------------------------------- 1 | name: no-deps 2 | version: 0.1.0.0 3 | synopsis: A package with no dependencies, other than base 4 | license: BSD3 5 | author: Author name here 6 | copyright: 2000 Author name here 7 | category: Development 8 | extra-source-files: [] 9 | 10 | dependencies: 11 | - base 12 | 13 | library: 14 | source-dirs: '.' 15 | exposed-modules: [] 16 | -------------------------------------------------------------------------------- /tests/integration/tests/3942-solver-error-output/files/one-deps/package.yaml: -------------------------------------------------------------------------------- 1 | name: one-deps 2 | version: 0.1.0.0 3 | synopsis: A package with one dependency (no-deps) other than base 4 | license: BSD3 5 | author: Author name here 6 | copyright: 2000 Author name here 7 | category: Development 8 | extra-source-files: [] 9 | 10 | dependencies: 11 | - base 12 | - no-deps 13 | 14 | library: 15 | source-dirs: '.' 16 | exposed-modules: [] 17 | -------------------------------------------------------------------------------- /tests/integration/tests/3942-solver-error-output/files/script.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | -- stack runhaskell --stack-yaml test-stack.yml --package one-deps 3 | 4 | main :: IO () 5 | main = putStrLn "yo" 6 | -------------------------------------------------------------------------------- /tests/integration/tests/3942-solver-error-output/files/test-stack.yml: -------------------------------------------------------------------------------- 1 | resolver: lts-23.17 2 | 3 | packages: [] 4 | 5 | extra-deps: 6 | - ./one-deps 7 | -------------------------------------------------------------------------------- /tests/integration/tests/3959-order-of-flags/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3959-order-of-flags/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: issue3959 2 | version: 0.1.0.0 3 | 4 | dependencies: 5 | - base 6 | 7 | tests: 8 | test: 9 | main: Spec.hs 10 | source-dirs: test 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3959-order-of-flags/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3959-order-of-flags/files/test/Spec.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = fail "this always fails for the test" 3 | -------------------------------------------------------------------------------- /tests/integration/tests/397-case-insensitive-flags/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackErr ["build"] 6 | stack ["build", "--flag", "new-template:fixIt"] 7 | stack ["build", "--flag", "new-template:fixit"] 8 | stack ["build", "--flag", "new-template:fiXit"] 9 | stack ["build", "--flag", "*:fiXit"] 10 | stackErr ["build", "--flag", "*:fiXit-else"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/397-case-insensitive-flags/files/new-template.cabal: -------------------------------------------------------------------------------- 1 | name: new-template 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | flag fixIt 7 | manual: True 8 | default: False 9 | description: Make the build work 10 | 11 | library 12 | hs-source-dirs: src 13 | exposed-modules: Lib 14 | default-language: Haskell2010 15 | if flag(fixIt) 16 | build-depends: base >= 4.7 17 | else 18 | build-depends: base < 4.7 && > 4.7 19 | -------------------------------------------------------------------------------- /tests/integration/tests/397-case-insensitive-flags/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/397-case-insensitive-flags/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3996-sublib-not-depended-upon/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | 5 | main :: IO () 6 | main = do 7 | stack ["clean"] 8 | stack ["build"] 9 | -------------------------------------------------------------------------------- /tests/integration/tests/3996-sublib-not-depended-upon/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/3996-sublib-not-depended-upon/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >= 2.0 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base 10 | default-language: Haskell2010 11 | 12 | library lib 13 | hs-source-dirs: src-internal 14 | exposed-modules: Internal 15 | build-depends: base 16 | default-language: Haskell2010 17 | -------------------------------------------------------------------------------- /tests/integration/tests/3996-sublib-not-depended-upon/files/src-internal/Internal.hs: -------------------------------------------------------------------------------- 1 | module Internal where 2 | 3 | test :: Int 4 | test = 42 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3996-sublib-not-depended-upon/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | testLib :: Int 4 | testLib = 42 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3996-sublib-not-depended-upon/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | extra-deps: 3 | - stm-2.4.4.1 4 | - mtl-2.2.1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3997-coverage-with-cabal-3/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | 5 | main :: IO () 6 | main = do 7 | stack ["setup"] 8 | stackCheckStderr ["test", "--coverage"] $ \out -> do 9 | unless ("The coverage report for foo's test-suite foo-test is available at" `isInfixOf` out) $ 10 | fail "Coverage report didn't build" 11 | -------------------------------------------------------------------------------- /tests/integration/tests/3997-coverage-with-cabal-3/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | 3 | dependencies: 4 | - base 5 | 6 | library: 7 | source-dirs: src 8 | 9 | tests: 10 | foo-test: 11 | source-dirs: test 12 | main: Main.hs 13 | dependencies: 14 | - foo 15 | -------------------------------------------------------------------------------- /tests/integration/tests/3997-coverage-with-cabal-3/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib (foo) where 2 | 3 | foo :: Int 4 | foo = 1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/3997-coverage-with-cabal-3/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/3997-coverage-with-cabal-3/files/test/Main.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = print foo 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4001-excess-recompilation/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/4001-excess-recompilation/files/bench/Main1.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = putStrLn "I am Main1" 5 | 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4001-excess-recompilation/files/bench/Main2.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = putStrLn "I am Main2" 5 | 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4001-excess-recompilation/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | -------------------------------------------------------------------------------- /tests/integration/tests/4001-excess-recompilation/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4001-excess-recompilation/files/test/Main1.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = putStrLn "I am Main1" 5 | 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4001-excess-recompilation/files/test/Main2.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = putStrLn "I am Main2" 5 | 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4044-no-run-tests-config/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["test"] 6 | stack ["build", "foo:test:foo"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4044-no-run-tests-config/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4044-no-run-tests-config/files/Test.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = error "You shall not pass!" 3 | -------------------------------------------------------------------------------- /tests/integration/tests/4044-no-run-tests-config/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | dependencies: 4 | - base 5 | 6 | library: {} 7 | 8 | tests: 9 | foo: 10 | main: Test.hs 11 | -------------------------------------------------------------------------------- /tests/integration/tests/4044-no-run-tests-config/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | 3 | build: 4 | test-arguments: 5 | no-run-tests: true 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4085-insufficient-error-message/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fpco/stack-build:lts 2 | 3 | WORKDIR ./src 4 | 5 | # we should pre-build stack dependencies before coping the rest of the source 6 | # so we will not build the dependencies every time the source changes 7 | COPY *.yaml ./ 8 | RUN for i in $(stack ls dependencies | sed 's/ /-/g'); \ 9 | do stack build --fast $i; \ 10 | done 11 | 12 | COPY . ./ 13 | RUN stack build --fast 14 | # we can't use 'stack install' to install stack so we're installing it manually 15 | RUN cp -a $(dirname $(stack exec which stack))/. $(dirname $(which stack)) 16 | 17 | WORKDIR .. 18 | -------------------------------------------------------------------------------- /tests/integration/tests/4095-utf8-pure-nix/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4095-utf8-pure-nix/files/ShowUnicode.hs: -------------------------------------------------------------------------------- 1 | import System.IO (stdout) 2 | import Text.Printf (hPrintf) 3 | 4 | main :: IO () 5 | main = hPrintf stdout "平和" 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4095-utf8-pure-nix/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | dependencies: 4 | - base 5 | 6 | executables: 7 | ShowUnicode: 8 | main: ShowUnicode.hs 9 | -------------------------------------------------------------------------------- /tests/integration/tests/4095-utf8-pure-nix/files/stack.yaml: -------------------------------------------------------------------------------- 1 | # As of 20 August 2023, there is no Nix package haskell.compiler.ghc946. 2 | # Available options include ghc92 (GHC 9.2.8), ghc926, ghc927, 3 | # ghc94 (GHC 9.4.5), ghc942, ghc943 or ghc944. 4 | snapshot: lts-20.26 # GHC 9.2.8 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4101-dependency-tree/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5, mtl, subproject, filelock 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/4101-dependency-tree/files/src/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = do 5 | putStrLn "hello world" 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4101-dependency-tree/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: 3 | - . 4 | - subproject 5 | extra-deps: 6 | - github: snoyberg/filelock 7 | commit: 4f080496d8bf153fbe26e64d1f52cf73c7db25f6 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4101-dependency-tree/files/subproject/src/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = do 5 | putStrLn "hello world" 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4101-dependency-tree/files/subproject/subproject.cabal: -------------------------------------------------------------------------------- 1 | name: subproject 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/4105-test-coverage-of-internal-lib/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >= 2.0 5 | 6 | library 7 | exposed-modules: Src 8 | hs-source-dirs: src 9 | build-depends: base 10 | default-language: Haskell2010 11 | 12 | library sublib 13 | exposed-modules: B 14 | hs-source-dirs: src-sublib 15 | build-depends: base 16 | default-language: Haskell2010 17 | 18 | test-suite test 19 | type: exitcode-stdio-1.0 20 | main-is: Main.hs 21 | hs-source-dirs: test 22 | build-depends: base, files, sublib 23 | default-language: Haskell2010 24 | -------------------------------------------------------------------------------- /tests/integration/tests/4105-test-coverage-of-internal-lib/files/src-sublib/B.hs: -------------------------------------------------------------------------------- 1 | module B where 2 | 3 | -- | A function of the internal library 4 | funInternal :: Int -> Int 5 | funInternal = pred 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4105-test-coverage-of-internal-lib/files/src/Src.hs: -------------------------------------------------------------------------------- 1 | module Src where 2 | 3 | -- | A function of the main library 4 | funMainLib :: Int -> Int 5 | funMainLib = succ 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4105-test-coverage-of-internal-lib/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4105-test-coverage-of-internal-lib/files/test/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (when) 2 | 3 | import Src 4 | import B 5 | 6 | main = when (funMainLib 41 /= funInternal 43) $ error "test failed" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4181-clean-wo-dl-ghc/Main.hs: -------------------------------------------------------------------------------- 1 | -- | 2 | -- The integration tests have no ghc present, initially. Stack should not 3 | -- require ghc present to run the `clean` command. 4 | 5 | import StackTest 6 | 7 | main :: IO () 8 | main = do 9 | -- `stack clean` should succeed even though there is no ghc available. 10 | -- See the stack.yaml file for how this works. 11 | stackIgnoreException ["clean"] 12 | stackCleanFull 13 | -------------------------------------------------------------------------------- /tests/integration/tests/4181-clean-wo-dl-ghc/files/foo.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: >= 1.10 2 | 3 | -- This file has been generated from package.yaml by hpack version 0.29.6. 4 | -- 5 | -- see: https://github.com/sol/hpack 6 | -- 7 | -- hash: 941a1ab4bea2f0ee229dd6ab7fe9730517a0397fb9141fe2841a0f9748dbfd57 8 | 9 | name: foo 10 | version: 0.1.0.0 11 | build-type: Simple 12 | 13 | library 14 | -------------------------------------------------------------------------------- /tests/integration/tests/4181-clean-wo-dl-ghc/files/stack.yaml: -------------------------------------------------------------------------------- 1 | # Update the resolver as necessary 2 | snapshot: ghc-8.22 3 | # Do not use the system ghc, as ghc must not be available 4 | system-ghc: false 5 | # Do not install any other ghc, as ghc must not be available 6 | install-ghc: false 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4215-missing-unregister/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build", "--stack-yaml", "stack1.yaml"] 6 | stack ["build", "--stack-yaml", "stack2.yaml"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4215-missing-unregister/files/.gitignore: -------------------------------------------------------------------------------- 1 | foo.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4215-missing-unregister/files/stack1.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | packages: 3 | - v1 4 | -------------------------------------------------------------------------------- /tests/integration/tests/4215-missing-unregister/files/stack2.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | packages: 3 | - v2 4 | -------------------------------------------------------------------------------- /tests/integration/tests/4215-missing-unregister/files/v1/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 1 3 | 4 | dependencies: 5 | - base 6 | 7 | library: {} 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4215-missing-unregister/files/v2/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 2 3 | 4 | dependencies: 5 | - base 6 | 7 | library: {} 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4270-files-order/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad 2 | import StackTest 3 | import StackTest.Repl 4 | 5 | main :: IO () 6 | main = do 7 | stack ["build"] 8 | stackRepl [] $ do 9 | nextPrompt 10 | replCommand "putStrLn greeting" 11 | line <- replGetLine 12 | let expected = "Hello, world!" 13 | when (line /= expected) $ 14 | error $ 15 | "Didn't load correctly.\n" 16 | <> "Expected: " <> expected <> "\n" 17 | <> "Actual : " <> line <> "\n" 18 | -------------------------------------------------------------------------------- /tests/integration/tests/4270-files-order/files/cbits-ordering.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 3.4 2 | 3 | name: cbits-ordering 4 | version: 0.0.0 5 | build-type: Simple 6 | 7 | library 8 | exposed-modules: 9 | Lib 10 | other-modules: 11 | Paths_cbits_ordering 12 | hs-source-dirs: 13 | src 14 | include-dirs: 15 | cbits 16 | c-sources: 17 | cbits/the_dependency.c 18 | cbits/a_dependent.c 19 | 20 | build-depends: 21 | base >=4.7 && <5 22 | default-language: GHC2021 23 | -------------------------------------------------------------------------------- /tests/integration/tests/4270-files-order/files/cbits/a_dependent.c: -------------------------------------------------------------------------------- 1 | extern const char *msg; 2 | 3 | const char *greeting() 4 | { 5 | return msg; 6 | } 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4270-files-order/files/cbits/a_dependent.h: -------------------------------------------------------------------------------- 1 | const char *greeting(); 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4270-files-order/files/cbits/the_dependency.c: -------------------------------------------------------------------------------- 1 | const char *msg = "Hello, world!"; 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4270-files-order/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | import Foreign.C.String 4 | import System.IO.Unsafe 5 | 6 | foreign import ccall unsafe "a_dependent.h greeting" 7 | c_greeting :: CString 8 | 9 | {-# NOINLINE greeting #-} 10 | greeting :: String 11 | greeting = unsafePerformIO $ peekCString c_greeting 12 | -------------------------------------------------------------------------------- /tests/integration/tests/4270-files-order/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4324-dot-includes-boot-packages/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Control.Monad (unless) 3 | import Data.List (isInfixOf) 4 | 5 | main :: IO () 6 | main = do 7 | stackCheckStdout ["dot", "--external"] $ \str -> 8 | unless ("\n\"process\" ->" `isInfixOf` str) $ 9 | error "Not showing dependencies of process" 10 | -------------------------------------------------------------------------------- /tests/integration/tests/4324-dot-includes-boot-packages/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4324-dot-includes-boot-packages/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | 3 | dependencies: 4 | - base 5 | - process 6 | 7 | library: {} 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4324-dot-includes-boot-packages/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4390-dot-no-ghc/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["ls", "dependencies", "--global-hints"] 6 | stack ["dot", "--global-hints"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4390-dot-no-ghc/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4390-dot-no-ghc/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | dependencies: 4 | - base 5 | - process 6 | library: {} 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4390-dot-no-ghc/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4408-init-internal-libs/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["init", "--snapshot", "ghc-9.2.4", "--force"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4408-init-internal-libs/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4408-init-internal-libs/files/foo.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 2.0 2 | name: foo 3 | version: 0 4 | build-type: Simple 5 | 6 | library 7 | hs-source-dirs: src 8 | build-depends: base, some-internal-lib 9 | default-language: Haskell2010 10 | 11 | library some-internal-lib 12 | hs-source-dirs: src-internal 13 | exposed-modules: Internal 14 | build-depends: base 15 | default-language: Haskell2010 16 | -------------------------------------------------------------------------------- /tests/integration/tests/443-specify-path/.gitignore: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /tests/integration/tests/444-package-option/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | isAlpine <- getIsAlpine 6 | if isAlpine || isARM 7 | then logInfo "Disabled on Alpine Linux and ARM since it cannot yet install its own GHC." 8 | else stack [defaultSnapshotArg, "--install-ghc", "runghc", "--package", "safe", "Test.hs"] 9 | -------------------------------------------------------------------------------- /tests/integration/tests/444-package-option/files/Test.hs: -------------------------------------------------------------------------------- 1 | import Safe 2 | 3 | main :: IO () 4 | main = print $ headMay ([] :: [Int]) 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4453-detailed/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | 4 | main :: IO () 5 | main = do 6 | removeDirIgnore ".stack-work" 7 | stack [defaultSnapshotArg, "test"] 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4453-detailed/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4453-detailed/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4453-detailed/files/test-detailed-example.cabal: -------------------------------------------------------------------------------- 1 | name: test-detailed-example 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.20 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | 12 | test-suite test-detailed-example-test 13 | type: detailed-0.9 14 | hs-source-dirs: test 15 | test-module: Spec 16 | build-depends: base >= 4.7, 17 | Cabal >= 1.20 18 | default-language: Haskell2010 19 | -------------------------------------------------------------------------------- /tests/integration/tests/4453-detailed/files/test/Spec.hs: -------------------------------------------------------------------------------- 1 | module Spec (tests) where 2 | 3 | import Distribution.TestSuite 4 | 5 | tests :: IO [Test] 6 | tests = do 7 | pure [ 8 | test "foo" Pass 9 | ] 10 | 11 | test :: String -> Result -> Test 12 | test name r = Test t 13 | where 14 | t = TestInstance { 15 | run = pure (Finished r) 16 | , name = name 17 | , tags = [] 18 | , options = [] 19 | , setOption = \_ _ -> Right t 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/tests/4488-newer-cabal-version/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | -- Sibi: Commenting this because we are supporting latest cabal 6 | -- version with this change. You can uncomment it when a newer cabal 7 | -- release is made. 8 | -- https://cabal.readthedocs.io/en/3.6/file-format-changelog.html 9 | -- stackErr ["--stack-yaml", "stack-bad.yaml", "build", "--dry-run"] 10 | -- 11 | stack ["--stack-yaml", "stack-good.yaml", "build", "--dry-run"] 12 | -------------------------------------------------------------------------------- /tests/integration/tests/4488-newer-cabal-version/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/4488-newer-cabal-version/files/foo.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 3.6 2 | name: foo 3 | version: 0 4 | build-type: Simple 5 | 6 | library 7 | default-language: Haskell2010 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4488-newer-cabal-version/files/stack-bad.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4488-newer-cabal-version/files/stack-good.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | extra-deps: 3 | - Cabal-2.4.1.0 4 | -------------------------------------------------------------------------------- /tests/integration/tests/4706-ignore-ghc-env-files/files/.gitignore: -------------------------------------------------------------------------------- 1 | foo.cabal 2 | stack.yaml 3 | -------------------------------------------------------------------------------- /tests/integration/tests/4706-ignore-ghc-env-files/files/Main.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = pure () 3 | -------------------------------------------------------------------------------- /tests/integration/tests/4706-ignore-ghc-env-files/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | 4 | dependencies: 5 | - base 6 | 7 | library: {} 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4754-rebuild-haddocks/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackCleanFull 6 | stackErr ["haddock"] 7 | stackCleanFull 8 | stackErr ["haddock", "--no-haddock-deps"] 9 | stack ["build"] 10 | stackErr ["haddock", "--no-haddock-deps"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/4754-rebuild-haddocks/files/.gitignore: -------------------------------------------------------------------------------- 1 | foo.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4754-rebuild-haddocks/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | 4 | dependencies: 5 | - base 6 | 7 | library: 8 | source-dirs: src 9 | ghc-options: 10 | - -Werror 11 | - -Winvalid-haddock 12 | -------------------------------------------------------------------------------- /tests/integration/tests/4754-rebuild-haddocks/files/src/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | 3 | -- | The function below intentionally contains invalid Haddock 4 | foo :: () 5 | foo = () -- ^ this should fail!!! 6 | -------------------------------------------------------------------------------- /tests/integration/tests/4754-rebuild-haddocks/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackCleanFull 6 | stack ["build", "acme-dont-copy"] 7 | stack ["test"] 8 | -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/files/.gitignore: -------------------------------------------------------------------------------- 1 | foo.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/files/acme-dont-copy/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | 4 | dependencies: 5 | - base 6 | 7 | library: 8 | source-dirs: src 9 | 10 | tests: 11 | doctest: 12 | source-dirs: test 13 | main: Main.hs 14 | dependencies: 15 | - doctest 16 | - acme-dont 17 | -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/files/snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | name: foo 3 | packages: 4 | - acme-dont-1.1@sha256:8264ad3e5113d3e0417b46e71d5a9c0914a1f03b5b81319cc329f1dc0f49b96c,602 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/files/src/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | 3 | -- | 4 | -- 5 | -- >>> import Acme.Dont 6 | -- >>> don't foo 7 | foo :: IO () 8 | foo = error "foo" 9 | -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshot.yaml 2 | extra-deps: 3 | # Include a package with a duplicated module name 4 | - acme-dont-copy 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4783-doctest-deps/files/test/Main.hs: -------------------------------------------------------------------------------- 1 | import Test.DocTest 2 | 3 | main :: IO () 4 | main = doctest ["src/Foo.hs"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4897-boot-package-pruned/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | 5 | planFailure :: String 6 | planFailure = "but this GHC boot package has been pruned" 7 | 8 | main :: IO () 9 | main = do 10 | stackErrStderr ["build"] (expectMessage planFailure) 11 | 12 | expectMessage :: String -> String -> IO () 13 | expectMessage msg stderr = do 14 | unless (words msg `isInfixOf` words stderr) 15 | (error $ "Expected an error: \n" ++ show msg) 16 | -------------------------------------------------------------------------------- /tests/integration/tests/4897-boot-package-pruned/files/directory/directory.cabal: -------------------------------------------------------------------------------- 1 | name: directory 2 | version: 1.3.3.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | build-depends: base 8 | default-language: Haskell2010 9 | -------------------------------------------------------------------------------- /tests/integration/tests/4897-boot-package-pruned/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | build-depends: base, directory, process 8 | default-language: Haskell2010 9 | -------------------------------------------------------------------------------- /tests/integration/tests/4897-boot-package-pruned/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | extra-deps: 3 | - ./directory 4 | -------------------------------------------------------------------------------- /tests/integration/tests/4938-non-ascii-module-names/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Control.Monad (unless) 3 | 4 | main :: IO () 5 | main = do 6 | -- Disabled on Windows due to an error occurred in the integration tests 7 | -- regarding Unicode character. Tried to fix it (https://github.com/commercialhaskell/stack/pull/5162/commits/8f04ad9e4cbaa54370dc5af476e3307a16c84405) 8 | -- but it didn't work 9 | unless isWindows $ stack ["build"] 10 | -------------------------------------------------------------------------------- /tests/integration/tests/4938-non-ascii-module-names/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/4938-non-ascii-module-names/files/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( foo 3 | , bar 4 | ) where 5 | 6 | import Täst 7 | 8 | bar :: Int 9 | bar = 42 10 | -------------------------------------------------------------------------------- /tests/integration/tests/4938-non-ascii-module-names/files/Täst.hs: -------------------------------------------------------------------------------- 1 | module Täst where 2 | 3 | foo :: Int 4 | foo = 42 5 | -------------------------------------------------------------------------------- /tests/integration/tests/4938-non-ascii-module-names/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Täst 4 | 5 | main :: IO () 6 | main = putStrLn "42" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/4938-non-ascii-module-names/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: umlaut 2 | dependencies: [base] 3 | library: 4 | source-dirs: . 5 | executables: 6 | exe: 7 | main: Main.hs 8 | source-dirs: app 9 | dependencies: 10 | - umlaut 11 | -------------------------------------------------------------------------------- /tests/integration/tests/4938-non-ascii-module-names/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/5180-ghc-rts-flags/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["clean"] 6 | stack ["build"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/5180-ghc-rts-flags/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5, mtl 10 | default-language: Haskell2010 11 | 12 | -------------------------------------------------------------------------------- /tests/integration/tests/5180-ghc-rts-flags/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | main :: IO () 4 | main = putStrLn "hello world" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/5180-ghc-rts-flags/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | 3 | ghc-options: 4 | "$locals": -j8 +RTS -s -A128M 5 | -------------------------------------------------------------------------------- /tests/integration/tests/5272-only-locals/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Control.Monad (void) 3 | 4 | main :: IO () 5 | main = do 6 | void $ stack' ["exec", "ghc-pkg", "unregister", "unliftio-core"] 7 | stack ["clean"] 8 | 9 | stackErr ["build", "--only-locals"] 10 | stack ["build", "--only-snapshot"] 11 | stack ["build", "--only-locals"] 12 | -------------------------------------------------------------------------------- /tests/integration/tests/5272-only-locals/files/.gitignore: -------------------------------------------------------------------------------- 1 | foo.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/5272-only-locals/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0.0.0 3 | 4 | dependencies: 5 | - base 6 | - unliftio-core 7 | 8 | library: 9 | source-dirs: src/ 10 | -------------------------------------------------------------------------------- /tests/integration/tests/5272-only-locals/files/src/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo () where 2 | 3 | import Control.Monad.IO.Unlift () 4 | -------------------------------------------------------------------------------- /tests/integration/tests/5272-only-locals/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | extra-deps: 3 | - unliftio-core-0.2.0.1@sha256:f9abcdd3f3d28e4840563efb7b8760d2de9b5707bcd6f53a87f6a0d77bb5a9f7,1082 4 | # Force a unique snapshot 5 | - acme-missiles-0.3@rev:0 6 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackEnv <- stackExe 6 | withCwd "package-a" $ stack ["build"] 7 | withCwd "package-b" $ stack ["build"] 8 | withCwd "package-a" $ stack ["build"] 9 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-a/package.yaml: -------------------------------------------------------------------------------- 1 | name: package-a 2 | version: 0.1.0.0 3 | dependencies: 4 | - base >= 4.7 && < 5 5 | library: 6 | source-dirs: src 7 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-a/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-a/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: 3 | - . 4 | - ../package-c 5 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-b/package.yaml: -------------------------------------------------------------------------------- 1 | name: package-b 2 | version: 0.1.0.0 3 | dependencies: 4 | - base >= 4.7 && < 5 5 | library: 6 | source-dirs: src 7 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-b/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-b/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: 3 | - . 4 | - ../package-c 5 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-c/package.yaml: -------------------------------------------------------------------------------- 1 | name: package-c 2 | version: 0.1.0.0 3 | dependencies: 4 | - base >= 4.7 && < 5 5 | library: 6 | source-dirs: src 7 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-c/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/5680-share-package-across-projects/files/package-c/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/6046-missing-sublib-unregister/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | -- This tests building a package with a library and an internal sub library, 4 | -- where the library depends on the sub library, first version 0.1.0.0 (the 5 | -- Cabal file is @foo.cabal1@) and then version 0.2.0.0 (the Cabal file is 6 | -- @foo.cabal2@). 7 | main :: IO () 8 | main = do 9 | copy "foo.cabal1" "foo.cabal" 10 | stack ["build"] 11 | copy "foo.cabal2" "foo.cabal" 12 | stack ["build"] 13 | -------------------------------------------------------------------------------- /tests/integration/tests/6046-missing-sublib-unregister/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | import Sub ( someFunc ) 6 | -------------------------------------------------------------------------------- /tests/integration/tests/6046-missing-sublib-unregister/files/src/Sub.hs: -------------------------------------------------------------------------------- 1 | module Sub 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/6046-missing-sublib-unregister/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/606-local-version-not-exist/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackErr ["build", "files-3"] 6 | stackErr ["build", "files-0.1.0.0"] 7 | stack ["build", "files"] 8 | stack ["build", "."] 9 | -------------------------------------------------------------------------------- /tests/integration/tests/606-local-version-not-exist/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/606-local-version-not-exist/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/606-local-version-not-exist/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/617-extra-dep-flag/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["build", "acme-dont-1.1"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/617-extra-dep-flag/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | flags: 3 | text: 4 | integer-simple: false 5 | extra-deps: 6 | - text-1.2.0.3 7 | packages: [] 8 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-cli/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build"] 6 | stackErr ["build", "--flag", "foo:bar"] 7 | stackErr ["build", "--flag", "files:bar"] 8 | stack ["build", "--flag", "*:bar"] 9 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-cli/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-cli/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-cli/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-name-yaml/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stackErr ["build"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-name-yaml/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-name-yaml/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-name-yaml/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | flags: 3 | files: 4 | does-not-exist: false 5 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-yaml/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stackErr ["build"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-yaml/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-yaml/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/617-unused-flag-yaml/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | flags: 3 | does-not-exist: 4 | foo: false 5 | -------------------------------------------------------------------------------- /tests/integration/tests/620-env-command/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Process 3 | import Control.Exception (throwIO) 4 | import Control.Monad (unless) 5 | 6 | main :: IO () 7 | main = unless isWindows $ rawSystem "bash" ["run.sh"] >>= throwIO 8 | -------------------------------------------------------------------------------- /tests/integration/tests/620-env-command/files/.gitignore: -------------------------------------------------------------------------------- 1 | Main 2 | Main.exe 3 | -------------------------------------------------------------------------------- /tests/integration/tests/620-env-command/files/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Concurrent.Async () 2 | 3 | main :: IO () 4 | main = pure () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/620-env-command/files/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euxo pipefail 4 | 5 | stack build --resolver lts-23.17 async 6 | eval `stack config env --resolver lts-23.17` 7 | ghc Main.hs 8 | -------------------------------------------------------------------------------- /tests/integration/tests/6372-sdist-unicode-test/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml.lock 2 | -------------------------------------------------------------------------------- /tests/integration/tests/6372-sdist-unicode-test/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: test١٢٣ 2 | version: 0.1.0.0 3 | license: BSD-3-Clause 4 | description: Test of Unicode characters in file names 5 | dependencies: 6 | - base < 5 7 | library: 8 | source-dirs: src 9 | -------------------------------------------------------------------------------- /tests/integration/tests/6372-sdist-unicode-test/files/src/Libαβγ.hs: -------------------------------------------------------------------------------- 1 | module Libαβγ 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = putStrLn "someFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/6372-sdist-unicode-test/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/6372-sdist-unicode-test/files/test١٢٣.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 2.2 2 | 3 | -- This file has been generated from package.yaml by hpack version 0.36.0. 4 | -- 5 | -- see: https://github.com/sol/hpack 6 | 7 | name: test١٢٣ 8 | version: 0.1.0.0 9 | description: Test of Unicode characters in file names 10 | license: BSD-3-Clause 11 | build-type: Simple 12 | 13 | library 14 | exposed-modules: 15 | Libαβγ 16 | other-modules: 17 | Paths_test١٢٣ 18 | autogen-modules: 19 | Paths_test١٢٣ 20 | hs-source-dirs: 21 | src 22 | build-depends: 23 | base <5 24 | default-language: Haskell2010 25 | -------------------------------------------------------------------------------- /tests/integration/tests/6465-msys-environment/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | import Control.Monad ( when ) 4 | 5 | main :: IO () 6 | main = when isWindows $ do 7 | stack ["exec", "--", "pacman", "-S", "--noconfirm", "mingw-w64-ucrt-x86_64-gsl"] 8 | stack ["build"] 9 | stack ["exec", "--", "foo"] 10 | -------------------------------------------------------------------------------- /tests/integration/tests/6465-msys-environment/files/Main.hs: -------------------------------------------------------------------------------- 1 | module Main (main) where 2 | 3 | import Foreign.C.Types 4 | 5 | foreign import ccall "gsl/gsl_sf_bessel.h gsl_sf_bessel_J0" 6 | gsl_sf_bessel_J0 :: CDouble -> CDouble 7 | 8 | main :: IO () 9 | main = do 10 | let x = CDouble 5.0 11 | result = gsl_sf_bessel_J0 x 12 | putStrLn $ "J0(" ++ show x ++ ") = " ++ show result 13 | -------------------------------------------------------------------------------- /tests/integration/tests/6465-msys-environment/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/6465-msys-environment/files/foo.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 2.2 2 | name: foo 3 | version: 0.1.0.0 4 | build-type: Simple 5 | 6 | executable foo 7 | main-is: Main.hs 8 | ghc-options: -threaded -rtsopts -with-rtsopts=-N 9 | extra-libraries: gsl 10 | build-depends: base >=4.7 && <5 11 | default-language: Haskell2010 12 | -------------------------------------------------------------------------------- /tests/integration/tests/6465-msys-environment/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | msys-environment: UCRT64 3 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-failing-test/README.md: -------------------------------------------------------------------------------- 1 | # thtest 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-failing-test/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-failing-test/files/file.txt: -------------------------------------------------------------------------------- 1 | aaa 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-failing-test/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | import Language.Haskell.TH 6 | 7 | someFunc :: IO () 8 | someFunc = putStrLn "aaa" 9 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-failing-test/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Data.Functor ( void ) 2 | 3 | main :: IO () 4 | main = void $ readFile "files/file.txt" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-th/README.md: -------------------------------------------------------------------------------- 1 | # thtest 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-th/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-th/files/file.txt: -------------------------------------------------------------------------------- 1 | aaa 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-th/src/Lib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | module Lib 3 | ( someFunc 4 | ) where 5 | 6 | import TH 7 | import Language.Haskell.TH 8 | 9 | someFunc :: IO () 10 | someFunc = print $(thFunc) 11 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-th/src/TH.hs: -------------------------------------------------------------------------------- 1 | module TH (thFunc) where 2 | 3 | import Language.Haskell.TH 4 | 5 | thFunc :: Q Exp 6 | thFunc = runIO $ do 7 | readFile "files/file.txt" 8 | pure $ LitE (IntegerL 5) 9 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-working-th/README.md: -------------------------------------------------------------------------------- 1 | # thtest 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-working-th/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-working-th/files/file.txt: -------------------------------------------------------------------------------- 1 | aaa 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-working-th/src/Lib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | module Lib 3 | ( someFunc 4 | ) where 5 | 6 | import TH 7 | import Language.Haskell.TH 8 | 9 | someFunc :: IO () 10 | someFunc = print $(thFunc) 11 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/package-with-working-th/src/TH.hs: -------------------------------------------------------------------------------- 1 | module TH (thFunc) where 2 | 3 | import Language.Haskell.TH 4 | 5 | thFunc :: Q Exp 6 | thFunc = 7 | pure $ LitE (IntegerL 5) 8 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: 3 | - package-with-th 4 | - package-with-working-th 5 | - package-with-failing-test 6 | - subdirs/dependent-on-failing-packages 7 | - subdirs/failing-in-subdir 8 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/dependent-on-failing-packages/README.md: -------------------------------------------------------------------------------- 1 | # thtest 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/dependent-on-failing-packages/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/dependent-on-failing-packages/files/file.txt: -------------------------------------------------------------------------------- 1 | aaa 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/dependent-on-failing-packages/src/LibD.hs: -------------------------------------------------------------------------------- 1 | module LibD 2 | ( someFunc 3 | ) where 4 | 5 | import Lib 6 | import LibC 7 | 8 | someFuncD :: IO () 9 | someFuncD = do 10 | someFunc 11 | someFuncC 12 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/failing-in-subdir/README.md: -------------------------------------------------------------------------------- 1 | # thtest 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/failing-in-subdir/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/failing-in-subdir/files/file.txt: -------------------------------------------------------------------------------- 1 | aaa 2 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/failing-in-subdir/src/LibC.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | module LibC 3 | ( someFuncC 4 | ) where 5 | 6 | import THInSubdir 7 | import Language.Haskell.TH 8 | 9 | someFuncC :: IO () 10 | someFuncC = print $(thFuncC) 11 | -------------------------------------------------------------------------------- /tests/integration/tests/717-sdist-test/files/subdirs/failing-in-subdir/src/THInSubdir.hs: -------------------------------------------------------------------------------- 1 | module THInSubdir (thFuncC) where 2 | 3 | import Language.Haskell.TH 4 | 5 | thFuncC :: Q Exp 6 | thFuncC = runIO $ do 7 | readFile "files/file.txt" 8 | pure $ LitE (IntegerL 5) 9 | -------------------------------------------------------------------------------- /tests/integration/tests/763-buildable-false/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build"] 6 | stack ["build", "--flag", "*:force-enable"] 7 | stack ["build", ":enabled"] 8 | stackErr ["build", ":disabled"] 9 | stack ["build", ":disabled", "--flag", "files:force-enable"] 10 | -------------------------------------------------------------------------------- /tests/integration/tests/763-buildable-false/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | main :: IO () 4 | main = pure () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/763-buildable-false/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | flag force-enable 7 | default: False 8 | description: foo 9 | 10 | executable enabled 11 | hs-source-dirs: app 12 | main-is: Main.hs 13 | build-depends: base 14 | default-language: Haskell2010 15 | buildable: True 16 | 17 | executable disabled 18 | hs-source-dirs: app 19 | main-is: Main.hs 20 | build-depends: base 21 | default-language: Haskell2010 22 | if flag(force-enable) 23 | buildable: True 24 | else 25 | buildable: False 26 | -------------------------------------------------------------------------------- /tests/integration/tests/763-buildable-false/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/796-ghc-options/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build"] 6 | stackErr ["build", "--ghc-options=-DBAZ"] 7 | stack ["build", "--ghc-options=-DQUX"] 8 | -------------------------------------------------------------------------------- /tests/integration/tests/796-ghc-options/files/ghc-options.cabal: -------------------------------------------------------------------------------- 1 | name: ghc-options 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/796-ghc-options/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | module Lib 3 | ( someFunc 4 | ) where 5 | 6 | someFunc :: IO () 7 | someFunc = putStrLn "someFunc" 8 | 9 | -- Avoid problems with CPP and HLint 10 | #ifndef __HLINT__ 11 | 12 | #ifndef FOO 13 | #error FOO isn't defined 14 | #endif 15 | 16 | #ifndef BAR 17 | #error BAR isn't defined 18 | #endif 19 | 20 | #ifdef BAZ 21 | #error BAZ is defined 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /tests/integration/tests/796-ghc-options/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | ghc-options: 3 | "*": -DFOO 4 | ghc-options: -DBAR 5 | rebuild-ghc-options: true 6 | -------------------------------------------------------------------------------- /tests/integration/tests/allow-newer-specific-packages/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack ["build"] 6 | -------------------------------------------------------------------------------- /tests/integration/tests/allow-newer-specific-packages/files/foo.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 1.12 2 | 3 | -- This file has been generated from package.yaml by hpack version 0.35.0. 4 | -- 5 | -- see: https://github.com/sol/hpack 6 | 7 | name: foo 8 | version: 0 9 | build-type: Simple 10 | 11 | library 12 | exposed-modules: 13 | Foo 14 | other-modules: 15 | Paths_foo 16 | hs-source-dirs: 17 | src 18 | build-depends: 19 | base ==4.13.* 20 | default-language: Haskell2010 21 | -------------------------------------------------------------------------------- /tests/integration/tests/allow-newer-specific-packages/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | 4 | dependencies: 5 | - base >= 4.13 && < 4.14 6 | 7 | library: 8 | source-dirs: src 9 | -------------------------------------------------------------------------------- /tests/integration/tests/allow-newer-specific-packages/files/src/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/allow-newer-specific-packages/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | 3 | allow-newer: true 4 | allow-newer-deps: 5 | - foo 6 | -------------------------------------------------------------------------------- /tests/integration/tests/basic-install/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stack [defaultSnapshotArg, "install", "acme-missiles-0.3"] 6 | doesNotExist "stack.yaml" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-non-buildable-bug/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | foo.cabal 3 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-non-buildable-bug/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: "0" 3 | 4 | dependencies: 5 | - base 6 | 7 | library: {} 8 | 9 | executables: 10 | not-built: 11 | main: Main.hs 12 | dependencies: 13 | - does-not-exist 14 | buildable: false 15 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-public-sublibraries/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | putStrLn "Disabled: CI doesn't have GHC 8.8.1" 6 | --stack ["build"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-public-sublibraries/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-public-sublibraries/files/files.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 3.0 2 | name: files 3 | version: 0.1.0.0 4 | build-type: Simple 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | 12 | library sub 13 | visibility: public 14 | hs-source-dirs: src 15 | exposed-modules: Sub 16 | build-depends: base >= 4.7 && < 5 17 | default-language: Haskell2010 18 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-public-sublibraries/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = do 7 | putStrLn "hello world" 8 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-public-sublibraries/files/src/Sub.hs: -------------------------------------------------------------------------------- 1 | module Sub 2 | ( someFunc 3 | ) where 4 | 5 | someFunc :: IO () 6 | someFunc = do 7 | putStrLn "hello world" 8 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-public-sublibraries/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: nightly-2020-01-17 2 | extra-deps: 3 | - github: snoyberg/filelock 4 | commit: 4f080496d8bf153fbe26e64d1f52cf73c7db25f6 5 | # - Cabal-3.0.0.0@sha256:1ba37b8d80e89213b17db7b8b9ea0108da55ca65f8c0cbb7433881a284c5cf67,26027 6 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | 5 | -- This tests building two project packages, one of which depends on the other 6 | -- (subproject). The dependency has a library and a visible sub-library named 7 | -- sub, each of which exposes a module that exports a function. 8 | 9 | main :: IO () 10 | -- The '--install-ghc' flag is passed here, because IntegrationSpec.runApp sets 11 | -- up `config.yaml` with `system-ghc: true` and `install-ghc: false`. 12 | -- (See stack.yaml; using GHC 9.8.4.) 13 | main = stack ["build", "--install-ghc"] 14 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/files.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 3.8 2 | name: files 3 | version: 0.1.0.0 4 | build-type: Simple 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5 10 | , subproject:{subproject, sub} 11 | default-language: Haskell2010 12 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | import Subproject.Lib ( libFunc ) 6 | import Subproject.SubLib ( subLibFunc ) 7 | 8 | someFunc :: IO () 9 | someFunc = do 10 | libFunc 11 | subLibFunc 12 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: 3 | - . 4 | - subproject 5 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | sha256: c4233cb7ff3bc39c1eaad6153615331c9adc624559391142a8b812248a31300d 10 | size: 598787 11 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2023/3/4.yaml 12 | original: nightly-2023-03-04 13 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/subproject/src/Subproject/Lib.hs: -------------------------------------------------------------------------------- 1 | module Subproject.Lib 2 | ( libFunc 3 | ) where 4 | 5 | libFunc :: IO () 6 | libFunc = putStrLn "libFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/subproject/src/Subproject/SubLib.hs: -------------------------------------------------------------------------------- 1 | module Subproject.SubLib 2 | ( subLibFunc 3 | ) where 4 | 5 | subLibFunc :: IO () 6 | subLibFunc = putStrLn "subLibFunc" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/cabal-sublibrary-dependency/files/subproject/subproject.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 3.8 2 | name: subproject 3 | version: 0.1.0.0 4 | build-type: Simple 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Subproject.Lib 9 | build-depends: base >= 4.7 && < 5 10 | default-language: Haskell2010 11 | 12 | library sub 13 | visibility: public 14 | hs-source-dirs: src 15 | exposed-modules: Subproject.SubLib 16 | build-depends: base >= 4.7 && < 5 17 | default-language: Haskell2010 18 | -------------------------------------------------------------------------------- /tests/integration/tests/copy-bins-works/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | import Control.Monad (unless) 4 | 5 | main :: IO () 6 | main = do 7 | let test args = do 8 | removeDirIgnore "bin" 9 | stackCleanFull 10 | stack args 11 | exists <- doesDirectoryExist "bin" 12 | unless exists $ error $ "Failed with: " ++ show args 13 | test ["install", "--local-bin-path", "bin"] 14 | test ["build", "--copy-bins", "--local-bin-path", "bin"] 15 | -------------------------------------------------------------------------------- /tests/integration/tests/copy-bins-works/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | /bin/ 3 | -------------------------------------------------------------------------------- /tests/integration/tests/copy-bins-works/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0 3 | 4 | executables: 5 | bar: 6 | source-dirs: src 7 | main: Main.hs 8 | dependencies: 9 | - base 10 | -------------------------------------------------------------------------------- /tests/integration/tests/copy-bins-works/files/src/Main.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = pure () 3 | -------------------------------------------------------------------------------- /tests/integration/tests/copy-bins-works/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | copy-bins: true 3 | -------------------------------------------------------------------------------- /tests/integration/tests/cyclic-test-deps/.gitignore: -------------------------------------------------------------------------------- 1 | files 2 | -------------------------------------------------------------------------------- /tests/integration/tests/cyclic-test-deps/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | removeDirIgnore "text-2.1" 6 | stack ["unpack", "text-2.1"] 7 | stack ["unpack", "QuickCheck-2.14.3"] 8 | removeFileIgnore "stack.yaml" 9 | stack ["init", defaultSnapshotArg] 10 | stack ["test", "--dry-run"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/drop-packages/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stackErr ["build"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/drop-packages/files/.gitignore: -------------------------------------------------------------------------------- 1 | *.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/drop-packages/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: unimportant 2 | version: 0 3 | dependencies: 4 | - base 5 | - unliftio-core 6 | library: {} 7 | -------------------------------------------------------------------------------- /tests/integration/tests/drop-packages/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | drop-packages: 3 | - unliftio-core 4 | -------------------------------------------------------------------------------- /tests/integration/tests/duplicate-package-ids/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | readFile "stack1.yaml" >>= writeFile "stack.yaml" 6 | stack ["setup"] 7 | stack ["build", "auto-update"] 8 | readFile "stack2.yaml" >>= writeFile "stack.yaml" 9 | removeDirIgnore "auto-update-0.1.2.1" 10 | stack ["unpack", "auto-update-0.1.2.1"] 11 | stack ["build"] 12 | -------------------------------------------------------------------------------- /tests/integration/tests/duplicate-package-ids/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | auto-update-0.1.2.1 3 | -------------------------------------------------------------------------------- /tests/integration/tests/duplicate-package-ids/files/stack1.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: [] 3 | -------------------------------------------------------------------------------- /tests/integration/tests/duplicate-package-ids/files/stack2.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: 3 | - auto-update-0.1.2.1 4 | -------------------------------------------------------------------------------- /tests/integration/tests/ghc-install-hooks/Main.hs: -------------------------------------------------------------------------------- 1 | import System.Process (rawSystem) 2 | import Control.Exception (throwIO) 3 | import StackTest 4 | import Control.Monad (unless) 5 | 6 | main :: IO () 7 | main = rawSystem "sh" ["run.sh"] >>= throwIO 8 | -------------------------------------------------------------------------------- /tests/integration/tests/ghc-install-hooks/files/.gitignore: -------------------------------------------------------------------------------- 1 | /fake-root/ 2 | -------------------------------------------------------------------------------- /tests/integration/tests/ghc-install-hooks/files/foo.hs: -------------------------------------------------------------------------------- 1 | main = putStrLn "Looks like everything is working!" 2 | -------------------------------------------------------------------------------- /tests/integration/tests/ghc-install-hooks/files/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -exu 4 | 5 | stack_bin=$("$STACK_EXE" path --resolver ghc-9.8.4 --compiler-bin) 6 | 7 | export STACK_ROOT=$(pwd)/fake-root 8 | 9 | mkdir -p "${STACK_ROOT}"/hooks 10 | 11 | echo "echo '${stack_bin}/ghc'" > "${STACK_ROOT}"/hooks/ghc-install.sh 12 | chmod +x "${STACK_ROOT}"/hooks/ghc-install.sh 13 | 14 | "$STACK_EXE" --no-install-ghc --resolver ghc-9.8.4 ghc -- --info 15 | "$STACK_EXE" --no-install-ghc --resolver ghc-9.8.4 runghc foo.hs 16 | -------------------------------------------------------------------------------- /tests/integration/tests/git-submodules/files/.gitignore: -------------------------------------------------------------------------------- 1 | tmpPackage 2 | tmpRepo 3 | tmpSubRepo 4 | tmpSubSubRepo 5 | -------------------------------------------------------------------------------- /tests/integration/tests/haddock-options/files/haddock-options.cabal: -------------------------------------------------------------------------------- 1 | name: haddock-options 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/haddock-options/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE CPP #-} 2 | module Lib 3 | ( someFunc 4 | ) where 5 | 6 | someFunc :: IO () 7 | someFunc = putStrLn "someFunc" 8 | 9 | #if defined(FOO) && defined(BAR) 10 | #error FOO and BAR is defined 11 | #endif 12 | -------------------------------------------------------------------------------- /tests/integration/tests/haddock-options/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | 3 | build: 4 | haddock-arguments: 5 | haddock-args: 6 | - --optghc=-DFOO 7 | -------------------------------------------------------------------------------- /tests/integration/tests/hpack-repo/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | 4 | main :: IO () 5 | main = do 6 | removeDirIgnore ".stack-work" 7 | stack ["build"] 8 | -------------------------------------------------------------------------------- /tests/integration/tests/hpack-repo/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 0.1.0.0 3 | build-type: Simple 4 | cabal-version: >=1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base >= 4.7 && < 5, validity 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/hpack-repo/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | ) where 4 | 5 | import Data.Validity 6 | 7 | someFunc :: IO () 8 | someFunc = putStrLn "someFunc" 9 | -------------------------------------------------------------------------------- /tests/integration/tests/hpack-repo/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | extra-deps: 3 | - git: https://github.com/NorfairKing/validity.git 4 | commit: d128cc30bc886e31ea7f8161fb7708c08b162937 5 | subdirs: 6 | - validity 7 | -------------------------------------------------------------------------------- /tests/integration/tests/init-omit-packages/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless) 2 | import StackTest 3 | import System.IO (readFile) 4 | 5 | main :: IO () 6 | main = do 7 | removeFileIgnore "stack.yaml" 8 | stackErr ["init", "--snapshot", "lts-23.17"] 9 | stack ["init", "--snapshot", "lts-23.17", "--omit-packages"] 10 | contents <- lines <$> readFile "stack.yaml" 11 | unless ("#- bad" `elem` contents) $ 12 | error "commented out 'bad' package was expected" 13 | -------------------------------------------------------------------------------- /tests/integration/tests/init-omit-packages/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/init-omit-packages/files/bad/Bad.hs: -------------------------------------------------------------------------------- 1 | module Bad where 2 | 3 | bad :: Int 4 | bad = error "Something bad here" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/init-omit-packages/files/bad/bad.cabal: -------------------------------------------------------------------------------- 1 | name: bad 2 | version: 1.0.0 3 | build-type: Simple 4 | cabal-version: >= 1.8 5 | 6 | library 7 | exposed-modules: Bad 8 | build-depends: base, not-existing-package == 666.0 9 | default-language: Haskell2010 -------------------------------------------------------------------------------- /tests/integration/tests/init-omit-packages/files/good/Good.hs: -------------------------------------------------------------------------------- 1 | module Good where 2 | 3 | good :: Int 4 | good = 42 5 | -------------------------------------------------------------------------------- /tests/integration/tests/init-omit-packages/files/good/good.cabal: -------------------------------------------------------------------------------- 1 | name: good 2 | version: 1.0.0 3 | build-type: Simple 4 | cabal-version: >= 1.8 5 | 6 | library 7 | exposed-modules: Good 8 | build-depends: base 9 | default-language: Haskell2010 -------------------------------------------------------------------------------- /tests/integration/tests/internal-libraries/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/internal-libraries/files/src-bar/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Files 4 | import Foo 5 | 6 | main :: IO () 7 | main = do 8 | putStrLn "files:" 9 | print files 10 | putStrLn "foo" 11 | foo >>= print 12 | -------------------------------------------------------------------------------- /tests/integration/tests/internal-libraries/files/src-baz/Baz.hs: -------------------------------------------------------------------------------- 1 | module Baz where 2 | 3 | import Files 4 | import Foo 5 | import Control.Monad.Reader 6 | 7 | baz :: IO () 8 | baz = flip runReaderT () $ lift $ do 9 | putStrLn "files:" 10 | print files 11 | putStrLn "foo" 12 | foo >>= print 13 | -------------------------------------------------------------------------------- /tests/integration/tests/internal-libraries/files/src-foo/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | 3 | import Control.Monad.STM 4 | import Files 5 | 6 | foo :: IO String 7 | foo = atomically $ pure $ "foo using " ++ files 8 | -------------------------------------------------------------------------------- /tests/integration/tests/internal-libraries/files/src/Files.hs: -------------------------------------------------------------------------------- 1 | module Files where 2 | 3 | files :: String 4 | files = "files" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/internal-libraries/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/lock-files/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad (unless, when) 2 | import Data.List (isInfixOf) 3 | import StackTest 4 | import System.Directory 5 | 6 | main :: IO () 7 | main = do 8 | copyFile "stack-2-extras" "stack.yaml" 9 | stack ["build"] 10 | lock1 <- readFile "stack.yaml.lock" 11 | unless ("acme-dont" `isInfixOf` lock1) $ 12 | error "Package acme-dont wasn't found in Stack lock file" 13 | copyFile "stack-1-extra" "stack.yaml" 14 | stack ["build"] 15 | lock2 <- readFile "stack.yaml.lock" 16 | when ("acme-dont" `isInfixOf` lock2) $ 17 | error "Package acme-dont shouldn't be in Stack lock file anymore" 18 | -------------------------------------------------------------------------------- /tests/integration/tests/lock-files/files/Lib.hs: -------------------------------------------------------------------------------- 1 | foo :: Int 2 | foo = 42 3 | -------------------------------------------------------------------------------- /tests/integration/tests/lock-files/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | library: 3 | dependencies: 4 | - base 5 | -------------------------------------------------------------------------------- /tests/integration/tests/lock-files/files/stack-1-extra: -------------------------------------------------------------------------------- 1 | resolver: lts-23.17 2 | extra-deps: 3 | - acme-cuteboy-0.1.0.0 4 | -------------------------------------------------------------------------------- /tests/integration/tests/lock-files/files/stack-2-extras: -------------------------------------------------------------------------------- 1 | resolver: lts-23.17 2 | extra-deps: 3 | - acme-cuteboy-0.1.0.0 4 | - acme-dont-1.1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/module-added-multiple-times/Main.hs: -------------------------------------------------------------------------------- 1 | import Control.Monad 2 | import StackTest.Repl 3 | 4 | main :: IO () 5 | main = stackRepl [] $ do 6 | nextPrompt 7 | replCommand ":main" 8 | line <- replGetLine 9 | let expected = "Hello World!" 10 | when (line /= expected) $ 11 | error $ 12 | "Main module didn't load correctly.\n" 13 | <> "Expected: " <> expected <> "\n" 14 | <> "Actual : " <> line <> "\n" 15 | -------------------------------------------------------------------------------- /tests/integration/tests/module-added-multiple-times/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/module-added-multiple-times/files/exe/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Lib.A 4 | 5 | main :: IO () 6 | main = putStrLn messageA 7 | -------------------------------------------------------------------------------- /tests/integration/tests/module-added-multiple-times/files/src/Lib/A.hs: -------------------------------------------------------------------------------- 1 | module Lib.A where 2 | 3 | messageA :: String 4 | messageA = "Hello World!" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/module-added-multiple-times/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Lib 4 | 5 | main :: IO () 6 | main = someFunc 7 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/cyclic/Cyclic.hs: -------------------------------------------------------------------------------- 1 | module Cyclic where 2 | 3 | cyclic :: String 4 | cyclic = "Hello from cyclic" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/cyclic/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/cyclic/Spec.hs: -------------------------------------------------------------------------------- 1 | import Lib (cyclicOutput) 2 | 3 | main :: IO () 4 | main = cyclicOutput 5 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib 2 | ( someFunc 3 | , someOtherFunc 4 | , cyclicOutput 5 | ) where 6 | 7 | import Cyclic 8 | 9 | someFunc :: IO () 10 | someFunc = putStrLn "someFunc" 11 | 12 | someOtherFunc :: IO () 13 | someOtherFunc = putStrLn "someOtherFunc" 14 | 15 | cyclicOutput :: IO () 16 | cyclicOutput = putStrLn cyclic 17 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | packages: 3 | - . 4 | - sub-package 5 | - cyclic 6 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/sub-package/src/Lib2.hs: -------------------------------------------------------------------------------- 1 | module Lib2 where 2 | 3 | lib2 :: IO () 4 | lib2 = putStrLn "lib2" 5 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/sub-package/src/main.hs: -------------------------------------------------------------------------------- 1 | import Lib2 2 | 3 | main = lib2 4 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/sub-package/test/Spec.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | import Lib2 3 | 4 | main :: IO () 5 | main = do 6 | someOtherFunc 7 | lib2 8 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/test-2/Spec.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = pure () 5 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/test-3/Spec.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = pure () 3 | -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/test/OtherModule.hs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/commercialhaskell/stack/ee20e91a3e6054661bdbd06c5835daea3c8c95ea/tests/integration/tests/multi-test/files/test/OtherModule.hs -------------------------------------------------------------------------------- /tests/integration/tests/multi-test/files/test/Spec.hs: -------------------------------------------------------------------------------- 1 | import Lib 2 | 3 | main :: IO () 4 | main = someFunc 5 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Files 4 | 5 | main = do 6 | cFiles <- allCFiles 7 | putStrLn $ "C files:" ++ show cFiles 8 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/System/FilePath/Posix.hs: -------------------------------------------------------------------------------- 1 | {- HLINT ignore -} 2 | {-# LANGUAGE CPP #-} 3 | 4 | #undef WINDOWS 5 | #define IS_WINDOWS False 6 | #define MODULE_NAME Posix 7 | 8 | #include "Internal.hs" 9 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/System/FilePath/Windows.hs: -------------------------------------------------------------------------------- 1 | {- HLINT ignore -} 2 | {-# LANGUAGE CPP #-} 3 | 4 | #undef POSIX 5 | #define WINDOWS 6 | #define IS_WINDOWS True 7 | #define MODULE_NAME Windows 8 | 9 | #include "Internal.hs" 10 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/System/OsPath.hs-boot: -------------------------------------------------------------------------------- 1 | module System.OsPath where 2 | 3 | import System.OsPath.Types 4 | ( OsPath ) 5 | 6 | isValid :: OsPath -> Bool 7 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/System/OsPath/Posix/Internal.hs: -------------------------------------------------------------------------------- 1 | {- HLINT ignore -} 2 | {-# LANGUAGE CPP #-} 3 | 4 | #undef WINDOWS 5 | #define OS_PATH 6 | #define IS_WINDOWS False 7 | #define MODULE_NAME Posix 8 | 9 | #include "../../FilePath/Internal.hs" 10 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/System/OsPath/Windows/Internal.hs: -------------------------------------------------------------------------------- 1 | {- HLINT ignore -} 2 | {-# LANGUAGE CPP #-} 3 | 4 | #undef POSIX 5 | #define WINDOWS 6 | #define OS_PATH 7 | #define IS_WINDOWS True 8 | #define MODULE_NAME Windows 9 | 10 | #include "../../FilePath/Internal.hs" 11 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/System/OsString/Posix.hs: -------------------------------------------------------------------------------- 1 | {- HLINT ignore -} 2 | {-# LANGUAGE CPP #-} 3 | #undef WINDOWS 4 | #define MODULE_NAME Posix 5 | #define PLATFORM_STRING PosixString 6 | #define PLATFORM_WORD PosixChar 7 | #define IS_WINDOWS False 8 | #include "Common.hs" 9 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/filepath-1.4.100.4/System/OsString/Windows.hs: -------------------------------------------------------------------------------- 1 | {- HLINT ignore -} 2 | {-# LANGUAGE CPP #-} 3 | #undef POSIX 4 | #define MODULE_NAME Windows 5 | #define PLATFORM_STRING WindowsString 6 | #define PLATFORM_WORD WindowsChar 7 | #define IS_WINDOWS True 8 | #define WINDOWS 9 | #include "Common.hs" 10 | #undef MODULE_NAME 11 | #undef FILEPATH_NAME 12 | #undef OSSTRING_NAME 13 | #undef IS_WINDOWS 14 | #undef WINDOWS 15 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/files.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 3.8 2 | 3 | name: files 4 | version: 1.0.0 5 | build-type: Simple 6 | 7 | library 8 | hs-source-dirs: 9 | src 10 | exposed-modules: 11 | Files 12 | build-depends: 13 | base 14 | , filemanip 15 | 16 | executable test-exe 17 | hs-source-dirs: 18 | app 19 | main-is: 20 | Main.hs 21 | build-depends: 22 | base 23 | , files 24 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/src/Files.hs: -------------------------------------------------------------------------------- 1 | module Files where 2 | 3 | import System.FilePath.Glob 4 | 5 | allCFiles :: IO [FilePath] 6 | allCFiles = namesMatching "*.c" 7 | -------------------------------------------------------------------------------- /tests/integration/tests/mutable-deps/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | extra-deps: 3 | - ./filepath-1.4.100.4 4 | # Required, otherwise Stack reports that GHC boot library has been pruned. 5 | - directory-1.3.8.5 6 | - unix-2.8.6.0 7 | - Win32-2.13.4.0 8 | - time-1.12.2 9 | -------------------------------------------------------------------------------- /tests/integration/tests/nice-resolver-names/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | unimportant.cabal 3 | -------------------------------------------------------------------------------- /tests/integration/tests/nice-resolver-names/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: unimportant 2 | version: 0 3 | library: {} 4 | -------------------------------------------------------------------------------- /tests/integration/tests/no-rerun-tests/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | import Control.Monad 4 | 5 | main :: IO () 6 | main = do 7 | stack ["test"] 8 | exists1 <- doesFileExist "foo" 9 | unless exists1 $ error "exists1 should be True" 10 | removeFile "foo" 11 | stack ["test", "--no-rerun-tests"] 12 | exists2 <- doesFileExist "foo" 13 | when exists2 $ error "exists2 should be False" 14 | -------------------------------------------------------------------------------- /tests/integration/tests/no-rerun-tests/files/.gitignore: -------------------------------------------------------------------------------- 1 | .stack-work/ 2 | files.cabal 3 | *~ 4 | foo 5 | -------------------------------------------------------------------------------- /tests/integration/tests/no-rerun-tests/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: files 2 | 3 | dependencies: 4 | - base >= 4.7 && < 5 5 | 6 | library: 7 | source-dirs: src 8 | 9 | tests: 10 | test: 11 | main: Spec.hs 12 | source-dirs: test 13 | -------------------------------------------------------------------------------- /tests/integration/tests/no-rerun-tests/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/no-rerun-tests/files/test/Spec.hs: -------------------------------------------------------------------------------- 1 | main :: IO () 2 | main = writeFile "foo" "" 3 | -------------------------------------------------------------------------------- /tests/integration/tests/override-compiler/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Control.Monad (unless) 3 | 4 | main :: IO () 5 | main = stackCheckStdout ["exec", "--", "ghc", "--numeric-version"] $ \ver -> 6 | -- get rid of the newline character 7 | unless (concat (lines ver) == "9.8.4") $ error $ "Invalid version: " ++ show ver 8 | -------------------------------------------------------------------------------- /tests/integration/tests/override-compiler/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-22.43 2 | compiler: ghc-9.8.4 3 | packages: [] 4 | -------------------------------------------------------------------------------- /tests/integration/tests/proper-rebuilds/files/.gitignore: -------------------------------------------------------------------------------- 1 | src/Lib.hs 2 | -------------------------------------------------------------------------------- /tests/integration/tests/proper-rebuilds/files/app/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Lib 4 | 5 | main = do 6 | putStrLn $ "Sample strings: " ++ show someStrings 7 | -------------------------------------------------------------------------------- /tests/integration/tests/proper-rebuilds/files/files.cabal: -------------------------------------------------------------------------------- 1 | name: files 2 | version: 1.0.0 3 | build-type: Simple 4 | cabal-version: >= 1.10 5 | 6 | library 7 | hs-source-dirs: src 8 | exposed-modules: Lib 9 | build-depends: base 10 | default-language: Haskell2010 11 | 12 | executable test-exe 13 | hs-source-dirs: app 14 | main-is: Main.hs 15 | ghc-options: -rtsopts 16 | build-depends: base, files 17 | default-language: Haskell2010 -------------------------------------------------------------------------------- /tests/integration/tests/proper-rebuilds/files/src/Lib.hs.v1: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | someStrings :: [String] 4 | someStrings = ["Hello", "world!"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/proper-rebuilds/files/src/Lib.hs.v2: -------------------------------------------------------------------------------- 1 | module Lib where 2 | 3 | someStrings :: [String] 4 | someStrings = ["Hello", "other", "world!"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/proper-rebuilds/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | -------------------------------------------------------------------------------- /tests/integration/tests/relative-script-snapshots/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["subdir/script.hs"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/relative-script-snapshots/files/subdir/script.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | -- stack --snapshot snapshot.yaml script 3 | import Acme.Missiles 4 | 5 | main :: IO () 6 | main = launchMissiles 7 | -------------------------------------------------------------------------------- /tests/integration/tests/relative-script-snapshots/files/subdir/snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | name: snapshot 3 | packages: 4 | - acme-missiles-0.3@rev:0 5 | - stm-2.5.0.0@rev:0 6 | -------------------------------------------------------------------------------- /tests/integration/tests/sanity/files/.gitignore: -------------------------------------------------------------------------------- 1 | acme-missiles-0.2 2 | acme-missiles-0.3 3 | -------------------------------------------------------------------------------- /tests/integration/tests/sanity/files/foo.bat: -------------------------------------------------------------------------------- 1 | echo hello world 2 | -------------------------------------------------------------------------------- /tests/integration/tests/sanity/files/foo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo hello world 3 | 4 | -------------------------------------------------------------------------------- /tests/integration/tests/script-extra-dep/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = stack ["script.hs"] 5 | -------------------------------------------------------------------------------- /tests/integration/tests/script-extra-dep/files/script.hs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env stack 2 | -- stack --snapshot ghc-9.8.4 script --extra-dep acme-missiles-0.3@rev:0 --extra-dep stm-2.5.2.1@rev:0 3 | import Acme.Missiles 4 | 5 | main :: IO () 6 | main = launchMissiles 7 | -------------------------------------------------------------------------------- /tests/integration/tests/skip-unreachable-dirs/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | import Control.Exception (catch, IOException) 4 | 5 | main :: IO () 6 | main = do 7 | removeFileIgnore "stack.yaml" 8 | createDirectory "unreachabledir" `catch` \(e :: IOException) -> pure () 9 | setPermissions "unreachabledir" emptyPermissions 10 | stack ["init"] 11 | -------------------------------------------------------------------------------- /tests/integration/tests/skip-unreachable-dirs/files/.gitignore: -------------------------------------------------------------------------------- 1 | stack.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/skip-unreachable-dirs/files/foo.cabal: -------------------------------------------------------------------------------- 1 | name: foo 2 | version: 0.0.0 3 | synopsis: foo 4 | build-type: Simple 5 | cabal-version: >=1.10 6 | 7 | library 8 | exposed-modules: Foo 9 | build-depends: base 10 | default-language: Haskell2010 11 | -------------------------------------------------------------------------------- /tests/integration/tests/stackage-3185-ignore-bounds-in-snapshot/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | 3 | main :: IO () 4 | main = do 5 | stackErr ["build", "--stack-yaml", "as-extra-dep.yaml", "--dry-run"] 6 | stack ["build", "--stack-yaml", "as-snapshot.yaml", "--dry-run"] 7 | -------------------------------------------------------------------------------- /tests/integration/tests/stackage-3185-ignore-bounds-in-snapshot/files/.gitignore: -------------------------------------------------------------------------------- 1 | /unimportant.cabal 2 | -------------------------------------------------------------------------------- /tests/integration/tests/stackage-3185-ignore-bounds-in-snapshot/files/as-extra-dep.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | extra-deps: 3 | - async-2.1.1.1 4 | - stm-2.1.2.2 5 | -------------------------------------------------------------------------------- /tests/integration/tests/stackage-3185-ignore-bounds-in-snapshot/files/as-snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: snapshot.yaml 2 | -------------------------------------------------------------------------------- /tests/integration/tests/stackage-3185-ignore-bounds-in-snapshot/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: unimportant 2 | 3 | dependencies: 4 | - base 5 | - async 6 | 7 | library: {} 8 | -------------------------------------------------------------------------------- /tests/integration/tests/stackage-3185-ignore-bounds-in-snapshot/files/snapshot.yaml: -------------------------------------------------------------------------------- 1 | snapshot: ghc-9.8.4 2 | name: hackage-revisions-are-annoying 3 | packages: 4 | - async-2.1.1.1 5 | - stm-2.1.2.2 6 | -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/FakeHackageStart.hs: -------------------------------------------------------------------------------- 1 | -- | Module to force downloading all the dependencies to avoid race conditions 2 | main = pure () 3 | -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/Foo.hs: -------------------------------------------------------------------------------- 1 | module Foo where 2 | -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/gpg-disabled/gpg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Should not be used!" >&2 4 | exit 1 5 | -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/gpg-disabled/gpg.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | exit 1 3 | -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/gpg-disabled/gpg2: -------------------------------------------------------------------------------- 1 | gpg -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/gpg-disabled/gpg2.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | exit 1 3 | -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | hackage-base-url: http://localhost:12415/ 3 | -------------------------------------------------------------------------------- /tests/integration/tests/upload/files/uploadtest.cabal: -------------------------------------------------------------------------------- 1 | build-type: Simple 2 | name: uploadtest 3 | version: 0.0.0 4 | category: test 5 | maintainer: uploadtest@example.com 6 | cabal-version: 1.20 7 | synopsis: Upload test 8 | description: Upload test description 9 | license: BSD3 10 | library 11 | build-depends: base >= 4.7 && < 5 12 | exposed-modules: Foo 13 | default-language: Haskell2010 14 | -------------------------------------------------------------------------------- /tests/integration/tests/variables-in-template-file-names/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import System.Directory 3 | import Control.Monad (unless) 4 | 5 | main :: IO () 6 | main = do 7 | removeDirIgnore "somename" 8 | stack ["new", "somename", "./template.hsfiles"] 9 | exists <- doesFileExist "somename/somename.cabal" 10 | unless exists $ error "does not exist" 11 | -------------------------------------------------------------------------------- /tests/integration/tests/variables-in-template-file-names/files/.gitignore: -------------------------------------------------------------------------------- 1 | /somename/ 2 | -------------------------------------------------------------------------------- /tests/integration/tests/variables-in-template-file-names/files/template.hsfiles: -------------------------------------------------------------------------------- 1 | {-# START_FILE {{name}}.cabal #-} 2 | name: {{name}} 3 | version: 0.0 4 | -------------------------------------------------------------------------------- /tests/integration/tests/watched-files/Main.hs: -------------------------------------------------------------------------------- 1 | import StackTest 2 | import Data.Foldable (for_) 3 | import Control.Monad (unless) 4 | 5 | main :: IO () 6 | main = for_ (words "foo bar baz bin") $ \x -> do 7 | writeFile "some-text-file.txt" x 8 | stackCheckStdout ["run"] $ \y -> 9 | unless (x == y) $ error $ concat 10 | [ "Expected: " 11 | , show x 12 | , "\nActual: " 13 | , show y 14 | ] 15 | -------------------------------------------------------------------------------- /tests/integration/tests/watched-files/files/.gitignore: -------------------------------------------------------------------------------- 1 | some-text-file.txt 2 | *.cabal 3 | -------------------------------------------------------------------------------- /tests/integration/tests/watched-files/files/Main.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | module Main where 3 | 4 | import Data.FileEmbed 5 | import qualified Data.ByteString as B 6 | import System.IO (stdout) 7 | 8 | main :: IO () 9 | main = B.hPut stdout $(embedFile "some-text-file.txt") 10 | -------------------------------------------------------------------------------- /tests/integration/tests/watched-files/files/package.yaml: -------------------------------------------------------------------------------- 1 | name: watched-files 2 | dependencies: 3 | - base 4 | - bytestring 5 | - file-embed 6 | 7 | executables: 8 | watched: 9 | main: Main.hs 10 | -------------------------------------------------------------------------------- /tests/integration/tests/watched-files/files/stack.yaml: -------------------------------------------------------------------------------- 1 | snapshot: lts-23.17 2 | -------------------------------------------------------------------------------- /tests/unit/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-missing-export-lists #-} 2 | {-# OPTIONS_GHC -F -pgmF hspec-discover #-} 3 | -------------------------------------------------------------------------------- /tests/unit/Stack/Build/ExecuteSpec.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | 3 | module Stack.Build.ExecuteSpec 4 | ( main 5 | , spec 6 | ) where 7 | 8 | import Stack.Prelude 9 | import Test.Hspec 10 | 11 | main :: IO () 12 | main = hspec spec 13 | 14 | spec :: Spec 15 | spec = pure () 16 | -------------------------------------------------------------------------------- /tests/unit/Stack/Untar/README.md: -------------------------------------------------------------------------------- 1 | Use ./createFiles.sh to regenerate the test tarballs in this directory. 2 | -------------------------------------------------------------------------------- /tests/unit/Stack/Untar/createFiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This allows recreating 4 | 5 | # Name for GNU tar. 6 | TAR=tar 7 | CHOWN=chown 8 | # Needed on my macOS install with HomeBrew. 9 | #TAR=gtar 10 | #CHOWN=gchown 11 | 12 | mkdir -p test1 test2 13 | touch test1/foo 14 | mkfifo test2/bar 15 | sudo mknod test2/devB b 1 0 16 | sudo mknod test2/devC c 3 2 17 | sudo $CHOWN --reference=test2 test2/* 18 | 19 | for i in 1 2; do 20 | $TAR czf test$i.tar.gz --format=posix test$i 21 | done 22 | for i in 1 2; do 23 | gtar czf test$i.tar.gz --format=posix test$i 24 | done 25 | 26 | rm -rf test1 test2 27 | -------------------------------------------------------------------------------- /tests/unit/Stack/Untar/test1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/commercialhaskell/stack/ee20e91a3e6054661bdbd06c5835daea3c8c95ea/tests/unit/Stack/Untar/test1.tar.gz -------------------------------------------------------------------------------- /tests/unit/Stack/Untar/test2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/commercialhaskell/stack/ee20e91a3e6054661bdbd06c5835daea3c8c95ea/tests/unit/Stack/Untar/test2.tar.gz -------------------------------------------------------------------------------- /tests/unit/unix/Stack/Ghci/FakePaths.hs: -------------------------------------------------------------------------------- 1 | module Stack.Ghci.FakePaths 2 | ( defaultDrive 3 | ) where 4 | 5 | -- | Helpers for writing fake paths for test suite for the GhciScript DSL. This 6 | -- must be a separate module because it is used in Template Haskell splices. 7 | defaultDrive :: FilePath 8 | defaultDrive = "/" 9 | -------------------------------------------------------------------------------- /tests/unit/windows/Stack/Ghci/FakePaths.hs: -------------------------------------------------------------------------------- 1 | module Stack.Ghci.FakePaths 2 | ( defaultDrive 3 | ) where 4 | 5 | -- | Helpers for writing fake paths for test suite for the GhciScript DSL. This 6 | -- must be a separate module because it is used in Template Haskell splices. 7 | defaultDrive :: FilePath 8 | defaultDrive = "C:\\" 9 | --------------------------------------------------------------------------------