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 ghc
--reload includes
......
......@@ -271,7 +271,7 @@ hadrian-ghc-in-ghci:
- ./boot
- ./configure $CONFIGURE_ARGS
# 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:
key: hadrian-ghci
paths:
......
......@@ -402,7 +402,7 @@ function clean() {
}
function run_hadrian() {
run hadrian/build.cabal.sh \
run hadrian/build-cabal \
--flavour="$FLAVOUR" \
-j"$cores" \
--broken-test="$BROKEN_TESTS" \
......
......@@ -902,7 +902,7 @@ Producing an eventlog for GHC
To actually produce the eventlog, you need an eventlog-capable GHC build:
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:
$ make -j GhcStage2HcOpts+=-eventlog
......
# generated by the configure script
cfg/system.config
# build.bat and build.sh specific
# build.bat and build specific
/bin/
# build.cabal.sh specific
# build-cabal specific
/dist/
/.cabal-sandbox/
cabal.sandbox.config
# build.cabal-new.sh specific
# build-cabal-new specific
/dist-newstyle/
.ghc.environment.*
# build.stack.sh and build.stack.bat specific
# build-stack and build-stack.bat specific
/.stack-work/
# the user settings
......@@ -23,4 +23,4 @@ cabal.sandbox.config
*~
# ghcid output
/ghcid.txt
\ No newline at end of file
/ghcid.txt
......@@ -21,7 +21,7 @@ tree:
```
./boot && ./configure
hadrian/build.sh -j
hadrian/build -j
```
or on Windows:
......@@ -39,8 +39,8 @@ or simply `-c`. See the overview of command line flags below.
Notes:
* 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
(`build.stack.nix.*`).
e.g. based on Cabal sandboxes (`build-cabal.*`), Stack (`build-stack.*`) or Nix
(`build-stack-nix.*`).
* 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
......@@ -164,18 +164,18 @@ build stage1:exe:haddock
#### 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
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`.
```
ghcid --command="./hadrian/ghci.sh"
ghcid --command="./hadrian/ghci"
```
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
build in parallel.
```
./hadrian/ghci.sh -j8
./hadrian/ghci -j8
```
#### Testing
......@@ -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.
```
> ./hadrian/build.sh tool-args
> ./hadrian/build tool-args
-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
---------------
......
#!/usr/bin/env bash
# By default on Linux/MacOS we build Hadrian using Cabal
(. "hadrian/ghci.cabal.sh" "$@")
(. "hadrian/build-cabal" "$@")
#!/usr/bin/env bash
HADRIAN_NIX=YES hadrian/build.stack.sh
HADRIAN_NIX=YES hadrian/build-stack
@echo off
rem By default on Windows we build Hadrian using Cabal
hadrian/build.cabal.bat %*
hadrian/build-cabal.bat %*
......@@ -3,5 +3,5 @@
hadrian=$(cd hadrian; cabal new-exec which hadrian; cd ..)
all_settings=$($hadrian autocomplete --complete-setting="$@" --quiet)
complete -W "$all_settings" hadrian/build.sh
complete -W "$all_settings" hadrian/build.cabal.sh
complete -W "$all_settings" hadrian/build
complete -W "$all_settings" hadrian/build-cabal
......@@ -6,7 +6,7 @@ The simplest way to run the testsuite is
``` sh
# assuming 'build' is the build script you're using
# (hadrian/build.sh, hadrian/build.bat, ...)
# (hadrian/build, hadrian/build.bat, ...)
build test
```
......
......@@ -106,7 +106,7 @@ userArgs = mconcat
You can match any combination of the `builder`, `stage`, `package`, `way`, `input`
and `output` predicates when specifying custom command line arguments. File
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.
#### Enabling -Werror
......@@ -368,7 +368,7 @@ the stage.
We could equivalently specify those settings on the command-line:
``` sh
$ hadrian/build.sh "stage1.ghc-bin.ghc.link.opts += -eventlog" \
$ hadrian/build "stage1.ghc-bin.ghc.link.opts += -eventlog" \
"*.base.ghc.*.opts += -v3"
```
......@@ -388,7 +388,7 @@ the right names for them:
when building all known packages, if the Hadrian command ever gets them to be
built;
- 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:
* `c.opts` for commands that build C files with GHC
......@@ -397,7 +397,7 @@ the right names for them:
* `deps.opts` for commands that figure out dependencies between Haskell modules
(with `ghc -M`)
* `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
......@@ -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.
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:
``` sh
$ source hadrian/completion.sh
$ hadrian/build.sh <TAB>
$ hadrian/build.sh stage1.ba<TAB>
$ hadrian/build.sh "stage1.base.ghc.<TAB>
$ hadrian/build.sh "*.*.ghc.*.opts += -v3" "stage0.ghc-bin.ghc.lin<TAB>
$ hadrian/build <TAB>
$ hadrian/build stage1.ba<TAB>
$ hadrian/build "stage1.base.ghc.<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
......@@ -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
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.
## Prerequisites
......
#!/usr/bin/env bash
# By default on Linux/MacOS we build Hadrian using Cabal
(. "hadrian/build.cabal.sh" "$@")
(. "hadrian/ghci-cabal" "$@")
......@@ -2,5 +2,5 @@
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
......@@ -2,5 +2,5 @@
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
......@@ -3,7 +3,7 @@
# 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
# 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 "ghc/Main.hs" >> $HIE_BIOS_OUTPUT
......@@ -34,7 +34,7 @@ import UserSettings
-- run, the target prints out the arguments that would be passed to @ghc@
-- 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.
toolArgsTarget :: Rules ()
toolArgsTarget = do
......
......@@ -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
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>
is the build root to be used for the build, which is _build by default.
......@@ -117,7 +117,7 @@ following contents:
and issue:
> $ hadrian/build.sh
> $ hadrian/build
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
......@@ -254,7 +254,7 @@ data BuilderMode = BM_Ghc (Wildcard GhcMode)
-- - @<ghc mode>@ is one of @c@ (building C files), @hs@ (building Haskell
-- modules), @link@ (linking object files), @deps@ (finding Haskell
-- 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
-- dependencies);
-- - locations that support a wildcard (@*@) entry are here to avoid
......
......@@ -163,14 +163,14 @@ else
# Just build hadrian.
if [ "$use_stack" = "NO" ]
then
hadrian/build.sh --help > /dev/null
hadrian/build --help > /dev/null
cd hadrian
hadrian_cmd=$(cabal new-exec -- which hadrian)
else
if [ $no_clean -eq 0 ]; then
rm -rf hadrian/.stack-work
fi
hadrian/build.stack.sh --help > /dev/null
hadrian/build-stack --help > /dev/null
cd hadrian
hadrian_cmd=$(stack exec -- which hadrian)
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