stack 1.6.1.1 → 1.6.3
raw patch · 17 files changed
+161/−41 lines, 17 filesdep ~hpack
Dependency ranges changed: hpack
Files
- ChangeLog.md +27/−0
- doc/ChangeLog.md +27/−0
- doc/ghcjs.md +4/−2
- doc/install_and_upgrade.md +4/−0
- package.yaml +1/−1
- src/Stack/BuildPlan.hs +1/−1
- src/Stack/Options/BuildParser.hs +2/−3
- src/Stack/Options/GhciParser.hs +2/−3
- src/Stack/Package.hs +33/−3
- src/Stack/PackageLocation.hs +23/−14
- src/Stack/SDist.hs +14/−1
- src/Stack/Setup.hs +1/−6
- src/Stack/Snapshot.hs +1/−1
- src/Stack/Types/Build.hs +1/−3
- src/Stack/Types/Version.hs +17/−1
- stack.cabal +2/−2
- test/integration/IntegrationSpec.hs +1/−0
ChangeLog.md view
@@ -1,5 +1,32 @@ # Changelog +## v1.6.3++Enhancements:++* In addition to supporting `.tar.gz` and `.zip` files as remote archives,+ plain `.tar` files are now accepted too. This will additionally help with+ cases where HTTP servers mistakenly set the transfer encoding to `gzip`. See+ [#3647](https://github.com/commercialhaskell/stack/issues/3647).+* Links to docs.haskellstack.org ignore Stack version patchlevel.+* Downloading Docker-compatible `stack` binary ignores Stack version patchlevel.++Bug fixes:++* For versions of Cabal before 1.24, ensure that the dependencies of+ non-buildable components are part of the build plan to work around an old+ Cabal bug. See [#3631](https://github.com/commercialhaskell/stack/issues/3631).+* Run the Cabal file checking in the `sdist` command more reliably by+ allowing the Cabal library to flatten the+ `GenericPackageDescription` itself.+++## v1.6.1.1++Hackage-only release with no user facing changes (updated to build with+newer dependency versions).++ ## v1.6.1 Major changes:
doc/ChangeLog.md view
@@ -1,5 +1,32 @@ # Changelog +## v1.6.3++Enhancements:++* In addition to supporting `.tar.gz` and `.zip` files as remote archives,+ plain `.tar` files are now accepted too. This will additionally help with+ cases where HTTP servers mistakenly set the transfer encoding to `gzip`. See+ [#3647](https://github.com/commercialhaskell/stack/issues/3647).+* Links to docs.haskellstack.org ignore Stack version patchlevel.+* Downloading Docker-compatible `stack` binary ignores Stack version patchlevel.++Bug fixes:++* For versions of Cabal before 1.24, ensure that the dependencies of+ non-buildable components are part of the build plan to work around an old+ Cabal bug. See [#3631](https://github.com/commercialhaskell/stack/issues/3631).+* Run the Cabal file checking in the `sdist` command more reliably by+ allowing the Cabal library to flatten the+ `GenericPackageDescription` itself.+++## v1.6.1.1++Hackage-only release with no user facing changes (updated to build with+newer dependency versions).++ ## v1.6.1 Major changes:
doc/ghcjs.md view
@@ -105,15 +105,17 @@ compiler-check: match-exact ``` -### Custom installed GHCJS (development branch)+### Custom installed GHCJS -In order to use a GHCJS installed on your path, just add the following to your `stack.yaml`:+In order to use a GHCJS installed on your PATH, just add the following to your `stack.yaml`: ```yaml compiler: ghcjs-0.2.0_ghc-7.10.2 ``` (Or, `ghcjs-0.1.0_ghc-7.10.2` if you are working with an older version)++This is particularly useful when you have built GHCJS from source. ## Project with both client and server
doc/install_and_upgrade.md view
@@ -34,6 +34,10 @@ If in doubt: you should prefer the 64-bit installer. +You may see a "Windows Defender SmartScreen prevented an unrecognized app from+starting" warning when you try to run the installer. If so, click on+**More info**, and then click on the **Run anyway** button that appears.+ ### Manual download * Download the latest release:
package.yaml view
@@ -1,5 +1,5 @@ name: stack-version: '1.6.1.1'+version: '1.6.3' 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
src/Stack/BuildPlan.hs view
@@ -198,7 +198,7 @@ -> Map FlagName Bool -> Map PackageName VersionRange gpdPackageDeps gpd cv platform flags =- Map.filterWithKey (const . (/= name)) (packageDependencies pkgDesc)+ Map.filterWithKey (const . (/= name)) (packageDependencies pkgConfig pkgDesc) where name = gpdPackageName gpd -- Since tests and benchmarks are both enabled, doesn't matter
src/Stack/Options/BuildParser.hs view
@@ -4,17 +4,16 @@ module Stack.Options.BuildParser where import qualified Data.Map as Map-import Data.Version (showVersion) import Options.Applicative import Options.Applicative.Args import Options.Applicative.Builder.Extra-import Paths_stack as Meta import Stack.Options.Completion import Stack.Options.PackageParser (readFlag) import Stack.Prelude import Stack.Types.Config import Stack.Types.FlagName import Stack.Types.PackageName+import Stack.Types.Version -- | Parser for CLI-only build arguments buildOptsParser :: BuildCommand@@ -92,7 +91,7 @@ completer targetCompleter <> help ("If none specified, use all local packages. " <> "See https://docs.haskellstack.org/en/v" <>- showVersion Meta.version <>+ versionString stackMinorVersion <> "/build_command/#target-syntax for details."))) flagsParser :: Parser (Map.Map (Maybe PackageName) (Map.Map FlagName Bool))
src/Stack/Options/GhciParser.hs view
@@ -1,16 +1,15 @@ {-# LANGUAGE NoImplicitPrelude #-} module Stack.Options.GhciParser where -import Data.Version (showVersion) import Options.Applicative import Options.Applicative.Args import Options.Applicative.Builder.Extra-import Paths_stack as Meta import Stack.Config (packagesParser) import Stack.Ghci (GhciOpts (..)) import Stack.Options.BuildParser (flagsParser) import Stack.Options.Completion import Stack.Prelude+import Stack.Types.Version -- | Parser for GHCI options ghciOptsParser :: Parser GhciOpts@@ -21,7 +20,7 @@ completer (targetCompleter <> fileExtCompleter [".hs", ".lhs"]) <> help ("If none specified, use all local packages. " <> "See https://docs.haskellstack.org/en/v" <>- showVersion Meta.version <>+ versionString stackMinorVersion <> "/build_command/#target-syntax for details. " <> "If a path to a .hs or .lhs file is specified, it will be loaded."))) <*> fmap concat (many (argsOption (long "ghci-options" <>
src/Stack/Package.hs view
@@ -356,7 +356,7 @@ pkgId = package pkg name = fromCabalPackageName (pkgName pkgId) deps = M.filterWithKey (const . not . isMe) (M.union- (packageDependencies pkg)+ (packageDependencies packageConfig pkg) -- We include all custom-setup deps - if present - in the -- package deps themselves. Stack always works with the -- invariant that there will be a single installed package@@ -602,12 +602,42 @@ getBuildComponentDir (Just name) = parseRelDir (name FilePath.</> (name ++ "-tmp")) -- | Get all dependencies of the package (buildable targets only).-packageDependencies :: PackageDescription -> Map PackageName VersionRange-packageDependencies pkg =+--+-- Note that for Cabal versions 1.22 and earlier, there is a bug where+-- Cabal requires dependencies for non-buildable components to be+-- present. We're going to use GHC version as a proxy for Cabal+-- library version in this case for simplicity, so we'll check for GHC+-- being 7.10 or earlier. This obviously makes our function a lot more+-- fun to write...+packageDependencies+ :: PackageConfig+ -> PackageDescription+ -> Map PackageName VersionRange+packageDependencies pkgConfig pkg' = M.fromListWith intersectVersionRanges $ map (depName &&& depRange) $ concatMap targetBuildDepends (allBuildInfo' pkg) ++ maybe [] setupDepends (setupBuildInfo pkg)+ where+ pkg+ | getGhcVersion (packageConfigCompilerVersion pkgConfig) >= $(mkVersion "8.0") = pkg'+ -- Set all components to buildable. Only need to worry about+ -- library, exe, test, and bench, since others didn't exist in+ -- older Cabal versions+ | otherwise = pkg'+ { library = (\c -> c { libBuildInfo = go (libBuildInfo c) }) <$> library pkg'+ , executables = (\c -> c { buildInfo = go (buildInfo c) }) <$> executables pkg'+ , testSuites =+ if packageConfigEnableTests pkgConfig+ then (\c -> c { testBuildInfo = go (testBuildInfo c) }) <$> testSuites pkg'+ else testSuites pkg'+ , benchmarks =+ if packageConfigEnableBenchmarks pkgConfig+ then (\c -> c { benchmarkBuildInfo = go (benchmarkBuildInfo c) }) <$> benchmarks pkg'+ else benchmarks pkg'+ }++ go bi = bi { buildable = True } -- | Get all dependencies of the package (buildable targets only). --
src/Stack/PackageLocation.hs view
@@ -109,25 +109,34 @@ let fp = toFilePath file - let tryTar = do- logDebug $ "Trying to untar " <> T.pack fp- liftIO $ withBinaryFile fp ReadMode $ \h -> do- lbs <- L.hGetContents h- let entries = Tar.read $ GZip.decompress lbs- Tar.unpack (toFilePath dirTmp) entries- tryZip = do+ withBinaryFile fp ReadMode $ \h -> do+ -- Share a single file read among all of the different+ -- parsing attempts. We're not worried about unbounded+ -- memory usage, as we will detect almost immediately if+ -- this is the wrong type of file.+ lbs <- liftIO $ L.hGetContents h++ let tryTargz = do+ logDebug $ "Trying to ungzip/untar " <> T.pack fp+ let entries = Tar.read $ GZip.decompress lbs+ liftIO $ Tar.unpack (toFilePath dirTmp) entries+ tryZip = do logDebug $ "Trying to unzip " <> T.pack fp- archive <- fmap Zip.toArchive $ liftIO $ L.readFile fp+ let archive = Zip.toArchive lbs liftIO $ Zip.extractFilesFromArchive [Zip.OptDestination (toFilePath dirTmp)] archive- err = throwM $ UnableToExtractArchive url file+ tryTar = do+ logDebug $ "Trying to untar (no ungzip) " <> T.pack fp+ let entries = Tar.read lbs+ liftIO $ Tar.unpack (toFilePath dirTmp) entries+ err = throwM $ UnableToExtractArchive url file - catchAnyLog goodpath handler =- catchAny goodpath $ \e -> do- logDebug $ "Got exception: " <> T.pack (show e)- handler+ catchAnyLog goodpath handler =+ catchAny goodpath $ \e -> do+ logDebug $ "Got exception: " <> T.pack (show e)+ handler - tryTar `catchAnyLog` tryZip `catchAnyLog` err+ tryTargz `catchAnyLog` tryZip `catchAnyLog` tryTar `catchAnyLog` err renameDir dirTmp dir x <- listDir dir
src/Stack/SDist.hs view
@@ -406,7 +406,20 @@ (gdesc, PackageDescriptionPair pkgDesc _) <- readPackageDescriptionDir config pkgDir False logInfo $ "Checking package '" <> packageNameText name <> "' for common mistakes"- let pkgChecks = Check.checkPackage gdesc (Just pkgDesc)+ let pkgChecks =+ -- MSS 2017-12-12: Try out a few different variants of+ -- pkgDesc to try and provoke an error or warning. I don't+ -- know why, but when using `Just pkgDesc`, it appears that+ -- Cabal does not detect that `^>=` is used with+ -- `cabal-version: 1.24` or earlier. It seems like pkgDesc+ -- (the one we create) does not populate the `buildDepends`+ -- field, whereas flattenPackageDescription from Cabal+ -- does. In any event, using `Nothing` seems more logical+ -- for this check anyway, and the fallback to `Just pkgDesc`+ -- is just a crazy sanity check.+ case Check.checkPackage gdesc Nothing of+ [] -> Check.checkPackage gdesc (Just pkgDesc)+ x -> x fileChecks <- liftIO $ Check.checkPackageFiles pkgDesc (toFilePath pkgDir) let checks = pkgChecks ++ fileChecks (errors, warnings) =
src/Stack/Setup.hs view
@@ -61,7 +61,6 @@ import Distribution.System (OS, Arch (..), Platform (..)) import qualified Distribution.System as Cabal import Distribution.Text (simpleParse)-import Distribution.Version (mkVersion') import Lens.Micro (set) import Network.HTTP.Simple (getResponseBody, httpLBS, withResponse, getResponseStatusCode) import Network.HTTP.Download@@ -69,7 +68,6 @@ import Path.CheckInstall (warnInstallSearchPathIssues) import Path.Extra (toFilePathNoTrailingSep) import Path.IO hiding (findExecutable, withSystemTempDir)-import qualified Paths_stack as Meta import Prelude (getLine, putStr, putStrLn, until) import Stack.Build (build) import Stack.Config (loadConfig)@@ -661,7 +659,7 @@ stackExeExists <- doesFileExist stackExePath unless stackExeExists $ do logInfo $ mconcat ["Downloading Docker-compatible ", T.pack stackProgName, " executable"]- sri <- downloadStackReleaseInfo Nothing Nothing (Just (versionString stackVersion))+ sri <- downloadStackReleaseInfo Nothing Nothing (Just (versionString stackMinorVersion)) platforms <- runReaderT preferredPlatforms (containerPlatform, PlatformVariantNone) downloadStackExe platforms sri stackExeDir False (const $ return ()) return stackExePath@@ -1983,6 +1981,3 @@ String rawName <- HashMap.lookup "name" o -- drop the "v" at the beginning of the name parseVersion $ T.drop 1 rawName--stackVersion :: Version-stackVersion = fromCabalVersion (mkVersion' Meta.version)
src/Stack/Snapshot.hs view
@@ -769,7 +769,7 @@ , lpiGhcOptions = options , lpiPackageDeps = Map.map fromVersionRange $ Map.filterWithKey (const . (/= name))- $ packageDependencies pd+ $ packageDependencies pconfig pd , lpiProvidedExes = Set.fromList $ map (ExeName . T.pack . C.unUnqualComponentName . C.exeName)
src/Stack/Types/Build.hs view
@@ -62,13 +62,11 @@ import Data.Text.Encoding.Error (lenientDecode) import Data.Time.Calendar import Data.Time.Clock-import Data.Version (showVersion) import Distribution.PackageDescription (TestSuiteInterface) import Distribution.System (Arch) import qualified Distribution.Text as C import Path (mkRelDir, parseRelDir, (</>)) import Path.Extra (toFilePathNoTrailingSep)-import Paths_stack as Meta import Stack.Constants import Stack.Types.BuildPlan import Stack.Types.Compiler@@ -187,7 +185,7 @@ "The following target packages were not found: " ++ intercalate ", " (map packageNameString $ Set.toList noKnown) ++ "\nSee https://docs.haskellstack.org/en/v"- <> showVersion Meta.version <>+ <> versionString stackMinorVersion <> "/build_command/#target-syntax for details." notInSnapshot' | Map.null notInSnapshot = []
src/Stack/Types/Version.hs view
@@ -29,7 +29,10 @@ ,latestApplicableVersion ,checkVersion ,nextMajorVersion- ,UpgradeTo(..))+ ,UpgradeTo(..)+ ,minorVersion+ ,stackVersion+ ,stackMinorVersion) where import Stack.Prelude hiding (Vector)@@ -45,6 +48,7 @@ import qualified Distribution.Version as Cabal import Language.Haskell.TH import Language.Haskell.TH.Syntax+import qualified Paths_stack as Meta import Text.PrettyPrint (render) -- | A parse fail.@@ -219,3 +223,15 @@ (Nothing, _) -> True (Just _, Nothing) -> False (Just w, Just a) -> a >= w++-- | Get minor version (excludes any patchlevel)+minorVersion :: Version -> Version+minorVersion (Version v) = Version (V.take 3 v)++-- | Current Stack version+stackVersion :: Version+stackVersion = fromCabalVersion (Cabal.mkVersion' Meta.version)++-- | Current Stack minor version (excludes patchlevel)+stackMinorVersion :: Version+stackMinorVersion = minorVersion stackVersion
stack.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: de62cea79534de3d9c9e0479c0650a4159c588e37a8ae05df6dab12a1a5f0c46+-- hash: 0604a4361ea11be3c239468877d85b80556dd68a8780b5f0b136be7862921342 name: stack-version: 1.6.1.1+version: 1.6.3 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 the API for the library is not currently stable, and may change significantly, even between minor releases. It is currently only intended for use by the executable. category: Development
test/integration/IntegrationSpec.hs view
@@ -77,6 +77,7 @@ test runghc env' currDir origStackRoot newHome newStackRoot name = it name $ withDir $ \dir -> do newHomeExists <- doesDirectoryExist newHome when newHomeExists (removeDirectoryRecursive newHome)+ createDirectoryIfMissing True newStackRoot copyTree toCopyRoot origStackRoot newStackRoot writeFile (newStackRoot </> "config.yaml") "system-ghc: true" let testDir = currDir </> "tests" </> name