Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Model registry
Operate
Terraform modules
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
Reinier Maas
GHC
Commits
f383a242
Commit
f383a242
authored
1 year ago
by
Sylvain Henry
Committed by
Marge Bot
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Modularity: pass TempDir instead of DynFlags (#17957)
parent
e99cf237
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compiler/GHC/SysTools/Process.hs
+5
-6
5 additions, 6 deletions
compiler/GHC/SysTools/Process.hs
compiler/GHC/SysTools/Tasks.hs
+4
-4
4 additions, 4 deletions
compiler/GHC/SysTools/Tasks.hs
with
9 additions
and
10 deletions
compiler/GHC/SysTools/Process.hs
+
5
−
6
View file @
f383a242
...
...
@@ -10,14 +10,14 @@ module GHC.SysTools.Process where
import
GHC.Prelude
import
GHC.Driver.DynFlags
import
GHC.Utils.Exception
import
GHC.Utils.Error
import
GHC.Utils.Outputable
import
GHC.Utils.Panic
import
GHC.Utils.Misc
import
GHC.Utils.Logger
import
GHC.Utils.TmpFs
import
GHC.Utils.CliOption
import
GHC.Types.SrcLoc
(
SrcLoc
,
mkSrcLoc
,
mkSrcSpan
)
import
GHC.Data.FastString
...
...
@@ -32,7 +32,6 @@ import System.IO
import
System.IO.Error
as
IO
import
System.Process
import
GHC.Utils.TmpFs
-- | Enable process jobs support on Windows if it can be expected to work (e.g.
-- @process >= 1.6.9.0@).
...
...
@@ -153,14 +152,14 @@ runSomething logger phase_name pgm args =
runSomethingResponseFile
::
Logger
->
TmpFs
->
DynFlags
->
TempDir
->
(
String
->
String
)
->
String
->
String
->
[
Option
]
->
Maybe
[(
String
,
String
)]
->
IO
()
runSomethingResponseFile
logger
tmpfs
dflags
filter_fn
phase_name
pgm
args
mb_env
=
runSomethingResponseFile
logger
tmpfs
tmp_dir
filter_fn
phase_name
pgm
args
mb_env
=
runSomethingWith
logger
phase_name
pgm
args
$
\
real_args
->
do
fp
<-
getResponseFile
real_args
let
args
=
[
'@'
:
fp
]
...
...
@@ -168,7 +167,7 @@ runSomethingResponseFile logger tmpfs dflags filter_fn phase_name pgm args mb_en
return
(
r
,
()
)
where
getResponseFile
args
=
do
fp
<-
newTempName
logger
tmpfs
(
tmp
Dir
dflags
)
TFL_CurrentModule
"rsp"
fp
<-
newTempName
logger
tmpfs
tmp
_dir
TFL_CurrentModule
"rsp"
withFile
fp
WriteMode
$
\
h
->
do
hSetEncoding
h
utf8
hPutStr
h
$
unlines
$
map
escape
args
...
...
This diff is collapsed.
Click to expand it.
compiler/GHC/SysTools/Tasks.hs
+
4
−
4
View file @
f383a242
...
...
@@ -117,7 +117,7 @@ runCpp logger tmpfs dflags args = traceSystoolCommand logger "cpp" $ do
userOpts_c
=
map
Option
$
getOpts
dflags
opt_c
args2
=
args0
++
args
++
userOpts_c
mb_env
<-
getGccEnv
args2
runSomethingResponseFile
logger
tmpfs
dflags
cc_filter
"C pre-processor"
p
runSomethingResponseFile
logger
tmpfs
(
tmpDir
dflags
)
cc_filter
"C pre-processor"
p
args2
mb_env
-- | Run the Haskell C preprocessor.
...
...
@@ -148,7 +148,7 @@ runCc mLanguage logger tmpfs dflags args = traceSystoolCommand logger "cc" $ do
-- We take care to pass -optc flags in args1 last to ensure that the
-- user can override flags passed by GHC. See #14452.
mb_env
<-
getGccEnv
args2
runSomethingResponseFile
logger
tmpfs
dflags
cc_filter
dbgstring
prog
args2
runSomethingResponseFile
logger
tmpfs
(
tmpDir
dflags
)
cc_filter
dbgstring
prog
args2
mb_env
where
-- force the C compiler to interpret this file as C when
...
...
@@ -275,7 +275,7 @@ runLink logger tmpfs dflags args = traceSystoolCommand logger "linker" $ do
optl_args
=
map
Option
(
getOpts
dflags
opt_l
)
args2
=
args0
++
args
++
optl_args
mb_env
<-
getGccEnv
args2
runSomethingResponseFile
logger
tmpfs
dflags
ld_filter
"Linker"
p
args2
mb_env
runSomethingResponseFile
logger
tmpfs
(
tmpDir
dflags
)
ld_filter
"Linker"
p
args2
mb_env
where
ld_filter
=
case
(
platformOS
(
targetPlatform
dflags
))
of
OSSolaris2
->
sunos_ld_filter
...
...
@@ -339,7 +339,7 @@ runMergeObjects logger tmpfs dflags args =
if
toolSettings_mergeObjsSupportsResponseFiles
(
toolSettings
dflags
)
then
do
mb_env
<-
getGccEnv
args2
runSomethingResponseFile
logger
tmpfs
dflags
id
"Merge objects"
p
args2
mb_env
runSomethingResponseFile
logger
tmpfs
(
tmpDir
dflags
)
id
"Merge objects"
p
args2
mb_env
else
do
runSomething
logger
"Merge objects"
p
args2
...
...
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