Opened 5 years ago

Last modified 4 weeks ago

#4243 new task

Make a proper options parser for the RTS

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

Description

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 (14)

comment:1 Changed 5 years ago by simonmar

Agree.

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 4 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

Punting

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 hackage.haskell.org@… added

comment:7 Changed 12 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 12 months ago by thoughtpolice

  • Priority changed from high to normal

Actually dropping priority. :)

comment:9 Changed 5 months ago by thomie

  • Cc simonmar added

comment:10 Changed 4 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 4 weeks 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 4 weeks 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). configure.ac would also need updating?

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

From https://hg.python.org/cpython/rev/a826a46bae54:

"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 4 weeks ago by thomie

  • Blocking 7535 added

comment:14 Changed 4 weeks ago by carlostome

  • Owner set to carlostome
Note: See TracTickets for help on using tickets.