Compare commits

...

14 Commits

Author SHA1 Message Date
86c144b285 Merge remote-tracking branch 'remotes/origin/merge-requests/12' into hadrian 2020-06-20 14:40:47 +02:00
7ec6e8604c Slight style changes 2020-06-20 14:37:38 +02:00
de70f4820f Merge remote-tracking branch 'origin/merge-requests/13' into hadrian 2020-06-20 12:39:21 +02:00
Brian McKenna
febe6fcb35 Fix behaviour of non-Hadrian builds
getFileStatus will resolve symbolic links. getSymbolicLinkStatus doesn't.
2020-06-20 03:38:41 +00:00
Brian McKenna
3055529d4c Update GHCupDownloads with ghcup-0.0.2.json content 2020-06-19 23:17:34 +00:00
Brian McKenna
d276bfb3ec Extract Hadrian logic to isHadrian function with comment 2020-06-19 23:06:46 +00:00
9db0664465 Add hie.yaml 2020-06-19 19:44:30 +02:00
e9c727647a Update .gitigore 2020-06-19 19:42:55 +02:00
55eef8a3d3 Merge branch 'redhat' 2020-06-19 19:22:56 +02:00
d07ad3eb26 Update ghcup-0.0.2.json with redhat wrt #29 2020-06-19 10:49:31 +02:00
Sigmund Vestergaard
ad53b141c7 Removed reference to specific version of RHEL in GHCupDownloads.hs 2020-06-19 10:49:31 +02:00
Sigmund Vestergaard
23c13a07a9 Added support for RedHat in lib/GHCup/Data/GHCupDownloads.hs 2020-06-19 10:49:31 +02:00
Brian McKenna
a186b07763 Support Hadrian provided bindists
Fixes #31
2020-06-18 14:03:51 +00:00
puffnfresh
1ca628aba1 Fix dlSubdir of ghc-8.10.1-x86_64-unknown-linux for Linux_Alpine 2020-06-18 07:52:34 -04:00
5 changed files with 84 additions and 8 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,6 @@
.ghci
.vim
codex.tags
dist-newstyle/
cabal.project.local
.stack-work/

View File

