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
Commits
c76cce58
Verified
Commit
c76cce58
authored
4 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Add a --set option to install/compile, fixes
#81
parent
4fef93b7
No related branches found
No related tags found
1 merge request
!42
Settings
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/ghcup/Main.hs
+29
-10
29 additions, 10 deletions
app/ghcup/Main.hs
with
29 additions
and
10 deletions
app/ghcup/Main.hs
+
29
−
10
View file @
c76cce58
...
...
@@ -122,6 +122,7 @@ data InstallOptions = InstallOptions
{
instVer
::
Maybe
ToolVersion
,
instPlatform
::
Maybe
PlatformRequest
,
instBindist
::
Maybe
URI
,
instSet
::
Bool
}
data
SetCommand
=
SetGHC
SetOptions
...
...
@@ -158,6 +159,7 @@ data GHCCompileOptions = GHCCompileOptions
,
patchDir
::
Maybe
(
Path
Abs
)
,
crossTarget
::
Maybe
Text
,
addConfArgs
::
[
Text
]
,
setCompile
::
Bool
}
data
CabalCompileOptions
=
CabalCompileOptions
...
...
@@ -470,7 +472,7 @@ Examples:
installOpts
::
Parser
InstallOptions
installOpts
=
(
\
p
(
u
,
v
)
->
InstallOptions
v
p
u
)
(
\
p
(
u
,
v
)
b
->
InstallOptions
v
p
u
b
)
<$>
(
optional
(
option
(
eitherReader
platformParser
)
...
...
@@ -495,6 +497,12 @@ installOpts =
)
<|>
((,)
<$>
pure
Nothing
<*>
optional
toolVersionArgument
)
)
<*>
flag
False
True
(
long
"set"
<>
help
"Set as active version after install"
)
setParser
::
Parser
(
Either
SetCommand
SetOptions
)
...
...
@@ -664,7 +672,7 @@ Examples:
ghcCompileOpts
::
Parser
GHCCompileOptions
ghcCompileOpts
=
(
\
CabalCompileOptions
{
..
}
crossTarget
addConfArgs
->
GHCCompileOptions
{
..
}
(
\
CabalCompileOptions
{
..
}
crossTarget
addConfArgs
setCompile
->
GHCCompileOptions
{
..
}
)
<$>
cabalCompileOpts
<*>
(
optional
...
...
@@ -676,6 +684,12 @@ ghcCompileOpts =
)
)
<*>
many
(
argument
str
(
metavar
"CONFIGURE_ARGS"
<>
help
"Additional arguments to configure, prefix with '-- ' (longopts)"
))
<*>
flag
False
True
(
long
"set"
<>
help
"Set as active version after install"
)
cabalCompileOpts
::
Parser
CabalCompileOptions
cabalCompileOpts
=
...
...
@@ -1158,12 +1172,14 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
Nothing
->
runInstTool
$
do
v
<-
liftE
$
fromVersion
dls
instVer
GHC
liftE
$
installGHCBin
dls
(
_tvVersion
v
)
(
fromMaybe
pfreq
instPlatform
)
when
instSet
$
void
$
liftE
$
setGHC
v
SetGHCOnly
Just
uri
->
runInstTool'
appstate
{
settings
=
settings
{
noVerify
=
True
}}
$
do
v
<-
liftE
$
fromVersion
dls
instVer
GHC
liftE
$
installGHCBindist
(
DownloadInfo
uri
(
Just
$
RegexDir
"ghc-.*"
)
""
)
(
_tvVersion
v
)
(
fromMaybe
pfreq
instPlatform
)
when
instSet
$
void
$
liftE
$
setGHC
v
SetGHCOnly
)
>>=
\
case
VRight
_
->
do
...
...
@@ -1376,14 +1392,17 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
pure
$
ExitFailure
8
Compile
(
CompileGHC
GHCCompileOptions
{
..
})
->
(
runCompileGHC
$
liftE
$
compileGHC
dls
(
GHCTargetVersion
crossTarget
targetVer
)
bootstrapGhc
jobs
buildConfig
patchDir
addConfArgs
pfreq
(
runCompileGHC
$
do
liftE
$
compileGHC
dls
(
GHCTargetVersion
crossTarget
targetVer
)
bootstrapGhc
jobs
buildConfig
patchDir
addConfArgs
pfreq
when
setCompile
$
void
$
liftE
$
setGHC
(
GHCTargetVersion
crossTarget
targetVer
)
SetGHCOnly
)
>>=
\
case
VRight
_
->
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment