From 733a0a4628eb9190d5ceec06c1c6ca466875c795 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 30 Oct 2019 16:34:16 -0400 Subject: [PATCH] =?UTF-8?q?Revert=20"Build=20both=20static=20&=20dynamic?= =?UTF-8?q?=20files=20so=20we=20don=E2=80=99t=20have=20to=20live=20in=20a?= =?UTF-8?q?=20separate=20build=20dir."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 47b0dac3d86e076b730e8e84f3798cecc4a3ae3c. --- .ghci.semantic | 19 +++++++------------ script/repl | 8 +++++++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.ghci.semantic b/.ghci.semantic index a42cb6cc6..e34f0a0d5 100644 --- a/.ghci.semantic +++ b/.ghci.semantic @@ -10,20 +10,15 @@ -- Compile to object code :set -fwrite-interface -fobject-code --- Build both static & dynamic objects so we don’t confuse cabal build -:set -static -:set -dynamic-too -:set -dynosuf dyn_o -:set -dynhisuf dyn_hi --- Write build products to dist-newstyle (instead of alongside the .hs files) -:set -outputdir dist-newstyle/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build -:set -odir dist-newstyle/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build -:set -hidir dist-newstyle/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build -:set -stubdir dist-newstyle/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build +-- Write build products to dist-repl (so that we don’t clobber 'cabal build' outputs) +:set -outputdir dist-repl/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build +:set -odir dist-repl/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build +:set -hidir dist-repl/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build +:set -stubdir dist-repl/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build --- Look for autogen’d files in dist-newstyle -:set -idist-newstyle/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build/autogen +-- Look for autogen’d files in dist-repl +:set -idist-repl/build/x86_64-osx/ghc-8.6.5/semantic-0.8.0.0/build/autogen -- Load all our sources… remember to keep this up to date when we add new packages! -- But don’t add semantic-source, it’s important that we get that from hackage. diff --git a/script/repl b/script/repl index ba116a7b5..9e991bbed 100755 --- a/script/repl +++ b/script/repl @@ -6,4 +6,10 @@ set -e cd $(dirname "$0")/.. -cabal exec ghci -- -ghci-script=.ghci.semantic $@ +repl_builddir=dist-repl + +if [[ ! -d $repl_builddir ]]; then + echo "$repl_builddir does not exist, first run 'cabal repl --builddir=$replbuilddir', exit, and then re-run $0" +else + cabal exec --builddir=$repl_builddir ghci -- -ghci-script=.ghci.semantic $@ +fi