@@ -597,6 +597,13 @@
"dlUri": "https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-x86_64-apple-darwin.tar.xz"
}
},
"Linux_RedHat": {
"unknown_versioning": {
"dlHash": "355bd85c69933c31bbe99b4269ce719acfd0aad0b45e359ac39b9bb13996acc6",
"dlSubdir": "ghc-8.6.3",
"dlUri": "https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-x86_64-centos7-linux.tar.xz"
}
},
"Linux_UnknownLinux": {
"unknown_versioning": {
"dlHash": "52ae92f4e8bb2ac0b7847287ea3da37081f5f7bf8bbb7c78ac35fde537d1a89f",
@@ -687,7 +694,7 @@
"Linux_Alpine": {
"unknown_versioning": {
"dlHash": "cb13b645d103e2fba2eb8dfcc4e5f2fbd9550c00c4df42f342b4210436dcb8a8",
"dlSubdir": "ghc-8.10.1",
"dlSubdir": "ghc-8.10.1-x86_64-unknown-linux",
"dlUri": "https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-alpine3.10-linux-integer-simple.tar.xz"
}
},
@@ -732,6 +739,13 @@
"dlUri": "https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-apple-darwin.tar.xz"
}
},
"Linux_RedHat": {
"unknown_versioning": {
"dlHash": "0618b94854edc6be5302489df905e627820b71be6b66c950f5e3088fe92df0a1",
"dlSubdir": "ghc-8.10.1",
"dlUri": "https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-centos7-linux.tar.xz"
}
},
"Linux_UnknownLinux": {
"unknown_versioning": {
"dlHash": "3c4cd72b4806045779739e8f5d1658e30e57123d88c2c8966422cdbcae448470",
@@ -871,6 +885,13 @@
"dlUri": "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-apple-darwin.tar.xz"
}
},
"Linux_RedHat": {
"unknown_versioning": {
"dlHash": "80ab566f4411299f9e5922d60749ca80f989d697db19e03ed875619d699f0edf",
"dlSubdir": "ghc-8.6.5",
"dlUri": "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-centos7-linux.tar.xz"
}
},
"Linux_UnknownLinux": {
"unknown_versioning": {
"dlHash": "cf78b53eaf336083e7a05f4a3000afbae4abe5bbc77ef80cc40e09d04ac5b4a1",
@@ -1124,6 +1145,13 @@
"dlUri": "https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-x86_64-apple-darwin.tar.xz"
}
},
"Linux_RedHat": {
"unknown_versioning": {
"dlHash": "6cdd34e4dbaeb801e805811f91cf43a2d5f64b22f884718ffbd3542a2f4dd14f",
"dlSubdir": "ghc-8.8.1",
"dlUri": "https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-x86_64-centos7-linux.tar.xz"
}
},
"Linux_UnknownLinux": {
"unknown_versioning": {
"dlHash": "851a78df620bc056c34b252c97040d5755e294993fa8afa5429708b5229204d6",
@@ -1493,6 +1521,13 @@
"dlUri": "https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-apple-darwin.tar.xz"
}
},
"Linux_RedHat": {
"unknown_versioning": {
"dlHash": "f065a017d7a38f235f186ffe32d8261a4fd39c7e945d5cde85c0984c2569db99",
"dlSubdir": "ghc-8.8.2",
"dlUri": "https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-centos7-linux.tar.xz"
}
},
"Linux_UnknownLinux": {
"unknown_versioning": {
"dlHash": "dbe2db717b33460f790e155e487d2a31c9b21a9d245f0c9490ad65844c3ea21f",
@@ -1866,6 +1901,13 @@
"dlUri": "https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-apple-darwin.tar.xz"
}
},
"Linux_RedHat": {
"unknown_versioning": {
"dlHash": "83a96650f5a92b1e4d7651d256d6438624342d40e780e68125033435a54cd674",
"dlSubdir": "ghc-8.4.4",
"dlUri": "https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-x86_64-centos70-linux.tar.xz"
}
},
"Linux_UnknownLinux": {
"unknown_versioning": {
"dlHash": "8ab2befddc14d1434d0aad0c5d3c7e0c2b78ff84caa3429fa62527bfc6b86095",
@@ -1996,6 +2038,13 @@
"dlUri": "https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-apple-darwin.tar.xz"
}
},
"Linux_RedHat": {
"unknown_versioning": {
"dlHash": "4b2b5313f7c12b81e54efcb26705fa9e4ad5b98f2b58bfc76fb0c9ba1d55eb1f",
"dlSubdir": "ghc-8.8.3",
"dlUri": "https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-centos7-linux.tar.xz"
}
},
"Linux_UnknownLinux": {
"unknown_versioning": {
"dlHash": "45ee1de3bfc98cbcc4886b65fc7651ade2d3820aa85eac2dbe9bc7bf91e7c818",

4
hie.yaml Normal file
View File

@@ -0,0 +1,4 @@
cradle:
cabal:
- path: "."
component: "ghcup:lib:ghcup"

View File

@@ -883,7 +883,7 @@ ghc_8101_64_darwin = DownloadInfo
ghc_8101_64_alpine :: DownloadInfo
ghc_8101_64_alpine = DownloadInfo
[uri|https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-alpine3.10-linux-integer-simple.tar.xz|]
(Just [rel|ghc-8.10.1|])
(Just [rel|ghc-8.10.1-x86_64-unknown-linux|])
"cb13b645d103e2fba2eb8dfcc4e5f2fbd9550c00c4df42f342b4210436dcb8a8"
@@ -1360,6 +1360,7 @@ ghcupDownloads = M.fromList
, M.fromList [(Nothing, ghc_844_64_fedora)]
)
, (Linux CentOS, M.fromList [(Nothing, ghc_844_64_centos)])
, (Linux RedHat, M.fromList [(Nothing, ghc_844_64_centos)])
, ( Linux AmazonLinux
, M.fromList [(Nothing, ghc_844_64_centos)]
)
@@ -1509,6 +1510,7 @@ ghcupDownloads = M.fromList
)
, (Linux Fedora, M.fromList [(Nothing, ghc_863_64_fedora)])
, (Linux CentOS, M.fromList [(Nothing, ghc_863_64_centos)])
, (Linux RedHat, M.fromList [(Nothing, ghc_863_64_centos)])
, ( Linux AmazonLinux
, M.fromList [(Nothing, ghc_863_64_centos)]
)
@@ -1612,6 +1614,7 @@ ghcupDownloads = M.fromList
)
, (Linux Fedora, M.fromList [(Nothing, ghc_865_64_fedora)])
, (Linux CentOS, M.fromList [(Nothing, ghc_865_64_centos)])
, (Linux RedHat, M.fromList [(Nothing, ghc_865_64_centos)])
, ( Linux AmazonLinux
, M.fromList [(Nothing, ghc_865_64_centos)]
)
@@ -1665,6 +1668,7 @@ ghcupDownloads = M.fromList
)
, (Linux Fedora, M.fromList [(Nothing, ghc_881_64_fedora)])
, (Linux CentOS, M.fromList [(Nothing, ghc_881_64_centos)])
, (Linux RedHat, M.fromList [(Nothing, ghc_881_64_centos)])
, ( Linux AmazonLinux
, M.fromList [(Nothing, ghc_881_64_centos)]
)
@@ -1718,6 +1722,7 @@ ghcupDownloads = M.fromList
)
, (Linux Fedora, M.fromList [(Nothing, ghc_882_64_fedora)])
, (Linux CentOS, M.fromList [(Nothing, ghc_882_64_centos)])
, (Linux RedHat, M.fromList [(Nothing, ghc_882_64_centos)])
, ( Linux AmazonLinux
, M.fromList [(Nothing, ghc_882_64_centos)]
)
@@ -1771,6 +1776,7 @@ ghcupDownloads = M.fromList
)
, (Linux Fedora, M.fromList [(Nothing, ghc_883_64_fedora)])
, (Linux CentOS, M.fromList [(Nothing, ghc_883_64_centos)])
, (Linux RedHat, M.fromList [(Nothing, ghc_883_64_centos)])
, ( Linux AmazonLinux
, M.fromList [(Nothing, ghc_883_64_centos)]
)
@@ -1834,6 +1840,7 @@ ghcupDownloads = M.fromList
, (Just [vers|7|], ghc_8101_64_centos)
]
)
, ( Linux RedHat, M.fromList [(Nothing, ghc_8101_64_centos)])
, ( Linux AmazonLinux
, M.fromList [(Nothing, ghc_8101_64_centos)]
)

