Commit a999ee96 authored by xldenis's avatar xldenis Committed by Marge Bot

Rename ghci.sh and build.sh to ghci and build respectively

Convert hadrian buildscripts to unsuffixed, dashed form

final cleanups
parent 99d2de86
Pipeline #16334 passed with stages
in 545 minutes and 1 second
--command sh ./hadrian/ghci.sh --command sh ./hadrian/ghci
--reload compiler --reload compiler
--reload ghc --reload ghc
--reload includes --reload includes
......
...@@ -271,7 +271,7 @@ hadrian-ghc-in-ghci: ...@@ -271,7 +271,7 @@ hadrian-ghc-in-ghci:
- ./boot - ./boot
- ./configure $CONFIGURE_ARGS - ./configure $CONFIGURE_ARGS
# Load ghc-in-ghci then immediately exit and check the modules loaded # Load ghc-in-ghci then immediately exit and check the modules loaded
- echo ":q" | hadrian/ghci.sh -j`mk/detect-cpu-count.sh`| tail -n2 | grep "Ok," - echo ":q" | hadrian/ghci -j`mk/detect-cpu-count.sh`| tail -n2 | grep "Ok,"
cache: cache:
key: hadrian-ghci key: hadrian-ghci
paths: paths:
......
...@@ -402,7 +402,7 @@ function clean() { ...@@ -402,7 +402,7 @@ function clean() {
} }
function run_hadrian() { function run_hadrian() {
run hadrian/build.cabal.sh \ run hadrian/build-cabal \
--flavour="$FLAVOUR" \ --flavour="$FLAVOUR" \
-j"$cores" \ -j"$cores" \
--broken-test="$BROKEN_TESTS" \ --broken-test="$BROKEN_TESTS" \
......
...@@ -902,7 +902,7 @@ Producing an eventlog for GHC ...@@ -902,7 +902,7 @@ Producing an eventlog for GHC
To actually produce the eventlog, you need an eventlog-capable GHC build: To actually produce the eventlog, you need an eventlog-capable GHC build:
With Hadrian: With Hadrian:
$ hadrian/build.sh -j "stage1.ghc-bin.ghc.link.opts += -eventlog" $ hadrian/build -j "stage1.ghc-bin.ghc.link.opts += -eventlog"
With Make: With Make:
$ make -j GhcStage2HcOpts+=-eventlog $ make -j GhcStage2HcOpts+=-eventlog
......
# generated by the configure script # generated by the configure script
cfg/system.config cfg/system.config
# build.bat and build.sh specific # build.bat and build specific
/bin/ /bin/
# build.cabal.sh specific # build-cabal specific
/dist/ /dist/
/.cabal-sandbox/ /.cabal-sandbox/
cabal.sandbox.config cabal.sandbox.config
# build.cabal-new.sh specific # build-cabal-new specific
/dist-newstyle/ /dist-newstyle/
.ghc.environment.* .ghc.environment.*
# build.stack.sh and build.stack.bat specific # build-stack and build-stack.bat specific
/.stack-work/ /.stack-work/
# the user settings # the user settings
...@@ -23,4 +23,4 @@ cabal.sandbox.config ...@@ -23,4 +23,4 @@ cabal.sandbox.config
*~ *~
# ghcid output # ghcid output
/ghcid.txt /ghcid.txt
\ No newline at end of file
...@@ -21,7 +21,7 @@ tree: ...@@ -21,7 +21,7 @@ tree:
``` ```
./boot && ./configure ./boot && ./configure
hadrian/build.sh -j hadrian/build -j
``` ```
or on Windows: or on Windows:
...@@ -39,8 +39,8 @@ or simply `-c`. See the overview of command line flags below. ...@@ -39,8 +39,8 @@ or simply `-c`. See the overview of command line flags below.
Notes: Notes:
* If the default build script doesn't work, you might want to try another one, * If the default build script doesn't work, you might want to try another one,
e.g. based on Cabal sandboxes (`build.cabal.*`), Stack (`build.stack.*`) or Nix e.g. based on Cabal sandboxes (`build-cabal.*`), Stack (`build-stack.*`) or Nix
(`build.stack.nix.*`). (`build-stack-nix.*`).
* On Windows, if you do not want to install MSYS, you can use the Stack-based * On Windows, if you do not want to install MSYS, you can use the Stack-based
build script (Stack provides a managed MSYS environment), as described in build script (Stack provides a managed MSYS environment), as described in
...@@ -164,18 +164,18 @@ build stage1:exe:haddock ...@@ -164,18 +164,18 @@ build stage1:exe:haddock
#### Fast feedback using ghci #### Fast feedback using ghci
Running the `./hadrian/ghci.sh` script will load the main compiler into Running the `./hadrian/ghci` script will load the main compiler into
a ghci session. This is intended for fast development feedback, modules are only a ghci session. This is intended for fast development feedback, modules are only
typechecked so it isn't possible to run any functions in the repl. typechecked so it isn't possible to run any functions in the repl.
``` ```
./hadrian/ghci.sh ./hadrian/ghci
``` ```
You can also use this target with `ghcid`. You can also use this target with `ghcid`.
``` ```
ghcid --command="./hadrian/ghci.sh" ghcid --command="./hadrian/ghci"
``` ```
The first time this command is run hadrian will need to compile a few dependencies The first time this command is run hadrian will need to compile a few dependencies
...@@ -188,7 +188,7 @@ have the effect of passing `-j` to both hadrian and ghci so they will both ...@@ -188,7 +188,7 @@ have the effect of passing `-j` to both hadrian and ghci so they will both
build in parallel. build in parallel.
``` ```
./hadrian/ghci.sh -j8 ./hadrian/ghci -j8
``` ```
#### Testing #### Testing
...@@ -272,12 +272,12 @@ a GHC API session with the correct environment to load a module into your own ...@@ -272,12 +272,12 @@ a GHC API session with the correct environment to load a module into your own
GHC session. This is how `haskell-ide-engine` is able to support hadrian. GHC session. This is how `haskell-ide-engine` is able to support hadrian.
``` ```
> ./hadrian/build.sh tool-args > ./hadrian/build tool-args
-hide-all-packages -no-user-package-db -package-db _build/stage0/lib/packag... -hide-all-packages -no-user-package-db -package-db _build/stage0/lib/packag...
``` ```
The `./hadrian/ghci.sh` script is implemented using this target. The `./hadrian/ghci` script is implemented using this target.
Troubleshooting Troubleshooting
--------------- ---------------
......
#!/usr/bin/env bash #!/usr/bin/env bash
# By default on Linux/MacOS we build Hadrian using Cabal # By default on Linux/MacOS we build Hadrian using Cabal
(. "hadrian/ghci.cabal.sh" "$@") (. "hadrian/build-cabal" "$@")
#!/usr/bin/env bash #!/usr/bin/env bash
HADRIAN_NIX=YES hadrian/build.stack.sh HADRIAN_NIX=YES hadrian/build-stack
@echo off @echo off
rem By default on Windows we build Hadrian using Cabal rem By default on Windows we build Hadrian using Cabal
hadrian/build.cabal.bat %* hadrian/build-cabal.bat %*
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
hadrian=$(cd hadrian; cabal new-exec which hadrian; cd ..) hadrian=$(cd hadrian; cabal new-exec which hadrian; cd ..)
all_settings=$($hadrian autocomplete --complete-setting="$@" --quiet) all_settings=$($hadrian autocomplete --complete-setting="$@" --quiet)
complete -W "$all_settings" hadrian/build.sh complete -W "$all_settings" hadrian/build
complete -W "$all_settings" hadrian/build.cabal.sh complete -W "$all_settings" hadrian/build-cabal
...@@ -6,7 +6,7 @@ The simplest way to run the testsuite is ...@@ -6,7 +6,7 @@ The simplest way to run the testsuite is
``` sh ``` sh
# assuming 'build' is the build script you're using # assuming 'build' is the build script you're using
# (hadrian/build.sh, hadrian/build.bat, ...) # (hadrian/build, hadrian/build.bat, ...)
build test build test
``` ```
......
...@@ -106,7 +106,7 @@ userArgs = mconcat ...@@ -106,7 +106,7 @@ userArgs = mconcat
You can match any combination of the `builder`, `stage`, `package`, `way`, `input` You can match any combination of the `builder`, `stage`, `package`, `way`, `input`
and `output` predicates when specifying custom command line arguments. File and `output` predicates when specifying custom command line arguments. File
patterns such as `"**/Prelude.*"` can be used when matching input and output files, patterns such as `"**/Prelude.*"` can be used when matching input and output files,
where `**` matches an arbitrary number of path components, but not absolute path where `**` matches an arbitrary number of path components, but not absolute path
prefixes, and `*` matches an entire path component, excluding any separators. prefixes, and `*` matches an entire path component, excluding any separators.
#### Enabling -Werror #### Enabling -Werror
...@@ -368,7 +368,7 @@ the stage. ...@@ -368,7 +368,7 @@ the stage.
We could equivalently specify those settings on the command-line: We could equivalently specify those settings on the command-line:
``` sh ``` sh
$ hadrian/build.sh "stage1.ghc-bin.ghc.link.opts += -eventlog" \ $ hadrian/build "stage1.ghc-bin.ghc.link.opts += -eventlog" \
"*.base.ghc.*.opts += -v3" "*.base.ghc.*.opts += -v3"
``` ```
...@@ -388,7 +388,7 @@ the right names for them: ...@@ -388,7 +388,7 @@ the right names for them:
when building all known packages, if the Hadrian command ever gets them to be when building all known packages, if the Hadrian command ever gets them to be
built; built;
- the remaining slots specify the builder and how it was invoked, - the remaining slots specify the builder and how it was invoked,
* `ghc` refers to GHC commands; the final slot refers to how GHC is invoked: * `ghc` refers to GHC commands; the final slot refers to how GHC is invoked:
* `c.opts` for commands that build C files with GHC * `c.opts` for commands that build C files with GHC
...@@ -397,7 +397,7 @@ the right names for them: ...@@ -397,7 +397,7 @@ the right names for them:
* `deps.opts` for commands that figure out dependencies between Haskell modules * `deps.opts` for commands that figure out dependencies between Haskell modules
(with `ghc -M`) (with `ghc -M`)
* `toolargs.opts` for GHC commands that are used to generate the right ghci * `toolargs.opts` for GHC commands that are used to generate the right ghci
argument for `hadrian/ghci.sh` to work argument for `hadrian/ghci` to work
* `cc` refers to C compiler commands * `cc` refers to C compiler commands
...@@ -426,15 +426,15 @@ that takes an (optional) argument, `--complete-setting=<some string>`, and ...@@ -426,15 +426,15 @@ that takes an (optional) argument, `--complete-setting=<some string>`, and
prints on stdout all the setting keys that have the given string as a prefix. prints on stdout all the setting keys that have the given string as a prefix.
There is a `hadrian/completion.sh` script that makes use of this rule to There is a `hadrian/completion.sh` script that makes use of this rule to
install Bash completions for `hadrian/build.sh` and `hadrian/build.cabal.sh`. install Bash completions for `hadrian/build` and `hadrian/build-cabal`.
You can try it out by doing: You can try it out by doing:
``` sh ``` sh
$ source hadrian/completion.sh $ source hadrian/completion.sh
$ hadrian/build.sh <TAB> $ hadrian/build <TAB>
$ hadrian/build.sh stage1.ba<TAB> $ hadrian/build stage1.ba<TAB>
$ hadrian/build.sh "stage1.base.ghc.<TAB> $ hadrian/build "stage1.base.ghc.<TAB>
$ hadrian/build.sh "*.*.ghc.*.opts += -v3" "stage0.ghc-bin.ghc.lin<TAB> $ hadrian/build "*.*.ghc.*.opts += -v3" "stage0.ghc-bin.ghc.lin<TAB>
``` ```
[split-sections]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/phases.html#ghc-flag--split-sections [split-sections]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/phases.html#ghc-flag--split-sections
...@@ -38,7 +38,7 @@ but are much simpler and may also be more robust. ...@@ -38,7 +38,7 @@ but are much simpler and may also be more robust.
The `stack build` and `stack exec hadrian` commands can be replaced by an The `stack build` and `stack exec hadrian` commands can be replaced by an
invocation of Hadrian's Stack-based build script: invocation of Hadrian's Stack-based build script:
`build.stack.bat -j --flavour=quickest`. Use this script if you plan to work on `build-stack.bat -j --flavour=quickest`. Use this script if you plan to work on
Hadrian and/or rebuild GHC often. Hadrian and/or rebuild GHC often.
## Prerequisites ## Prerequisites
......
#!/usr/bin/env bash #!/usr/bin/env bash
# By default on Linux/MacOS we build Hadrian using Cabal # By default on Linux/MacOS we build Hadrian using Cabal
(. "hadrian/build.cabal.sh" "$@") (. "hadrian/ghci-cabal" "$@")
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
set -e set -e
GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build.cabal.sh" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")" GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build-cabal" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")"
ghci $GHC_FLAGS "$@" -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs +RTS -A128m ghci $GHC_FLAGS "$@" -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs +RTS -A128m
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
set -e set -e
GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build.stack.sh" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")" GHC_FLAGS="$GHC_FLAGS $(TERM=dumb CABFLAGS=-v0 "hadrian/build-stack" tool-args -q --build-root=.hadrian_ghci --flavour=ghc-in-ghci "$@")"
stack exec -- ghci $GHC_FLAGS "$@" -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs +RTS -A128m stack exec -- ghci $GHC_FLAGS "$@" -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 ghc/Main.hs +RTS -A128m
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# When run, this program will output a list of arguments which are necessary to # When run, this program will output a list of arguments which are necessary to
# load the GHC library component into GHCi. The program is used by `ghcide` in # load the GHC library component into GHCi. The program is used by `ghcide` in
# order to automatically set up the correct GHC API session for a project. # order to automatically set up the correct GHC API session for a project.
TERM=dumb CABFLAGS=-v0 $PWD/hadrian/build.cabal.sh tool-args -q --build-root=.hie-bios --flavour=ghc-in-ghci > $HIE_BIOS_OUTPUT TERM=dumb CABFLAGS=-v0 $PWD/hadrian/build-cabal tool-args -q --build-root=.hie-bios --flavour=ghc-in-ghci > $HIE_BIOS_OUTPUT
echo -ighc >> $HIE_BIOS_OUTPUT echo -ighc >> $HIE_BIOS_OUTPUT
echo "ghc/Main.hs" >> $HIE_BIOS_OUTPUT echo "ghc/Main.hs" >> $HIE_BIOS_OUTPUT
...@@ -34,7 +34,7 @@ import UserSettings ...@@ -34,7 +34,7 @@ import UserSettings
-- run, the target prints out the arguments that would be passed to @ghc@ -- run, the target prints out the arguments that would be passed to @ghc@
-- during normal compilation to @stdout@. -- during normal compilation to @stdout@.
-- --
-- This target is called by the `ghci.sh` script in order to load all of GHC's -- This target is called by the `ghci` script in order to load all of GHC's
-- modules into GHCi. -- modules into GHCi.
toolArgsTarget :: Rules () toolArgsTarget :: Rules ()
toolArgsTarget = do toolArgsTarget = do
......
...@@ -105,7 +105,7 @@ It now also offers a more "old-school" interface, in the form of ...@@ -105,7 +105,7 @@ It now also offers a more "old-school" interface, in the form of
@foo.bar.baz = v@ or @foo.bar.baz += v@ expressions, that one can @foo.bar.baz = v@ or @foo.bar.baz += v@ expressions, that one can
pass on the command line that invokes hadrian: pass on the command line that invokes hadrian:
> $ hadrian/build.sh --flavour=quickest -j "stage1.ghc-bin.ghc.link.opts += -v3" > $ hadrian/build --flavour=quickest -j "stage1.ghc-bin.ghc.link.opts += -v3"
or in a file at <build root>/hadrian.settings, where <build root> or in a file at <build root>/hadrian.settings, where <build root>
is the build root to be used for the build, which is _build by default. is the build root to be used for the build, which is _build by default.
...@@ -117,7 +117,7 @@ following contents: ...@@ -117,7 +117,7 @@ following contents:
and issue: and issue:
> $ hadrian/build.sh > $ hadrian/build
Hadrian would pick up the settings given in _build/hadrian.settings (as well as Hadrian would pick up the settings given in _build/hadrian.settings (as well as
any settings that you may additionally be passing on the command line) and any settings that you may additionally be passing on the command line) and
...@@ -254,7 +254,7 @@ data BuilderMode = BM_Ghc (Wildcard GhcMode) ...@@ -254,7 +254,7 @@ data BuilderMode = BM_Ghc (Wildcard GhcMode)
-- - @<ghc mode>@ is one of @c@ (building C files), @hs@ (building Haskell -- - @<ghc mode>@ is one of @c@ (building C files), @hs@ (building Haskell
-- modules), @link@ (linking object files), @deps@ (finding Haskell -- modules), @link@ (linking object files), @deps@ (finding Haskell
-- dependencies with @ghc -M@) or @toolargs@ (getting necessary flags to -- dependencies with @ghc -M@) or @toolargs@ (getting necessary flags to
-- make hadrian/ghci.sh work; -- make hadrian/ghci work;
-- - @<cc mode>@ is one of @c@ (building C files) or @deps@ (finding C -- - @<cc mode>@ is one of @c@ (building C files) or @deps@ (finding C
-- dependencies); -- dependencies);
-- - locations that support a wildcard (@*@) entry are here to avoid -- - locations that support a wildcard (@*@) entry are here to avoid
......
...@@ -163,14 +163,14 @@ else ...@@ -163,14 +163,14 @@ else
# Just build hadrian. # Just build hadrian.
if [ "$use_stack" = "NO" ] if [ "$use_stack" = "NO" ]
then then
hadrian/build.sh --help > /dev/null hadrian/build --help > /dev/null
cd hadrian cd hadrian
hadrian_cmd=$(cabal new-exec -- which hadrian) hadrian_cmd=$(cabal new-exec -- which hadrian)
else else
if [ $no_clean -eq 0 ]; then if [ $no_clean -eq 0 ]; then
rm -rf hadrian/.stack-work rm -rf hadrian/.stack-work
fi fi
hadrian/build.stack.sh --help > /dev/null hadrian/build-stack --help > /dev/null
cd hadrian cd hadrian
hadrian_cmd=$(stack exec -- which hadrian) hadrian_cmd=$(stack exec -- which hadrian)
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment