Skip to content

Commit

Permalink
Support --RTS
Browse files Browse the repository at this point in the history
… as suggested by @geekosaur
  • Loading branch information
Gabriella439 committed Oct 24, 2023
1 parent 1c19296 commit bbe0bd2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple/Program/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ runGHCWithResponseFile workDir fileNameTemplate encoding verbosity ghcProg comp
case arg of
"+RTS" -> (True, responseFileArgs, arg : otherArgs)
"-RTS" -> (False, responseFileArgs, arg : otherArgs)
"--RTS" -> (False, args, [ arg ])

This comment has been minimized.

Copy link
@geekosaur

geekosaur Oct 24, 2023

You may want to support it properly, but this also requires parsing --.

The rules are:

  • +RTS begins a group of RTS options
  • -RTS ends a group of RTS options; another +RTS group may follow
  • --RTS stops parsing of RTS options completely (a following +RTS will be passed on to the program)
  • -- stops parsing of both RTS and program options
_
| isRTSOption -> (isRTSOption, responseFileArgs, arg : otherArgs)
| otherwise -> (isRTSOption, arg : responseFileArgs, otherArgs)
Expand Down

0 comments on commit bbe0bd2

Please sign in to comment.