View File

@@ -417,13 +417,26 @@ ghcToolFiles ver = do
([s|^([a-zA-Z0-9_-]*[a-zA-Z0-9_]-)?ghc$|] :: ByteString)
)
(Just symver) <-
(B.stripPrefix (toFilePath ghcbin <> "-") . takeFileName)
<$> (liftIO $ readSymbolicLink $ toFilePath (bindir </> ghcbin))
when (B.null symver)
(throwIO $ userError $ "Fatal: ghc symlink target is broken")
let ghcbinPath = bindir </> ghcbin
ghcIsHadrian <- liftIO $ isHadrian ghcbinPath
onlyUnversioned <- if ghcIsHadrian
then pure id
else do
(Just symver) <-
(B.stripPrefix (toFilePath ghcbin <> "-") . takeFileName)
<$> (liftIO $ readSymbolicLink $ toFilePath ghcbinPath)
when (B.null symver)
(throwIO $ userError $ "Fatal: ghc symlink target is broken")
pure $ filter (\x -> not $ symver `B.isSuffixOf` toFilePath x)
pure . filter (\x -> not $ symver `B.isSuffixOf` toFilePath x) $ files
pure $ onlyUnversioned files
where
-- GHC is moving some builds to Hadrian for bindists,
-- which doesn't create versioned binaries.
-- https://gitlab.haskell.org/haskell/ghcup-hs/issues/31
isHadrian :: Path Abs -- ^ ghcbin path
-> IO Bool
isHadrian = fmap (/= SymbolicLink) . getFileType
-- | This file, when residing in ~/.ghcup/ghc/<ver>/ signals that