Opened 5 years ago

Last modified 8 days ago

#4243 new task

Make a proper options parser for the RTS

Reported by: igloo Owned by:
Priority: normal Milestone: 7.12.1
Component: Runtime System Version: 6.13
Keywords: Cc:…, simonmar, osa1
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking: #7535
Related Tickets: #9839 Differential Revisions:


The RTS options parsing is getting increasingly crufty, and the new rtsOptsEnabled options have made it even worse. We should really have a proper options parser.

Change History (17)

comment:1 Changed 5 years ago by simonmar


comment:2 Changed 5 years ago by igloo

It should also be possible to link against the RTS in such a way that it won't try to parse the RTS arguments at all, e.g. so +RTS would be passed to the program as an argument (as opposed to the RTS failing, as it currently does when given that argument if linked with -no-rtsopts).

comment:3 Changed 5 years ago by igloo

See also #3910.

comment:4 Changed 4 years ago by igloo

  • Milestone changed from 7.4.1 to 7.6.1


comment:5 Changed 3 years ago by igloo

  • difficulty set to Unknown
  • Milestone changed from 7.6.1 to 7.8.1

comment:6 Changed 2 years ago by liyang

  • Cc… added

comment:7 Changed 16 months ago by thoughtpolice

  • Milestone changed from 7.8.3 to 7.10.1

Bumping priority down (these tickets haven't been closely followed or fixed in 7.4), and moving out to 7.10 and out of 7.8.3.

comment:8 Changed 16 months ago by thoughtpolice

  • Priority changed from high to normal

Actually dropping priority. :)

comment:9 Changed 9 months ago by thomie

  • Cc simonmar added

comment:10 Changed 8 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:11 Changed 5 months ago by carlostome

Maybe we should change rts/RtsFlags.c to make use of <getopt.h> because now the option parser is a bit scaring. I think I can do it myself. Any suggestions?

comment:12 Changed 5 months ago by thomie

Make sure that whatever you do also works, and behaves the same, on Windows, Mac, Solaris, FreeBSD. At least in theory. Is getopt.h posix only, or is avaible the way ghc is built on Windows (I don't know). would also need updating?

I noticed Python keeps their own copy of getopt, would that be an option?


"Move our own getopt() implementation to _PyOS_GetOpt(), and use it regardless of whether the system getopt() does what we want. This avoids the hassle with prototypes and externs, and the check to see if the system getopt() does what we want."

comment:13 Changed 5 months ago by thomie

  • Blocking 7535 added

comment:14 Changed 5 months ago by carlostome

  • Owner set to carlostome

comment:15 Changed 8 weeks ago by osa1

  • Cc osa1 added

What keeps us from implementing RTS arg parser in Haskell?

comment:16 Changed 13 days ago by carlostome

  • Owner carlostome deleted

comment:17 Changed 8 days ago by bgamari

osa1, I think for the sake of simplicity it would be best to avoid going down that road. The RTS really just needs to work, even if Haskell-land is broken (e.g. as is often the case when debugging RTS bugs or bringing up new platforms).

Note: See TracTickets for help on using tickets.