packages feed

stack 1.5.0 → 1.5.1

raw patch · 11 files changed

+143/−76 lines, 11 files

Files

ChangeLog.md view
@@ -1,6 +1,18 @@ # Changelog  +## 1.5.1++Bug fixes:++* Stack eagerly tries to parse all cabal files related to a+  snapshot. Starting with Stackage Nightly 2017-07-31, snapshots are+  using GHC 8.2.1, and the `ghc.cabal` file implicitly referenced uses+  the (not yet supported) Cabal 2.0 file format. Future releases of+  Stack will both be less eager about cabal file parsing and support+  Cabal 2.0. This patch simply bypasses the error for invalid parsing.++ ## 1.5.0  Behavior changes:
doc/ChangeLog.md view
@@ -1,6 +1,18 @@ # Changelog  +## 1.5.1++Bug fixes:++* Stack eagerly tries to parse all cabal files related to a+  snapshot. Starting with Stackage Nightly 2017-07-31, snapshots are+  using GHC 8.2.1, and the `ghc.cabal` file implicitly referenced uses+  the (not yet supported) Cabal 2.0 file format. Future releases of+  Stack will both be less eager about cabal file parsing and support+  Cabal 2.0. This patch simply bypasses the error for invalid parsing.++ ## 1.5.0  Behavior changes:
doc/MAINTAINER_GUIDE.md view
@@ -2,26 +2,37 @@  ## Next release: -* Adjust static binary build on Alpine. See-  https://github.com/commercialhaskell/stack/issues/3045-* For minor release, ensure https://github.com/commercialhaskell/stack/commit/d3637126b9045b266d2e53387e183915cb4a912d cherry-picked+* Create release candidate process (maybe switch to GHC-style versioning)+* Maybe drop 32-bit CentOS 6 bindists, since GHC 8.2.1 seems to have dropped them.+* Replace non-static Linux bindists with static (but keep old links active so+  links don't break and 'stack upgrade' in old versions still work)  ## Pre-release steps +* Check for any P0 and P1 issues. * Ensure `release` and `stable` branches merged to `master`+* Check compatibility with latest Stackage snapshots+    * stack-*.yaml (where `*` is not `nightly`): bump to use latest LTS minor+      version (be sure any extra-deps that exist only for custom flags have+      versions matching the snapshot)+    * Check for any redundant extra-deps+    * Run `stack --stack-yaml=stack-*.yaml test --pedantic` (replace `*` with+      the actual file) * Check compatibility with latest nightly stackage snapshot:-    * Update `stack-nightly.yaml` with latest nightly and remove extra-deps+    * Update `stack-nightly.yaml` with latest nightly and remove extra-deps (be+      sure any extra-deps that exist only for custom flags have versions+      matching the snapshot)     * Run `stack --stack-yaml=stack-nightly.yaml test --pedantic` * Check pvp-bounds compatibility with Stackage snapshots:     * Create an sdist using `stack sdist --pvp-bounds=both`     * Temporarily replace `stack.cabal` with the `stack.cabal` in that sdist-    * Run `stack --stack-yaml=stack-SNAPSHOT.yaml test --pedantic` for each+    * Run `stack --stack-yaml=stack-*.yaml test --pedantic` for each       `stack-*.yaml` and adjust upper bounds in original `stack.cabal` until it       works with pvp-bounds. * Ensure integration tests pass on a Windows, macOS, and Linux (Linux   integration tests are run   by-  [Jenkins](https://jenkins-public.fpcomplete.com/job/stack-integration-tests)):+  [Gitlab](http://gitlab.fpcomplete.com/fpco-mirrors/stack/pipelines)):   `stack install --pedantic && stack test --pedantic --flag   stack:integration-tests`. The actual release script will perform a more   thorough test for every platform/variant prior to uploading, so this is just a@@ -29,13 +40,11 @@ * In master branch:     * stack.cabal: bump the version number to release (even third       component)-    * ChangeLog: rename the "unreleased changes" section to the new version+    * ChangeLog: rename the "Unreleased changes" section to the new version * Cut a release candidate branch `rc/vX.Y.Z` from master * In master branch:     * stack.cabal: bump version number to unstable (odd third component)     * Changelog: add new "unreleased changes" section-    * stack-*.yaml: bump to use latest LTS minor version or nightly, and check-      whether extra-deps still needed * In RC branch:     * Update the ChangeLog:         * Check for any important changes that missed getting an entry in@@ -49,14 +58,6 @@         * Look for any links to "latest" documentation, replace with version tag         * Ensure all documentation pages listed in `mkdocs.yaml`     * Update `.github/ISSUE_TEMPLATE.md` to point at the new version.-    * <del>-      Check that any new Linux distribution versions added to-      `etc/scripts/release.hs` and `etc/scripts/vagrant-releases.sh`-        * [Ubuntu](https://wiki.ubuntu.com/Releases)-        * [Debian](https://www.debian.org/releases/)-        * [CentOS](https://wiki.centos.org/Download)-        * [Fedora](https://fedoraproject.org/wiki/Releases)-      </del>     * Check for new [FreeBSD release](https://www.freebsd.org/releases/).     * Check that no new entries need to be added to       [releases.yaml](https://github.com/fpco/stackage-content/blob/master/stack/releases.yaml),@@ -65,11 +66,8 @@       `README.md`     * Remove unsupported/obsolete distribution versions from the release process.         * [Ubuntu](https://wiki.ubuntu.com/Releases)-            * 12.04 EOL 2017-APR-            * 16.10 EOL 2017-JUL             * 14.04 EOL 2019-APR             * 16.04 EOL 2021-APR-        * [Debian](https://www.debian.org/releases/)         * [CentOS](https://wiki.centos.org/Download)              * 6 EOL 2020-NOV-30             * 7 EOL 2024-JUN-30@@ -119,18 +117,18 @@ * Build sdist using `stack sdist . --pvp-bounds=both`, and upload it to the   Github release with a name like `stack-X.Y.Z-sdist-0.tar.gz`. -* Publish Github release. Use e.g. `git shortlog -s v1.1.2..rc/v1.2.0|sed 's/^[0-9 ]*/* /'|sort -f`+* Publish Github release. Use e.g. `git shortlog -s release..HEAD|sed $'s/^[0-9 \t]*/* /'|sort -f`   to get the list of contributors.  * Upload package to Hackage: `stack upload . --pvp-bounds=both` -* Push signed Git tag, matching Github release tag name, e.g.: `git tag -d vX.Y.Z; git tag -u 0x575159689BEFB442 vX.Y.Z && git push -f origin vX.Y.Z`+* Push signed Git tag, matching Github release tag name, e.g.: `git tag -d vX.Y.Z; git tag -u 0x575159689BEFB442 -m vX.Y.Z vX.Y.Z && git push -f origin vX.Y.Z`  * Reset the `release` branch to the released commit, e.g.: `git checkout release && git merge --ff-only vX.Y.Z && git push origin release`  * Update the `stable` branch similarly -* Delete the RC branch (locally and on origin)+* Delete the RC branch and any RC tags (locally and on origin)  * Activate version for new release tag on   [readthedocs.org](https://readthedocs.org/dashboard/stack/versions/), and@@ -139,17 +137,9 @@ * Merge any changes made in the RC/release/stable branches to master.  * On a machine with Vagrant installed:+    * Make sure you are on the same commit as when `vagrant-release.sh` was run.     * Run `etc/scripts/vagrant-distros.sh` -* <del>Submit a PR for the-  [haskell-stack Homebrew formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/haskell-stack.rb)-      * Ensure that the formula use the sdist uploaded to the Github release-      * Be sure to update the SHA sum-      * The commit message should just be `haskell-stack <VERSION>`-  </del>--* <del>[Flag the Arch Linux package as out-of-date](https://www.archlinux.org/packages/community/x86_64/stack/flag/)</del>- * Upload haddocks to Hackage: `etc/scripts/upload-haddocks.sh` (if they weren't auto-built)  * Announce to haskell-cafe@haskell.org, haskell-stack@googlegroups.com,@@ -264,22 +254,27 @@     qemu-system-arm -M vexpress-a9 -cpu cortex-a9 -kernel vmlinuz -initrd initrd.gz -sd armdisk.raw -append "root=/dev/mmcblk0p2" -m 1024M -redir tcp:2223::22 -dtb vexpress-v2p-ca9.dtb -append "console=ttyAMA0,115200" -serial stdio  Now the Debian installer will run. Don't use LVM for partitioning (it won't-BOOT), and add at least 2 GB swap during installation.+boot), and add at least 4 GB swap during installation.  ### Get boot files after install +Adjust the disk number `/dev/disk3` below to match the output from `hdiutil attach`.+     hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount armdisk.raw && \-    mkdir -p /Volumes/armdeb && \-    fuse-ext2 /dev/disk2s1 /Volumes/armdeb/ && \+    sudo mkdir -p /Volumes/debarm && \+    sudo fuse-ext2 /dev/disk3s1 /Volumes/debarm/ && \     sleep 5 && \-    cp /Volumes/armdeb/vmlinuz-3.16.0-4-armmp . && \-    cp /Volumes/armdeb/initrd.img-3.16.0-4-armmp . && \-    hdiutil detach /dev/disk2+    cp /Volumes/debarm/vmlinuz-3.16.0-4-armmp . && \+    cp /Volumes/debarm/initrd.img-3.16.0-4-armmp . && \+    sudo umount /Volumes/debarm && \+    hdiutil detach /dev/disk3  ### Boot VM -    qemu-system-arm -M vexpress-a9 -cpu cortex-a9 -kernel vmlinuz-3.16.0-4-armmp -initrd initrd.img-3.16.0-4-armmp -sd armdisk.raw -m 1024M -dtb vexpress-v2p-ca9.dtb -append "root=/dev/mmcblk0p2 console=ttyAMA0,115200" -serial stdio -redir tcp:2223::22+Adjust `/dev/mmcblk0p3` below to the root partition you created during installation. +    qemu-system-arm -M vexpress-a9 -cpu cortex-a9 -kernel vmlinuz-3.16.0-4-armmp -initrd initrd.img-3.16.0-4-armmp -sd armdisk.raw -m 1024M -dtb vexpress-v2p-ca9.dtb -append "root=/dev/mmcblk0p3 console=ttyAMA0,115200" -serial stdio -redir tcp:2223::22+ ### Setup rest of system  Log onto the VM as root, then (replace `<<<USERNAME>>>` with the user you set up@@ -292,27 +287,30 @@ Now you can SSH to the VM using `ssh -p 2223 <<<USERNAME>>>@localhost` and use `sudo` in the shell. -### Install clang+llvmGHC/clang+### Install build tools and dependencies packages +    sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg++### Install clang+llvm+ NOTE: the Debian jessie `llvm` packge does not work (executables built with it just exit with "schedule: re-entered unsafely.").  The version of LLVM needed depends on the version of GHC you need. -#### GHC 7.10.3 (the standard for building Stack)+#### GHC 8.0.2 (the standard for building Stack) -    sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make xz-utils zlib1g-dev git gnupg && \-    wget http://llvm.org/releases/3.5.2/clang+llvm-3.5.2-armv7a-linux-gnueabihf.tar.xz && \-    sudo tar xvf clang+llvm-3.5.2-armv7a-linux-gnueabihf.tar.xz -C /opt+    wget http://llvm.org/releases/3.7.1/clang+llvm-3.7.1-armv7a-linux-gnueabihf.tar.xz && \+    sudo tar xvf clang+llvm-3.7.1-armv7a-linux-gnueabihf.tar.xz -C /opt  Run this now and add it to the `.profile`: -    export PATH="$HOME/.local/bin:/opt/clang+llvm-3.5.2-armv7a-linux-gnueabihf/bin:$PATH"+    export PATH="$HOME/.local/bin:/opt/clang+llvm-3.7.1-armv7a-linux-gnueabihf/bin:$PATH" -#### GHC 8.0.1+#### GHC 7.10.3 -    wget http://llvm.org/releases/3.7.1/clang+llvm-3.7.1-armv7a-linux-gnueabihf.tar.xz && \-    sudo tar xvf clang+llvm-3.7.1-armv7a-linux-gnueabihf.tar.xz -C /opt+    wget http://llvm.org/releases/3.5.2/clang+llvm-3.5.2-armv7a-linux-gnueabihf.tar.xz && \+    sudo tar xvf clang+llvm-3.5.2-armv7a-linux-gnueabihf.tar.xz -C /opt  Run this now and add it to the `.profile`: @@ -349,6 +347,10 @@     cd stack-* && \     cabal install && \     mv ~/.cabal/bin/stack ~/.local/bin++### Import GPG private key++Import the `dev@fpcomplete.com` (0x575159689BEFB442) GPG secret key  ### Resources 
doc/install_and_upgrade.md view
@@ -295,10 +295,18 @@  ## Upgrade -There are essentially three different approaches to upgrade:+There are essentially four different approaches to upgrade: -* The `stack` tool itself ships with an `upgrade` command, which will build `stack` from source and install it to the default install path (see the previous section). You can use `stack upgrade` to get the latest official release, and `stack upgrade --git` to install from Git and live on the bleeding edge. If you follow this, make sure that this directory is on your `PATH` and takes precedence over the system installed `stack`. For more information, see [this discussion](https://github.com/commercialhaskell/stack/issues/237#issuecomment-126793301).+* The `stack` tool itself ships with an `upgrade` command, which download a `stack` binary or build it from source and install it to the default install path (e.g. `~/.local/bin` or `%APPDATA%\local\bin`; see the [Path](#Path) section above). You can use `stack upgrade` to get the latest official release, and `stack upgrade --git` to install from Git and live on the bleeding edge. Make sure the default install directory is on your `PATH` and takes precedence over the system installed `stack`, or copy `stack` from that directory to the system location afterward. For more information, see [this discussion](https://github.com/commercialhaskell/stack/issues/237#issuecomment-126793301). -* If you're using a package manager (e.g., the Ubuntu debs listed above) and are happy with sticking with the officially released binaries, simply follow your normal package manager strategies for upgrading (e.g. `apt-get update && apt-get upgrade`).+* If you're using a package manager and are happy with sticking with the officially released binaries from the distribution (which may the lag behind latest version of Stack significantly), simply follow your normal package manager strategies for upgrading (e.g. `apt-get update && apt-get upgrade`). -* If you're not using a package manager but want to stick with the official binaries (such as on Windows or Mac), you'll need to manually follow the steps above to download the newest binaries from the release page and replace the old binary.+* The get.haskellstack.org script supports the `-f` argument to over-write the current stack executable.  For example:++      curl -sSL https://get.haskellstack.org/ | sh -s - -f++  or:++      wget -qO- https://get.haskellstack.org/ | sh -s - -f++* Manually follow the steps above to download the newest binaries from the release page and replace the old binary.
src/Stack/Build.hs view
@@ -323,7 +323,10 @@             -- Intentionally ignore warnings, as it's not really             -- appropriate to print a bunch of warnings out while             -- resolving the package index.-            (_warnings,pkg) <- readPackageBS (depPackageConfig econfig flags ghcOptions) bs+            (_warnings,pkg) <- readPackageBS+              (depPackageConfig econfig flags ghcOptions)+              (PackageIdentifier name version)+              bs             return pkg   where     -- | Package config to be used for dependencies
src/Stack/BuildPlan.hs view
@@ -299,9 +299,14 @@                             Nothing -> (Map.empty, [], Nothing)                             Just (_, x, y, z) -> (x, y, z)                  in (indexName $ rpIndex rp, [(rp, (cache, ghcOptions, sha))])-    res <- forM (Map.toList byIndex) $ \(indexName', pkgs) -> withCabalFiles indexName' pkgs-        $ \ident (flags, ghcOptions, mgitSha) cabalBS -> do-            (_warnings,gpd) <- readPackageUnresolvedBS Nothing cabalBS+    res <- forM (Map.toList byIndex) $ \(indexName', pkgs) ->+      fmap Map.unions $ withCabalFiles indexName' pkgs+        $ \ident (flags, ghcOptions, mgitSha) cabalBS ->+        case readPackageUnresolvedBS (Right ident) cabalBS of+          Left e+            | allowedToSkip ident -> return Map.empty+            | otherwise -> throwM e+          Right (_warnings, gpd) -> do             let packageConfig = PackageConfig                     { packageConfigEnableTests = False                     , packageConfigEnableBenchmarks = False@@ -314,7 +319,7 @@                 pd = resolvePackageDescription packageConfig gpd                 exes = Set.fromList $ map (ExeName . T.pack . exeName) $ executables pd                 notMe = Set.filter (/= name) . Map.keysSet-            return (name, MiniPackageInfo+            return $ Map.singleton name MiniPackageInfo                 { mpiVersion = packageIdentifierVersion ident                 , mpiFlags = flags                 , mpiGhcOptions = ghcOptions@@ -326,12 +331,30 @@                     (buildable . libBuildInfo)                     (library pd)                 , mpiGitSHA1 = mgitSha-                })-    return (Map.fromList $ concat res, missingIdents)+                }+    return (Map.unions res, missingIdents)   where     shaMap = Map.fromList         $ map (\(n, (v, _f, _ghcOptions, gitsha)) -> (PackageIdentifier n v, gitsha))         $ Map.toList toCalc++    -- Michael Snoyman, 2017-07-31:+    --+    -- This is a stop-gap measure to address a specific concern around+    -- the GHC 8.2.1 release. The current Stack version (1.5.0) will+    -- eagerly parse all cabal files mentioned in a snapshot,+    -- including global packages. Additionally, for the first time+    -- (AFAICT), GHC 8.2.1 is providing a package on Hackage with a+    -- ghc.cabal file, which requires the (not yet supported) Cabal+    -- 2.0 file format. To work around this, we're adding a special+    -- dispensation to ignore parse failures for this package.+    --+    -- Master already does better by simply ignoring global+    -- information and looking things up in the database. We may want+    -- to consider going a step further and simply ignoring _all_+    -- parse failures, or turning them into warnings, though I haven't+    -- considered the repercussions of that.+    allowedToSkip (PackageIdentifier name _) = name == $(mkPackageName "ghc")  -- | Resolve all packages necessary to install for the needed packages. getDeps :: MiniBuildPlan
src/Stack/Package.hs view
@@ -110,17 +110,17 @@                       -> m ([PWarning],GenericPackageDescription) readPackageUnresolved cabalfp =   liftIO (BS.readFile (FL.toFilePath cabalfp))-  >>= readPackageUnresolvedBS (Just cabalfp)+  >>= readPackageUnresolvedBS (Left cabalfp)  -- | Read the raw, unresolved package information from a ByteString. readPackageUnresolvedBS :: (MonadThrow m)-                        => Maybe (Path Abs File)+                        => Either (Path Abs File) PackageIdentifier                         -> BS.ByteString                         -> m ([PWarning],GenericPackageDescription)-readPackageUnresolvedBS mcabalfp bs =+readPackageUnresolvedBS source bs =     case parsePackageDescription chars of        ParseFailed per ->-         throwM (PackageInvalidCabalFile mcabalfp per)+         throwM (PackageInvalidCabalFile source per)        ParseOk warnings gpkg -> return (warnings,gpkg)   where     chars = T.unpack (dropBOM (decodeUtf8With lenientDecode bs))@@ -140,10 +140,11 @@ -- | Reads and exposes the package information, from a ByteString readPackageBS :: (MonadThrow m)               => PackageConfig+              -> PackageIdentifier               -> BS.ByteString               -> m ([PWarning],Package)-readPackageBS packageConfig bs =-  do (warnings,gpkg) <- readPackageUnresolvedBS Nothing bs+readPackageBS packageConfig ident bs =+  do (warnings,gpkg) <- readPackageUnresolvedBS (Right ident) bs      return (warnings,resolvePackage packageConfig gpkg)  -- | Get 'GenericPackageDescription' and 'PackageDescription' reading info
src/Stack/SDist.hs view
@@ -177,8 +177,8 @@             -> FilePath             -> m (PackageIdentifier, L.ByteString) getCabalLbs pvpBounds mrev fp = do-    bs <- liftIO $ S.readFile fp-    (_warnings, gpd) <- readPackageUnresolvedBS Nothing bs+    path <- liftIO $ resolveFile' fp+    (_warnings, gpd) <- readPackageUnresolved path     (_, sourceMap) <- loadSourceMap AllowNoTargets defaultBuildOptsCLI     menv <- getMinimalEnvOverride     (installedMap, _, _, _) <- getInstalled menv GetInstalledOpts
src/Stack/Types/Package.hs view
@@ -48,20 +48,25 @@  -- | All exceptions thrown by the library. data PackageException-  = PackageInvalidCabalFile (Maybe (Path Abs File)) PError+  = PackageInvalidCabalFile (Either (Path Abs File) PackageIdentifier) PError   | PackageNoCabalFileFound (Path Abs Dir)   | PackageMultipleCabalFilesFound (Path Abs Dir) [Path Abs File]   | MismatchedCabalName (Path Abs File) PackageName   deriving Typeable instance Exception PackageException instance Show PackageException where-    show (PackageInvalidCabalFile mfile err) =-        "Unable to parse cabal file" ++-        (case mfile of-            Nothing -> ""-            Just file -> ' ' : toFilePath file) ++-        ": " ++-        show err+    show (PackageInvalidCabalFile (Left file) err) = concat+        [ "Unable to parse cabal file "+        , toFilePath file+        , ": "+        , show err+        ]+    show (PackageInvalidCabalFile (Right ident) err) = concat+        [ "Unable to parse cabal file for "+        , packageIdentifierString ident+        , ": "+        , show err+        ]     show (PackageNoCabalFileFound dir) = concat         [ "Stack looks for packages in the directories configured in"         , " the 'packages' variable defined in your stack.yaml\n"
stack.cabal view
@@ -1,5 +1,5 @@ name:                stack-version:             1.5.0+version:             1.5.1 synopsis:            The Haskell Tool Stack description:         Please see the README.md for usage information, and                      the wiki on Github for more details.  Also, note that
stack.yaml view
@@ -18,3 +18,4 @@     win32-2-5: false extra-deps: - mintty-0.1.1+- unicode-transforms-0.3.2