-
Notifications
You must be signed in to change notification settings - Fork 451
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
Multi component ghcide setup #374
Changes from 20 commits
4e17878
35270be
ddff669
b2c8fd9
63f9cdb
1e0ec64
547617a
2541955
3f69e09
90bf61d
c9cbc83
e6fc10b
fbe02da
978beb7
09568bd
8854575
9a212db
d41961f
8ef9e14
110b1b6
7662ee7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ tmp/ | |
*.hp | ||
*.prof | ||
*.pyc | ||
/hie.yaml | ||
|
||
/test.* | ||
/*.html | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cradle: | ||
bios: | ||
program: script/ghci-flags | ||
dependency-program: script/ghci-flags-dependencies | ||
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
# Computes the flags for ghcide to pass to ghci. You probably won’t be running this yourself, but rather ghcide will via configuration in hie.yaml. | ||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The approach here is similar to the approach of #373: basically just listing all the options we can think of, collected by clever use of A more robust approach would probably be to do something like
Maybe someday all of this will be made unnecessary by |
||
|
||
set -e | ||
|
||
cd $(dirname "$0")/.. | ||
|
||
root="$(pwd)" | ||
ghc_version="$(ghc --numeric-version)" | ||
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’ve attempted to compute what I can about the project, but I don’t know how to efficiently and robustly parse |
||
|
||
if [ "$1" == "--builddir" ]; then | ||
repl_builddir="$2" | ||
shift 2 | ||
else | ||
repl_builddir=dist-newstyle | ||
fi | ||
Comment on lines
+11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can’t pass flags into this program from |
||
|
||
echo "-O0" | ||
echo "-ignore-dot-ghci" | ||
|
||
echo "-outputdir $repl_builddir/build/x86_64-osx/ghc-$ghc_version/semantic-0.8.0.0/build" | ||
echo "-odir $repl_builddir/build/x86_64-osx/ghc-$ghc_version/semantic-0.8.0.0/build" | ||
echo "-hidir $repl_builddir/build/x86_64-osx/ghc-$ghc_version/semantic-0.8.0.0/build" | ||
echo "-stubdir $repl_builddir/build/x86_64-osx/ghc-$ghc_version/semantic-0.8.0.0/build" | ||
Comment on lines
+21
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don’t instruct |
||
|
||
echo "-i$root/$repl_builddir/build/x86_64-osx/ghc-$ghc_version/semantic-0.8.0.0/build/autogen" | ||
|
||
echo "-I$root/$repl_builddir/build/x86_64-osx/ghc-$ghc_version/semantic-0.8.0.0/build/autogen" | ||
|
||
echo "-i$root/semantic-analysis/src" | ||
echo "-i$root/semantic-ast/src" | ||
echo "-i$root/semantic-core/src" | ||
echo "-i$root/semantic-java/src" | ||
echo "-i$root/semantic-json/src" | ||
echo "-i$root/semantic-python/src" | ||
echo "-i$root/semantic-tags/src" | ||
echo "-i$root/app" | ||
echo "-i$root/src" | ||
echo "-i$root/bench" | ||
echo "-i$root/test" | ||
Comment on lines
+30
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pretty similar to what we were doing in |
||
|
||
echo "-optP-include" | ||
echo "-optP$root/$repl_builddir/build/x86_64-osx/ghc-$ghc_version/semantic-0.8.0.0/build/autogen/cabal_macros.h" | ||
|
||
# Emit package flags from the environment file, removing comments & prefixing with - | ||
cabal exec --builddir=$repl_builddir -v0 bash -- -c 'cat $GHC_ENVIRONMENT' | grep -v '^--' | sed -e 's/^/-/' | ||
Comment on lines
+47
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than using the existing |
||
|
||
echo "-XHaskell2010" | ||
echo "-XStrictData" | ||
|
||
echo "-Wwarn" | ||
|
||
echo "-Weverything" | ||
echo "-Wno-all-missed-specialisations" | ||
echo "-Wno-implicit-prelude" | ||
echo "-Wno-missed-specialisations" | ||
echo "-Wno-missing-import-lists" | ||
echo "-Wno-missing-local-signatures" | ||
echo "-Wno-monomorphism-restriction" | ||
echo "-Wno-name-shadowing" | ||
echo "-Wno-safe" | ||
echo "-Wno-unsafe" | ||
echo "-Wno-star-is-type" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# Computes the paths to files causing changes to the ghci flags. You probably won’t be running this yourself, but rather ghcide will via configuration in hie.yaml. | ||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes to the listed files might result in different package flags for |
||
|
||
set -e | ||
|
||
cd $(dirname "$0")/.. | ||
|
||
echo "cabal.project" | ||
|
||
echo "semantic.cabal" | ||
echo "semantic-analysis/semantic-analysis.cabal" | ||
echo "semantic-ast/semantic-ast.cabal" | ||
echo "semantic-core/semantic-core.cabal" | ||
echo "semantic-java/semantic-java.cabal" | ||
echo "semantic-json/semantic-json.cabal" | ||
echo "semantic-python/semantic-python.cabal" | ||
echo "semantic-tags/semantic-tags.cabal" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,5 @@ repl_builddir=dist-repl | |
if [[ ! -d $repl_builddir ]]; then | ||
echo "$repl_builddir does not exist, first run 'cabal repl --builddir=$repl_builddir', exit, and then re-run $0" | ||
else | ||
cabal exec --builddir=$repl_builddir ghci -- -ghci-script=.ghci.semantic $@ | ||
cabal exec --builddir=$repl_builddir ghci -- -ghci-script=.ghci.semantic $(script/ghci-flags --builddir "$repl_builddir") -no-ignore-dot-ghci $@ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the deletions in this file are now being handled via
script/ghci-flags
instead.