Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
ghcup-hs
Merge requests
!13
Support Hadrian provided bindists
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Support Hadrian provided bindists
puffnfresh/ghcup-hs:issues/31/hadrian-bindists
into
master
Overview
10
Commits
3
Pipelines
3
Changes
1
2 unresolved threads
Show all comments
Merged
puffnfresh
requested to merge
puffnfresh/ghcup-hs:issues/31/hadrian-bindists
into
master
4 years ago
Overview
10
Commits
3
Pipelines
3
Changes
1
2 unresolved threads
Show all comments
Expand
Fixes
#31 (closed)
0
0
Merge request reports
Compare
master
version 2
d276bfb3
4 years ago
version 1
a186b077
4 years ago
master (base)
and
latest version
latest version
febe6fcb
3 commits,
4 years ago
version 2
d276bfb3
2 commits,
4 years ago
version 1
a186b077
1 commit,
4 years ago
1 file
+
19
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
lib/GHCup/Utils.hs
+
19
−
8
Options
@@ -54,7 +54,7 @@ import System.IO.Error
import
System.Posix.FilePath
(
getSearchPath
,
takeFileName
)
import
System.Posix.Files.ByteString
(
readSymbolicLink
)
import
System.Posix.Files.ByteString
(
getSymbolicLinkStatus
,
isSymbolicLink
,
readSymbolicLink
)
import
Text.Regex.Posix
import
URI.ByteString
@@ -417,13 +417,24 @@ 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"
)
pure
.
filter
(
\
x
->
not
$
symver
`
B
.
isSuffixOf
`
toFilePath
x
)
$
files
let
ghcbinPath
=
toFilePath
(
bindir
</>
ghcbin
)
ghcIsHadrian
<-
liftIO
$
isHadrian
ghcbinPath
onlyUnversioned
<-
if
ghcIsHadrian
then
pure
id
else
do
(
Just
symver
)
<-
(
B
.
stripPrefix
(
toFilePath
ghcbin
<>
"-"
)
.
takeFileName
)
<$>
(
liftIO
$
readSymbolicLink
ghcbinPath
)
when
(
B
.
null
symver
)
(
throwIO
$
userError
$
"Fatal: ghc symlink target is broken"
)
pure
$
filter
(
\
x
->
not
$
symver
`
B
.
isSuffixOf
`
toFilePath
x
)
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
::
ByteString
->
IO
Bool
isHadrian
=
(
not
.
isSymbolicLink
<$>
)
.
getSymbolicLinkStatus
-- | This file, when residing in ~/.ghcup/ghc/<ver>/ signals that
Loading