Skip to content

driver: add explicit c++ support.

This adds first class C++ support to the compile driver so users don't have to manually coerce gcc and ghci to be able to compile and use C++ code.

Should fix #20010 (closed)

Tested by compiling text reported in #20010 (closed)

Tamar@Pinky /c/U/x/s/r/g/tmp ((d712f015…))> cabal new-repl text -w ghc-stage2.exe --allow-newer
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.2.0.0 supports
'ghc' version < 8.12):
~\ghc\inplace\bin\ghc-stage2.exe is version
9.3.20210801
Build profile: -w ghc-9.3.20210801 -O1
In order, the following will be built (use -v for more details):
 - text-1.2.4.2 (lib) (ephemeral targets)
Preprocessing library for text-1.2.4.2..
GHCi, version 9.3.20210801: https://www.haskell.org/ghc/  :? for help
Ok, 44 modules loaded.
ghci> import Data.Text
ghci> toUpper $ pack "hello world"
"HELLO WORLD"
ghci>

> cabal new-test -w ghc-stage2.exe --allow-newer -j
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.2.0.0 supports
'ghc' version < 8.12):
~\ghc\inplace\bin\ghc-stage2.exe is version
9.3.20210801
Build profile: -w ghc-9.3.20210801 -O1
In order, the following will be built (use -v for more details):
 - text-1.2.4.2 (test:tests) (ephemeral targets)
Preprocessing test suite 'tests' for text-1.2.4.2..
Building test suite 'tests' for text-1.2.4.2..
Running 1 test suites...
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to:
~\ghc\tmp\dist-newstyle\build\x86_64-windows\ghc-9.3.20210801\text-1.2.4.2\t\tests\test\text-1.2.4.2-tests.log
1 of 1 test suites (1 of 1 test cases) passed.

/cc @Bodigrim

Edited by Tamar Christina

Merge request reports