on master help sign in
Add a ghc wrapper to invoke ghc on individual files

With all the extensions used in streamly, optimization options and ddump-simpl options. This is useful for compiling standalone files, when inspecting core for perf issues. I wish cabal could invoke ghc with environment from the cabal file. Can it?

commitd2d0e16d5333c28500bcee1ab6955c8097738219 authorHarendra Kumar <harendra@composewell.com> dateWed 10 Feb 2021, 02:30 (6 years ago) parent7500c72
2 files changed+46
bin/ghc.sh+45 streamly.cabal+1
bin/ghc.shnew file+45
@@ -0,0 +1,45 @@
1+#!/bin/bash
2+
3+ghc -Wall \
4+ -Wcompat \
5+ -Wunrecognised-warning-flags \
6+ -Widentities \
7+ -Wincomplete-record-updates \
8+ -Wincomplete-uni-patterns \
9+ -Wredundant-constraints \
10+ -Wnoncanonical-monad-instances \
11+ -Rghc-timing \
12+ -XBangPatterns \
13+ -XCApiFFI \
14+ -XCPP \
15+ -XConstraintKinds \
16+ -XDeriveDataTypeable \
17+ -XDeriveGeneric \
18+ -XDeriveTraversable \
19+ -XExistentialQuantification \
20+ -XFlexibleContexts \
21+ -XFlexibleInstances \
22+ -XGeneralizedNewtypeDeriving \
23+ -XInstanceSigs \
24+ -XKindSignatures \
25+ -XLambdaCase \
26+ -XMagicHash \
27+ -XMultiParamTypeClasses \
28+ -XPatternSynonyms \
29+ -XRankNTypes \
30+ -XRecordWildCards \
31+ -XScopedTypeVariables \
32+ -XTupleSections \
33+ -XTypeFamilies \
34+ -XViewPatterns \
35+ -XNoMonoLocalBinds \
36+ -XTypeApplications \
37+ -XQuantifiedConstraints \
38+ -O2 \
39+ -fdicts-strict \
40+ -fspec-constr-recursive=16 \
41+ -fmax-worker-args=16 \
42+ -fplugin Fusion.Plugin \
43+ -ddump-to-file \
44+ -ddump-simpl \
45+ $*
streamly.cabal+1
@@ -123,6 +123,7 @@ extra-source-files:
123123 bin/bench.sh
124124 bin/bench-exec-one.sh
125125 bin/build-lib.sh
126+ bin/ghc.sh
126127 bin/mk-hscope.sh
127128 bin/mk-tags.sh
128129 bin/targets.sh