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

cabal run, without target, "-- +RTS .." does not work with "-w" #10487

Open
jwaldmann opened this issue Oct 29, 2024 · 2 comments
Open

cabal run, without target, "-- +RTS .." does not work with "-w" #10487

jwaldmann opened this issue Oct 29, 2024 · 2 comments

Comments

@jwaldmann
Copy link

With cabal run I wan to use -w to select a compiler, an also set RTS options.

This prints a nice suggestion

$ cabal run -w /opt/ghc/ghc-9.10.1/bin/ghc  +RTS -s
Warning: Your RTS options are applied to cabal, not the executable. Use '--'
to separate cabal options from your executable options. 

but

$ cabal run -w /opt/ghc/ghc-9.10.1/bin/ghc  -- +RTS -s
Error: [Cabal-7129]
Unrecognised target '+RTS'.
Expected a meta-target 'all' or component kind filter or component name or package name or package directory or package .cabal file or component name or module name or file, rather than '+RTS'.

it works when I write a target

$ cabal run all -w /opt/ghc/ghc-9.10.1/bin/ghc  -- +RTS -s

My version is

$ cabal --version
cabal-install version 3.12.1.0
compiled using version 3.12.1.0 of the Cabal library 
@geekosaur
Copy link
Collaborator

FWIW, my first thought was that it needed two --s, but:

hilfy «cabal:master$» Z$ cabal run -w ghc-9.10 -- -- +RTS -s
Error: [Cabal-7131]
Unknown target '--'.
There is no component '--'.
The project has no package '--'.


(I don't know where the extra two newlines came from.)

@jasagredo
Copy link
Collaborator

Does cabal run -- +RTS ... work? I think the issue is that it is considering "+RTS" to be the target and that the issue is not with "-w"

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

No branches or pull requests

3 participants