RTS options broken with Hadrian builds?
I have been using GHC HEAD GitLab artifacts recently, and I've discovered that the RTS options appear to be broken, but only for some artifacts. To reproduce this bug, you'll first need a Haskell program like the one below. (The exact implementation of this program isn't particularly important for the purposes of this bug.)
module Main where
import Control.Concurrent
main :: IO ()
main = getNumCapabilities >>= print
If I use a validate-x86_64-linux-deb9-hadrian
artifact from here, I observe the following errors when I try to use various RTS options:
$ ghc-9.1.0.20201217-hadrian/bin/ghc -fforce-recomp -threaded Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
$ ./Main +RTS -maxN4
Main: Most RTS options are disabled. Link with -rtsopts to enable them.
$ ./Main +RTS -N4
Main: unknown RTS option: -N4
Main:
Main: Usage: <prog> <args> [+RTS <rtsopts> | -RTS <args>] ... --RTS <args>
Main:
Main: <elided>
$ ghc-9.1.0.20201217-hadrian/bin/ghc -fforce-recomp -threaded -rtsopts Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
$ ./Main +RTS -maxN4
Main: bad RTS option: -maxN4
$ ./Main +RTS -N4
Main: unknown RTS option: -N4
Main:
Main: Usage: <prog> <args> [+RTS <rtsopts> | -RTS <args>] ... --RTS <args>
Main:
Main: <elided>
On the other hand, I experience no such issues if I use a different artifact from the same pipeline, such as the validate-x86_64-linux-deb9-integer-simple
artifact from here:
$ ghc-9.1.0.20201217-integer-simple/bin/ghc -fforce-recomp -threaded Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
$ ./Main +RTS -maxN4
4
$ ./Main +RTS -N4
4
$ ghc-9.1.0.20201217-integer-simple/bin/ghc -fforce-recomp -threaded -rtsopts Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
$ ./Main +RTS -maxN4
4
$ ./Main +RTS -N4
4
My best explanation as to why the results differ between artifacts is that the validate-x86_64-linux-deb9-hadrian
artifact was built with Hadrian, while the validate-x86_64-linux-deb9-integer-simple
artifact was built with Make. As a result, I'm speculatively labeling this as a hadrian issue.