Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Passing RTS options using --ghc-option doesn't work #986

Closed
tibbe opened this Issue · 2 comments

2 participants

@tibbe
Owner

To reproduce using Cabal itself:

cd Cabal
cabal configure --enable-tests --ghc-option='+RTS -M512m -RTS' -v

Expected result: Setup.hs should be compile with +RTS -M512m -RTS.

Actual result:

/usr/local/bin/ghc --numeric-version
looking for tool "ghc-pkg" near compiler in /usr/local/bin
found ghc-pkg in /usr/local/bin/ghc-pkg
/usr/local/bin/ghc-pkg --version
/usr/local/bin/ghc --supported-languages
/usr/local/bin/ghc --info +RTS -M512m -RTS
Reading available packages...
Choosing modular solver.
Resolving dependencies...
creating dist/setup
/usr/local/bin/ghc --make ./Setup.hs -o ./dist/setup/setup -odir ./dist/setup -hidir ./dist/setup -i -i. +RTS -M512m -RTS
target `+RTS -M512m -RTS' is not a module name or a source file

However, pasting

/usr/local/bin/ghc --make ./Setup.hs -o ./dist/setup/setup -odir ./dist/setup -hidir ./dist/setup -i -i. +RTS -M512m -RTS

into the shell works (i.e. GHC starts compiling Setup.hs). Perhaps Cabal is passing the command line arguments incorrectly somehow. Here's the output with -v3:


searching for ghc in path.
found ghc at /usr/local/bin/ghc
("/usr/local/bin/ghc",["--numeric-version"])
/usr/local/bin/ghc is version 7.4.2
looking for tool "ghc-pkg" near compiler in /usr/local/bin
found ghc-pkg in /usr/local/bin/ghc-pkg
("/usr/local/bin/ghc-pkg",["--version"])
/usr/local/bin/ghc-pkg is version 7.4.2
("/usr/local/bin/ghc",["--supported-languages"])
("/usr/local/bin/ghc",["--info","+RTS -M512m -RTS"])
Reading installed packages...
("/usr/local/bin/ghc-pkg",["dump","--global","-v0"])
("/usr/local/bin/ghc-pkg",["dump","--user","-v0"])
("/usr/local/bin/ghc",["--print-libdir","+RTS -M512m -RTS"])
Reading available packages...
Choosing modular solver.
Resolving dependencies...
[__0] trying: Cabal-1.17.0 (user goal)
[__1] trying: base-4.5.1.0/installed-8a2... (dependency of Cabal-1.17.0)
[__2] trying: rts-1.0/installedbuil... (dependency of
base-4.5.1.0/installed-8a2...)
[__3] trying: integer-gmp-0.4.0.0/installed-c15... (dependency of
base-4.5.1.0/installed-8a2...)
[__4] trying: ghc-prim-0.2.0.0/installed-23f... (dependency of
base-4.5.1.0/installed-8a2...)
[__5] trying: Cabal-1.17.0:+base4
[__6] trying: Cabal-1.17.0:+base3
[__7] rejecting: Cabal-1.17.0:!test (global constraint requires opposite flag
selection)
[__7] trying: Cabal-1.17.0:*test
[__8] trying: bytestring-0.9.2.1/installed-ac1... (dependency of
Cabal-1.17.0:*test)
[__9] trying: extensible-exceptions-0.1.1.4/installed-3d9... (dependency of
Cabal-1.17.0:*test)
[_10] trying: directory-1.1.0.2/installed-ef4... (dependency of
Cabal-1.17.0:*test)
[_11] trying: old-time-1.1.0.0/installed-3e0... (dependency of
directory-1.1.0.2/installed-ef4...)
[_12] trying: old-locale-1.0.0.4/installed-b1d... (dependency of
old-time-1.1.0.0/installed-3e0...)
[_13] trying: process-1.1.0.1/installed-c55... (dependency of
Cabal-1.17.0:*test)
[_14] trying: QuickCheck-2.5/installed-e22... (dependency of
Cabal-1.17.0:*test)
[_15] trying: template-haskell-2.7.0.0/installed-e05... (dependency of
QuickCheck-2.5/installed-e22...)
[_16] trying: pretty-1.1.1.0/installed-867... (dependency of
template-haskell-2.7.0.0/installed-e05...)
[_17] trying: containers-0.4.2.1/installed-efa... (dependency of
template-haskell-2.7.0.0/installed-e05...)
[_18] trying: deepseq-1.3.0.0/installed-c8a... (dependency of
containers-0.4.2.1/installed-efa...)
[_19] trying: array-0.4.0.0/installed-4f6... (dependency of
containers-0.4.2.1/installed-efa...)
[_20] trying: random-1.0.1.1/installed-de8... (dependency of
QuickCheck-2.5/installed-e22...)
[_21] trying: time-1.4/installed-b8e... (dependency of
random-1.0.1.1/installed-de8...)
[_22] trying: HUnit-1.2.5.1/installed-04f... (dependency of
Cabal-1.17.0:*test)
[_23] trying: test-framework-hunit-0.2.7/installed-818... (dependency of
Cabal-1.17.0:*test)
[_24] next goal: test-framework-quickcheck2 (dependency of Cabal-1.17.0:*test)
[_24] rejecting: test-framework-quickcheck2-0.2.12.2/installed-b32...
(conflict: QuickCheck==2.5/installed-e22..., test-framework-quickcheck2 =>
QuickCheck==2.4.2/installed-ce0...)
[_15] fail (backjumping, conflict set: Cabal, QuickCheck,
test-framework-quickcheck2, Cabal-1.17.0:test)
[_14] trying: QuickCheck-2.4.2/installed-ce0...
[_15] trying: template-haskell-2.7.0.0/installed-e05... (dependency of
QuickCheck-2.4.2/installed-ce0...)
[_16] trying: pretty-1.1.1.0/installed-867... (dependency of
template-haskell-2.7.0.0/installed-e05...)
[_17] trying: containers-0.4.2.1/installed-efa... (dependency of
template-haskell-2.7.0.0/installed-e05...)
[_18] trying: deepseq-1.3.0.0/installed-c8a... (dependency of
containers-0.4.2.1/installed-efa...)
[_19] trying: array-0.4.0.0/installed-4f6... (dependency of
containers-0.4.2.1/installed-efa...)
[_20] trying: random-1.0.1.1/installed-de8... (dependency of
QuickCheck-2.4.2/installed-ce0...)
[_21] trying: time-1.4/installed-b8e... (dependency of
random-1.0.1.1/installed-de8...)
[_22] trying: HUnit-1.2.5.1/installed-04f... (dependency of
Cabal-1.17.0:*test)
[_23] trying: test-framework-hunit-0.2.7/installed-818... (dependency of
Cabal-1.17.0:*test)
[_24] trying: test-framework-quickcheck2-0.2.12.2/installed-b32... (dependency
of Cabal-1.17.0:*test)
[_25] trying: test-framework-0.6/installed-c27... (dependency of
Cabal-1.17.0:*test)
[_26] trying: xml-1.3.12/installed-3c9... (dependency of
test-framework-0.6/installed-c27...)
[_27] trying: text-0.11.2.2/installed-a47... (dependency of
xml-1.3.12/installed-3c9...)
[_28] trying: regex-posix-0.95.2/installed-eae... (dependency of
test-framework-0.6/installed-c27...)
[_29] trying: regex-base-0.93.2/installed-7aa... (dependency of
regex-posix-0.95.2/installed-eae...)
[_30] trying: mtl-2.1.2/installed-cf6... (dependency of
regex-base-0.93.2/installed-7aa...)
[_31] trying: transformers-0.3.0.0/installed-288... (dependency of
mtl-2.1.2/installed-cf6...)
[_32] trying: hostname-1.0/installed-127... (dependency of
test-framework-0.6/installed-c27...)
[_33] trying: ansi-wl-pprint-0.6.4/installed-58a... (dependency of
test-framework-0.6/installed-c27...)
[_34] trying: ansi-terminal-0.5.5/installed-880... (dependency of
test-framework-0.6/installed-c27...)
[_35] trying: unix-2.5.1.1/installed-fcd... (dependency of Cabal-1.17.0)
[_36] next goal: filepath (dependency of Cabal-1.17.0)
[_36] trying: filepath-1.3.0.0/installed-954...
[_37] done
Using external setup method with build-type Custom
creating dist/setup
Using Cabal library version 1.17.0
Using ./Setup.hs as setup script.
Setup script is out of date, compiling...
("/usr/local/bin/ghc",["-v","--make","./Setup.hs","-o","./dist/setup/setup","-odir","./dist/setup","-hidir","./dist/setup","-i","-i.","+RTS -M512m -RTS"])
Glasgow Haskell Compiler, Version 7.4.2, stage 2 booted by GHC version 6.12.1
Using binary package database: /usr/local/lib/ghc-7.4.2/package.conf.d/package.cache
Using binary package database: /var/lib/jenkins/.ghc/i386-linux-7.4.2/package.conf.d/package.cache
hiding package QuickCheck-2.4.2 to avoid conflict with later version QuickCheck-2.5
wired-in package ghc-prim mapped to ghc-prim-0.2.0.0-23f345e1ec26a64d5ebc768bd0b2a5d9
wired-in package integer-gmp mapped to integer-gmp-0.4.0.0-c15e185526893c3119f809251aac8c5b
wired-in package base mapped to base-4.5.1.0-8a237511fef48b8f180babb0282b28e3
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.7.0.0-e05510f205ee386ac39c49beeaff9b78
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
*** Deleting temp files:
Deleting: 
*** Deleting temp dirs:
Deleting: 
target `+RTS -M512m -RTS' is not a module name or a source file
/usr/local/bin/ghc returned ExitFailure 1
@kosmikus
Collaborator

I'd argue that this is normal behaviour. The argument of --ghc-option is passed as a single command-line argument. You can achieve what you want by saying

cabal configure --enable-tests --ghc-option=+RTS --ghc-option=-M512m --ghc-option=-RTS -v
@kosmikus kosmikus closed this
@tibbe
Owner

@kosmikus I should have thought of that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.