diff --git a/ChangeLog.md b/ChangeLog.md index ccb85e883c..9f84cbcb7d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -21,15 +21,48 @@ Bug fixes: Release notes: +* The fix for + [#2175](https://github.com/commercialhaskell/stack/issues/2175) + entails that stack must perform a full clone of a large Git repo of + Hackage meta-information. The total download size is about 200 MB. + Please be aware of this when upgrading your stack installation. +* On many Un*x systems, stack can now be installed with a simple + one-liner: `wget -qO- https://get.haskellstack.org/ | sh` +* 64-bit GHC bindists have been built for Linux systems with + libtinfo6/libncurses6 (such as Fedora 24 and Arch Linux), and `stack setup` + will detect when to use them. + Major changes: +* Add `stack hoogle` command. + [#55](https://github.com/commercialhaskell/stack/issues/55) +* Support for absolute file path in `url` field of `setup-info` or `--ghc-bindist` +* Add support for rendering GHCi scripts targeting different GHCi like + applications + [#2457](https://github.com/commercialhaskell/stack/pull/2457) + Behavior changes: +* Remove `stack ide start` and `stack ide load-targets` commands. + [#2178](https://github.com/commercialhaskell/stack/issues/2178) +* Support .buildinfo files in `stack ghci`. + [#2242](https://github.com/commercialhaskell/stack/pull/2242) +* Support -ferror-spans syntax in GHC error messages. +* Avoid unpacking ghc to `/tmp` + [#996](https://github.com/commercialhaskell/stack/issues/996) +* The Linux `gmp4` GHC bindist is no longer considered a full-fledged GHC + variant and can no longer be specified using the `ghc-variant` option, + and instead is treated more like a slightly different platform. + Other enhancements: * Nix & docker can be activated at the same time, in order to run stack in a nix-shell in a container, preferably from an image already containing the nix dependencies in its /nix/store +* Use the `store` package for binary serialization of most caches. +* Only require minor version match for Docker stack exe. + This way, we can make patch releases for version bounds and similar + build issues without needing to upload new binaries for Docker. * Stack/Nix: Passes the right ghc derivation as an argument to the `shell.nix` when a custom `shell.nix` is used See [#2243](https://github.com/commercialhaskell/stack/issues/2243) @@ -47,13 +80,36 @@ Other enhancements: See [#2259](https://github.com/commercialhaskell/stack/issues/2259) * Perform some subprocesses during setup concurrently, slightly speeding up most commands. [#2346](https://github.com/commercialhaskell/stack/pull/2346) -* Support for absolute file path in `url` field of `setup-info` or `--ghc-bindist` * `stack setup` no longer unpacks to the system temp dir on posix systems. [#996](https://github.com/commercialhaskell/stack/issues/996) -* `stack setup` detects libtinfo6 and can downloads alternate GHC bindists +* `stack setup` detects libtinfo6 and ncurses6 and can download alternate GHC + bindists [#257](https://github.com/commercialhaskell/stack/issues/257) [#2302](https://github.com/commercialhaskell/stack/issues/2302). * `stack setup` detects Linux ARMv7 downloads appropriate GHC bindist [#2103](https://github.com/commercialhaskell/stack/issues/2103) +* Custom `stack` binaries list dependency versions in output for `--version`. + See [#2222](https://github.com/commercialhaskell/stack/issues/2222) + and [#2450](https://github.com/commercialhaskell/stack/issues/2450). +* Use a pretty printer to output dependency resolution errors. + [#1912](https://github.com/commercialhaskell/stack/issues/1912) +* Remove the `--os` flag + [#2227](https://github.com/commercialhaskell/stack/issues/2227) +* Add 'netbase' and 'ca-certificates' as dependency for .deb packages. + [#2293](https://github.com/commercialhaskell/stack/issues/2293). +* Add `stack ide targets` command. +* Enhance debug logging with subprocess timings. +* Pretty-print YAML parse errors + [#2374](https://github.com/commercialhaskell/stack/issues/2374) +* Clarify confusing `stack setup` output + [#2314](https://github.com/commercialhaskell/stack/issues/2314) +* Delete `Stack.Types` multimodule to improve build times + [#2405](https://github.com/commercialhaskell/stack/issues/2405) +* Remove spurious newlines in build logs + [#2418](https://github.com/commercialhaskell/stack/issues/2418) +* Interpreter: Provide a way to hide implicit packages + [#1208](https://github.com/commercialhaskell/stack/issues/1208) +* Check executability in exec lookup + [#2489](https://github.com/commercialhaskell/stack/issues/2489) Bug fixes: @@ -63,12 +119,50 @@ Bug fixes: [#2225](https://github.com/commercialhaskell/stack/issues/2225) * Detect resolver change in `stack solver` [#2252](https://github.com/commercialhaskell/stack/issues/2252) +* Fix a bug in docker image creation where the wrong base image was + selected + [#2376](https://github.com/commercialhaskell/stack/issues/2376) * Ignore special entries when unpacking tarballs [#2361](https://github.com/commercialhaskell/stack/issues/2361) * Fixes src directory pollution of `style.css` and `highlight.js` with GHC 8's haddock [#2429](https://github.com/commercialhaskell/stack/issues/2429) -* Remove the `--os` flag - [#2227](https://github.com/commercialhaskell/stack/issues/2227) +* Handle filepaths with spaces in `stack ghci` + [#2266](https://github.com/commercialhaskell/stack/issues/2266) +* Apply ghc-options to snapshot packages + [#2289](https://github.com/commercialhaskell/stack/issues/2289) +* stack sdist: Fix timestamp in tarball + [#2394](https://github.com/commercialhaskell/stack/pull/2394) +* Allow global Stack arguments with a script + [#2316](https://github.com/commercialhaskell/stack/issues/2316) +* Inconsistency between ToJSON and FromJSON instances of PackageLocation + [#2412](https://github.com/commercialhaskell/stack/pull/2412) +* Perform Unicode normalization on filepaths + [#1810](https://github.com/commercialhaskell/stack/issues/1810) +* Solver: always keep ghc wired-in as hard constraints + [#2453](https://github.com/commercialhaskell/stack/issues/2453) +* Support OpenBSD's tar where possible, require GNU tar for xz support + [#2283](https://github.com/commercialhaskell/stack/issues/2283) +* Fix using --coverage with Cabal-1.24 + [#2424](https://github.com/commercialhaskell/stack/issues/2424) +* When marking exe installed, remove old version + [#2373](https://github.com/commercialhaskell/stack/issues/2373) +* Stop truncating all-cabal-hashes git repo + [#2175](https://github.com/commercialhaskell/stack/issues/2175) +* Handle non-ASCII filenames on Windows + [#2491](https://github.com/commercialhaskell/stack/issues/2491) +* Avoid using multiple versions of a package in script interpreter + by passing package-id to ghc/runghc + [#1957](https://github.com/commercialhaskell/stack/issues/1957) +* Only pre-load compiler version when using nix integration + [#2459](https://github.com/commercialhaskell/stack/issues/2459) +* Solver: parse cabal errors also on Windows + [#2502](https://github.com/commercialhaskell/stack/issues/2502) +* Allow exec and ghci commands in interpreter mode. + Scripts can now automatically open in the repl by using `exec ghci` + instead of `runghc` in the shebang command. + [#2510](https://github.com/commercialhaskell/stack/issues/2510) +* Now consider a package to be dirty when an extra-source-file is changed. + See [#2040](https://github.com/commercialhaskell/stack/issues/2040) ## 1.1.2 @@ -139,9 +233,6 @@ Bug fixes: checked for dirtiness. See [#1982](https://github.com/commercialhaskell/stack/issues/1982) * Signing: always use `--with-fingerprints` - [#2110](https://github.com/commercialhaskell/stack/issues/2110). -* Now consider a package to be dirty when an extra-source-file is changed. - See [#2040](https://github.com/commercialhaskell/stack/issues/2040). ## 1.1.0 diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 3c801f7794..5f4de53da3 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -5,7 +5,7 @@ This way your question will be more easily discoverable by other people with the If you're reporting a bug please follow the steps below: -Make sure that you are using the latest release (currently stack-1.1.2). +Make sure that you are using the latest release (currently stack-1.2.0). See the [upgrade instructions](http://docs.haskellstack.org/en/stable/install_and_upgrade/#upgrade) to upgrade. Please use the following schema for your bug report: diff --git a/doc/MAINTAINER_GUIDE.md b/doc/MAINTAINER_GUIDE.md index c80625bf18..d222e8bc9e 100644 --- a/doc/MAINTAINER_GUIDE.md +++ b/doc/MAINTAINER_GUIDE.md @@ -209,8 +209,48 @@ set up. * [Publish a new Github release](https://github.com/commercialhaskell/ghc/releases/new) with tag `ghc-X.Y.Z-release` and same name. + * Down all the relevant GHC bindists from https://www.haskell.org/ghc/download_ghc_X_Y_Z and upload them to the just-created Github release (see + [stack-setup-2.yaml](https://github.com/fpco/stackage-content/blob/master/stack/stack-setup-2.yaml) + for the ones we used in the last GHC release). + + In the case of OS X, repackage the `.xz` bindist as a `.bz2`, since OS X does + not include `xz` by default or provide an easy way to install it. + + * Build any additional required bindists (see below for instructions) + + * libtinfo6 (etc/vagrant/fedora24-x86_64) + * [Edit stack-setup-2.yaml](https://github.com/fpco/stackage-content/edit/master/stack/stack-setup-2.yaml) - and add the new bindists. For each one, download the bindist from - https://www.haskell.org/ghc/download_ghc_X_Y_Z and upload it to the - just-created Github release, and refer to the Github version in the YAML. Be - sure to update the `content-length` and `sha1` values. + and add the new bindists, pointing to the Github release version. Be sure to + update the `content-length` and `sha1` values. + +### Building GHC + +Set the `GHC_VERSION` environment variable to the version to build. + +For GHC >= 7.10.2, run (from [here](https://ghc.haskell.org/trac/ghc/wiki/Newcomers)): + + git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/ && \ + git clone -b ghc-${GHC_VERSION}-release --recursive git://github.com/ghc/ghc ghc-${GHC_VERSION} && \ + cd ghc-${GHC_VERSION}/ && \ + cp mk/build.mk.sample mk/build.mk && \ + sed -i 's/^#BuildFlavour *= *perf$/BuildFlavour = perf/' mk/build.mk && \ + ./boot && \ + ./configure --enable-tarballs-autodownload && \ + sed -i 's/^TAR_COMP *= *bzip2$/TAR_COMP = xz/' mk/config.mk && \ + make -j$(cat /proc/cpuinfo|grep processor|wc -l) && \ + make binary-dist + +GHC 7.8.4 is slightly different: + + git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/ && \ + git clone -b ghc-${GHC_VERSION}-release --recursive git://github.com/ghc/ghc ghc-${GHC_VERSION} && \ + cd ghc-${GHC_VERSION}/ && \ + ./sync-all --extra --nofib -r git://git.haskell.org get -b ghc-7.8 && \ + cp mk/build.mk.sample mk/build.mk && \ + sed -i 's/^#BuildFlavour *= *perf$/BuildFlavour = perf/' mk/build.mk && \ + perl boot && \ + ./configure && \ + sed -i 's/^TAR_COMP *= *bzip2$/TAR_COMP = xz/' mk/config.mk && \ + make -j$(cat /proc/cpuinfo|grep processor|wc -l) && \ + make binary-dist diff --git a/doc/install_and_upgrade.md b/doc/install_and_upgrade.md index 6a181387eb..0e758cbff7 100644 --- a/doc/install_and_upgrade.md +++ b/doc/install_and_upgrade.md @@ -230,9 +230,15 @@ new releases by some days. - [stack](https://www.archlinux.org/packages/community/x86_64/stack/) _latest stable version_ - [haskell-stack-git](https://aur.archlinux.org/packages/haskell-stack-git/) _git version_ -In order to use `stack setup`, you will need the [ncurses5-compat-libs](https://aur.archlinux.org/packages/ncurses5-compat-libs/) AUR package installed. If this package is not installed, Stack will not be able to install GHC. +In order to use `stack setup` with older versions of GHC or on a 32-bit system, +you may need the +[ncurses5-compat-libs](https://aur.archlinux.org/packages/ncurses5-compat-libs/) +AUR package installed. If this package is not installed, Stack may not be able +to install older (< 7.10.3) or 32-bit GHC versions. -If you use the [ArchHaskell repository](https://wiki.archlinux.org/index.php/ArchHaskell), you can also get the `haskell-stack-tool` package from there. +If you use the +[ArchHaskell repository](https://wiki.archlinux.org/index.php/ArchHaskell), you +can also get the `haskell-stack-tool` package from there. ## NixOS @@ -279,8 +285,17 @@ Stack](http://nixos.org/nixpkgs/manual/#how-to-build-a-haskell-project-using-sta * Ensure you have required system dependencies installed. These include GCC, GNU make, xz, perl, libgmp, libffi, and zlib. We also recommend Git and GPG. To install these using your package manager: * Debian / Ubuntu: `sudo apt-get install g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg` * Fedora / CentOS: `sudo dnf install perl make automake gcc gmp-devel libffi zlib xz tar git gnupg` (use `yum` instead of `dnf` on CentOS and Fedora <= 21) + * Fedora 24: In order to use `stack setup` on a 32-bit system, you may + need to run `sudo dnf install ncurses-compat-libs`. If this package is + not installed, Stack may not be able to install 32-bit GHC versions. + Also `sudo dnf install ncurses-compat-libs` if you nee * Arch Linux: `sudo pacman -S make gcc ncurses git gnupg xz zlib gmp libffi zlib` - * In order to use `stack setup`, you will need the [ncurses5-compat-libs](https://aur.archlinux.org/packages/ncurses5-compat-libs/) AUR package installed. If this package is not installed, Stack will not be able to install GHC. + + * In order to use `stack setup` with older versions of GHC or on a + 32-bit system, you may need the + [ncurses5-compat-libs](https://aur.archlinux.org/packages/ncurses5-compat-libs/) + AUR package installed. If this package is not installed, Stack may not + be able to install older (< 7.10.3) or 32-bit GHC versions. * Gentoo users, make sure to have the `ncurses` package with `USE=tinfo` (without it, stack will not be able to install GHC). * Now you can run `stack` from the terminal. diff --git a/doc/yaml_configuration.md b/doc/yaml_configuration.md index ad18401f09..99163dcc47 100644 --- a/doc/yaml_configuration.md +++ b/doc/yaml_configuration.md @@ -429,8 +429,6 @@ rebuild-ghc-options: true Specify a variant binary distribution of GHC to use. Known values: * `standard`: This is the default, uses the standard GHC binary distribution -* `gmp4`: Use the "centos6" GHC bindist, for Linux systems with libgmp4 (aka - `libgmp.so.3`), such as CentOS 6. This variant will be used automatically on such systems; you should not need to specify it in the configuration * `integersimple`: Use a GHC bindist that uses [integer-simple instead of GMP](https://ghc.haskell.org/trac/ghc/wiki/ReplacingGMPNotes) * any other value: Use a custom GHC bindist. You should specify diff --git a/etc/scripts/get-stack.sh b/etc/scripts/get-stack.sh index f8a2ba5734..8ccc1737a1 100755 --- a/etc/scripts/get-stack.sh +++ b/etc/scripts/get-stack.sh @@ -340,7 +340,7 @@ do_sloppy_install() { info "Since this installer doesn't support your Linux distribution," info "there is no guarantee that 'stack' will work at all! You may" info "need to manually install some system info dependencies for GHC:" - info " gcc, make, libffi, zlib, libgmp5, and libtinfo5" + info " gcc, make, libffi, zlib, libgmp and libtinfo" info "Please see http://docs.haskellstack.org/en/stable/install_and_upgrade/" info "Pull requests to add support for this distro would be welcome!" info "" diff --git a/etc/scripts/linux-armv7-release.sh b/etc/scripts/linux-armv7-release.sh index fc9cc32161..356d4384e4 100755 --- a/etc/scripts/linux-armv7-release.sh +++ b/etc/scripts/linux-armv7-release.sh @@ -2,4 +2,4 @@ #TODO: move this logic into release.hs. set -xe (cd etc/scripts && stack --install-ghc build) -$(cd etc/scripts && stack exec which stack-release-script) --no-test-haddocks --upload-label="Linux ARMv7" release +$(cd etc/scripts && stack exec which stack-release-script) --no-test-haddocks release diff --git a/etc/scripts/osx-release.sh b/etc/scripts/osx-release.sh index e01e921621..344288e631 100755 --- a/etc/scripts/osx-release.sh +++ b/etc/scripts/osx-release.sh @@ -4,4 +4,4 @@ set -xe RELEASE_SCRIPT=.local/bin/stack-release-script rm -f "$RELEASE_SCRIPT" (cd etc/scripts && stack --install-ghc build) -$(cd etc/scripts && stack exec which stack-release-script) --no-test-haddocks --arch=x86_64 --upload-label="Mac OS X 64-bit" release +$(cd etc/scripts && stack exec which stack-release-script) --no-test-haddocks --arch=x86_64 release diff --git a/etc/scripts/release.hs b/etc/scripts/release.hs index 967c79e95f..c04d3b70e2 100644 --- a/etc/scripts/release.hs +++ b/etc/scripts/release.hs @@ -103,9 +103,11 @@ options = "Label to give the uploaded release asset" , Option "" [noTestHaddocksOptName] (NoArg $ Right $ \g -> g{gTestHaddocks = False}) "Disable testing building haddocks." + , Option "" [staticOptName] (NoArg $ Right $ \g -> g{gBuildArgs = gBuildArgs g ++ ["--split-objs", "--ghc-options=-optc-Os -optl-static -fPIC"]}) + "Build a static binary." , Option "" [buildArgsOptName] (ReqArg - (\v -> Right $ \g -> g{gBuildArgs = words v}) + (\v -> Right $ \g -> g{gBuildArgs = gBuildArgs g ++ words v}) "\"ARG1 ARG2 ...\"") "Additional arguments to pass to 'stack build'." ] @@ -153,15 +155,16 @@ rules global@Global{..} args = do when (not gAllowDirty && not (null (trim dirty))) $ error ("Working tree is dirty. Use --" ++ allowDirtyOptName ++ " option to continue anyway.") withTempDir $ \tmpDir -> do - let cmd0 = cmd (releaseBinDir binaryName stackExeFileName) + let cmd0 c = cmd (releaseBinDir binaryName stackExeFileName) (stackArgs global) - gBuildArgs ["--local-bin-path=" ++ tmpDir] - () <- cmd0 $ concat $ concat - [["install --pedantic --no-haddock-deps"], [" --haddock" | gTestHaddocks]] - () <- cmd0 "install --resolver=lts-6.0 cabal-install" - let cmd' = cmd (AddPath [tmpDir] []) stackProgName (stackArgs global) gBuildArgs - () <- cmd' "test --pedantic --flag stack:integration-tests" + c + gBuildArgs + () <- cmd0 "install" $ concat $ concat + [["--pedantic --no-haddock-deps"], [" --haddock" | gTestHaddocks]] + () <- cmd0 "install" "--resolver=lts-6.0 cabal-install" + let cmd' c = cmd (AddPath [tmpDir] []) stackProgName (stackArgs global) c gBuildArgs + () <- cmd' "test" "--pedantic --flag stack:integration-tests" return () copyFileChanged (releaseBinDir binaryName stackExeFileName) out @@ -230,9 +233,10 @@ rules global@Global{..} args = do actionOnException (cmd stackProgName (stackArgs global) - gBuildArgs ["--local-bin-path=" ++ takeDirectory out] - "install --pedantic") + "install" + gBuildArgs + "--pedantic") (removeFile out) debDistroRules ubuntuDistro ubuntuVersions @@ -593,9 +597,14 @@ uploadLabelOptName = "upload-label" noTestHaddocksOptName :: String noTestHaddocksOptName = "no-test-haddocks" +-- | @--build-args@ command-line option name. buildArgsOptName :: String buildArgsOptName = "build-args" +-- | @--static@ command-line option name. +staticOptName :: String +staticOptName = "static" + -- | Arguments to pass to all 'stack' invocations. stackArgs :: Global -> [String] stackArgs Global{..} = ["--install-ghc", "--arch=" ++ display gArch] diff --git a/etc/scripts/vagrant-releases.sh b/etc/scripts/vagrant-releases.sh index 9c449a75e6..366c4748f0 100755 --- a/etc/scripts/vagrant-releases.sh +++ b/etc/scripts/vagrant-releases.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash set -xe -"$(dirname "$0")/with-vagrant.sh" debian-7-amd64 "--upload-label='Linux 64-bit, standard' $* release" -"$(dirname "$0")/with-vagrant.sh" debian-7-i386 "--upload-label='Linux 32-bit, standard' $* release" -"$(dirname "$0")/with-vagrant.sh" centos-6-x86_64 "--binary-variant=gmp4 --upload-label='Linux 64-bit, libgmp4 for CentOS 6.x' $* release" -"$(dirname "$0")/with-vagrant.sh" centos-6-i386 "--binary-variant=gmp4 --upload-label='Linux 32-bit, libgmp4 for CentOS 6.x' $* release" -"$(dirname "$0")/with-vagrant.sh" freebsd-10.3-amd64 "--upload-label='FreeBSD 64-bit' $* release" "export LANG=en_US.UTF-8;" +"$(dirname "$0")/with-vagrant.sh" alpine-3.4-x86_64 "--binary-variant=static --static $* release" +"$(dirname "$0")/with-vagrant.sh" debian-7-amd64 "$* release" +"$(dirname "$0")/with-vagrant.sh" debian-7-i386 "$* release" +"$(dirname "$0")/with-vagrant.sh" centos-6-x86_64 "--binary-variant=gmp4 $* release" +"$(dirname "$0")/with-vagrant.sh" centos-6-i386 "--binary-variant=gmp4 $* release" +"$(dirname "$0")/with-vagrant.sh" freebsd-10.3-amd64 "$* release" "export LANG=en_US.UTF-8;" diff --git a/etc/scripts/windows-releases.bat b/etc/scripts/windows-releases.bat index 8ace5a07a3..9d9d6629d2 100644 --- a/etc/scripts/windows-releases.bat +++ b/etc/scripts/windows-releases.bat @@ -10,7 +10,7 @@ cd etc\scripts stack --install-ghc install if errorlevel 1 exit /b cd ..\.. -%RELEASE_SCRIPT% --no-test-haddocks --arch=i386 --upload-label="Windows 32-bit" %1 %2 %3 %4 %5 %6 %7 %8 %9 release +%RELEASE_SCRIPT% --no-test-haddocks --arch=i386 %1 %2 %3 %4 %5 %6 %7 %8 %9 release if errorlevel 1 exit /b -%RELEASE_SCRIPT% --no-test-haddocks --arch=x86_64 --upload-label="Windows 64-bit" %1 %2 %3 %4 %5 %6 %7 %8 %9 release +%RELEASE_SCRIPT% --no-test-haddocks --arch=x86_64 %1 %2 %3 %4 %5 %6 %7 %8 %9 release if errorlevel 1 exit /b diff --git a/etc/scripts/with-vagrant.sh b/etc/scripts/with-vagrant.sh index c5d70af7fd..a4c2743d9c 100755 --- a/etc/scripts/with-vagrant.sh +++ b/etc/scripts/with-vagrant.sh @@ -3,8 +3,7 @@ set -xe cd "$(dirname "$0")/../.." #TODO: set up gpg-agent forwarding for package signing (see http://superuser.com/questions/161973/how-can-i-forward-a-gpg-key-via-ssh-agent). -mkdir -p dist -gpg --export-secret-keys --armor dev@fpcomplete.com >dist/gpg-secret-key.asc +gpg --export-secret-keys --armor dev@fpcomplete.com >gpg-secret-key.asc~ cd "etc/vagrant/$1" # Double 'vagrant up' is a workaround for FreeBSD @@ -13,5 +12,5 @@ vagrant up vagrant provision vagrant rsync -vagrant ssh -c "$3 export GITHUB_AUTH_TOKEN=$GITHUB_AUTH_TOKEN; export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID; export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY; export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION; export AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN; gpg --import /vagrant/dist/gpg-secret-key.asc; cd /vagrant && (cd etc/scripts && stack --install-ghc build) && \$(cd etc/scripts && stack exec which stack-release-script) --no-test-haddocks $2" -vagrant halt +vagrant ssh -c "set -xe; $3 export GITHUB_AUTH_TOKEN=$GITHUB_AUTH_TOKEN; export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID; export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY; export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION; export AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN; gpg --import /vagrant/gpg-secret-key.asc~ || true; cd /vagrant; for x in CONTRIBUTING ChangeLog; do rm -f doc/\$x.md; ln -s ../\$x.md doc/\$x.md; done; (cd etc/scripts; stack --install-ghc build); \$(cd etc/scripts; stack exec which stack-release-script) --no-test-haddocks $2" +vagrant halt || vagrant halt -f diff --git a/etc/vagrant/alpine-3.4-x86_64/Vagrantfile b/etc/vagrant/alpine-3.4-x86_64/Vagrantfile new file mode 100644 index 0000000000..7f9c8d1cec --- /dev/null +++ b/etc/vagrant/alpine-3.4-x86_64/Vagrantfile @@ -0,0 +1,19 @@ +Vagrant.configure(2) do |config| + config.vm.box = "maier/alpine-3.4-x86_64" + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z", "--copy-links"], rsync__rsync_path: "/usr/bin/rsync", rsync__chown: false + config.vm.provider "virtualbox" do |vb| + vb.memory = "3072" + end + config.ssh.forward_agent = true + config.vm.provision "shell", inline: <<-SHELL + echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/7.10" |sudo tee -a /etc/apk/repositories + curl -o /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub https://raw.githubusercontent.com/mitchty/alpine-ghc/master/mitch.tishmack%40gmail.com-55881c97.rsa.pub + apk -q update + apk add alpine-sdk linux-headers musl-dev gmp-dev zlib-dev ghc git rsync gnupg + cp /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginT.o /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginT.o.orig + cp /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginS.o /usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/crtbeginT.o + curl -sSLo /usr/local/bin/stack https://download.fpcomplete.com/temp/manny/stack-alpine-static + chmod a+x /usr/local/bin/stack + chown vagrant:vagrant /vagrant + SHELL +end diff --git a/etc/vagrant/centos-6-i386/Vagrantfile b/etc/vagrant/centos-6-i386/Vagrantfile index 3ed0d8dbe0..b84b699d34 100644 --- a/etc/vagrant/centos-6-i386/Vagrantfile +++ b/etc/vagrant/centos-6-i386/Vagrantfile @@ -2,9 +2,9 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "puppetlabs/centos-6.6-32-nocm" - config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__exclude: [".stack-work/", "_release/"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" + vb.memory = "3072" end config.ssh.forward_agent = true config.vm.provision "shell", inline: <<-SHELL diff --git a/etc/vagrant/centos-6-x86_64/Vagrantfile b/etc/vagrant/centos-6-x86_64/Vagrantfile index 8695706792..55dc55dd82 100644 --- a/etc/vagrant/centos-6-x86_64/Vagrantfile +++ b/etc/vagrant/centos-6-x86_64/Vagrantfile @@ -2,9 +2,9 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "puppetlabs/centos-6.6-64-nocm" - config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__exclude: [".stack-work/", "_release/"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" + vb.memory = "3072" end config.ssh.forward_agent = true config.vm.provision "shell", inline: <<-SHELL @@ -15,7 +15,7 @@ Vagrant.configure(2) do |config| yum -y install epel-release yum -y install perl make automake gcc gmp-devel zlib-devel rpm-build tar which git xz python-boto deltarpm python-deltarpm rpm-build rpm-sign ncurses-devel if ! which stack; then - curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/centos/6/fpco.repo >/etc/yum.repos.d/fpco.repo + curl -sSL https://download.fpcomplete.com/centos/6/fpco.repo >/etc/yum.repos.d/fpco.repo yum -y check-update || true fi yum -y install stack diff --git a/etc/vagrant/centos-7-x86_64/Vagrantfile b/etc/vagrant/centos-7-x86_64/Vagrantfile index c9f46ceffa..efabb9e9de 100644 --- a/etc/vagrant/centos-7-x86_64/Vagrantfile +++ b/etc/vagrant/centos-7-x86_64/Vagrantfile @@ -2,9 +2,9 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "puppetlabs/centos-7.0-64-nocm" - config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__exclude: [".stack-work/", "_release/"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" + vb.memory = "3072" end config.ssh.forward_agent = true config.vm.provision "shell", inline: <<-SHELL @@ -14,12 +14,13 @@ Vagrant.configure(2) do |config| yum -y install epel-release yum -y install perl make automake gcc gmp-devel zlib-devel tar which git python-boto deltarpm python-deltarpm rpm-build rpm-sign ncurses-devel if ! which stack; then - curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/centos/7/fpco.repo >/etc/yum.repos.d/fpco.repo + curl -sSL https://download.fpcomplete.com/centos/7/fpco.repo >/etc/yum.repos.d/fpco.repo yum -y check-update || true fi yum -y install stack if ! which fpm; then yum -y install ruby-devel + gem install json --version '< 1.8.0' gem install fpm --version '< 1.4.0' fi if ! [[ -d /opt/rpm-s3 ]]; then diff --git a/etc/vagrant/debian-7-amd64/Vagrantfile b/etc/vagrant/debian-7-amd64/Vagrantfile index 0c8a2f15ff..92a3bc5fd0 100644 --- a/etc/vagrant/debian-7-amd64/Vagrantfile +++ b/etc/vagrant/debian-7-amd64/Vagrantfile @@ -2,9 +2,9 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "puppetlabs/debian-7.8-64-nocm" - config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__exclude: [".stack-work/", "_release/"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" + vb.memory = "3072" end config.ssh.forward_agent = true config.vm.provision "shell", inline: <<-SHELL @@ -22,6 +22,7 @@ Vagrant.configure(2) do |config| if ! which fpm; then apt-get install -y ruby-dev libffi-dev make build-essential apt-get install -y rubygems || true + gem install json --version '< 1.8.0' gem install fpm --version '< 1.4.0' fi if ! which deb-s3; then diff --git a/etc/vagrant/debian-7-i386/Vagrantfile b/etc/vagrant/debian-7-i386/Vagrantfile index 5d5e6c3959..fcf9ae2443 100644 --- a/etc/vagrant/debian-7-i386/Vagrantfile +++ b/etc/vagrant/debian-7-i386/Vagrantfile @@ -2,9 +2,9 @@ # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "puppetlabs/debian-7.8-32-nocm" - config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__exclude: [".stack-work/", "_release/"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" + vb.memory = "3072" end config.ssh.forward_agent = true config.vm.provision "shell", inline: <<-SHELL @@ -19,6 +19,7 @@ Vagrant.configure(2) do |config| if ! which fpm; then apt-get install -y ruby-dev libffi-dev make build-essential apt-get install -y rubygems || true + gem install json --version '< 1.8.0' gem install fpm --version '< 1.4.0' fi if ! which deb-s3; then diff --git a/etc/vagrant/fedora-24-x86_64/Vagrantfile b/etc/vagrant/fedora-24-x86_64/Vagrantfile new file mode 100644 index 0000000000..0080189100 --- /dev/null +++ b/etc/vagrant/fedora-24-x86_64/Vagrantfile @@ -0,0 +1,13 @@ +Vagrant.configure(2) do |config| + config.vm.box = "fedora/24-cloud-base" + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.provider "virtualbox" do |vb| + vb.memory = "3072" + end + config.ssh.forward_agent = true + config.vm.provision "shell", inline: <<-SHELL + set -xe + sudo dnf update -y + sudo dnf install -y glibc-devel ncurses-devel gmp-devel autoconf automake libtool gcc make perl python ghc happy alex git python-sphinx docbook-utils docbook-utils-pdf docbook-style-xsl patch file gcc-c++ bzip2 xz + SHELL +end diff --git a/etc/vagrant/freebsd-10.3-amd64/Vagrantfile b/etc/vagrant/freebsd-10.3-amd64/Vagrantfile index 4fac70e6f4..0d131ede65 100644 --- a/etc/vagrant/freebsd-10.3-amd64/Vagrantfile +++ b/etc/vagrant/freebsd-10.3-amd64/Vagrantfile @@ -1,8 +1,8 @@ Vagrant.configure(2) do |config| config.vm.box = "freebsd/FreeBSD-10.3-RELEASE" - config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__exclude: [".stack-work/", "_release/"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" + vb.memory = "3072" end config.ssh.forward_agent = true config.ssh.shell = "/bin/sh" diff --git a/etc/vagrant/openbsd-5.9-amd64/Vagrantfile b/etc/vagrant/openbsd-5.9-amd64/Vagrantfile index b01aa19e6c..090eafd728 100644 --- a/etc/vagrant/openbsd-5.9-amd64/Vagrantfile +++ b/etc/vagrant/openbsd-5.9-amd64/Vagrantfile @@ -1,8 +1,8 @@ Vagrant.configure(2) do |config| config.vm.box = "kaorimatz/openbsd-5.9-amd64" - config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__exclude: [".stack-work/", "_release/"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] + config.vm.synced_folder "../../..", "/vagrant", type: "rsync", rsync__verbose: true, rsync__exclude: [".stack-work/", "_release/", ".cabal-sandbox/", "cabal.sandbox.config", "dist/", ".#*#"], rsync__args: ["--verbose", "--archive", "--delete", "-z"] config.vm.provider "virtualbox" do |vb| - vb.memory = "2048" + vb.memory = "3072" end config.ssh.forward_agent = true config.ssh.shell = "/bin/sh" @@ -11,7 +11,7 @@ Vagrant.configure(2) do |config| pkg_add xz bzip2 gmp libffi gmake git awscli gnupg-1.4.19p0 #TODO: use a newer version of stack that supports `stack setup` on OpenBSD for bootstrap - curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/dev-tools/stack/stack-1.1.3.20160521-openbsd.gz \ + curl -sSL https://download.fpcomplete.com/dev-tools/stack/stack-1.1.3.20160521-openbsd.gz \ | gzip -dc > /usr/local/bin/stack chmod a+x /usr/local/bin/stack diff --git a/src/Stack/Setup.hs b/src/Stack/Setup.hs index 99a52708ae..0490d29e96 100644 --- a/src/Stack/Setup.hs +++ b/src/Stack/Setup.hs @@ -8,6 +8,8 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE MultiWayIf #-} +{-# LANGUAGE CPP #-} module Stack.Setup ( setupEnv @@ -483,7 +485,7 @@ getGhcBuild menv = do -- that GHC does (i.e. built in same environment as the GHC bindist). The algorithm would go -- something like this: -- - -- check for previous 'uname -a' plus compiler version/variant in cache + -- check for previous 'uname -a'/`ldconfig -p` plus compiler version/variant in cache -- if cached, then use that as suffix -- otherwise: -- download setup-info @@ -493,30 +495,54 @@ getGhcBuild menv = do -- try running it -- if successful, then choose that -- cache compiler suffix with the uname -a and ldconfig -p output hash plus compiler version + -- + -- Of course, could also try to make a static GHC bindist instead of all this rigamarole. platform <- asks getPlatform case platform of Platform _ Linux -> do eldconfigOut <- tryProcessStdout Nothing menv "ldconfig" ["-p"] - let efirstWords = fmap (mapMaybe (headMay . T.words) . - T.lines . T.decodeUtf8With T.lenientDecode) eldconfigOut - case efirstWords of - Right firstWords - | "libtinfo.so.6" `elem` firstWords - && not ("libtinfo.so.5" `elem` firstWords) -> do - $logDebug "Found libtinfo.so.6; using tinfo6 GHC build" - return (CompilerBuildSpecialized "tinfo6") - | "libgmp.so.3" `elem` firstWords - && not ("libgmp.so.10" `elem` firstWords) -> do - $logDebug "Found libgmp.so.3; using gmp4 GHC build" - return (CompilerBuildSpecialized "gmp4") - | otherwise -> do - $logDebug "Did not find libtinfo.so.6 or libgmp.so.3; using standard GHC build" - return CompilerBuildStandard - Left _ -> do - $logDebug "ldconfig -p failed; falling back to using standard GHC build" - return CompilerBuildStandard - _ -> return CompilerBuildStandard + let firstWords = case eldconfigOut of + Right ldconfigOut -> mapMaybe (headMay . T.words) $ + T.lines $ T.decodeUtf8With T.lenientDecode ldconfigOut + Left _ -> [] + checkLib lib + | libT `elem` firstWords = do + $logDebug ("Found shared library " <> libT <> " in 'ldconfig -p' output") + return True +#ifndef WINDOWS + -- (mkAbsDir "/usr/lib") fails to compile on Windows, thus the CPP + | otherwise = do + -- This is a workaround for the fact that libtinfo.so.6 doesn't appear in + -- the 'ldconfig -p' output on Arch even when it exists. + -- There doesn't seem to be an easy way to get the true list of directories + -- to scan for shared libs, but this works for our particular case. + e <- doesFileExist ($(mkAbsDir "/usr/lib") lib) + if e + then $logDebug ("Found shared library " <> libT <> " in /usr/lib") + else $logDebug ("Did not find shared library " <> libT) + return e +#endif + where + libT = T.pack (toFilePath lib) + hastinfo5 <- checkLib $(mkRelFile "libtinfo.so.5") + hastinfo6 <- checkLib $(mkRelFile "libtinfo.so.6") + hasncurses6 <- checkLib $(mkRelFile "libncursesw.so.6") + hasgmp5 <- checkLib $(mkRelFile "libgmp.so.10") + hasgmp4 <- checkLib $(mkRelFile "libgmp.so.3") + if | hastinfo5 && hasgmp5 -> useBuild CompilerBuildStandard + | hastinfo6 && hasgmp5 -> useBuild (CompilerBuildSpecialized "tinfo6") + | hasncurses6 && hasgmp5 -> useBuild (CompilerBuildSpecialized "ncurses6") + | hasgmp4 && hastinfo5 -> useBuild (CompilerBuildSpecialized "gmp4") + | otherwise -> useBuild CompilerBuildStandard + _ -> useBuild CompilerBuildStandard + where + useBuild CompilerBuildStandard = do + $logDebug "Using standard GHC build" + return (CompilerBuildStandard) + useBuild (CompilerBuildSpecialized s) = do + $logDebug ("Using " <> T.pack s <> " GHC build") + return (CompilerBuildSpecialized s) -- | Ensure Docker container-compatible 'stack' executable is downloaded ensureDockerStackExe @@ -852,11 +878,11 @@ downloadFromInfo programsDir downloadInfo tool = do let DownloadInfo{downloadInfoContentLength=contentLength, downloadInfoSha1=sha1} = downloadInfo when (isJust contentLength) $ - $logWarn "`content-length` in not checked \n\ - \and should not be specified when `url` is a file path" + $logWarn ("`content-length` in not checked \n" <> + "and should not be specified when `url` is a file path") when (isJust sha1) $ - $logWarn "`sha1` is not checked and \n\ - \should not be specified when `url` is a file path" + $logWarn ("`sha1` is not checked and \n" <> + "should not be specified when `url` is a file path") return path _ -> fail $ "`url` must be either an HTTP URL or absolute file path: " ++ url diff --git a/stack.cabal b/stack.cabal index f7e7dbe8ef..dcc8c8dfc9 100644 --- a/stack.cabal +++ b/stack.cabal @@ -238,7 +238,7 @@ library , hastache , project-template >= 0.2 , zip-archive < 0.4 - , hpack >= 0.14.0 && < 0.15 + , hpack >= 0.14.0 && < 0.16 , store , annotated-wl-pprint if os(windows) @@ -264,7 +264,7 @@ executable stack , either , filelock >= 0.1.0.1 , filepath >= 1.3.0.2 - , hpack + , hpack >= 0.14.0 && < 0.16 , http-client -- https://github.com/basvandijk/lifted-base/issues/31 , lifted-base < 0.2.3.7 || > 0.2.3.7