Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments of -with-rtsopts are split by whitespace #101

Closed
fendor opened this issue Apr 10, 2020 · 1 comment
Closed

Arguments of -with-rtsopts are split by whitespace #101

fendor opened this issue Apr 10, 2020 · 1 comment

Comments

@fendor
Copy link
Contributor

fendor commented Apr 10, 2020

Reference: haskell/haskell-ide-engine#1725

UnitInfo
  { uiUnitId = UnitId "fprog-0.1.0.0-inplace-fprog"
  , uiPackageId =
      ( "fprog"
      , Version { versionBranch = [ 0 , 1 , 0 , 0 ] , versionTags = [] }
      )
  , uiComponents =
      fromList
        [ ( ChExeName "fprog"
          , ChComponentInfo
              { ciComponentName = ChExeName "fprog"
              , ciGhcOptions =
                  [ ...
                  , "-j"
                  , "-threaded"
                  , "-with-rtsopts=\"-N"
                  , "-A32m\""
                  , "-threaded"
                  , "-rtsopts"
                  , "-with-rtsopts=-N"
                  ]
              , ciSourceDirs = [ "app" ]
              , ciEntrypoints =
                  ChExeEntrypoint { chMainIs = "Main.hs" , chOtherModules = [] }
              }
          )
        ]
  , uiCompilerId =
      ( "GHC"
      , Version { versionBranch = [ 8 , 6 , 5 ] , versionTags = [] }
      )
  , uiPackageFlags = []
  , uiConfigFlags = []
  , uiNonDefaultConfigFlags = []
  , uiModTimes =
      UnitModTimes
        { umtPkgYaml = Nothing
        , umtCabalFile =
            ( "/home/baldr/Documents/haskell/fprog/./fprog.cabal"
            , 1586340677
            )
        , umtSetupConfig =
            Just
              ( "/home/baldr/Documents/haskell/fprog/dist-newstyle/build/x86_64-linux/ghc-8.6.5/fprog-0.1.0.0/x/fprog/setup-config"
              , 1586339845
              )
        }
  }

Reproduce:
Add to some executable stanza the lines: -with-rtsopts="-N -A32m"
Personally, I obtained this UnitInfo via logs from HIE and couldnt figure out how to use plain cabal-helper for this.

Expected:
I would expect it to be parsed as one flag.

@DanielG
Copy link
Owner

DanielG commented Apr 10, 2020

-with-rtsopts="-N -A32m" is the wrong syntax. Cabal expects Haskell style strings, not shell style, so: "-with-rtsopts=-N -A32m". See https://www.haskell.org/cabal/users-guide/developing-packages.html#package-descriptions

Cabal should probably complain about the stray " though, I'd report a Cabal bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants