Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • hadrian/hie-bios deleted
    1
    -#! /usr/bin/env bash
    
    2
    -
    
    3
    -# When run, this program will output a list of arguments which are necessary to
    
    4
    -# load the GHC library component into GHCi. The program is used by `ghcide` in
    
    5
    -# order to automatically set up the correct GHC API session for a project.
    
    6
    -TERM=dumb CABFLAGS=-v0 TOOL_OUTPUT=$HIE_BIOS_OUTPUT $PWD/hadrian/build-cabal tool:$1 -q --build-root=.hie-bios --flavour=ghc-in-ghci -j

  • hadrian/hie-bios.bat
    1
    +#!/usr/bin/env bash
    
    2
    +
    
    3
    +:;# When run, this program will output a list of arguments which are necessary to
    
    4
    +:;# load the GHC library component into GHCi. The program is used by `ghcide` in
    
    5
    +:;# order to automatically set up the correct GHC API session for a project.
    
    6
    +
    
    7
    +:;# This is a POSIX shell/Windows batch polyglot script, which allows hie-bios
    
    8
    +:;# to use a single hie.yaml file for both platforms.
    
    9
    +:;#
    
    10
    +:;#  1. The file extension is '.bat', because Windows requires this.
    
    11
    +:;#     On POSIX, the extension doesn't matter, because the #! is what makes
    
    12
    +:;#     the script runnable. On Windows, this shebang makes cmd.exe complain on
    
    13
    +:;#     stderr, but this doesn't break anything; we add 'Please ignore the #! error'
    
    14
    +:;#     to stderr as a courtesy.
    
    15
    +:;#  2. On Windows, cmd.exe interprets lines starting with ':' as (goto) labels,
    
    16
    +:;#     essentially ignoring them (for our purposes).
    
    17
    +:;#     On POSIX, ':' is the no-op command, which we terminate with ';'.
    
    18
    +:;#     As '#' is used for shell comment syntax, ':;#' behaves like a comment
    
    19
    +:;#     marker in the polyglot language.
    
    20
    +:;#  3. The line endings are LF-only, to make this POSIX-compliant.
    
    21
    +
    
    22
    +:;# The POSIX part. Ignored on Windows as it starts with ':'.
    
    23
    +:; TERM=dumb CABFLAGS=-v0 TOOL_OUTPUT=$HIE_BIOS_OUTPUT exec "$PWD/hadrian/build-cabal" tool:"$1" -q --build-root=.hie-bios --flavour=ghc-in-ghci -j
    
    24
    +
    
    25
    +:;# The Windows part. Ignored on POSIX, because the above command execs.
    
    26
    +@echo off
    
    27
    +>&2 echo Please ignore the above error that '#!' is not recognised.
    
    1 28
     set TERM=dumb
    
    2 29
     set CABFLAGS=-v0
    
    3 30
     set TOOL_OUTPUT=%HIE_BIOS_OUTPUT%
    
    4
    -%CD%\hadrian\build-cabal.bat tool:%1 --build-root=.hie-bios --flavour=ghc-in-ghci -j
    31
    +%CD%\hadrian\build-cabal.bat tool:%1 -q --build-root=.hie-bios --flavour=ghc-in-ghci -j

  • hie.yaml
    1 1
     # This is a IDE configuration file which tells IDEs such as `ghcide` how
    
    2 2
     # to set up a GHC API session for this project.
    
    3 3
     #
    
    4
    -# To use it in windows systems replace the config with
    
    5
    -# cradle: {bios: {program: "./hadrian/hie-bios.bat"}}
    
    6
    -#
    
    7 4
     # The format is documented here - https://github.com/mpickering/hie-bios
    
    8
    -cradle: {bios: {program: "./hadrian/hie-bios"}}
    5
    +cradle: {bios: {program: "./hadrian/hie-bios.bat"}}
    
    6
    +  # NB: hadrian/hie-bios.bat is a shell/batch polyglot script which runs
    
    7
    +  # on all platforms.