Compare commits

...

8 Commits

Author SHA1 Message Date
9375255452 Warn on all tools when shadowed 2022-05-23 16:50:23 +02:00
b8b3a16589 Update modgraph 2022-05-23 00:00:57 +02:00
e1d86c77d0 Merge branch 'issue-364' 2022-05-22 23:39:41 +02:00
001d33eabb Use 'cabal update' 2022-05-22 22:47:40 +02:00
9ccf29903e Add Ben's GPG key 2022-05-16 21:40:02 +02:00
2a2ace603b Bump 2022-05-12 18:35:38 +02:00
25f9ac71ca Merge branch 'windows-hotfix' 2022-05-12 18:33:19 +02:00
61e2801838 Windows fix 2022-05-12 18:03:04 +02:00
14 changed files with 1496 additions and 1178 deletions

View File

@@ -1,5 +1,13 @@
# Revision history for ghcup # Revision history for ghcup
## 0.1.17.10 -- 2022-05-12
* windows hotfix (hackage-only release)
## 0.1.17.9 -- 2022-05-12
* broken sdist (hackage-only release)
## 0.1.17.8 -- 2022-05-11 ## 0.1.17.8 -- 2022-05-11
* Fix a serious (but hard to trigger) bug when combining `--isolate <DIR>` with `--force`, please make sure to upgrade or avoid `--force` * Fix a serious (but hard to trigger) bug when combining `--isolate <DIR>` with `--force`, please make sure to upgrade or avoid `--force`

View File

@@ -437,7 +437,7 @@ install' _ (_, ListResult {..}) = do
, TarDirDoesNotExist , TarDirDoesNotExist
, FileAlreadyExistsError , FileAlreadyExistsError
, ProcessError , ProcessError
, GHCupShadowed , ToolShadowed
, UninstallFailed , UninstallFailed
, MergeFileTreeError , MergeFileTreeError
] ]

View File

@@ -94,7 +94,7 @@ type UpgradeEffects = '[ DigestError
, FileDoesNotExistError , FileDoesNotExistError
, CopyError , CopyError
, DownloadFailed , DownloadFailed
, GHCupShadowed , ToolShadowed
] ]

View File

@@ -287,10 +287,11 @@ GHCup itself is also pre-installed on all platforms, but may use non-standard in
GHCup supports verifying the GPG signature of the metadata file. The metadata file then contains SHA256 hashes of all downloads, so GHCup supports verifying the GPG signature of the metadata file. The metadata file then contains SHA256 hashes of all downloads, so
this is cryptographically secure. this is cryptographically secure.
First, obtain the gpg key: First, obtain the gpg keys:
```sh ```sh
gpg --batch --keyserver keys.openpgp.org --recv-keys 7784930957807690A66EBDBE3786C5262ECB4A3F gpg --batch --keyserver keys.openpgp.org --recv-keys 7784930957807690A66EBDBE3786C5262ECB4A3F
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys FE5AB6C91FEA597C3B31180B73EDE9E8CFBAEF01
``` ```
Then verify the gpg key in one of these ways: Then verify the gpg key in one of these ways:

View File

@@ -187,7 +187,7 @@ Lower availability of bindists. Stack and HLS binaries are experimental.
Download the binary for your platform at [https://downloads.haskell.org/~ghcup/](https://downloads.haskell.org/~ghcup/) Download the binary for your platform at [https://downloads.haskell.org/~ghcup/](https://downloads.haskell.org/~ghcup/)
and place it into your `PATH` anywhere. and place it into your `PATH` anywhere.
If you want to GPG verify the binaries, import the following key first: `7784930957807690A66EBDBE3786C5262ECB4A3F`. If you want to GPG verify the binaries, import the following keys first: `7784930957807690A66EBDBE3786C5262ECB4A3F` and `FE5AB6C91FEA597C3B31180B73EDE9E8CFBAEF01`.
Then adjust your `PATH` in `~/.bashrc` (or similar, depending on your shell) like so: Then adjust your `PATH` in `~/.bashrc` (or similar, depending on your shell) like so:

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 40 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -77,6 +77,7 @@ import Text.Regex.Posix
import qualified Data.Text as T import qualified Data.Text as T
import qualified Streamly.Prelude as S import qualified Streamly.Prelude as S
import Text.PrettyPrint.HughesPJClass (prettyShow)
@@ -291,7 +292,7 @@ upgradeGHCup :: ( MonadMask m
, DownloadFailed , DownloadFailed
, NoDownload , NoDownload
, NoUpdate , NoUpdate
, GHCupShadowed , ToolShadowed
] ]
m m
Version Version
@@ -322,17 +323,9 @@ upgradeGHCup mtarget force' fatal = do
liftIO (isShadowed destFile) >>= \case liftIO (isShadowed destFile) >>= \case
Nothing -> pure () Nothing -> pure ()
Just pa Just pa
| fatal -> throwE (GHCupShadowed pa destFile latestVer) | fatal -> throwE (ToolShadowed GHCup pa destFile latestVer)
| otherwise -> | otherwise ->
lift $ logWarn $ "ghcup is shadowed by " lift $ logWarn $ T.pack $ prettyShow (ToolShadowed GHCup pa destFile latestVer)
<> T.pack pa
<> ". The upgrade will not be in effect, unless you remove "
<> T.pack pa
<> " or make sure "
<> T.pack destDir
<> " comes before "
<> T.pack (takeDirectory pa)
<> " in PATH."
pure latestVer pure latestVer

View File

@@ -50,6 +50,7 @@ import System.FilePath
import System.IO.Error import System.IO.Error
import qualified Data.Text as T import qualified Data.Text as T
import Text.PrettyPrint.HughesPJClass (prettyShow)
@@ -230,6 +231,10 @@ setCabal ver = do
let destL = targetFile let destL = targetFile
lift $ createLink destL cabalbin lift $ createLink destL cabalbin
liftIO (isShadowed cabalbin) >>= \case
Nothing -> pure ()
Just pa -> lift $ logWarn $ T.pack $ prettyShow (ToolShadowed Cabal pa cabalbin ver)
pure () pure ()
unsetCabal :: ( MonadMask m unsetCabal :: ( MonadMask m

View File

@@ -308,19 +308,21 @@ instance Pretty HadrianNotFound where
pPrint HadrianNotFound = pPrint HadrianNotFound =
text "Could not find Hadrian build files. Does this GHC version support Hadrian builds?" text "Could not find Hadrian build files. Does this GHC version support Hadrian builds?"
data GHCupShadowed = GHCupShadowed data ToolShadowed = ToolShadowed
Tool
FilePath -- shadow binary FilePath -- shadow binary
FilePath -- upgraded binary FilePath -- upgraded binary
Version -- upgraded version Version -- upgraded version
deriving Show deriving Show
instance Pretty GHCupShadowed where instance Pretty ToolShadowed where
pPrint (GHCupShadowed sh up _) = pPrint (ToolShadowed tool sh up _) =
text ("ghcup is shadowed by " text (prettyShow tool
<> " is shadowed by "
<> sh <> sh
<> ". The upgrade will not be in effect, unless you remove " <> ".\nThe upgrade will not be in effect, unless you remove "
<> sh <> sh
<> " or make sure " <> "\nor make sure "
<> takeDirectory up <> takeDirectory up
<> " comes before " <> " comes before "
<> takeDirectory sh <> takeDirectory sh

View File

@@ -442,6 +442,11 @@ setGHC ver sghc mBinDir = do
destL <- binarySymLinkDestination binDir fileWithExt destL <- binarySymLinkDestination binDir fileWithExt
lift $ createLink destL fullF lift $ createLink destL fullF
when (targetFile == "ghc") $
liftIO (isShadowed fullF) >>= \case
Nothing -> pure ()
Just pa -> lift $ logWarn $ T.pack $ prettyShow (ToolShadowed GHC pa fullF (_tvVersion ver))
when (isNothing mBinDir) $ do when (isNothing mBinDir) $ do
-- create symlink for share dir -- create symlink for share dir
when (isNothing . _tvTarget $ ver) $ lift $ symlinkShareDir (fromGHCupPath ghcdir) verS when (isNothing . _tvTarget $ ver) $ lift $ symlinkShareDir (fromGHCupPath ghcdir) verS

View File

@@ -68,6 +68,7 @@ import qualified Data.List.NonEmpty as NE
import qualified Data.ByteString as B import qualified Data.ByteString as B
import qualified Data.Text as T import qualified Data.Text as T
import qualified Text.Megaparsec as MP import qualified Text.Megaparsec as MP
import Text.PrettyPrint.HughesPJClass (prettyShow)
@@ -549,6 +550,10 @@ setHLS ver shls mBinDir = do
when (isNothing mBinDir) $ when (isNothing mBinDir) $
lift warnAboutHlsCompatibility lift warnAboutHlsCompatibility
liftIO (isShadowed wrapper) >>= \case
Nothing -> pure ()
Just pa -> lift $ logWarn $ T.pack $ prettyShow (ToolShadowed HLS pa wrapper ver)
unsetHLS :: ( MonadMask m unsetHLS :: ( MonadMask m
, MonadReader env m , MonadReader env m

View File

@@ -50,6 +50,7 @@ import System.FilePath
import System.IO.Error import System.IO.Error
import qualified Data.Text as T import qualified Data.Text as T
import Text.PrettyPrint.HughesPJClass (prettyShow)
@@ -229,6 +230,10 @@ setStack ver = do
lift $ createLink targetFile stackbin lift $ createLink targetFile stackbin
liftIO (isShadowed stackbin) >>= \case
Nothing -> pure ()
Just pa -> lift $ logWarn $ T.pack $ prettyShow (ToolShadowed Cabal pa stackbin ver)
pure () pure ()

View File

@@ -763,7 +763,7 @@ if [ -z "${BOOTSTRAP_HASKELL_MINIMAL}" ] ; then
do_cabal_config_init $ask_cabal_config_init_answer do_cabal_config_init $ask_cabal_config_init_answer
edo cabal new-update --ignore-project edo cabal update --ignore-project
else # don't install ghc and cabal else # don't install ghc and cabal
case "${plat}" in case "${plat}" in
MSYS*|MINGW*) MSYS*|MINGW*)