Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/ghc
  • bgamari/ghc
  • syd/ghc
  • ggreif/ghc
  • watashi/ghc
  • RolandSenn/ghc
  • mpickering/ghc
  • DavidEichmann/ghc
  • carter/ghc
  • harpocrates/ghc
  • ethercrow/ghc
  • mijicd/ghc
  • adamse/ghc
  • alexbiehl/ghc
  • gridaphobe/ghc
  • trofi/ghc
  • supersven/ghc
  • ppk/ghc
  • ulysses4ever/ghc
  • AndreasK/ghc
  • ghuntley/ghc
  • shayne-fletcher-da/ghc
  • fgaz/ghc
  • yav/ghc
  • osa1/ghc
  • mbbx6spp/ghc
  • JulianLeviston/ghc
  • reactormonk/ghc
  • rae/ghc
  • takenobu-hs/ghc
  • michalt/ghc
  • andrewthad/ghc
  • hsyl20/ghc
  • scottgw/ghc
  • sjakobi/ghc
  • angerman/ghc
  • RyanGlScott/ghc
  • hvr/ghc
  • howtonotwin/ghc
  • chessai/ghc
  • m-renaud/ghc
  • brprice/ghc
  • stevehartdata/ghc
  • sighingnow/ghc
  • kgardas/ghc
  • ckoparkar/ghc
  • alp/ghc
  • smaeul/ghc
  • kakkun61/ghc
  • sykloid/ghc
  • newhoggy/ghc
  • toonn/ghc
  • nineonine/ghc
  • Phyx/ghc
  • ezyang/ghc
  • tweag/ghc
  • langston/ghc
  • ndmitchell/ghc
  • rockbmb/ghc
  • artempyanykh/ghc
  • mniip/ghc
  • mynguyenbmc/ghc
  • alexfmpe/ghc
  • crockeea/ghc
  • nh2/ghc
  • vaibhavsagar/ghc
  • phadej/ghc
  • Haskell-mouse/ghc
  • lolotp/ghc
  • spacekitteh/ghc
  • michaelpj/ghc
  • mgsloan/ghc
  • HPCohen/ghc
  • tmobile/ghc
  • radrow/ghc
  • simonmar/ghc
  • _deepfire/ghc
  • Ericson2314/ghc
  • leitao/ghc
  • fumieval/ghc
  • trac-isovector/ghc
  • cblp/ghc
  • xich/ghc
  • ciil/ghc
  • erthalion/ghc
  • xldenis/ghc
  • autotaker/ghc
  • haskell-wasm/ghc
  • kcsongor/ghc
  • agander/ghc
  • Baranowski/ghc
  • trac-dredozubov/ghc
  • 23Skidoo/ghc
  • iustin/ghc
  • ningning/ghc
  • josefs/ghc
  • kabuhr/ghc
  • gallais/ghc
  • dten/ghc
  • expipiplus1/ghc
  • Pluralia/ghc
  • rohanjr/ghc
  • intricate/ghc
  • kirelagin/ghc
  • Javran/ghc
  • DanielG/ghc
  • trac-mizunashi_mana/ghc
  • pparkkin/ghc
  • bollu/ghc
  • ntc2/ghc
  • jaspervdj/ghc
  • JoshMeredith/ghc
  • wz1000/ghc
  • zkourouma/ghc
  • code5hot/ghc
  • jdprice/ghc
  • tdammers/ghc
  • J-mie6/ghc
  • trac-lantti/ghc
  • ch1bo/ghc
  • cgohla/ghc
  • lucamolteni/ghc
  • acairncross/ghc
  • amerocu/ghc
  • chreekat/ghc
  • txsmith/ghc
  • trupill/ghc
  • typetetris/ghc
  • sergv/ghc
  • fryguybob/ghc
  • erikd/ghc
  • trac-roland/ghc
  • setupminimal/ghc
  • Friede80/ghc
  • SkyWriter/ghc
  • xplorld/ghc
  • abrar/ghc
  • obsidiansystems/ghc
  • Icelandjack/ghc
  • adinapoli/ghc
  • trac-matthewbauer/ghc
  • heatsink/ghc
  • dwijnand/ghc
  • Cmdv/ghc
  • alinab/ghc
  • pepeiborra/ghc
  • fommil/ghc
  • luochen1990/ghc
  • rlupton20/ghc
  • applePrincess/ghc
  • lehins/ghc
  • ronmrdechai/ghc
  • leeadam/ghc
  • harendra/ghc
  • mightymosquito1991/ghc
  • trac-gershomb/ghc
  • lucajulian/ghc
  • Rizary/ghc
  • VictorCMiraldo/ghc
  • jamesbrock/ghc
  • andrewdmeier/ghc
  • luke/ghc
  • pranaysashank/ghc
  • cocreature/ghc
  • hithroc/ghc
  • obreitwi/ghc
  • slrtbtfs/ghc
  • kaol/ghc
  • yairchu/ghc
  • Mathemagician98/ghc
  • trac-taylorfausak/ghc
  • leungbk/ghc
  • MichaWiedenmann/ghc
  • chris-martin/ghc
  • TDecki/ghc
  • adithyaov/ghc
  • trac-gelisam/ghc
  • Lysxia/ghc
  • complyue/ghc
  • bwignall/ghc
  • sternmull/ghc
  • sonika/ghc
  • leif/ghc
  • broadwaylamb/ghc
  • myszon/ghc
  • danbroooks/ghc
  • Mechachleopteryx/ghc
  • zardyh/ghc
  • trac-vdukhovni/ghc
  • OmarKhaledAbdo/ghc
  • arrowd/ghc
  • Bodigrim/ghc
  • matheus23/ghc
  • cardenaso11/ghc
  • trac-Athas/ghc
  • mb720/ghc
  • DylanZA/ghc
  • liff/ghc
  • typedrat/ghc
  • trac-claude/ghc
  • jbm/ghc
  • Gertjan423/ghc
  • PHO/ghc
  • JKTKops/ghc
  • kockahonza/ghc
  • msakai/ghc
  • Sir4ur0n/ghc
  • barambani/ghc
  • vishnu.c/ghc
  • dcoutts/ghc
  • trac-runeks/ghc
  • trac-MaxGabriel/ghc
  • lexi.lambda/ghc
  • strake/ghc
  • spavikevik/ghc
  • JakobBruenker/ghc
  • rmanne/ghc
  • gdziadkiewicz/ghc
  • ani/ghc
  • iliastsi/ghc
  • smunix/ghc
  • judah/ghc
  • blackgnezdo/ghc
  • emilypi/ghc
  • trac-bpfoley/ghc
  • muesli4/ghc
  • trac-gkaracha/ghc
  • Kleidukos/ghc
  • nek0/ghc
  • TristanCacqueray/ghc
  • dwulive/ghc
  • mbakke/ghc
  • arybczak/ghc
  • Yang123321/ghc
  • maksbotan/ghc
  • QuietMisdreavus/ghc
  • trac-olshanskydr/ghc
  • emekoi/ghc
  • samuela/ghc
  • josephcsible/ghc
  • dramforever/ghc
  • lpsmith/ghc
  • DenisFrezzato/ghc
  • michivi/ghc
  • jneira/ghc
  • jeffhappily/ghc
  • Ivan-Yudin/ghc
  • nakaji-dayo/ghc
  • gdevanla/ghc
  • galen/ghc
  • fendor/ghc
  • yaitskov/ghc
  • rcythr/ghc
  • awpr/ghc
  • jeremyschlatter/ghc
  • Aver1y/ghc
  • mitchellvitez/ghc
  • merijn/ghc
  • tomjaguarpaw1/ghc
  • trac-NoidedSuper/ghc
  • erewok/ghc
  • trac-junji.hashimoto/ghc
  • adamwespiser/ghc
  • bjaress/ghc
  • jhrcek/ghc
  • leonschoorl/ghc
  • lukasz-golebiewski/ghc
  • sheaf/ghc
  • last-g/ghc
  • carassius1014/ghc
  • eschwartz/ghc
  • dwincort/ghc
  • felixwiemuth/ghc
  • TimWSpence/ghc
  • marcusmonteirodesouza/ghc
  • WJWH/ghc
  • vtols/ghc
  • theobat/ghc
  • BinderDavid/ghc
  • ckoparkar0/ghc
  • alexander-kjeldaas/ghc
  • dme2/ghc
  • philderbeast/ghc
  • aaronallen8455/ghc
  • rayshih/ghc
  • benkard/ghc
  • mpardalos/ghc
  • saidelman/ghc
  • leiftw/ghc
  • ca333/ghc
  • bwroga/ghc
  • nmichael44/ghc
  • trac-crobbins/ghc
  • felixonmars/ghc
  • adityagupta1089/ghc
  • hgsipiere/ghc
  • treeowl/ghc
  • alexpeits/ghc
  • CraigFe/ghc
  • dnlkrgr/ghc
  • kerckhove_ts/ghc
  • cptwunderlich/ghc
  • eiais/ghc
  • hahohihu/ghc
  • sanchayan/ghc
  • lemmih/ghc
  • sehqlr/ghc
  • trac-dbeacham/ghc
  • luite/ghc
  • trac-f-a/ghc
  • vados/ghc
  • luntain/ghc
  • fatho/ghc
  • alexbiehl-gc/ghc
  • dcbdan/ghc
  • tvh/ghc
  • liam-ly/ghc
  • timbobbarnes/ghc
  • GovanifY/ghc
  • shanth2600/ghc
  • gliboc/ghc
  • duog/ghc
  • moxonsghost/ghc
  • zander/ghc
  • masaeedu/ghc
  • georgefst/ghc
  • guibou/ghc
  • nicuveo/ghc
  • mdebruijne/ghc
  • stjordanis/ghc
  • emiflake/ghc
  • wygulmage/ghc
  • frasertweedale/ghc
  • coot/ghc
  • aratamizuki/ghc
  • tsandstr/ghc
  • mrBliss/ghc
  • Anton-Latukha/ghc
  • tadfisher/ghc
  • vapourismo/ghc
  • Sorokin-Anton/ghc
  • basile-henry/ghc
  • trac-mightybyte/ghc
  • AbsoluteNikola/ghc
  • cobrien99/ghc
  • songzh/ghc
  • blamario/ghc
  • aj4ayushjain/ghc
  • trac-utdemir/ghc
  • tangcl/ghc
  • hdgarrood/ghc
  • maerwald/ghc
  • arjun/ghc
  • ratherforky/ghc
  • haskieLambda/ghc
  • EmilGedda/ghc
  • Bogicevic/ghc
  • eddiejessup/ghc
  • kozross/ghc
  • AlistairB/ghc
  • 3Rafal/ghc
  • christiaanb/ghc
  • trac-bit/ghc
  • matsumonkie/ghc
  • trac-parsonsmatt/ghc
  • chisui/ghc
  • jaro/ghc
  • trac-kmiyazato/ghc
  • davidsd/ghc
  • Tritlo/ghc
  • I-B-3/ghc
  • lykahb/ghc
  • AriFordsham/ghc
  • turion1/ghc
  • berberman/ghc
  • christiantakle/ghc
  • zyklotomic/ghc
  • trac-ocramz/ghc
  • CSEdd/ghc
  • doyougnu/ghc
  • mmhat/ghc
  • why-not-try-calmer/ghc
  • plutotulp/ghc
  • kjekac/ghc
  • Manvi07/ghc
  • teo/ghc
  • cactus/ghc
  • CarrieMY/ghc
  • abel/ghc
  • yihming/ghc
  • tsakki/ghc
  • jessicah/ghc
  • oliverbunting/ghc
  • meld/ghc
  • friedbrice/ghc
  • Joald/ghc
  • abarbu/ghc
  • DigitalBrains1/ghc
  • sterni/ghc
  • alexDarcy/ghc
  • hexchain/ghc
  • minimario/ghc
  • zliu41/ghc
  • tommd/ghc
  • jazcarate/ghc
  • peterbecich/ghc
  • alirezaghey/ghc
  • solomon/ghc
  • mikael.urankar/ghc
  • davjam/ghc
  • int-index/ghc
  • MorrowM/ghc
  • nrnrnr/ghc
  • Sonfamm/ghc-test-only
  • afzt1/ghc
  • nguyenhaibinh-tpc/ghc
  • trac-lierdakil/ghc
  • MichaWiedenmann1/ghc
  • jmorag/ghc
  • Ziharrk/ghc
  • trac-MitchellSalad/ghc
  • juampe/ghc
  • jwaldmann/ghc
  • snowleopard/ghc
  • juhp/ghc
  • normalcoder/ghc
  • ksqsf/ghc
  • trac-jberryman/ghc
  • roberth/ghc
  • 1ntEgr8/ghc
  • epworth/ghc
  • MrAdityaAlok/ghc
  • JunmingZhao42/ghc
  • jappeace/ghc
  • trac-Gabriel439/ghc
  • alt-romes/ghc
  • HugoPeters1024/ghc
  • 10ne1/ghc-fork
  • agentultra/ghc
  • Garfield1002/ghc
  • ChickenProp/ghc
  • clyring/ghc
  • MaxHearnden/ghc
  • jumper149/ghc
  • vem/ghc
  • ketzacoatl/ghc
  • Rosuavio/ghc
  • jackohughes/ghc
  • p4l1ly/ghc
  • konsumlamm/ghc
  • shlevy/ghc
  • torsten.schmits/ghc
  • andremarianiello/ghc
  • amesgen/ghc
  • googleson78/ghc
  • InfiniteVerma/ghc
  • uhbif19/ghc
  • yiyunliu/ghc
  • raehik/ghc
  • mrkun/ghc
  • telser/ghc
  • 1Jajen1/ghc
  • slotThe/ghc
  • WinstonHartnett/ghc
  • mpilgrem/ghc
  • dreamsmasher/ghc
  • schuelermine/ghc
  • trac-Viwor/ghc
  • undergroundquizscene/ghc
  • evertedsphere/ghc
  • coltenwebb/ghc
  • oberblastmeister/ghc
  • agrue/ghc
  • lf-/ghc
  • zacwood9/ghc
  • steshaw/ghc
  • high-cloud/ghc
  • SkamDart/ghc
  • PiDelport/ghc
  • maoif/ghc
  • RossPaterson/ghc
  • CharlesTaylor7/ghc
  • ribosomerocker/ghc
  • trac-ramirez7/ghc
  • daig/ghc
  • NicolasT/ghc
  • FinleyMcIlwaine/ghc
  • lawtonnichols/ghc
  • jmtd/ghc
  • ozkutuk/ghc
  • wildsebastian/ghc
  • nikshalark/ghc
  • lrzlin/ghc
  • tobias/ghc
  • fw/ghc
  • hawkinsw/ghc
  • type-dance/ghc
  • rui314/ghc
  • ocharles/ghc
  • wavewave/ghc
  • TheKK/ghc
  • nomeata/ghc
  • trac-csabahruska/ghc
  • jonathanjameswatson/ghc
  • L-as/ghc
  • Axman6/ghc
  • barracuda156/ghc
  • trac-jship/ghc
  • jake-87/ghc
  • meooow/ghc
  • rebeccat/ghc
  • hamana55/ghc
  • Enigmage/ghc
  • kokobd/ghc
  • agevelt/ghc
  • gshen42/ghc
  • chrismwendt/ghc
  • MangoIV/ghc
  • teto/ghc
  • Sookr1/ghc
  • trac-thomasjm/ghc
  • barci2/ghc-dev
  • trac-m4dc4p/ghc
  • dixonary/ghc
  • breakerzirconia/ghc
  • alexsio27444/ghc
  • glocq/ghc
  • sourabhxyz/ghc
  • ryantrinkle/ghc
  • Jade/ghc
  • scedfaliako/ghc
  • martijnbastiaan/ghc
  • trac-george.colpitts/ghc
  • ammarbinfaisal/ghc
  • mimi.vx/ghc
  • lortabac/ghc
  • trac-zyla/ghc
  • benbellick/ghc
  • aadaa-fgtaa/ghc
  • jvanbruegge/ghc
  • archbung/ghc
  • gilmi/ghc
  • mfonism/ghc
  • alex-mckenna/ghc
  • Ei30metry/ghc
  • DiegoDiverio/ghc
  • jorgecunhamendes/ghc
  • liesnikov/ghc
  • akrmn/ghc
  • trac-simplifierticks/ghc
  • jacco/ghc
  • rhendric/ghc
  • damhiya/ghc
  • ryndubei/ghc
  • DaveBarton/ghc
  • trac-Profpatsch/ghc
  • GZGavinZhao/ghc
  • ncfavier/ghc
  • jameshaydon/ghc
  • ajccosta/ghc
  • dschrempf/ghc
  • cydparser/ghc
  • LinuxUserGD/ghc
  • elodielander/ghc
  • facundominguez/ghc
  • psilospore/ghc
  • lachrimae/ghc
  • dylan-thinnes/ghc-type-errors-plugin
  • hamishmack/ghc
  • Leary/ghc
  • lzszt/ghc
  • lyokha/ghc
  • trac-glaubitz/ghc
  • Rewbert/ghc
  • andreabedini/ghc
  • Jasagredo/ghc
  • sol/ghc
  • OlegAlexander/ghc
  • trac-sthibaul/ghc
  • avdv/ghc
  • Wendaolee/ghc
  • ur4t/ghc
  • daylily/ghc
  • boltzmannrain/ghc
  • mmzk1526/ghc
  • trac-fizzixnerd/ghc
  • soulomoon/ghc
  • rwmjones/ghc
  • j14i/ghc
  • tracsis/ghc
  • gesh/ghc
  • flip101/ghc
  • eldritch-cookie/ghc
  • LemonjamesD/ghc
  • pgujjula/ghc
  • skeuchel/ghc
  • noteed/ghc
  • gulin.serge/ghc
  • Torrekie/ghc
  • jlwoodwa/ghc
  • ayanamists/ghc
  • husong998/ghc
  • trac-edmundnoble/ghc
  • josephf/ghc
  • contrun/ghc
  • baulig/ghc
  • edsko/ghc
  • mzschr/ghc-issue-24732
  • ulidtko/ghc
  • Arsen/ghc
  • trac-sjoerd_visscher/ghc
  • crumbtoo/ghc
  • L0neGamer/ghc
  • DrewFenwick/ghc
  • benz0li/ghc
  • MaciejWas/ghc
  • jordanrule/ghc
  • trac-qqwy/ghc
  • LiamGoodacre/ghc
  • isomorpheme/ghc
  • trac-danidiaz/ghc
  • Kariim/ghc
  • MTaimoorZaeem/ghc
  • hololeap/ghc
  • ticat-fp/ghc
  • meritamen/ghc
  • criskell/ghc
  • trac-kraai/ghc
  • aergus/ghc
  • jdral/ghc
  • SamB/ghc
  • Tristian/ghc
  • ywgrit/ghc
  • KatsuPatrick/ghc
  • OsePedro/ghc
  • mpscholten/ghc
  • fp/ghc
  • zaquest/ghc
  • fangyi-zhou/ghc
  • augyg/ghc
640 results
Show changes
Commits on Source (475)
Showing
with 1119 additions and 832 deletions
--command sh ./hadrian/ghci.sh
--command sh ./hadrian/ghci
--reload compiler
--reload ghc
--reload includes
......
......@@ -2,20 +2,19 @@ variables:
GIT_SSL_NO_VERIFY: "1"
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: 408eff66aef6ca2b44446c694c5a56d6ca0460cc
DOCKER_REV: 3f731f5d37a156e7ebe10cd32656946083baaf4a
# Sequential version number capturing the versions of all tools fetched by
# .gitlab/win32-init.sh.
# .gitlab/ci.sh.
WINDOWS_TOOLCHAIN_VERSION: 1
# Disable shallow clones; they break our linting rules
GIT_DEPTH: 0
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
# Overridden by individual jobs
CONFIGURE_ARGS: ""
GIT_SUBMODULE_STRATEGY: "recursive"
stages:
- lint # Source linting
......@@ -27,21 +26,31 @@ stages:
- testing # head.hackage correctness and compiler performance testing
- deploy # push documentation
# N.B.Don't run on wip/ branches, instead on run on merge requests.
.only-default: &only-default
only:
- master
- /ghc-[0-9]+\.[0-9]+/
- merge_requests
- tags
- web
workflow:
# N.B.Don't run on wip/ branches, instead on run on merge requests.
rules:
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_TAG
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
- if: '$CI_PIPELINE_SOURCE == "web"'
.nightly: &nightly
rules:
- if: $NIGHTLY
artifacts:
when: always
expire_in: 8 weeks
.release: &release
variables:
BUILD_FLAVOUR: "perf"
FLAVOUR: "perf"
artifacts:
when: always
expire_in: 1 year
only:
- tags
rules:
- if: '$RELEASE == "yes"'
############################################################
# Runner Tags
......@@ -75,13 +84,11 @@ ghc-linters:
dependencies: []
tags:
- lint
only:
refs:
- merge_requests
rules:
- if: $CI_MERGE_REQUEST_ID
# Run mypy Python typechecker on linter scripts.
lint-linters:
<<: *only-default
stage: lint
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
script:
......@@ -92,7 +99,6 @@ lint-linters:
# Check that .T files all parse by listing broken tests.
lint-testsuite:
<<: *only-default
stage: lint
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
script:
......@@ -103,7 +109,6 @@ lint-testsuite:
# Run mypy Python typechecker on testsuite driver
typecheck-testsuite:
<<: *only-default
stage: lint
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
script:
......@@ -116,7 +121,6 @@ typecheck-testsuite:
# accommodate, e.g., haddock changes not yet upstream) but not on `master` or
# Marge jobs.
.lint-submods:
<<: *only-default
stage: lint
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
script:
......@@ -129,25 +133,14 @@ typecheck-testsuite:
tags:
- lint
lint-submods-marge:
lint-submods:
extends: .lint-submods
only:
refs:
- merge_requests
variables:
- "$CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/"
lint-submods-mr:
extends: .lint-submods
# Allow failure since any necessary submodule patches may not be upstreamed
# yet.
allow_failure: true
only:
refs:
- merge_requests
except:
variables:
- "$CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/"
# Allow failure on merge requests since any necessary submodule patches may
# not be upstreamed yet.
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*marge_bot_batch_merge_job.*/'
allow_failure: false
- allow_failure: true
lint-submods-branch:
extends: .lint-submods
......@@ -155,13 +148,11 @@ lint-submods-branch:
- "echo Linting submodule changes between $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
- git submodule foreach git remote update
- submodchecker . $(git rev-list $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA)
only:
refs:
- master
- /ghc-[0-9]+\.[0-9]+/
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
.lint-changelogs:
<<: *only-default
stage: lint
image: "registry.gitlab.haskell.org/ghc/ci-images/linters:$DOCKER_REV"
dependencies: []
......@@ -174,15 +165,13 @@ lint-changelogs:
extends: .lint-changelogs
# Allow failure since this isn't a final release.
allow_failure: true
only:
refs:
- /ghc-[0-9]+\.[0-9]+/
rules:
- if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
lint-release-changelogs:
extends: .lint-changelogs
only:
refs:
- /ghc-[0-9]+\.[0-9]+\.[0-9]+-.*/
rules:
- if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
############################################################
......@@ -190,30 +179,13 @@ lint-release-changelogs:
############################################################
.validate-hadrian:
<<: *only-default
variables:
FLAVOUR: "validate"
script:
- cabal update
- git clean -xdf && git submodule foreach git clean -xdf
- .gitlab/prepare-system.sh
- if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
- ./boot
- ./configure $CONFIGURE_ARGS
- hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --docs=no-sphinx binary-dist
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
- export TOP=$(pwd)
- cd _build/bindist/ghc-*/ && ./configure --prefix=$TOP/_build/install && make install && cd ../../../
- |
# Prepare to push git notes.
export METRICS_FILE=$CI_PROJECT_DIR/performance-metrics.tsv
git config user.email "ben+ghc-ci@smart-cactus.org"
git config user.name "GHC GitLab CI"
.gitlab/test-metrics.sh pull
- hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --docs=no-sphinx test --summary-junit=./junit.xml --test-compiler=$TOP/_build/install/bin/ghc || (.gitlab/test-metrics.sh push && false)
- |
# Push git notes.
.gitlab/test-metrics.sh push
- .gitlab/ci.sh setup
- .gitlab/ci.sh configure
- .gitlab/ci.sh build_hadrian
- .gitlab/ci.sh test_hadrian
cache:
key: hadrian
paths:
......@@ -238,6 +210,8 @@ lint-release-changelogs:
- git submodule update --init --recursive
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
after_script:
- .gitlab/ci.sh clean
tags:
- x86_64-linux
......@@ -253,7 +227,6 @@ validate-x86_64-linux-deb9-unreg-hadrian:
TEST_ENV: "x86_64-linux-deb9-unreg-hadrian"
hadrian-ghc-in-ghci:
<<: *only-default
stage: quick-build
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
before_script:
......@@ -270,12 +243,12 @@ hadrian-ghc-in-ghci:
- cabal update
- cd hadrian; cabal new-build --project-file=ci.project; cd ..
- git clean -xdf && git submodule foreach git clean -xdf
- .gitlab/prepare-system.sh
- .gitlab/ci.sh setup
- if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
- ./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:
......@@ -286,31 +259,14 @@ hadrian-ghc-in-ghci:
############################################################
.validate:
<<: *only-default
variables:
TEST_TYPE: test
before_script:
- git clean -xdf && git submodule foreach git clean -xdf
MAKE_ARGS: "-Werror"
script:
- ./boot
- ./configure $CONFIGURE_ARGS
- |
THREADS=`mk/detect-cpu-count.sh`
make V=0 -j$THREADS WERROR=-Werror
- make binary-dist-prep TAR_COMP_OPTS="-1"
- make test_bindist TEST_PREP=YES
- |
# Prepare to push git notes.
METRICS_FILE=$CI_PROJECT_DIR/performance-metrics.tsv
git config user.email "ben+ghc-ci@smart-cactus.org"
git config user.name "GHC GitLab CI"
.gitlab/test-metrics.sh pull
- |
THREADS=`mk/detect-cpu-count.sh`
make $TEST_TYPE THREADS=$THREADS JUNIT_FILE=../../junit.xml METRICS_FILE=$METRICS_FILE || (METRICS_FILE=$METRICS_FILE .gitlab/test-metrics.sh push && false)
- |
# Push git notes.
METRICS_FILE=$METRICS_FILE .gitlab/test-metrics.sh push
- .gitlab/ci.sh setup
- .gitlab/ci.sh configure
- .gitlab/ci.sh build_make
- .gitlab/ci.sh test_make
dependencies: []
artifacts:
reports:
......@@ -321,6 +277,86 @@ hadrian-ghc-in-ghci:
- junit.xml
- performance-metrics.tsv
#################################
# x86_64-freebsd
#################################
.build-x86_64-freebsd:
extends: .validate
tags:
- x86_64-freebsd
allow_failure: true
variables:
# N.B. we use iconv from ports as I see linker errors when we attempt
# to use the "native" iconv embedded in libc as suggested by the
# porting guide [1].
# [1] https://www.freebsd.org/doc/en/books/porters-handbook/using-iconv.html)
CONFIGURE_ARGS: "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib"
GHC_VERSION: 8.10.1
CABAL_INSTALL_VERSION: 3.2.0.0
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-portbld-freebsd.tar.xz"
TEST_ENV: "x86_64-freebsd"
BUILD_FLAVOUR: "validate"
after_script:
- cp -Rf $HOME/.cabal cabal-cache
- .gitlab/ci.sh clean
artifacts:
when: always
expire_in: 2 week
cache:
key: "freebsd-$GHC_VERSION"
paths:
- cabal-cache
- toolchain
# Conditional due to lack of builder capacity
validate-x86_64-freebsd:
extends: .build-x86_64-freebsd
stage: full-build
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*FreeBSD.*/'
nightly-x86_64-freebsd:
<<: *nightly
extends: .build-x86_64-freebsd
stage: full-build
release-x86_64-freebsd:
<<: *release
extends: .build-x86_64-freebsd
stage: full-build
.build-x86_64-freebsd-hadrian:
extends: .validate-hadrian
stage: full-build
tags:
- x86_64-freebsd
allow_failure: true
variables:
CONFIGURE_ARGS: "--with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib"
HADRIAN_ARGS: "--docs=no-sphinx"
GHC_VERSION: 8.6.3
CABAL_INSTALL_VERSION: 3.0.0.0
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-portbld-freebsd.tar.xz"
TEST_ENV: "x86_64-freebsd-hadrian"
FLAVOUR: "validate"
after_script:
- cp -Rf $HOME/.cabal cabal-cache
- .gitlab/ci.sh clean
artifacts:
when: always
expire_in: 2 week
cache:
key: "freebsd-$GHC_VERSION"
paths:
- cabal-cache
- toolchain
# Disabled due to lack of builder capacity
.validate-x86_64-freebsd-hadrian:
extends: .build-x86_64-freebsd-hadrian
stage: full-build
#################################
# x86_64-darwin
#################################
......@@ -331,26 +367,19 @@ validate-x86_64-darwin:
tags:
- x86_64-darwin
variables:
GHC_VERSION: 8.6.5
CABAL_INSTALL_VERSION: 2.4.1.0
GHC_VERSION: 8.8.3
CABAL_INSTALL_VERSION: 3.0.0.0
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-apple-darwin.tar.xz"
MACOSX_DEPLOYMENT_TARGET: "10.7"
# Only Sierra and onwards supports clock_gettime. See #12858
ac_cv_func_clock_gettime: "no"
LANG: "en_US.UTF-8"
CONFIGURE_ARGS: --with-intree-gmp
CONFIGURE_ARGS: "--with-intree-gmp"
TEST_ENV: "x86_64-darwin"
before_script:
- git clean -xdf && git submodule foreach git clean -xdf
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
- bash .gitlab/darwin-init.sh
- PATH="`pwd`/toolchain/bin:$PATH"
BUILD_FLAVOUR: "perf"
after_script:
- cp -Rf $HOME/.cabal cabal-cache
- .gitlab/ci.sh clean
artifacts:
when: always
expire_in: 2 week
......@@ -362,38 +391,25 @@ validate-x86_64-darwin:
# Disabled because of OS X CI capacity
.validate-x86_64-darwin-hadrian:
<<: *only-default
stage: full-build
tags:
- x86_64-darwin
variables:
GHC_VERSION: 8.6.3
GHC_VERSION: 8.8.3
MACOSX_DEPLOYMENT_TARGET: "10.7"
ac_cv_func_clock_gettime: "no"
LANG: "en_US.UTF-8"
CONFIGURE_ARGS: --with-intree-gmp
TEST_ENV: "x86_64-darwin-hadrian"
FLAVOUR: "validate"
before_script:
- git clean -xdf && git submodule foreach git clean -xdf
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
- bash .gitlab/darwin-init.sh
- PATH="`pwd`/toolchain/bin:$PATH"
script:
- cabal update
- ./boot
- ./configure $CONFIGURE_ARGS
- hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --docs=no-sphinx binary-dist
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
- export TOP=$(pwd)
- cd _build/bindist/ghc-*/ && ./configure --prefix=$TOP/_build/install && make install && cd ../../../
- hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --docs=no-sphinx test --summary-junit=./junit.xml --test-compiler=$TOP/_build/install/bin/ghc
- .gitlab/ci.sh setup
- .gitlab/ci.sh configure
- .gitlab/ci.sh build_hadrian
- .gitlab/ci.sh test_hadrian
after_script:
- cp -Rf $HOME/.cabal cabal-cache
- .gitlab/ci.sh clean
artifacts:
when: always
expire_in: 2 week
......@@ -407,19 +423,15 @@ validate-x86_64-darwin:
extends: .validate
tags:
- x86_64-linux
variables:
BUILD_FLAVOUR: "perf"
before_script:
- git clean -xdf && git submodule foreach git clean -xdf
- git submodule sync --recursive
- git submodule update --init --recursive
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
# Build hyperlinked sources for documentation when building releases
- |
if [[ -n "$CI_COMMIT_TAG" ]]; then
echo "EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump" >> mk/build.mk
HADDOCK_HYPERLINKED_SOURCES=1
fi
- .gitlab/prepare-system.sh
# workaround for docker permissions
- sudo chown ghc:ghc -R .
after_script:
......@@ -454,14 +466,10 @@ validate-aarch64-linux-deb9:
expire_in: 2 week
nightly-aarch64-linux-deb9:
<<: *nightly
extends: .build-aarch64-linux-deb9
artifacts:
expire_in: 2 year
variables:
TEST_TYPE: slowtest
only:
variables:
- $NIGHTLY
#################################
# armv7-linux-deb9
......@@ -487,14 +495,10 @@ validate-armv7-linux-deb9:
expire_in: 2 week
nightly-armv7-linux-deb9:
<<: *nightly
extends: .build-armv7-linux-deb9
artifacts:
expire_in: 2 year
variables:
TEST_TYPE: slowtest
only:
variables:
- $NIGHTLY
#################################
# i386-linux-deb9
......@@ -517,15 +521,10 @@ validate-i386-linux-deb9:
expire_in: 2 week
nightly-i386-linux-deb9:
<<: *nightly
extends: .build-i386-linux-deb9
variables:
TEST_TYPE: slowtest
artifacts:
when: always
expire_in: 2 week
only:
variables:
- $NIGHTLY
#################################
# x86_64-linux-deb9
......@@ -554,15 +553,11 @@ release-x86_64-linux-deb9:
stage: full-build
nightly-x86_64-linux-deb9:
<<: *nightly
extends: .build-x86_64-linux-deb9
stage: full-build
artifacts:
expire_in: 2 year
variables:
TEST_TYPE: slowtest
only:
variables:
- $NIGHTLY
# N.B. Has DEBUG assertions enabled in stage2
validate-x86_64-linux-deb9-debug:
......@@ -576,7 +571,7 @@ validate-x86_64-linux-deb9-debug:
BUILD_SPHINX_PDF: "YES"
TEST_TYPE: slowtest
TEST_ENV: "x86_64-linux-deb9-debug"
BIN_DIST_PREP_COMP: "ghc-x86_64-deb9-linux-debug.tar.xz"
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-deb9-linux-debug.tar.xz"
artifacts:
when: always
expire_in: 2 week
......@@ -590,35 +585,30 @@ validate-x86_64-linux-deb9-debug:
TEST_ENV: "x86_64-linux-deb9-llvm"
nightly-x86_64-linux-deb9-llvm:
<<: *nightly
extends: .build-x86_64-linux-deb9
stage: full-build
variables:
BUILD_FLAVOUR: perf-llvm
TEST_ENV: "x86_64-linux-deb9-llvm"
only:
variables:
- $NIGHTLY
validate-x86_64-linux-deb9-integer-simple:
extends: .build-x86_64-linux-deb9
stage: full-build
variables:
BUILD_FLAVOUR: validate
INTEGER_LIBRARY: integer-simple
TEST_ENV: "x86_64-linux-deb9-integer-simple"
TEST_ENV: "x86_64-linux-deb9-integer-simple-validate"
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-deb9-linux-integer-simple.tar.xz"
nightly-x86_64-linux-deb9-integer-simple:
<<: *nightly
extends: .build-x86_64-linux-deb9
stage: full-build
variables:
INTEGER_LIBRARY: integer-simple
TEST_ENV: "x86_64-linux-deb9-integer-simple"
TEST_TYPE: slowtest
artifacts:
expire_in: 2 year
only:
variables:
- $NIGHTLY
validate-x86_64-linux-deb9-dwarf:
extends: .build-x86_64-linux-deb9
......@@ -649,14 +639,10 @@ validate-x86_64-linux-deb9-dwarf:
stage: full-build
nightly-x86_64-linux-deb10:
<<: *nightly
extends: .build-x86_64-linux-deb10
artifacts:
expire_in: 2 weeks
variables:
TEST_TYPE: slowtest
only:
variables:
- $NIGHTLY
release-x86_64-linux-deb10:
<<: *release
......@@ -691,18 +677,21 @@ release-x86_64-linux-deb8:
# x86_64-linux-alpine
#################################
.build-x86_64-linux-alpine:
extends: .validate-linux
.build-x86_64-linux-alpine-hadrian:
extends: .validate-linux-hadrian
stage: full-build
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine:$DOCKER_REV"
# There are currently a few failing tests
allow_failure: true
variables:
BUILD_SPHINX_PDF: "NO"
TEST_ENV: "x86_64-linux-alpine"
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-alpine-linux.tar.xz"
# Can't use ld.gold due to #13958.
CONFIGURE_ARGS: "--disable-ld-override"
HADRIAN_ARGS: "--docs=no-sphinx"
# encoding004 due to lack of locale support
# T10458 due to fact that dynamic linker tries to reload libAS
BROKEN_TESTS: "encoding004 T10458"
cache:
key: linux-x86_64-alpine
artifacts:
......@@ -711,13 +700,11 @@ release-x86_64-linux-deb8:
release-x86_64-linux-alpine:
<<: *release
extends: .build-x86_64-linux-alpine
extends: .build-x86_64-linux-alpine-hadrian
nightly-x86_64-linux-alpine:
extends: .build-x86_64-linux-alpine
only:
variables:
- $NIGHTLY
<<: *nightly
extends: .build-x86_64-linux-alpine-hadrian
#################################
# x86_64-linux-centos7
......@@ -766,63 +753,46 @@ validate-x86_64-linux-fedora27:
############################################################
.build-windows:
<<: *only-default
# For the reasons given in #17777 this build isn't reliable.
allow_failure: true
before_script:
- git clean -xdf
# Use a local temporary directory to ensure that concurrent builds don't
# interfere with one another
- |
mkdir tmp
set TMP=%cd%\tmp
set TEMP=%cd%\tmp
- set PATH=C:\msys64\usr\bin;%PATH%
# On Windows submodules can inexplicably get into funky states where git
# believes that the submodule is initialized yet its associated repository
# is not valid. Avoid failing in this case with the following insanity.
- |
bash -c 'git submodule sync --recursive || git submodule deinit --force --all'
bash -c 'git submodule update --init --recursive'
git submodule foreach git clean -xdf
- git checkout .gitmodules
- "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
- bash .gitlab/win32-init.sh
# Setup toolchain
- bash .gitlab/ci.sh setup
after_script:
- rd /s /q tmp
- robocopy /np /nfl /ndl /e "%APPDATA%\cabal" cabal-cache
- bash -c 'make clean || true'
- |
Copy-Item -Recurse -Path $Env:APPDATA\cabal -Destination cabal-cache
- bash .gitlab/ci.sh clean
dependencies: []
variables:
#FORCE_SYMLINKS: 1
LANG: "en_US.UTF-8"
SPHINXBUILD: "/mingw64/bin/sphinx-build.exe"
CABAL_INSTALL_VERSION: 3.0.0.0
GHC_VERSION: "8.8.3"
cache:
paths:
- cabal-cache
- ghc-8.6.5
- toolchain
- ghc-tarballs
.build-windows-hadrian:
extends: .build-windows
stage: full-build
variables:
GHC_VERSION: "8.6.5"
FLAVOUR: "validate"
# due to #16574 this currently fails
allow_failure: true
script:
- |
python boot
bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
- bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --flavour=Quick --docs=no-sphinx binary-dist"
- mv _build/bindist/ghc*.tar.xz ghc.tar.xz
- bash -c "export TOP=$(pwd); cd _build/bindist/ghc-*/ && PATH=$TOP/toolchain/bin:$PATH ./configure --prefix=$TOP/_build/install && make install && cd ../../../"
- bash -c "export TOP=$(pwd); PATH=$TOP/toolchain/bin:$PATH hadrian/build.cabal.sh --flavour=$FLAVOUR -j`mk/detect-cpu-count.sh` --flavour=quick test --summary-junit=./junit.xml --skip-perf --test-compiler=$TOP/_build/install/bin/ghc"
# skipping perf tests for now since we build a quick-flavoured GHC,
# which might result in some broken perf tests?
HADRIAN_ARGS: "--docs=no-sphinx --skip-perf"
script:
- bash .gitlab/ci.sh configure
- bash .gitlab/ci.sh build_hadrian
- bash .gitlab/ci.sh test_hadrian
tags:
- x86_64-windows
- new-x86_64-windows
- test
artifacts:
reports:
junit: junit.xml
......@@ -841,13 +811,11 @@ validate-x86_64-windows-hadrian:
key: "x86_64-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
nightly-i386-windows-hadrian:
<<: *nightly
extends: .build-windows-hadrian
variables:
MSYSTEM: MINGW32
TEST_ENV: "i386-windows-hadrian"
only:
variables:
- $NIGHTLY
cache:
key: "i386-windows-hadrian-$WINDOWS_TOOLCHAIN_VERSION"
......@@ -856,20 +824,14 @@ nightly-i386-windows-hadrian:
stage: full-build
variables:
BUILD_FLAVOUR: "quick"
GHC_VERSION: "8.6.5"
BIN_DIST_PREP_TAR_COMP: "ghc-x86_64-mingw32.tar.xz"
script:
- |
python boot
bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex $CONFIGURE_ARGS'
- bash -c "echo include mk/flavours/${BUILD_FLAVOUR}.mk > mk/build.mk"
- bash -c "echo 'GhcLibHcOpts+=-haddock' >> mk/build.mk"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make binary-dist-prep TAR_COMP_OPTS=-1"
- bash -c "PATH=`pwd`/toolchain/bin:$PATH make test_bindist TEST_PREP=YES"
- bash -c 'make V=0 test PYTHON=/mingw64/bin/python3 THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
- bash .gitlab/ci.sh configure
- bash .gitlab/ci.sh build_make
- bash .gitlab/ci.sh test_make
tags:
- x86_64-windows
- new-x86_64-windows
- test
artifacts:
when: always
expire_in: 2 week
......@@ -877,69 +839,70 @@ nightly-i386-windows-hadrian:
junit: junit.xml
paths:
# N.B. variable interpolation apparently doesn't work on Windows so
# this can't be $BIN_DIST_TAR_COMP
# this can't be $BIN_DIST_PREP_TAR_COMP
- "ghc-x86_64-mingw32.tar.xz"
- junit.xml
validate-x86_64-windows:
.build-x86_64-windows-make:
extends: .build-windows-make
variables:
MSYSTEM: MINGW64
CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
TEST_ENV: "x86_64-windows"
cache:
key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
validate-x86_64-windows:
extends: .build-x86_64-windows-make
nightly-x86_64-windows:
extends: .build-windows-make
<<: *nightly
extends: .build-x86_64-windows-make
stage: full-build
variables:
BUILD_FLAVOUR: "validate"
MSYSTEM: MINGW64
CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
only:
variables:
- $NIGHTLY
cache:
key: "x86_64-windows-$WINDOWS_TOOLCHAIN_VERSION"
# Normal Windows validate builds are profiled; that won't do for releases.
release-x86_64-windows:
<<: *release
extends: validate-x86_64-windows
variables:
MSYSTEM: MINGW64
BUILD_FLAVOUR: "perf"
CONFIGURE_ARGS: "--target=x86_64-unknown-mingw32"
TEST_ENV: "x86_64-windows"
release-i386-windows:
#
release-x86_64-windows-integer-simple:
<<: *release
extends: .build-windows-make
extends: validate-x86_64-windows
variables:
MSYSTEM: MINGW32
INTEGER_LIBRARY: integer-simple
BUILD_FLAVOUR: "perf"
CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
# Due to #15934
BUILD_PROF_LIBS: "NO"
TEST_ENV: "i386-windows"
cache:
key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
nightly-i386-windows:
.build-i386-windows-make:
extends: .build-windows-make
only:
variables:
- $NIGHTLY
variables:
MSYSTEM: MINGW32
CONFIGURE_ARGS: "--target=i386-unknown-mingw32"
# Due to #15934
BUILD_PROF_LIBS: "NO"
TEST_ENV: "i386-windows"
# Due to #17736
allow_failure: true
cache:
key: "i386-windows-$WINDOWS_TOOLCHAIN_VERSION"
validate-i386-windows:
extends: .build-i386-windows-make
variables:
BUILD_FLAVOUR: "perf"
release-i386-windows:
<<: *release
extends: .build-i386-windows-make
variables:
BUILD_FLAVOUR: "perf"
nightly-i386-windows:
<<: *nightly
extends: .build-i386-windows-make
############################################################
# Cleanup
############################################################
......@@ -963,7 +926,6 @@ nightly-i386-windows:
# See Note [Cleanup after shell executor]
cleanup-darwin:
<<: *only-default
stage: cleanup
tags:
- x86_64-darwin
......@@ -985,7 +947,6 @@ cleanup-darwin:
############################################################
doc-tarball:
<<: *only-default
stage: packaging
tags:
- x86_64-linux
......@@ -994,7 +955,7 @@ doc-tarball:
- validate-x86_64-linux-deb9-debug
- validate-x86_64-windows
variables:
LINUX_BINDIST: "ghc-x86_64-deb9-linux.tar.xz"
LINUX_BINDIST: "ghc-x86_64-deb9-linux-debug.tar.xz"
WINDOWS_BINDIST: "ghc-x86_64-mingw32.tar.xz"
# Due to Windows allow_failure
allow_failure: true
......@@ -1025,16 +986,16 @@ source-tarball:
tags:
- x86_64-linux
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
when: always
dependencies: []
only:
- tags
rules:
- if: $CI_COMMIT_TAG
when: always
artifacts:
paths:
- ghc-*.tar.xz
- version
script:
- mk/get-win32-tarballs.sh download all
- python3 mk/get-win32-tarballs.py download all
- ./boot
- ./configure
- make sdist
......@@ -1055,7 +1016,6 @@ source-tarball:
# pipeline.
.hackage:
<<: *only-default
stage: testing
image: ghcci/x86_64-linux-deb9:0.2
tags:
......@@ -1072,15 +1032,12 @@ hackage:
hackage-label:
extends: .hackage
only:
variables:
- $CI_MERGE_REQUEST_LABELS =~ /.*user-facing.*/
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*user-facing.*/'
nightly-hackage:
<<: *nightly
extends: .hackage
only:
variables:
- $NIGHTLY
############################################################
# Nofib testing
......@@ -1091,11 +1048,10 @@ perf-nofib:
dependencies:
- validate-x86_64-linux-deb9-dwarf
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
only:
refs:
- merge_requests
- master
- /ghc-[0-9]+\.[0-9]+/
rules:
- if: $CI_MERGE_REQUEST_ID
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
tags:
- x86_64-linux
script:
......@@ -1144,8 +1100,8 @@ pages:
<meta http-equiv="refresh" content="1; url=doc/">
EOF
- cp -f index.html public/doc
only:
- master
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
artifacts:
paths:
- public
#!/usr/bin/env bash
# shellcheck disable=SC2230
# This is the primary driver of the GitLab CI infrastructure.
set -e -o pipefail
# Configuration:
hackage_index_state="@1579718451"
# Colors
BLACK="0;30"
GRAY="1;30"
RED="0;31"
LT_RED="1;31"
BROWN="0;33"
LT_BROWN="1;33"
GREEN="0;32"
LT_GREEN="1;32"
BLUE="0;34"
LT_BLUE="1;34"
PURPLE="0;35"
LT_PURPLE="1;35"
CYAN="0;36"
LT_CYAN="1;36"
WHITE="1;37"
LT_GRAY="0;37"
# GitLab Pipelines log section delimiters
# https://gitlab.com/gitlab-org/gitlab-foss/issues/14664
start_section() {
name="$1"
echo -e "section_start:$(date +%s):$name\015\033[0K"
}
end_section() {
name="$1"
echo -e "section_end:$(date +%s):$name\015\033[0K"
}
echo_color() {
local color="$1"
local msg="$2"
echo -e "\033[${color}m${msg}\033[0m"
}
error() { echo_color "${RED}" "$1"; }
warn() { echo_color "${LT_BROWN}" "$1"; }
info() { echo_color "${LT_BLUE}" "$1"; }
fail() { error "error: $1"; exit 1; }
function run() {
info "Running $*..."
"$@" || ( error "$* failed"; return 1; )
}
TOP="$(pwd)"
function mingw_init() {
case "$MSYSTEM" in
MINGW32)
triple="i386-unknown-mingw32"
boot_triple="i386-unknown-mingw32" # triple of bootstrap GHC
;;
MINGW64)
triple="x86_64-unknown-mingw32"
boot_triple="x86_64-unknown-mingw32" # triple of bootstrap GHC
;;
*)
fail "win32-init: Unknown MSYSTEM $MSYSTEM"
;;
esac
# Bring mingw toolchain into PATH.
# This is extracted from /etc/profile since this script inexplicably fails to
# run under gitlab-runner.
# shellcheck disable=SC1091
source /etc/msystem
MINGW_MOUNT_POINT="${MINGW_PREFIX}"
PATH="$MINGW_MOUNT_POINT/bin:$PATH"
# We always use mingw64 Python to avoid path length issues like #17483.
export PYTHON="/mingw64/bin/python3"
}
# This will contain GHC's local native toolchain
toolchain="$TOP/toolchain"
mkdir -p "$toolchain/bin"
PATH="$toolchain/bin:$PATH"
export METRICS_FILE="$CI_PROJECT_DIR/performance-metrics.tsv"
cores="$(mk/detect-cpu-count.sh)"
# Use a local temporary directory to ensure that concurrent builds don't
# interfere with one another
mkdir -p "$TOP/tmp"
export TMP="$TOP/tmp"
export TEMP="$TOP/tmp"
function darwin_setup() {
# It looks like we already have python2 here and just installing python3
# does not work.
brew upgrade python
brew install ghc cabal-install ncurses gmp
pip3 install sphinx
# PDF documentation disabled as MacTeX apparently doesn't include xelatex.
#brew cask install mactex
}
function show_tool() {
local tool="$1"
info "$tool = ${!tool}"
${!tool} --version
}
function set_toolchain_paths() {
needs_toolchain=1
case "$(uname)" in
Linux) needs_toolchain="" ;;
*) ;;
esac
if [[ -n "$needs_toolchain" ]]; then
# These are populated by setup_toolchain
GHC="$toolchain/bin/ghc$exe"
CABAL="$toolchain/bin/cabal$exe"
HAPPY="$toolchain/bin/happy$exe"
ALEX="$toolchain/bin/alex$exe"
else
GHC="$(which ghc)"
CABAL="/usr/local/bin/cabal"
HAPPY="$HOME/.cabal/bin/happy"
ALEX="$HOME/.cabal/bin/alex"
fi
export GHC
export CABAL
export HAPPY
export ALEX
}
# Extract GHC toolchain
function setup() {
if [ -d "$TOP/cabal-cache" ]; then
info "Extracting cabal cache..."
mkdir -p "$cabal_dir"
cp -Rf cabal-cache/* "$cabal_dir"
fi
if [[ -n "$needs_toolchain" ]]; then
setup_toolchain
fi
case "$(uname)" in
Darwin) darwin_setup ;;
*) ;;
esac
# Make sure that git works
git config user.email "ghc-ci@gitlab-haskell.org"
git config user.name "GHC GitLab CI"
info "====================================================="
info "Toolchain versions"
info "====================================================="
show_tool GHC
show_tool CABAL
show_tool HAPPY
show_tool ALEX
}
function fetch_ghc() {
local v="$GHC_VERSION"
if [[ -z "$v" ]]; then
fail "GHC_VERSION is not set"
fi
if [ ! -e "$GHC" ]; then
start_section "fetch GHC"
url="https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-${boot_triple}.tar.xz"
info "Fetching GHC binary distribution from $url..."
curl "$url" > ghc.tar.xz || fail "failed to fetch GHC binary distribution"
tar -xJf ghc.tar.xz || fail "failed to extract GHC binary distribution"
case "$(uname)" in
MSYS_*|MINGW*)
cp -r "ghc-${GHC_VERSION}"/* "$toolchain"
;;
*)
pushd "ghc-${GHC_VERSION}"
./configure --prefix="$toolchain"
"$MAKE" install
popd
;;
esac
rm -Rf "ghc-${GHC_VERSION}" ghc.tar.xz
end_section "fetch GHC"
fi
}
function fetch_cabal() {
local v="$CABAL_INSTALL_VERSION"
if [[ -z "$v" ]]; then
fail "CABAL_INSTALL_VERSION is not set"
fi
if [ ! -e "$CABAL" ]; then
start_section "fetch GHC"
case "$(uname)" in
# N.B. Windows uses zip whereas all others use .tar.xz
MSYS_*|MINGW*)
case "$MSYSTEM" in
MINGW32) cabal_arch="i386" ;;
MINGW64) cabal_arch="x86_64" ;;
*) fail "unknown MSYSTEM $MSYSTEM" ;;
esac
url="https://downloads.haskell.org/~cabal/cabal-install-$v/cabal-install-$v-$cabal_arch-unknown-mingw32.zip"
info "Fetching cabal binary distribution from $url..."
curl "$url" > "$TMP/cabal.zip"
unzip "$TMP/cabal.zip"
mv cabal.exe "$CABAL"
;;
*)
local base_url="https://downloads.haskell.org/~cabal/cabal-install-$v/"
case "$(uname)" in
Darwin) cabal_url="$base_url/cabal-install-$v-x86_64-apple-darwin17.7.0.tar.xz" ;;
FreeBSD)
#cabal_url="$base_url/cabal-install-$v-x86_64-portbld-freebsd.tar.xz" ;;
cabal_url="http://home.smart-cactus.org/~ben/ghc/cabal-install-3.0.0.0-x86_64-portbld-freebsd.tar.xz" ;;
*) fail "don't know where to fetch cabal-install for $(uname)"
esac
echo "Fetching cabal-install from $cabal_url"
curl "$cabal_url" > cabal.tar.xz
tar -xJf cabal.tar.xz
mv cabal "$toolchain/bin"
;;
esac
end_section "fetch GHC"
fi
}
# For non-Docker platforms we prepare the bootstrap toolchain
# here. For Docker platforms this is done in the Docker image
# build.
function setup_toolchain() {
fetch_ghc
fetch_cabal
cabal_install="$CABAL v2-install --index-state=$hackage_index_state --installdir=$toolchain/bin"
# Avoid symlinks on Windows
case "$(uname)" in
MSYS_*|MINGW*) cabal_install="$cabal_install --install-method=copy" ;;
*) ;;
esac
if [ ! -e "$HAPPY" ]; then
info "Building happy..."
cabal update
$cabal_install happy
fi
if [ ! -e "$ALEX" ]; then
info "Building alex..."
cabal update
$cabal_install alex
fi
}
function cleanup_submodules() {
start_section "clean submodules"
info "Cleaning submodules..."
# On Windows submodules can inexplicably get into funky states where git
# believes that the submodule is initialized yet its associated repository
# is not valid. Avoid failing in this case with the following insanity.
git submodule sync --recursive || git submodule deinit --force --all
git submodule update --init --recursive
git submodule foreach git clean -xdf
end_section "clean submodules"
}
function prepare_build_mk() {
if [[ -z "$BUILD_FLAVOUR" ]]; then fail "BUILD_FLAVOUR is not set"; fi
if [[ -z ${BUILD_SPHINX_HTML:-} ]]; then BUILD_SPHINX_HTML=YES; fi
if [[ -z ${BUILD_SPHINX_PDF:-} ]]; then BUILD_SPHINX_PDF=YES; fi
if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi
cat > mk/build.mk <<EOF
V=1
HADDOCK_DOCS=YES
LATEX_DOCS=YES
HSCOLOUR_SRCS=YES
BUILD_SPHINX_HTML=$BUILD_SPHINX_HTML
BUILD_SPHINX_PDF=$BUILD_SPHINX_PDF
BeConservative=YES
INTEGER_LIBRARY=$INTEGER_LIBRARY
XZ_CMD=$XZ
BuildFlavour=$BUILD_FLAVOUR
ifneq "\$(BuildFlavour)" ""
include mk/flavours/\$(BuildFlavour).mk
endif
GhcLibHcOpts+=-haddock
EOF
if [ -n "$HADDOCK_HYPERLINKED_SOURCES" ]; then
echo "EXTRA_HADDOCK_OPTS += --hyperlinked-source --quickjump" >> mk/build.mk
fi
case "$(uname)" in
Darwin) echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk ;;
*) ;;
esac
info "build.mk is:"
cat mk/build.mk
}
function configure() {
start_section "booting"
run python3 boot
end_section "booting"
local target_args=""
if [[ -n "$triple" ]]; then
target_args="--target=$triple"
fi
start_section "configuring"
run ./configure \
--enable-tarballs-autodownload \
$target_args \
$CONFIGURE_ARGS \
GHC="$GHC" \
HAPPY="$HAPPY" \
ALEX="$ALEX" \
|| ( cat config.log; fail "configure failed" )
end_section "configuring"
}
function build_make() {
prepare_build_mk
if [[ -z "$BIN_DIST_PREP_TAR_COMP" ]]; then
fail "BIN_DIST_PREP_TAR_COMP is not set"
fi
echo "include mk/flavours/${BUILD_FLAVOUR}.mk" > mk/build.mk
echo 'GhcLibHcOpts+=-haddock' >> mk/build.mk
run "$MAKE" -j"$cores" $MAKE_ARGS
run "$MAKE" -j"$cores" binary-dist-prep TAR_COMP_OPTS=-1
ls -lh "$BIN_DIST_PREP_TAR_COMP"
}
function fetch_perf_notes() {
info "Fetching perf notes..."
"$TOP/.gitlab/test-metrics.sh" pull
}
function push_perf_notes() {
info "Pushing perf notes..."
"$TOP/.gitlab/test-metrics.sh" push
}
function test_make() {
run "$MAKE" test_bindist TEST_PREP=YES
run "$MAKE" V=0 test \
THREADS="$cores" \
JUNIT_FILE=../../junit.xml
}
function build_hadrian() {
if [ -z "$FLAVOUR" ]; then
fail "FLAVOUR not set"
fi
run_hadrian binary-dist
mv _build/bindist/ghc*.tar.xz ghc.tar.xz
}
function test_hadrian() {
cd _build/bindist/ghc-*/
run ./configure --prefix="$TOP"/_build/install
run "$MAKE" install
cd ../../../
run_hadrian \
test \
--summary-junit=./junit.xml \
--test-compiler="$TOP"/_build/install/bin/ghc
}
function clean() {
rm -R tmp
run "$MAKE" --quiet clean || true
run rm -Rf _build
}
function run_hadrian() {
run hadrian/build-cabal \
--flavour="$FLAVOUR" \
-j"$cores" \
--broken-test="$BROKEN_TESTS" \
$HADRIAN_ARGS \
$@
}
# A convenience function to allow debugging in the CI environment.
function shell() {
local cmd=$@
if [ -z "$cmd" ]; then
cmd="bash -i"
fi
run $cmd
}
# Determine Cabal data directory
case "$(uname)" in
MSYS_*|MINGW*) exe=".exe"; cabal_dir="$APPDATA/cabal" ;;
*) cabal_dir="$HOME/.cabal"; exe="" ;;
esac
# Platform-specific environment initialization
MAKE="make"
case "$(uname)" in
MSYS_*|MINGW*) mingw_init ;;
Darwin) boot_triple="x86_64-apple-darwin" ;;
FreeBSD)
boot_triple="x86_64-portbld-freebsd"
MAKE="gmake"
;;
Linux) ;;
*) fail "uname $(uname) is not supported" ;;
esac
set_toolchain_paths
case $1 in
setup) setup && cleanup_submodules ;;
configure) configure ;;
build_make) build_make ;;
test_make) fetch_perf_notes; test_make; push_perf_notes ;;
build_hadrian) build_hadrian ;;
test_hadrian) fetch_perf_notes; test_hadrian; push_perf_notes ;;
run_hadrian) run_hadrian $@ ;;
clean) clean ;;
shell) shell $@ ;;
*) fail "unknown mode $1" ;;
esac
#!/bin/bash
set -e
toolchain=`pwd`/toolchain
PATH="$toolchain/bin:$PATH"
if [ -d "`pwd`/cabal-cache" ]; then
cp -Rf cabal-cache $HOME/.cabal
fi
if [ ! -e $toolchain/bin/ghc ]; then
mkdir -p tmp
cd tmp
ghc_tarball="https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-apple-darwin.tar.xz"
echo "Fetching GHC from $ghc_tarball"
curl $ghc_tarball | tar -xJ
cd ghc-$GHC_VERSION
./configure --prefix=$toolchain
make install
cd ../..
rm -Rf tmp
fi
if [ ! -e $toolchain/bin/cabal ]; then
cabal_tarball="https://downloads.haskell.org/~cabal/cabal-install-$CABAL_INSTALL_VERSION/cabal-install-$CABAL_INSTALL_VERSION-x86_64-apple-darwin-sierra.tar.xz"
echo "Fetching cabal-install from $cabal_tarball"
curl $cabal_tarball | tar -xz
mv cabal $toolchain/bin
fi
if [ ! -e $toolchain/bin/happy ]; then
cabal update
cabal new-install happy --symlink-bindir=$toolchain/bin
fi
if [ ! -e $toolchain/bin/alex ]; then
cabal update
cabal new-install alex --symlink-bindir=$toolchain/bin
fi
......@@ -29,6 +29,8 @@ for l in linters:
# Don't lint font files
l.add_path_filter(lambda path: not path.parent == Path('docs','users_guide',
'rtd-theme', 'static', 'fonts'))
# Don't lint core spec
l.add_path_filter(lambda path: not path.name == 'core-spec.pdf')
if __name__ == '__main__':
run_linters(linters)
......@@ -9,10 +9,11 @@ Please take a few moments to verify that your commits fulfill the following:
* [ ] have added source comments describing your change. For larger changes you
likely should add a [Note][notes] and cross-reference it from the relevant
places.
* [ ] add a [testcase to the
testsuite](https://gitlab.haskell.org/ghc/ghc/wikis/building/running-tests/adding).
* [ ] add a [testcase to the testsuite](https://gitlab.haskell.org/ghc/ghc/wikis/building/running-tests/adding).
* [ ] if your MR affects library interfaces (e.g. changes `base`) please add
the ~"user facing" label.
* [ ] updates the users guide if applicable
* [ ] mentions new features in the release notes for the next release
If you have any questions don't hesitate to open your merge request and inquire
in a comment. If your patch isn't quite done yet please do add prefix your MR
......
#!/usr/bin/env bash
# vim: sw=2 et
set -euo pipefail
fail() {
echo "ERROR: $*" >&2
exit 1
}
hackage_index_state="@1522046735"
if [[ -z ${BUILD_SPHINX_HTML:-} ]]; then BUILD_SPHINX_HTML=YES; fi
if [[ -z ${BUILD_SPHINX_PDF:-} ]]; then BUILD_SPHINX_PDF=YES; fi
if [[ -z ${INTEGER_LIBRARY:-} ]]; then INTEGER_LIBRARY=integer-gmp; fi
if [[ -z ${BUILD_FLAVOUR:-} ]]; then BUILD_FLAVOUR=perf; fi
if [[ -z ${XZ:-} ]]; then
if which pxz; then
XZ="pxz"
elif which xz; then
# Check whether --threads is supported
if echo "hello" | xz --threads=$CORES >/dev/null; then
XZ="xz --threads=$CORES"
else
XZ="xz"
fi
else
echo "error: neither pxz nor xz were found"
exit 1
fi
fi
echo "Using $XZ for compression..."
cat > mk/build.mk <<EOF
V=1
HADDOCK_DOCS=YES
LATEX_DOCS=YES
HSCOLOUR_SRCS=YES
BUILD_SPHINX_HTML=$BUILD_SPHINX_HTML
BUILD_SPHINX_PDF=$BUILD_SPHINX_PDF
BeConservative=YES
INTEGER_LIBRARY=$INTEGER_LIBRARY
XZ_CMD=$XZ
EOF
cat <<EOF >> mk/build.mk
BuildFlavour=$BUILD_FLAVOUR
ifneq "\$(BuildFlavour)" ""
include mk/flavours/\$(BuildFlavour).mk
endif
GhcLibHcOpts+=-haddock
EOF
case "$(uname)" in
Linux)
if [[ -n ${TARGET:-} ]]; then
if [[ $TARGET = FreeBSD ]]; then
# cross-compiling to FreeBSD
echo 'HADDOCK_DOCS = NO' >> mk/build.mk
echo 'WERROR=' >> mk/build.mk
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
echo 'export PATH=/opt/ghc/bin:$PATH' >> $BASH_ENV
else
fail "TARGET=$target not supported"
fi
fi
;;
Darwin)
if [[ -n ${TARGET:-} ]]; then
fail "uname=$(uname) not supported for cross-compilation"
fi
# It looks like we already have python2 here and just installing python3
# does not work.
brew upgrade python
brew install ghc cabal-install ncurses gmp
pip3 install sphinx
# PDF documentation disabled as MacTeX apparently doesn't include xelatex.
#brew cask install mactex
cabal update
cabal install --reinstall alex happy haddock hscolour --index-state=$hackage_index_state
# put them on the $PATH, don't fail if already installed
ln -s $HOME/.cabal/bin/alex /usr/local/bin/alex || true
ln -s $HOME/.cabal/bin/happy /usr/local/bin/happy || true
ln -s $HOME/.cabal/bin/HsColour /usr/local/bin/HsColour || true
echo "libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp" >> mk/build.mk
;;
*)
fail "uname=$(uname) not supported"
esac
echo "================================================="
echo "Build.mk:"
echo ""
cat mk/build.mk
echo "================================================="
#!/bin/bash
set -e
toolchain=`pwd`/toolchain
PATH="$toolchain/bin:/mingw64/bin:$PATH"
if [ -d "`pwd`/cabal-cache" ]; then
cp -Rf cabal-cache $APPDATA/cabal
fi
if [ ! -e $toolchain/bin/ghc ]; then
case $MSYSTEM in
MINGW32)
triple="i386-unknown-mingw32"
;;
MINGW64)
triple="x86_64-unknown-mingw32"
;;
*)
echo "win32-init: Unknown MSYSTEM $MSYSTEM"
exit 1
;;
esac
curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-$triple.tar.xz | tar -xJ
mv ghc-$GHC_VERSION toolchain
fi
if [ ! -e $toolchain/bin/cabal ]; then
url="https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-mingw32.zip"
curl $url > /tmp/cabal.zip
unzip /tmp/cabal.zip
mv cabal.exe $toolchain/bin
fi
if [ ! -e $toolchain/bin/happy ]; then
cabal update
cabal install happy
cp $APPDATA/cabal/bin/happy $toolchain/bin
fi
if [ ! -e $toolchain/bin/alex ]; then
cabal update
cabal install alex
cp $APPDATA/cabal/bin/alex $toolchain/bin
fi
......@@ -16,26 +16,26 @@
/includes/ @bgamari @simonmar @osa1
# The compiler
/compiler/parser/ @int-index
/compiler/hsSyn/ @simonpj @rae
/compiler/typecheck/ @simonpj @rae
/compiler/rename/ @simonpj @rae
/compiler/types/ @simonpj @rae
/compiler/deSugar/ @simonpj @rae
/compiler/typecheck/TcDeriv* @RyanGlScott
/compiler/nativeGen/ @simonmar @bgamari @AndreasK
/compiler/llvmGen/ @angerman
/compiler/codeGen/ @simonmar @osa1
/compiler/cmm/ @simonmar @osa1
/compiler/ghci/ @simonmar
/compiler/simplCore/CallArity.hs @nomeata
/compiler/utils/UnVarGraph.hs @nomeata
/compiler/simplCore/Exitify.hs @nomeata
/compiler/simplStg/StgCse.hs @nomeata
/compiler/simplStg/StgLiftLams.hs @sgraf
/compiler/cmm/CmmSwitch.hs @nomeata
/compiler/stranal/DmdAnal.hs @simonpj @sgraf
/compiler/hsSyn/Convert.hs @rae
/compiler/parser/ @int-index
/compiler/GHC/Hs/ @simonpj @rae
/compiler/GHC/Tc/ @simonpj @rae
/compiler/GHC/Rename/ @simonpj @rae
/compiler/GHC/Types/ @simonpj @rae
/compiler/GHC/HsToCore/ @simonpj @rae
/compiler/GHC/Tc/Deriv/ @RyanGlScott
/compiler/GHC/CmmToAsm/ @simonmar @bgamari @AndreasK
/compiler/GHC/CmmToLlvm/ @angerman
/compiler/GHC/StgToCmm/ @simonmar @osa1
/compiler/GHC/Cmm/ @simonmar @osa1
/compiler/ghci/ @simonmar
/compiler/GHC/Core/Op/CallArity.hs @nomeata
/compiler/utils/UnVarGraph.hs @nomeata
/compiler/GHC/Core/Op/Exitify.hs @nomeata
/compiler/GHC/Stg/CSE.hs @nomeata
/compiler/GHC/Stg/Lift.hs @sgraf
/compiler/GHC/Cmm/Switch.hs @nomeata
/compiler/GHC/Core/Op/DmdAnal.hs @simonpj @sgraf
/compiler/GHC/ThToHs.hs @rae
# Core libraries
/libraries/base/ @hvr
......
......@@ -12,7 +12,7 @@ The home for GHC hackers is our GitLab instance, located here:
<https://gitlab.haskell.org/ghc/ghc>
From here, you can file bugs (or look them up,) use the wiki, view the
From here, you can file bugs (or look them up), use the wiki, view the
`git` history, among other things. Of particular note is the building
page, which has the high level overview of the build process and how
to get the source:
......@@ -34,7 +34,7 @@ $ git clone --recursive git@gitlab.haskell.org:ghc/ghc.git
```
On Windows, you need an extra repository containing some build tools.
These can be downloaded for you by configure. This only needs to be done once by running:
These can be downloaded for you by `configure`. This only needs to be done once by running:
```
$ ./configure --enable-tarballs-autodownload
......@@ -50,7 +50,7 @@ $ ... double-check mk/build.mk ...
```
Now build. The convenient `validate` script will build the tree in a way which
is both quick to build and consistent with our testsuite,
is both quick to build and consistent with our testsuite:
```
$ ./validate --build-only
......@@ -62,15 +62,15 @@ newly built compiler.
Now, hack on your copy and rebuild (with `make`) as necessary.
Then start by making your commits however you want. When you're done, you can submit
a pull request on Github for small changes. For larger changes the patch needs to be
submitted to [GitLab](https://gitlab.haskell.org/ghc/ghc/merge_requests) for code review.
The GHC Wiki has a good summary for the [overall process](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs).
a pull request on Github for small changes. For larger changes the patch needs to be
submitted to [GitLab](https://gitlab.haskell.org/ghc/ghc/merge_requests) for code review.
The GHC Wiki has a good summary for the [overall process](https://gitlab.haskell.org/ghc/ghc/wikis/working-conventions/fixing-bugs). One or several reviewers will review your PR, and when they are ok with your changes, they will assign the PR to [Marge Bot](https://gitlab.haskell.org/marge-bot) which will automatically rebase, batch and then merge your PR (assuming the build passes).
Useful links:
=============
An overview of things like using git, the release process, filing bugs
An overview of things like using Git, the release process, filing bugs
and more can be located here:
<https://gitlab.haskell.org/ghc/ghc/wikis/contributing>
......@@ -94,8 +94,6 @@ and type information of the GHC sources is available at:
Look for `GHC` in `Package-name`. For example, here is the link to
[GHC-8.6.5](https://haskell-code-explorer.mfix.io/package/ghc-8.6.5).
If you want to watch issues and code review activities, the following page is a good start:
<https://gitlab.haskell.org/ghc/ghc/activity>
......
......@@ -647,6 +647,7 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
# $5 is the name of the CPP flags variable
AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
[
AC_REQUIRE([FP_PROG_LD_IS_GNU])
AC_MSG_CHECKING([Setting up $2, $3, $4 and $5])
case $$1 in
i386-*)
......@@ -663,10 +664,20 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$2="$$2 -march=i686"
;;
x86_64-unknown-solaris2)
# Solaris is a multi-lib platform, providing both 32- and 64-bit
# user-land. It appears to default to 32-bit builds but we of course want to
# compile for 64-bits on x86-64.
#
# On OpenSolaris uses gnu ld whereas SmartOS appears to use the Solaris
# implementation, which rather uses the -64 flag.
$2="$$2 -m64"
$3="$$3 -m64"
$4="$$4 -m64"
$5="$$5 -m64"
if test "$fp_cv_gnu_ld" = "yes"; then
$4="$$4 -m64"
else
$4="$$4 -64"
fi
;;
alpha-*)
# For now, to suppress the gcc warning "call-clobbered
......@@ -2116,14 +2127,14 @@ fi
AC_SUBST($1)
])
# LIBRARY_VERSION(lib, [dir])
# LIBRARY_VERSION(lib, [cabal_file])
# --------------------------------
# Gets the version number of a library.
# If $1 is ghc-prim, then we define LIBRARY_ghc_prim_VERSION as 1.2.3
# $2 points to the directory under libraries/
AC_DEFUN([LIBRARY_VERSION],[
dir=m4_default([$2],[$1])
LIBRARY_[]translit([$1], [-], [_])[]_VERSION=`grep -i "^version:" libraries/${dir}/$1.cabal | sed "s/.* //"`
cabal_file=m4_default([$2],[$1/$1.cabal])
LIBRARY_[]translit([$1], [-], [_])[]_VERSION=`grep -i "^version:" libraries/${cabal_file} | sed "s/.* //"`
AC_SUBST(LIBRARY_[]translit([$1], [-], [_])[]_VERSION)
])
......
......@@ -28,43 +28,8 @@ def die(mesg):
print_err(mesg)
sys.exit(1)
def check_for_url_rewrites():
if os.path.isdir('.git') and \
subprocess.check_output('git config remote.origin.url'.split()).find(b'github.com') != -1 and \
subprocess.call(['git', 'config', '--get-regexp', '^url.*github.com/.*/packages-.insteadOf']) != 0:
# If we cloned from github, make sure the url rewrites are set.
# Otherwise 'git submodule update --init' prints confusing errors.
die("""\
It seems you cloned this repository from GitHub. But your git config files
don't contain the url rewrites that are needed to make this work (GitHub
doesn't support '/' in repository names, so we use a different naming scheme
for the submodule repositories there).
Please run the following commands first:
git config --global url."git://github.com/ghc/packages-".insteadOf git://github.com/ghc/packages/
git config --global url."http://github.com/ghc/packages-".insteadOf http://github.com/ghc/packages/
git config --global url."https://github.com/ghc/packages-".insteadOf https://github.com/ghc/packages/
git config --global url."ssh://git\@github.com/ghc/packages-".insteadOf ssh://git\@github.com/ghc/packages/
git config --global url."git\@github.com:/ghc/packages-".insteadOf git\@github.com:/ghc/packages/
And then:
git submodule update --init
./boot
Or start over, and clone the GHC repository from the haskell server:
git clone --recursive git@gitlab.haskell.org:ghc/ghc.git
For more information, see:
* https://gitlab.haskell.org/ghc/ghc/wikis/newcomers or
* https://gitlab.haskell.org/ghc/ghc/wikis/building/getting-the-sources#cloning-from-github
""")
def check_boot_packages():
# Check that we have all boot packages.
import re
for l in open('packages', 'r'):
if l.startswith('#'):
continue
......@@ -200,7 +165,6 @@ def check_build_mk():
https://gitlab.haskell.org/ghc/ghc/wikis/building/using#build-configuration
"""))
check_for_url_rewrites()
check_boot_packages()
if not args.hadrian:
boot_pkgs()
......
......@@ -45,7 +45,7 @@ module GHC (
guessTarget,
-- * Loading\/compiling the program
depanal,
depanal, depanalE,
load, LoadHowMuch(..), InteractiveImport(..),
SuccessFlag(..), succeeded, failed,
defaultWarnErrLogger, WarnErrLogger,
......@@ -132,7 +132,7 @@ module GHC (
-- ** Compiling expressions
HValue, parseExpr, compileParsedExpr,
InteractiveEval.compileExpr, dynCompileExpr,
GHC.Runtime.Eval.compileExpr, dynCompileExpr,
ForeignHValue,
compileExprRemote, compileParsedExprRemote,
......@@ -154,16 +154,16 @@ module GHC (
modInfoModBreaks,
ModBreaks(..), BreakIndex,
BreakInfo(breakInfo_number, breakInfo_module),
InteractiveEval.back,
InteractiveEval.forward,
GHC.Runtime.Eval.back,
GHC.Runtime.Eval.forward,
-- * Abstract syntax elements
-- ** Packages
UnitId,
-- ** Units
Unit,
-- ** Modules
Module, mkModule, pprModule, moduleName, moduleUnitId,
Module, mkModule, pprModule, moduleName, moduleUnit,
ModuleName, mkModuleName, moduleNameString,
-- ** Names
......@@ -260,7 +260,7 @@ module GHC (
-- *** Combining and comparing Located values
eqLocated, cmpLocated, combineLocs, addCLoc,
leftmost_smallest, leftmost_largest, rightmost,
leftmost_smallest, leftmost_largest, rightmost_smallest,
spans, isSubspanOf,
-- * Exceptions
......@@ -275,7 +275,7 @@ module GHC (
parser,
-- * API Annotations
ApiAnns,AnnKeywordId(..),AnnotationComment(..),
ApiAnns(..),AnnKeywordId(..),AnnotationComment(..),
getAnnotation, getAndRemoveAnnotation,
getAnnotationComments, getAndRemoveAnnotationComments,
unicodeAnn,
......@@ -288,81 +288,84 @@ module GHC (
{-
ToDo:
* inline bits of HscMain here to simplify layering: hscTcExpr, hscStmt.
* inline bits of GHC.Driver.Main here to simplify layering: hscTcExpr, hscStmt.
-}
#include "HsVersions.h"
import GhcPrelude hiding (init)
import GHC.Prelude hiding (init)
import ByteCodeTypes
import InteractiveEval
import InteractiveEvalTypes
import GHCi
import GHC.ByteCode.Types
import GHC.Runtime.Eval
import GHC.Runtime.Eval.Types
import GHC.Runtime.Interpreter
import GHC.Runtime.Interpreter.Types
import GHCi.RemoteTypes
import PprTyThing ( pprFamInst )
import HscMain
import GhcMake
import DriverPipeline ( compileOne' )
import GhcMonad
import TcRnMonad ( finalSafeMode, fixSafeInstances, initIfaceTcRn )
import GHC.Iface.Load ( loadSysInterface )
import TcRnTypes
import Predicate
import Packages
import NameSet
import RdrName
import GHC.Core.Ppr.TyThing ( pprFamInst )
import GHC.Driver.Main
import GHC.Driver.Make
import GHC.Driver.Hooks
import GHC.Driver.Pipeline ( compileOne' )
import GHC.Driver.Monad
import GHC.Tc.Utils.Monad ( finalSafeMode, fixSafeInstances, initIfaceTcRn )
import GHC.Iface.Load ( loadSysInterface )
import GHC.Tc.Types
import GHC.Core.Predicate
import GHC.Unit.State
import GHC.Types.Name.Set
import GHC.Types.Name.Reader
import GHC.Hs
import Type hiding( typeKind )
import TcType
import Id
import TysPrim ( alphaTyVars )
import TyCon
import TyCoPpr ( pprForAll )
import Class
import DataCon
import Name hiding ( varName )
import Avail
import InstEnv
import FamInstEnv ( FamInst )
import SrcLoc
import CoreSyn
import GHC.Core.Type hiding( typeKind )
import GHC.Tc.Utils.TcType
import GHC.Types.Id
import GHC.Builtin.Types.Prim ( alphaTyVars )
import GHC.Core.TyCon
import GHC.Core.TyCo.Ppr ( pprForAll )
import GHC.Core.Class
import GHC.Core.DataCon
import GHC.Core.FVs ( orphNamesOfFamInst )
import GHC.Core.FamInstEnv ( FamInst, famInstEnvElts )
import GHC.Core.InstEnv
import GHC.Types.Name hiding ( varName )
import GHC.Types.Avail
import GHC.Types.SrcLoc
import GHC.Core
import GHC.Iface.Tidy
import DriverPhases ( Phase(..), isHaskellSrcFilename )
import Finder
import HscTypes
import CmdLineParser
import DynFlags hiding (WarnReason(..))
import SysTools
import SysTools.BaseDir
import Annotations
import Module
import Panic
import GHC.Driver.Phases ( Phase(..), isHaskellSrcFilename )
import GHC.Driver.Finder
import GHC.Driver.Types
import GHC.Driver.CmdLine
import GHC.Driver.Session hiding (WarnReason(..))
import GHC.Driver.Ways
import GHC.SysTools
import GHC.SysTools.BaseDir
import GHC.Types.Annotations
import GHC.Unit.Module
import GHC.Utils.Panic
import GHC.Platform
import Bag ( listToBag )
import ErrUtils
import MonadUtils
import Util
import StringBuffer
import Outputable
import BasicTypes
import FastString
import qualified Parser
import Lexer
import ApiAnnotation
import GHC.Data.Bag ( listToBag )
import GHC.Utils.Error
import GHC.Utils.Monad
import GHC.Utils.Misc
import GHC.Data.StringBuffer
import GHC.Utils.Outputable
import GHC.Types.Basic
import GHC.Data.FastString
import qualified GHC.Parser as Parser
import GHC.Parser.Lexer
import GHC.Parser.Annotation
import qualified GHC.LanguageExtensions as LangExt
import NameEnv
import CoreFVs ( orphNamesOfFamInst )
import FamInstEnv ( famInstEnvElts )
import TcRnDriver
import Inst
import FamInst
import FileCleanup
import GHC.Types.Name.Env
import GHC.Tc.Module
import GHC.Tc.Utils.Instantiate
import GHC.Tc.Instance.Family
import GHC.SysTools.FileCleanup
import Data.Foldable
import qualified Data.Map.Strict as Map
import Data.Set (Set)
import qualified Data.Set as S
import qualified Data.Sequence as Seq
import Data.Maybe
import Data.Time
......@@ -370,11 +373,13 @@ import Data.Typeable ( Typeable )
import Data.Word ( Word8 )
import Control.Monad
import System.Exit ( exitWith, ExitCode(..) )
import Exception
import GHC.Utils.Exception
import Data.IORef
import System.FilePath
import Control.Concurrent
import Control.Applicative ((<|>))
import Maybes
import GHC.Data.Maybe
import System.IO.Error ( isDoesNotExistError )
import System.Environment ( getEnv )
import System.Directory
......@@ -486,7 +491,7 @@ withCleanupSession ghc = ghc `gfinally` cleanup
liftIO $ do
cleanTempFiles dflags
cleanTempDirs dflags
stopIServ hsc_env -- shut down the IServ
stopInterp hsc_env -- shut down the IServ
-- exceptions will be blocked while we clean the temporary files,
-- so there shouldn't be any difficulty if we receive further
-- signals.
......@@ -538,10 +543,10 @@ checkBrokenTablesNextToCode dflags
checkBrokenTablesNextToCode' :: MonadIO m => DynFlags -> m Bool
checkBrokenTablesNextToCode' dflags
| not (isARM arch) = return False
| WayDyn `notElem` ways dflags = return False
| not (tablesNextToCode dflags) = return False
| otherwise = do
| not (isARM arch) = return False
| WayDyn `S.notMember` ways dflags = return False
| not (tablesNextToCode dflags) = return False
| otherwise = do
linkerInfo <- liftIO $ getLinkerInfo dflags
case linkerInfo of
GnuLD _ -> return True
......@@ -589,20 +594,56 @@ checkBrokenTablesNextToCode' dflags
-- flags. If you are not doing linking or doing static linking, you
-- can ignore the list of packages returned.
--
setSessionDynFlags :: GhcMonad m => DynFlags -> m [InstalledUnitId]
setSessionDynFlags :: GhcMonad m => DynFlags -> m [UnitId]
setSessionDynFlags dflags = do
dflags' <- checkNewDynFlags dflags
dflags'' <- liftIO $ interpretPackageEnv dflags'
(dflags''', preload) <- liftIO $ initPackages dflags''
-- Interpreter
interp <- if gopt Opt_ExternalInterpreter dflags
then do
let
prog = pgm_i dflags ++ flavour
flavour
| WayProf `S.member` ways dflags = "-prof"
| WayDyn `S.member` ways dflags = "-dyn"
| otherwise = ""
msg = text "Starting " <> text prog
tr <- if verbosity dflags >= 3
then return (logInfo dflags (defaultDumpStyle dflags) msg)
else return (pure ())
let
conf = IServConfig
{ iservConfProgram = prog
, iservConfOpts = getOpts dflags opt_i
, iservConfProfiled = gopt Opt_SccProfilingOn dflags
, iservConfDynamic = WayDyn `S.member` ways dflags
, iservConfHook = createIservProcessHook (hooks dflags)
, iservConfTrace = tr
}
s <- liftIO $ newMVar IServPending
return (Just (ExternalInterp conf (IServ s)))
else
#if defined(HAVE_INTERNAL_INTERPRETER)
return (Just InternalInterp)
#else
return Nothing
#endif
modifySession $ \h -> h{ hsc_dflags = dflags'''
, hsc_IC = (hsc_IC h){ ic_dflags = dflags''' } }
, hsc_IC = (hsc_IC h){ ic_dflags = dflags''' }
, hsc_interp = hsc_interp h <|> interp
-- we only update the interpreter if there wasn't
-- already one set up
}
invalidateModSummaryCache
return preload
-- | Sets the program 'DynFlags'. Note: this invalidates the internal
-- cached module graph, causing more work to be done the next time
-- 'load' is called.
setProgramDynFlags :: GhcMonad m => DynFlags -> m [InstalledUnitId]
setProgramDynFlags :: GhcMonad m => DynFlags -> m [UnitId]
setProgramDynFlags dflags = setProgramDynFlags_ True dflags
-- | Set the action taken when the compiler produces a message. This
......@@ -614,7 +655,7 @@ setLogAction action = do
void $ setProgramDynFlags_ False $
dflags' { log_action = action }
setProgramDynFlags_ :: GhcMonad m => Bool -> DynFlags -> m [InstalledUnitId]
setProgramDynFlags_ :: GhcMonad m => Bool -> DynFlags -> m [UnitId]
setProgramDynFlags_ invalidate_needed dflags = do
dflags' <- checkNewDynFlags dflags
dflags_prev <- getProgramDynFlags
......@@ -816,7 +857,7 @@ data ParsedModule =
, pm_parsed_source :: ParsedSource
, pm_extra_src_files :: [FilePath]
, pm_annotations :: ApiAnns }
-- See Note [Api annotations] in ApiAnnotation.hs
-- See Note [Api annotations] in GHC.Parser.Annotation
instance ParsedMod ParsedModule where
modSummary m = pm_mod_summary m
......@@ -892,7 +933,7 @@ getModSummary mod = do
mg <- liftM hsc_mod_graph getSession
let mods_by_name = [ ms | ms <- mgModSummaries mg
, ms_mod_name ms == mod
, not (isBootSummary ms) ]
, isBootSummary ms == NotBoot ]
case mods_by_name of
[] -> do dflags <- getDynFlags
liftIO $ throwIO $ mkApiErr dflags (text "Module not part of module graph")
......@@ -910,7 +951,7 @@ parseModule ms = do
hpm <- liftIO $ hscParse hsc_env_tmp ms
return (ParsedModule ms (hpm_module hpm) (hpm_src_files hpm)
(hpm_annotations hpm))
-- See Note [Api annotations] in ApiAnnotation.hs
-- See Note [Api annotations] in GHC.Parser.Annotation
-- | Typecheck and rename a parsed module.
--
......@@ -1281,7 +1322,7 @@ getNameToInstancesIndex visible_mods mods_to_load = do
; (pkg_fie, home_fie) <- tcGetFamInstEnvs
-- We use Data.Sequence.Seq because we are creating left associated
-- mappends.
-- cls_index and fam_index below are adapted from TcRnDriver.lookupInsts
-- cls_index and fam_index below are adapted from GHC.Tc.Module.lookupInsts
; let cls_index = Map.fromListWith mappend
[ (n, Seq.singleton ispec)
| ispec <- instEnvElts ie_local ++ instEnvElts ie_global
......@@ -1316,7 +1357,7 @@ packageDbModules only_exposed = do
[ mkModule pid modname
| p <- pkgs
, not only_exposed || exposed p
, let pid = packageConfigId p
, let pid = mkUnit p
, modname <- exposedModules p
++ map exportName (reexportedModules p) ]
-}
......@@ -1364,7 +1405,7 @@ getModuleSourceAndFlags mod = do
-- | Return module source as token stream, including comments.
--
-- The module must be in the module graph and its source must be available.
-- Throws a 'HscTypes.SourceError' on parse error.
-- Throws a 'GHC.Driver.Types.SourceError' on parse error.
getTokenStream :: GhcMonad m => Module -> m [Located Token]
getTokenStream mod = do
(sourceFile, source, flags) <- getModuleSourceAndFlags mod
......@@ -1397,7 +1438,7 @@ addSourceToTokens _ _ [] = []
addSourceToTokens loc buf (t@(L span _) : ts)
= case span of
UnhelpfulSpan _ -> (t,"") : addSourceToTokens loc buf ts
RealSrcSpan s -> (t,str) : addSourceToTokens newLoc newBuf ts
RealSrcSpan s _ -> (t,str) : addSourceToTokens newLoc newBuf ts
where
(newLoc, newBuf, str) = go "" loc buf
start = realSrcSpanStart s
......@@ -1417,13 +1458,13 @@ showRichTokenStream ts = go startLoc ts ""
where sourceFile = getFile $ map (getLoc . fst) ts
getFile [] = panic "showRichTokenStream: No source file found"
getFile (UnhelpfulSpan _ : xs) = getFile xs
getFile (RealSrcSpan s : _) = srcSpanFile s
getFile (RealSrcSpan s _ : _) = srcSpanFile s
startLoc = mkRealSrcLoc sourceFile 1 1
go _ [] = id
go loc ((L span _, str):ts)
= case span of
UnhelpfulSpan _ -> go loc ts
RealSrcSpan s
RealSrcSpan s _
| locLine == tokLine -> ((replicate (tokCol - locCol) ' ') ++)
. (str ++)
. go tokEnd ts
......@@ -1448,7 +1489,7 @@ findModule mod_name maybe_pkg = withSession $ \hsc_env -> do
this_pkg = thisPackage dflags
--
case maybe_pkg of
Just pkg | fsToUnitId pkg /= this_pkg && pkg /= fsLit "this" -> liftIO $ do
Just pkg | fsToUnit pkg /= this_pkg && pkg /= fsLit "this" -> liftIO $ do
res <- findImportedModule hsc_env mod_name maybe_pkg
case res of
Found _ m -> return m
......@@ -1460,7 +1501,7 @@ findModule mod_name maybe_pkg = withSession $ \hsc_env -> do
Nothing -> liftIO $ do
res <- findImportedModule hsc_env mod_name maybe_pkg
case res of
Found loc m | moduleUnitId m /= this_pkg -> return m
Found loc m | moduleUnit m /= this_pkg -> return m
| otherwise -> modNotLoadedError dflags m loc
err -> throwOneError $ noModError dflags noSrcSpan mod_name err
......@@ -1504,7 +1545,7 @@ isModuleTrusted m = withSession $ \hsc_env ->
liftIO $ hscCheckSafe hsc_env m noSrcSpan
-- | Return if a module is trusted and the pkgs it depends on to be trusted.
moduleTrustReqs :: GhcMonad m => Module -> m (Bool, Set InstalledUnitId)
moduleTrustReqs :: GhcMonad m => Module -> m (Bool, Set UnitId)
moduleTrustReqs m = withSession $ \hsc_env ->
liftIO $ hscGetSafe hsc_env m noSrcSpan
......@@ -1526,15 +1567,15 @@ getGHCiMonad = fmap (ic_monad . hsc_IC) getSession
getHistorySpan :: GhcMonad m => History -> m SrcSpan
getHistorySpan h = withSession $ \hsc_env ->
return $ InteractiveEval.getHistorySpan hsc_env h
return $ GHC.Runtime.Eval.getHistorySpan hsc_env h
obtainTermFromVal :: GhcMonad m => Int -> Bool -> Type -> a -> m Term
obtainTermFromVal bound force ty a = withSession $ \hsc_env ->
liftIO $ InteractiveEval.obtainTermFromVal hsc_env bound force ty a
liftIO $ GHC.Runtime.Eval.obtainTermFromVal hsc_env bound force ty a
obtainTermFromId :: GhcMonad m => Int -> Bool -> Id -> m Term
obtainTermFromId bound force id = withSession $ \hsc_env ->
liftIO $ InteractiveEval.obtainTermFromId hsc_env bound force id
liftIO $ GHC.Runtime.Eval.obtainTermFromId hsc_env bound force id
-- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any
......
{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998
\section[PrelNames]{Definitions of prelude modules and names}
\section[GHC.Builtin.Names]{Definitions of prelude modules and names}
Nota Bene: all Names defined in here should come from the base package
......@@ -63,7 +63,7 @@ This is accomplished through a combination of mechanisms:
2. The knownKeyNames (which consist of the basicKnownKeyNames from
the module, and those names reachable via the wired-in stuff from
TysWiredIn) are used to initialise the "OrigNameCache" in
GHC.Builtin.Types) are used to initialise the "OrigNameCache" in
GHC.Iface.Env. This initialization ensures that when the type checker
or renamer (both of which use GHC.Iface.Env) look up an original name
(i.e. a pair of a Module and an OccName) for a known-key name
......@@ -98,7 +98,7 @@ things,
GHC.Iface.Binary.putName, with that special treatment detected when we read
back to ensure that we get back to the correct uniques. See Note [Symbol
table representation of names] in GHC.Iface.Binary and Note [How tuples
work] in TysWiredIn.
work] in GHC.Builtin.Types.
Most of the infinite families cannot occur in source code, so mechanisms (a) and (b)
suffice to ensure that they always have the right Unique. In particular,
......@@ -111,6 +111,10 @@ by the user. For those things that *can* appear in source programs,
See also Note [Built-in syntax and the OrigNameCache]
Note that one-tuples are an exception to the rule, as they do get assigned
known keys. See
Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)
in GHC.Builtin.Types.
Note [The integer library]
~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -139,34 +143,37 @@ this constructor directly (see CorePrep.lookupIntegerSDataConName)
When GHC reads the package data base, it (internally only) pretends it has UnitId
`integer-wired-in` instead of the actual UnitId (which includes the version
number); just like for `base` and other packages, as described in
Note [Wired-in packages] in Module. This is done in Packages.findWiredInPackages.
Note [Wired-in units] in GHC.Unit.Module. This is done in
GHC.Unit.State.findWiredInPackages.
-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module PrelNames (
Unique, Uniquable(..), hasKey, -- Re-exported for convenience
module GHC.Builtin.Names
( Unique, Uniquable(..), hasKey, -- Re-exported for convenience
-----------------------------------------------------------
module PrelNames, -- A huge bunch of (a) Names, e.g. intTyConName
-- (b) Uniques e.g. intTyConKey
-- (c) Groups of classes and types
-- (d) miscellaneous things
-- So many that we export them all
) where
-----------------------------------------------------------
module GHC.Builtin.Names, -- A huge bunch of (a) Names, e.g. intTyConName
-- (b) Uniques e.g. intTyConKey
-- (c) Groups of classes and types
-- (d) miscellaneous things
-- So many that we export them all
)
where
#include "HsVersions.h"
import GhcPrelude
import GHC.Prelude
import Module
import OccName
import RdrName
import Unique
import Name
import SrcLoc
import FastString
import GHC.Unit.Types
import GHC.Unit.Module.Name
import GHC.Types.Name.Occurrence
import GHC.Types.Name.Reader
import GHC.Types.Unique
import GHC.Types.Name
import GHC.Types.SrcLoc
import GHC.Data.FastString
{-
************************************************************************
......@@ -210,7 +217,7 @@ isUnboundName name = name `hasKey` unboundKey
This section tells what the compiler knows about the association of
names with uniques. These ones are the *non* wired-in ones. The
wired in ones are defined in TysWiredIn etc.
wired in ones are defined in GHC.Builtin.Types etc.
-}
basicKnownKeyNames :: [Name] -- See Note [Known-key names]
......@@ -463,6 +470,12 @@ basicKnownKeyNames
, typeErrorVAppendDataConName
, typeErrorShowTypeDataConName
-- Unsafe coercion proofs
, unsafeEqualityProofName
, unsafeEqualityTyConName
, unsafeReflDataConName
, unsafeCoercePrimName
, unsafeCoerceName
]
genericTyConNames :: [Name]
......@@ -502,7 +515,7 @@ gHC_PRIM, gHC_TYPES, gHC_GENERICS, gHC_MAGIC,
gHC_CLASSES, gHC_PRIMOPWRAPPERS, gHC_BASE, gHC_ENUM,
gHC_GHCI, gHC_GHCI_HELPERS, gHC_CSTRING,
gHC_SHOW, gHC_READ, gHC_NUM, gHC_MAYBE, gHC_INTEGER_TYPE, gHC_NATURAL,
gHC_LIST, gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_STRING,
gHC_LIST, gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_LIST, dATA_STRING,
dATA_FOLDABLE, dATA_TRAVERSABLE,
gHC_CONC, gHC_IO, gHC_IO_Exception,
gHC_ST, gHC_IX, gHC_STABLE, gHC_PTR, gHC_ERR, gHC_REAL,
......@@ -511,7 +524,7 @@ gHC_PRIM, gHC_TYPES, gHC_GENERICS, gHC_MAGIC,
rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, mONAD_ZIP, mONAD_FAIL,
aRROW, cONTROL_APPLICATIVE, gHC_DESUGAR, rANDOM, gHC_EXTS,
cONTROL_EXCEPTION_BASE, gHC_TYPELITS, gHC_TYPENATS, dATA_TYPE_EQUALITY,
dATA_COERCE, dEBUG_TRACE :: Module
dATA_COERCE, dEBUG_TRACE, uNSAFE_COERCE :: Module
gHC_PRIM = mkPrimModule (fsLit "GHC.Prim") -- Primitive types and values
gHC_TYPES = mkPrimModule (fsLit "GHC.Types")
......@@ -534,6 +547,7 @@ gHC_LIST = mkBaseModule (fsLit "GHC.List")
gHC_TUPLE = mkPrimModule (fsLit "GHC.Tuple")
dATA_TUPLE = mkBaseModule (fsLit "Data.Tuple")
dATA_EITHER = mkBaseModule (fsLit "Data.Either")
dATA_LIST = mkBaseModule (fsLit "Data.List")
dATA_STRING = mkBaseModule (fsLit "Data.String")
dATA_FOLDABLE = mkBaseModule (fsLit "Data.Foldable")
dATA_TRAVERSABLE= mkBaseModule (fsLit "Data.Traversable")
......@@ -573,6 +587,7 @@ gHC_TYPENATS = mkBaseModule (fsLit "GHC.TypeNats")
dATA_TYPE_EQUALITY = mkBaseModule (fsLit "Data.Type.Equality")
dATA_COERCE = mkBaseModule (fsLit "Data.Coerce")
dEBUG_TRACE = mkBaseModule (fsLit "Debug.Trace")
uNSAFE_COERCE = mkBaseModule (fsLit "Unsafe.Coerce")
gHC_SRCLOC :: Module
gHC_SRCLOC = mkBaseModule (fsLit "GHC.SrcLoc")
......@@ -795,9 +810,6 @@ showSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showSpace")
showCommaSpace_RDR = varQual_RDR gHC_SHOW (fsLit "showCommaSpace")
showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
undefined_RDR :: RdrName
undefined_RDR = varQual_RDR gHC_ERR (fsLit "undefined")
error_RDR :: RdrName
error_RDR = varQual_RDR gHC_ERR (fsLit "error")
......@@ -1286,7 +1298,7 @@ mkTrFunName = varQual tYPEABLE_INTERNAL (fsLit "mkTrFun") mkTrF
typeNatTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeNatTypeRep") typeNatTypeRepKey
typeSymbolTypeRepName = varQual tYPEABLE_INTERNAL (fsLit "typeSymbolTypeRep") typeSymbolTypeRepKey
-- this is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types)
-- See Note [Grand plan for Typeable] in TcTypeable.
-- See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable.
trGhcPrimModuleName = varQual gHC_TYPES (fsLit "tr$ModuleGHCPrim") trGhcPrimModuleKey
-- Typeable KindReps for some common cases
......@@ -1318,7 +1330,14 @@ typeErrorVAppendDataConName =
typeErrorShowTypeDataConName =
dcQual gHC_TYPELITS (fsLit "ShowType") typeErrorShowTypeDataConKey
-- Unsafe coercion proofs
unsafeEqualityProofName, unsafeEqualityTyConName, unsafeCoercePrimName,
unsafeCoerceName, unsafeReflDataConName :: Name
unsafeEqualityProofName = varQual uNSAFE_COERCE (fsLit "unsafeEqualityProof") unsafeEqualityProofIdKey
unsafeEqualityTyConName = tcQual uNSAFE_COERCE (fsLit "UnsafeEquality") unsafeEqualityTyConKey
unsafeReflDataConName = dcQual uNSAFE_COERCE (fsLit "UnsafeRefl") unsafeReflDataConKey
unsafeCoercePrimName = varQual uNSAFE_COERCE (fsLit "unsafeCoerce#") unsafeCoercePrimIdKey
unsafeCoerceName = varQual uNSAFE_COERCE (fsLit "unsafeCoerce") unsafeCoerceIdKey
-- Dynamic
toDynName :: Name
......@@ -1490,7 +1509,7 @@ srcLocDataConName
-- plugins
pLUGINS :: Module
pLUGINS = mkThisGhcModule (fsLit "Plugins")
pLUGINS = mkThisGhcModule (fsLit "GHC.Driver.Plugins")
pluginTyConName :: Name
pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
frontendPluginTyConName :: Name
......@@ -1577,17 +1596,8 @@ realFracClassKey = mkPreludeClassUnique 16
showClassKey = mkPreludeClassUnique 17
ixClassKey = mkPreludeClassUnique 18
typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey,
typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey
:: Unique
typeableClassKey :: Unique
typeableClassKey = mkPreludeClassUnique 20
typeable1ClassKey = mkPreludeClassUnique 21
typeable2ClassKey = mkPreludeClassUnique 22
typeable3ClassKey = mkPreludeClassUnique 23
typeable4ClassKey = mkPreludeClassUnique 24
typeable5ClassKey = mkPreludeClassUnique 25
typeable6ClassKey = mkPreludeClassUnique 26
typeable7ClassKey = mkPreludeClassUnique 27
monadFixClassKey :: Unique
monadFixClassKey = mkPreludeClassUnique 28
......@@ -1617,11 +1627,11 @@ datatypeClassKey = mkPreludeClassUnique 39
constructorClassKey = mkPreludeClassUnique 40
selectorClassKey = mkPreludeClassUnique 41
-- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in TcEvidence
-- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in GHC.Tc.Types.Evidence
knownNatClassNameKey :: Unique
knownNatClassNameKey = mkPreludeClassUnique 42
-- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in TcEvidence
-- KnownSymbol: see Note [KnownNat & KnownSymbol and EvLit] in GHC.Tc.Types.Evidence
knownSymbolClassNameKey :: Unique
knownSymbolClassNameKey = mkPreludeClassUnique 43
......@@ -1645,7 +1655,7 @@ hasFieldClassNameKey = mkPreludeClassUnique 49
---------------- Template Haskell -------------------
-- THNames.hs: USES ClassUniques 200-299
-- GHC.Builtin.Names.TH: USES ClassUniques 200-299
-----------------------------------------------------
{-
......@@ -1753,10 +1763,6 @@ funPtrTyConKey = mkPreludeTyConUnique 78
tVarPrimTyConKey = mkPreludeTyConUnique 79
compactPrimTyConKey = mkPreludeTyConUnique 80
-- dotnet interop
objectTyConKey :: Unique
objectTyConKey = mkPreludeTyConUnique 83
eitherTyConKey :: Unique
eitherTyConKey = mkPreludeTyConUnique 84
......@@ -1890,8 +1896,13 @@ someTypeRepDataConKey = mkPreludeTyConUnique 189
typeSymbolAppendFamNameKey :: Unique
typeSymbolAppendFamNameKey = mkPreludeTyConUnique 190
-- Unsafe equality
unsafeEqualityTyConKey :: Unique
unsafeEqualityTyConKey = mkPreludeTyConUnique 191
---------------- Template Haskell -------------------
-- THNames.hs: USES TyConUniques 200-299
-- GHC.Builtin.Names.TH: USES TyConUniques 200-299
-----------------------------------------------------
----------------------- SIMD ------------------------
......@@ -2021,7 +2032,7 @@ vecRepDataConKey = mkPreludeDataConUnique 71
tupleRepDataConKey = mkPreludeDataConUnique 72
sumRepDataConKey = mkPreludeDataConUnique 73
-- See Note [Wiring in RuntimeRep] in TysWiredIn
-- See Note [Wiring in RuntimeRep] in GHC.Builtin.Types
runtimeRepSimpleDataConKeys, unliftedSimpleRepDataConKeys, unliftedRepDataConKeys :: [Unique]
liftedRepDataConKey :: Unique
runtimeRepSimpleDataConKeys@(liftedRepDataConKey : unliftedSimpleRepDataConKeys)
......@@ -2032,12 +2043,12 @@ unliftedRepDataConKeys = vecRepDataConKey :
sumRepDataConKey :
unliftedSimpleRepDataConKeys
-- See Note [Wiring in RuntimeRep] in TysWiredIn
-- See Note [Wiring in RuntimeRep] in GHC.Builtin.Types
-- VecCount
vecCountDataConKeys :: [Unique]
vecCountDataConKeys = map mkPreludeDataConUnique [89..94]
-- See Note [Wiring in RuntimeRep] in TysWiredIn
-- See Note [Wiring in RuntimeRep] in GHC.Builtin.Types
-- VecElem
vecElemDataConKeys :: [Unique]
vecElemDataConKeys = map mkPreludeDataConUnique [95..104]
......@@ -2059,9 +2070,12 @@ typeLitSymbolDataConKey, typeLitNatDataConKey :: Unique
typeLitSymbolDataConKey = mkPreludeDataConUnique 112
typeLitNatDataConKey = mkPreludeDataConUnique 113
-- Unsafe equality
unsafeReflDataConKey :: Unique
unsafeReflDataConKey = mkPreludeDataConUnique 114
---------------- Template Haskell -------------------
-- THNames.hs: USES DataUniques 200-250
-- GHC.Builtin.Names.TH: USES DataUniques 200-250
-----------------------------------------------------
......@@ -2110,11 +2124,10 @@ typeErrorIdKey = mkPreludeMiscIdUnique 22
divIntIdKey = mkPreludeMiscIdUnique 23
modIntIdKey = mkPreludeMiscIdUnique 24
unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey,
returnIOIdKey, newStablePtrIdKey,
concatIdKey, filterIdKey, zipIdKey,
bindIOIdKey, returnIOIdKey, newStablePtrIdKey,
printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey,
fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey :: Unique
unsafeCoerceIdKey = mkPreludeMiscIdUnique 30
concatIdKey = mkPreludeMiscIdUnique 31
filterIdKey = mkPreludeMiscIdUnique 32
zipIdKey = mkPreludeMiscIdUnique 33
......@@ -2224,18 +2237,6 @@ rationalToFloatIdKey, rationalToDoubleIdKey :: Unique
rationalToFloatIdKey = mkPreludeMiscIdUnique 130
rationalToDoubleIdKey = mkPreludeMiscIdUnique 131
-- dotnet interop
unmarshalObjectIdKey, marshalObjectIdKey, marshalStringIdKey,
unmarshalStringIdKey, checkDotnetResNameIdKey :: Unique
unmarshalObjectIdKey = mkPreludeMiscIdUnique 150
marshalObjectIdKey = mkPreludeMiscIdUnique 151
marshalStringIdKey = mkPreludeMiscIdUnique 152
unmarshalStringIdKey = mkPreludeMiscIdUnique 153
checkDotnetResNameIdKey = mkPreludeMiscIdUnique 154
undefinedKey :: Unique
undefinedKey = mkPreludeMiscIdUnique 155
magicDictKey :: Unique
magicDictKey = mkPreludeMiscIdUnique 156
......@@ -2325,7 +2326,7 @@ proxyHashKey :: Unique
proxyHashKey = mkPreludeMiscIdUnique 502
---------------- Template Haskell -------------------
-- THNames.hs: USES IdUniques 200-499
-- GHC.Builtin.Names.TH: USES IdUniques 200-499
-----------------------------------------------------
-- Used to make `Typeable` dictionaries
......@@ -2408,6 +2409,12 @@ mkNaturalIdKey = mkPreludeMiscIdUnique 567
naturalSDataConKey = mkPreludeMiscIdUnique 568
wordToNaturalIdKey = mkPreludeMiscIdUnique 569
-- Unsafe coercion proofs
unsafeEqualityProofIdKey, unsafeCoercePrimIdKey, unsafeCoerceIdKey :: Unique
unsafeEqualityProofIdKey = mkPreludeMiscIdUnique 570
unsafeCoercePrimIdKey = mkPreludeMiscIdUnique 571
unsafeCoerceIdKey = mkPreludeMiscIdUnique 572
{-
************************************************************************
* *
......@@ -2451,7 +2458,7 @@ standardClassKeys = derivableClassKeys ++ numericClassKeys
{-
@derivableClassKeys@ is also used in checking \tr{deriving} constructs
(@TcDeriv@).
(@GHC.Tc.Deriv@).
-}
derivableClassKeys :: [Unique]
......
module PrelNames where
module GHC.Builtin.Names where
import Module
import Unique
import GHC.Unit.Module
import GHC.Types.Unique
mAIN :: Module
liftedTypeKindTyConKey :: Unique
......@@ -4,17 +4,17 @@
-- %* *
-- %************************************************************************
module THNames where
module GHC.Builtin.Names.TH where
import GhcPrelude ()
import GHC.Prelude ()
import PrelNames( mk_known_key_name )
import Module( Module, mkModuleNameFS, mkModule, thUnitId )
import Name( Name )
import OccName( tcName, clsName, dataName, varName )
import RdrName( RdrName, nameRdrName )
import Unique
import FastString
import GHC.Builtin.Names( mk_known_key_name )
import GHC.Unit
import GHC.Types.Name( Name )
import GHC.Types.Name.Occurrence( tcName, clsName, dataName, varName )
import GHC.Types.Name.Reader( RdrName, nameRdrName )
import GHC.Types.Unique
import GHC.Data.FastString
-- To add a name, do three things
--
......@@ -24,7 +24,7 @@ import FastString
templateHaskellNames :: [Name]
-- The names that are implicitly mentioned by ``bracket''
-- Should stay in sync with the import list of DsMeta
-- Should stay in sync with the import list of GHC.HsToCore.Quote
templateHaskellNames = [
returnQName, bindQName, sequenceQName, newNameName, liftName, liftTypedName,
......@@ -108,7 +108,6 @@ templateHaskellNames = [
-- Role
nominalRName, representationalRName, phantomRName, inferRName,
-- Kind
varKName, conKName, tupleKName, arrowKName, listKName, appKName,
starKName, constraintKName,
-- FamilyResultSig
noSigName, kindSigName, tyVarSigName,
......@@ -171,13 +170,13 @@ mkTHModule :: FastString -> Module
mkTHModule m = mkModule thUnitId (mkModuleNameFS m)
libFun, libTc, thFun, thTc, thCls, thCon, qqFun :: FastString -> Unique -> Name
libFun = mk_known_key_name OccName.varName thLib
libTc = mk_known_key_name OccName.tcName thLib
thFun = mk_known_key_name OccName.varName thSyn
thTc = mk_known_key_name OccName.tcName thSyn
thCls = mk_known_key_name OccName.clsName thSyn
thCon = mk_known_key_name OccName.dataName thSyn
qqFun = mk_known_key_name OccName.varName qqLib
libFun = mk_known_key_name varName thLib
libTc = mk_known_key_name tcName thLib
thFun = mk_known_key_name varName thSyn
thTc = mk_known_key_name tcName thSyn
thCls = mk_known_key_name clsName thSyn
thCon = mk_known_key_name dataName thSyn
qqFun = mk_known_key_name varName qqLib
-------------------- TH.Syntax -----------------------
liftClassName :: Name
......@@ -480,14 +479,7 @@ phantomRName = libFun (fsLit "phantomR") phantomRIdKey
inferRName = libFun (fsLit "inferR") inferRIdKey
-- data Kind = ...
varKName, conKName, tupleKName, arrowKName, listKName, appKName,
starKName, constraintKName :: Name
varKName = libFun (fsLit "varK") varKIdKey
conKName = libFun (fsLit "conK") conKIdKey
tupleKName = libFun (fsLit "tupleK") tupleKIdKey
arrowKName = libFun (fsLit "arrowK") arrowKIdKey
listKName = libFun (fsLit "listK") listKIdKey
appKName = libFun (fsLit "appK") appKIdKey
starKName, constraintKName :: Name
starKName = libFun (fsLit "starK") starKIdKey
constraintKName = libFun (fsLit "constraintK") constraintKIdKey
......@@ -562,7 +554,7 @@ decsQTyConName = libTc (fsLit "DecsQ") decsQTyConKey -- Q [De
typeQTyConName = libTc (fsLit "TypeQ") typeQTyConKey
patQTyConName = libTc (fsLit "PatQ") patQTyConKey
-- These are used in DsMeta but always wrapped in a type variable
-- These are used in GHC.HsToCore.Quote but always wrapped in a type variable
stmtTyConName = thTc (fsLit "Stmt") stmtTyConKey
conTyConName = thTc (fsLit "Con") conTyConKey
bangTypeTyConName = thTc (fsLit "BangType") bangTypeTyConKey
......@@ -616,7 +608,7 @@ incoherentDataConName = thCon (fsLit "Incoherent") incoherentDataConKey
********************************************************************* -}
-- ClassUniques available: 200-299
-- Check in PrelNames if you want to change this
-- Check in GHC.Builtin.Names if you want to change this
liftClassKey :: Unique
liftClassKey = mkPreludeClassUnique 200
......@@ -631,7 +623,7 @@ quoteClassKey = mkPreludeClassUnique 201
********************************************************************* -}
-- TyConUniques available: 200-299
-- Check in PrelNames if you want to change this
-- Check in GHC.Builtin.Names if you want to change this
expTyConKey, matchTyConKey, clauseTyConKey, qTyConKey, expQTyConKey,
patTyConKey,
......@@ -683,7 +675,7 @@ decsTyConKey = mkPreludeTyConUnique 236
********************************************************************* -}
-- DataConUniques available: 100-150
-- If you want to change this, make sure you check in PrelNames
-- If you want to change this, make sure you check in GHC.Builtin.Names
-- data Inline = ...
noInlineDataConKey, inlineDataConKey, inlinableDataConKey :: Unique
......@@ -723,7 +715,7 @@ incoherentDataConKey = mkPreludeDataConUnique 212
********************************************************************* -}
-- IdUniques available: 200-499
-- If you want to change this, make sure you check in PrelNames
-- If you want to change this, make sure you check in GHC.Builtin.Names
returnQIdKey, bindQIdKey, sequenceQIdKey, liftIdKey, newNameIdKey,
mkNameIdKey, mkNameG_vIdKey, mkNameG_dIdKey, mkNameG_tcIdKey,
......@@ -1001,14 +993,7 @@ phantomRIdKey = mkPreludeMiscIdUnique 417
inferRIdKey = mkPreludeMiscIdUnique 418
-- data Kind = ...
varKIdKey, conKIdKey, tupleKIdKey, arrowKIdKey, listKIdKey, appKIdKey,
starKIdKey, constraintKIdKey :: Unique
varKIdKey = mkPreludeMiscIdUnique 419
conKIdKey = mkPreludeMiscIdUnique 420
tupleKIdKey = mkPreludeMiscIdUnique 421
arrowKIdKey = mkPreludeMiscIdUnique 422
listKIdKey = mkPreludeMiscIdUnique 423
appKIdKey = mkPreludeMiscIdUnique 424
starKIdKey, constraintKIdKey :: Unique
starKIdKey = mkPreludeMiscIdUnique 425
constraintKIdKey = mkPreludeMiscIdUnique 426
......
......@@ -6,7 +6,7 @@
{-# LANGUAGE CPP #-}
module PrimOp (
module GHC.Builtin.PrimOps (
PrimOp(..), PrimOpVecCat(..), allThePrimOps,
primOpType, primOpSig,
primOpTag, maxPrimOpTag, primOpOcc,
......@@ -16,7 +16,7 @@ module PrimOp (
primOpOutOfLine, primOpCodeSize,
primOpOkForSpeculation, primOpOkForSideEffects,
primOpIsCheap, primOpFixity,
primOpIsCheap, primOpFixity, primOpDocs,
getPrimOpResultInfo, isComparisonPrimOp, PrimOpResultInfo(..),
......@@ -25,28 +25,28 @@ module PrimOp (
#include "HsVersions.h"
import GhcPrelude
import GHC.Prelude
import TysPrim
import TysWiredIn
import GHC.Builtin.Types.Prim
import GHC.Builtin.Types
import GHC.Cmm.Type
import Demand
import Id ( Id, mkVanillaGlobalWithInfo )
import IdInfo ( vanillaIdInfo, setCafInfo, CafInfo(NoCafRefs) )
import Name
import PrelNames ( gHC_PRIMOPWRAPPERS )
import TyCon ( TyCon, isPrimTyCon, PrimRep(..) )
import Type
import GHC.Types.RepType ( typePrimRep1, tyConPrimRep1 )
import BasicTypes ( Arity, Fixity(..), FixityDirection(..), Boxity(..),
SourceText(..) )
import SrcLoc ( wiredInSrcSpan )
import ForeignCall ( CLabelString )
import Unique ( Unique, mkPrimOpIdUnique, mkPrimOpWrapperUnique )
import Outputable
import FastString
import Module ( UnitId )
import GHC.Types.Demand
import GHC.Types.Id ( Id, mkVanillaGlobalWithInfo )
import GHC.Types.Id.Info ( vanillaIdInfo, setCafInfo, CafInfo(NoCafRefs) )
import GHC.Types.Name
import GHC.Builtin.Names ( gHC_PRIMOPWRAPPERS )
import GHC.Core.TyCon ( TyCon, isPrimTyCon, PrimRep(..) )
import GHC.Core.Type
import GHC.Types.RepType ( typePrimRep1, tyConPrimRep1 )
import GHC.Types.Basic ( Arity, Fixity(..), FixityDirection(..), Boxity(..),
SourceText(..) )
import GHC.Types.SrcLoc ( wiredInSrcSpan )
import GHC.Types.ForeignCall ( CLabelString )
import GHC.Types.Unique ( Unique, mkPrimOpIdUnique, mkPrimOpWrapperUnique )
import GHC.Unit ( Unit )
import GHC.Utils.Outputable
import GHC.Data.FastString
{-
************************************************************************
......@@ -161,6 +161,19 @@ primOpStrictness :: PrimOp -> Arity -> StrictSig
primOpFixity :: PrimOp -> Maybe Fixity
#include "primop-fixity.hs-incl"
{-
************************************************************************
* *
\subsubsection{Docs}
* *
************************************************************************
See Note [GHC.Prim Docs]
-}
primOpDocs :: [(String, String)]
#include "primop-docs.hs-incl"
{-
************************************************************************
* *
......@@ -323,7 +336,7 @@ Note [Checking versus non-checking primops]
It is important that a non-checking primop never be transformed in a way that
would cause it to bottom. Doing so would violate Core's let/app invariant
(see Note [CoreSyn let/app invariant] in CoreSyn) which is critical to
(see Note [Core let/app invariant] in GHC.Core) which is critical to
the simplifier's ability to float without fear of changing program meaning.
......@@ -483,7 +496,7 @@ primOpCanFail :: PrimOp -> Bool
primOpOkForSpeculation :: PrimOp -> Bool
-- See Note [PrimOp can_fail and has_side_effects]
-- See comments with CoreUtils.exprOkForSpeculation
-- See comments with GHC.Core.Utils.exprOkForSpeculation
-- primOpOkForSpeculation => primOpOkForSideEffects
primOpOkForSpeculation op
= primOpOkForSideEffects op
......@@ -498,7 +511,8 @@ primOpOkForSideEffects op
{-
Note [primOpIsCheap]
~~~~~~~~~~~~~~~~~~~~
@primOpIsCheap@, as used in \tr{SimplUtils.hs}. For now (HACK
@primOpIsCheap@, as used in GHC.Core.Opt.Simplify.Utils. For now (HACK
WARNING), we just borrow some other predicates for a
what-should-be-good-enough test. "Cheap" means willing to call it more
than once, and/or push it inside a lambda. The latter could change the
......@@ -535,7 +549,7 @@ primOpIsCheap op = primOpOkForSpeculation op
primOpCodeSize
~~~~~~~~~~~~~~
Gives an indication of the code size of a primop, for the purposes of
calculating unfolding sizes; see CoreUnfold.sizeExpr.
calculating unfolding sizes; see GHC.Core.Unfold.sizeExpr.
-}
primOpCodeSize :: PrimOp -> Int
......@@ -543,7 +557,7 @@ primOpCodeSize :: PrimOp -> Int
primOpCodeSizeDefault :: Int
primOpCodeSizeDefault = 1
-- CoreUnfold.primOpSize already takes into account primOpOutOfLine
-- GHC.Core.Unfold.primOpSize already takes into account primOpOutOfLine
-- and adds some further costs for the args in that case.
primOpCodeSizeForeignCall :: Int
......@@ -690,7 +704,7 @@ pprPrimOp other_op = pprOccName (primOpOcc other_op)
************************************************************************
-}
data PrimCall = PrimCall CLabelString UnitId
data PrimCall = PrimCall CLabelString Unit
instance Outputable PrimCall where
ppr (PrimCall lbl pkgId)
......
module GHC.Builtin.PrimOps where
import GHC.Prelude ()
data PrimOp
{-
(c) The GRASP Project, Glasgow University, 1994-1998
\section[TysWiredIn]{Wired-in knowledge about {\em non-primitive} types}
Wired-in knowledge about {\em non-primitive} types
-}
{-# LANGUAGE CPP #-}
......@@ -10,13 +10,13 @@
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
-- | This module is about types that can be defined in Haskell, but which
-- must be wired into the compiler nonetheless. C.f module TysPrim
module TysWiredIn (
-- must be wired into the compiler nonetheless. C.f module GHC.Builtin.Types.Prim
module GHC.Builtin.Types (
-- * Helper functions defined here
mkWiredInTyConName, -- This is used in TcTypeNats to define the
mkWiredInTyConName, -- This is used in GHC.Builtin.Types.Literals to define the
-- built-in functions for evaluation.
mkWiredInIdName, -- used in MkId
mkWiredInIdName, -- used in GHC.Types.Id.Make
-- * All wired in things
wiredInTyCons, isBuiltInOcc_maybe,
......@@ -71,7 +71,7 @@ module TysWiredIn (
-- * Tuples
mkTupleTy, mkTupleTy1, mkBoxedTupleTy, mkTupleStr,
tupleTyCon, tupleDataCon, tupleTyConName,
tupleTyCon, tupleDataCon, tupleTyConName, tupleDataConName,
promotedTupleDataCon,
unitTyCon, unitDataCon, unitDataConId, unitTy, unitTyConKey,
pairTyCon,
......@@ -126,45 +126,43 @@ module TysWiredIn (
int64ElemRepDataConTy, word8ElemRepDataConTy, word16ElemRepDataConTy,
word32ElemRepDataConTy, word64ElemRepDataConTy, floatElemRepDataConTy,
doubleElemRepDataConTy
) where
#include "HsVersions.h"
import GhcPrelude
import GHC.Prelude
import {-# SOURCE #-} MkId( mkDataConWorkId, mkDictSelId )
import {-# SOURCE #-} GHC.Types.Id.Make ( mkDataConWorkId, mkDictSelId )
-- friends:
import PrelNames
import TysPrim
import {-# SOURCE #-} KnownUniques
import GHC.Builtin.Names
import GHC.Builtin.Types.Prim
import {-# SOURCE #-} GHC.Builtin.Uniques
-- others:
import CoAxiom
import Id
import Constants ( mAX_TUPLE_SIZE, mAX_CTUPLE_SIZE, mAX_SUM_SIZE )
import Module ( Module )
import Type
import GHC.Core.Coercion.Axiom
import GHC.Types.Id
import GHC.Settings.Constants ( mAX_TUPLE_SIZE, mAX_CTUPLE_SIZE, mAX_SUM_SIZE )
import GHC.Unit.Module ( Module )
import GHC.Core.Type
import GHC.Types.RepType
import DataCon
import {-# SOURCE #-} ConLike
import TyCon
import Class ( Class, mkClass )
import RdrName
import Name
import NameEnv ( NameEnv, mkNameEnv, lookupNameEnv, lookupNameEnv_NF )
import NameSet ( NameSet, mkNameSet, elemNameSet )
import BasicTypes ( Arity, Boxity(..), TupleSort(..), ConTagZ,
SourceText(..) )
import ForeignCall
import SrcLoc ( noSrcSpan )
import Unique
import GHC.Core.DataCon
import {-# SOURCE #-} GHC.Core.ConLike
import GHC.Core.TyCon
import GHC.Core.Class ( Class, mkClass )
import GHC.Types.Name.Reader
import GHC.Types.Name as Name
import GHC.Types.Name.Env ( NameEnv, mkNameEnv, lookupNameEnv, lookupNameEnv_NF )
import GHC.Types.Name.Set ( NameSet, mkNameSet, elemNameSet )
import GHC.Types.Basic
import GHC.Types.ForeignCall
import GHC.Types.SrcLoc ( noSrcSpan )
import GHC.Types.Unique
import Data.Array
import FastString
import Outputable
import Util
import BooleanFormula ( mkAnd )
import GHC.Data.FastString
import GHC.Utils.Outputable
import GHC.Utils.Misc
import GHC.Data.BooleanFormula ( mkAnd )
import qualified Data.ByteString.Char8 as BS
......@@ -195,10 +193,10 @@ See also Note [Getting from RuntimeRep to PrimRep] in GHC.Types.RepType.
************************************************************************
If you change which things are wired in, make sure you change their
names in PrelNames, so they use wTcQual, wDataQual, etc
names in GHC.Builtin.Names, so they use wTcQual, wDataQual, etc
-}
-- This list is used only to define PrelInfo.wiredInThings. That in turn
-- This list is used only to define GHC.Builtin.Utils.wiredInThings. That in turn
-- is used to initialise the name environment carried around by the renamer.
-- This means that if we look up the name of a TyCon (or its implicit binders)
-- that occurs in this list that name will be assigned the wired-in key we
......@@ -377,7 +375,7 @@ It has these properties:
* If (Any k) is the type of a value, it must be a /lifted/ value. So
if we have (Any @(TYPE rr)) then rr must be 'LiftedRep. See
Note [TYPE and RuntimeRep] in TysPrim. This is a convenient
Note [TYPE and RuntimeRep] in GHC.Builtin.Types.Prim. This is a convenient
invariant, and makes isUnliftedTyCon well-defined; otherwise what
would (isUnliftedTyCon Any) be?
......@@ -565,6 +563,13 @@ pcDataConWithFixity' :: Bool -> Name -> Unique -> RuntimeRepInfo
-> [Type] -> TyCon -> DataCon
-- The Name should be in the DataName name space; it's the name
-- of the DataCon itself.
--
-- IMPORTANT NOTE:
-- if you try to wire-in a /GADT/ data constructor you will
-- find it hard (we did). You will need wrapper and worker
-- Names, a DataConBoxer, DataConRep, EqSpec, etc.
-- Try hard not to wire-in GADT data types. You will live
-- to regret doing so (we do).
pcDataConWithFixity' declared_infix dc_name wrk_key rri
tyvars ex_tyvars user_tyvars arg_tys tycon
......@@ -634,6 +639,7 @@ typeNatKind = mkTyConTy typeNatKindCon
typeSymbolKind = mkTyConTy typeSymbolKindCon
constraintKindTyCon :: TyCon
-- 'TyCon.isConstraintKindCon' assumes that this is an AlgTyCon!
constraintKindTyCon = pcTyCon constraintKindTyConName Nothing [] []
liftedTypeKind, typeToTypeKind, constraintKind :: Kind
......@@ -648,7 +654,7 @@ constraintKind = mkTyConApp constraintKindTyCon []
* *
************************************************************************
Note [How tuples work] See also Note [Known-key names] in PrelNames
Note [How tuples work] See also Note [Known-key names] in GHC.Builtin.Names
~~~~~~~~~~~~~~~~~~~~~~
* There are three families of tuple TyCons and corresponding
DataCons, expressed by the type BasicTypes.TupleSort:
......@@ -674,7 +680,7 @@ Note [How tuples work] See also Note [Known-key names] in PrelNames
- Given constraints: the superclasses automatically become available
- Wanted constraints: there is a built-in instance
instance (c1,c2) => (c1,c2)
See TcInteract.matchCTuple
See GHC.Tc.Solver.Interact.matchCTuple
- Currently just go up to 62; beyond that
you have to use manual nesting
- Their OccNames look like (%,,,%), so they can easily be
......@@ -695,14 +701,14 @@ Note [How tuples work] See also Note [Known-key names] in PrelNames
* Serialization to interface files works via the usual mechanism for known-key
things: instead of serializing the OccName we just serialize the key. During
deserialization we lookup the Name associated with the unique with the logic
in KnownUniques. See Note [Symbol table representation of names] for details.
in GHC.Builtin.Uniques. See Note [Symbol table representation of names] for details.
Note [One-tuples]
~~~~~~~~~~~~~~~~~
GHC supports both boxed and unboxed one-tuples:
- Unboxed one-tuples are sometimes useful when returning a
single value after CPR analysis
- A boxed one-tuple is used by DsUtils.mkSelectorBinds, when
- A boxed one-tuple is used by GHC.HsToCore.Utils.mkSelectorBinds, when
there is just one binder
Basically it keeps everything uniform.
......@@ -719,18 +725,45 @@ for one-tuples. So in ghc-prim:GHC.Tuple we see the declarations:
data Unit a = Unit a
data (a,b) = (a,b)
There is no way to write a boxed one-tuple in Haskell, but it can be
created in Template Haskell or in, e.g., `deriving` code. There is
nothing special about one-tuples in Core; in particular, they have no
There is no way to write a boxed one-tuple in Haskell using tuple syntax.
They can, however, be written using other methods:
1. They can be written directly by importing them from GHC.Tuple.
2. They can be generated by way of Template Haskell or in `deriving` code.
There is nothing special about one-tuples in Core; in particular, they have no
custom pretty-printing, just using `Unit`.
Note that there is *not* a unary constraint tuple, unlike for other forms of
tuples. See [Ignore unary constraint tuples] in TcHsType for more
tuples. See [Ignore unary constraint tuples] in GHC.Tc.Gen.HsType for more
details.
See also Note [Flattening one-tuples] in MkCore and
Note [Don't flatten tuples from HsSyn] in MkCore.
See also Note [Flattening one-tuples] in GHC.Core.Make and
Note [Don't flatten tuples from HsSyn] in GHC.Core.Make.
-----
-- Wrinkle: Make boxed one-tuple names have known keys
-----
We make boxed one-tuple names have known keys so that `data Unit a = Unit a`,
defined in GHC.Tuple, will be used when one-tuples are spliced in through
Template Haskell. This program (from #18097) crucially relies on this:
case $( tupE [ [| "ok" |] ] ) of Unit x -> putStrLn x
Unless Unit has a known key, the type of `$( tupE [ [| "ok" |] ] )` (an
ExplicitTuple of length 1) will not match the type of Unit (an ordinary
data constructor used in a pattern). Making Unit known-key allows GHC to make
this connection.
Unlike Unit, every other tuple is /not/ known-key
(see Note [Infinite families of known-key names] in GHC.Builtin.Names). The
main reason for this exception is that other tuples are written with special
syntax, and as a result, they are renamed using a special `isBuiltInOcc_maybe`
function (see Note [Built-in syntax and the OrigNameCache] in GHC.Types.Name.Cache).
In contrast, Unit is just an ordinary data type with no special syntax, so it
doesn't really make sense to handle it in `isBuiltInOcc_maybe`. Making Unit
known-key is the next-best way to teach the internals of the compiler about it.
-}
-- | Built-in syntax isn't "in scope" so these OccNames map to wired-in Names
......@@ -754,6 +787,8 @@ isBuiltInOcc_maybe occ =
"->" -> Just funTyConName
-- boxed tuple data/tycon
-- We deliberately exclude Unit (the boxed 1-tuple).
-- See Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)
"()" -> Just $ tup_name Boxed 0
_ | Just rest <- "(" `BS.stripPrefix` name
, (commas, rest') <- BS.span (==',') rest
......@@ -883,6 +918,9 @@ tupleDataCon sort i | i > mAX_TUPLE_SIZE = snd (mk_tuple sort i) -- Build one
tupleDataCon Boxed i = snd (boxedTupleArr ! i)
tupleDataCon Unboxed i = snd (unboxedTupleArr ! i)
tupleDataConName :: Boxity -> Arity -> Name
tupleDataConName sort i = dataConName (tupleDataCon sort i)
boxedTupleArr, unboxedTupleArr :: Array Int (TyCon,DataCon)
boxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Boxed i | i <- [0..mAX_TUPLE_SIZE]]
unboxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Unboxed i | i <- [0..mAX_TUPLE_SIZE]]
......@@ -928,7 +966,7 @@ mk_tuple Unboxed arity = (tycon, tuple_con)
tycon = mkTupleTyCon tc_name tc_binders tc_res_kind tc_arity tuple_con
UnboxedTuple flavour
-- See Note [Unboxed tuple RuntimeRep vars] in TyCon
-- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon
-- Kind: forall (k1:RuntimeRep) (k2:RuntimeRep). TYPE k1 -> TYPE k2 -> #
tc_binders = mkTemplateTyConBinders (replicate arity runtimeRepTy)
(\ks -> map tYPE ks)
......@@ -1085,7 +1123,7 @@ mk_sum arity = (tycon, sum_cons)
* *
********************************************************************* -}
-- See Note [The equality types story] in TysPrim
-- See Note [The equality types story] in GHC.Builtin.Types.Prim
-- ((~~) :: forall k1 k2 (a :: k1) (b :: k2). a -> b -> Constraint)
--
-- It's tempting to put functional dependencies on (~~), but it's not
......@@ -1165,11 +1203,11 @@ mk_class tycon sc_pred sc_sel_id
********************************************************************* -}
-- For information about the usage of the following type,
-- see Note [TYPE and RuntimeRep] in module TysPrim
-- see Note [TYPE and RuntimeRep] in module GHC.Builtin.Types.Prim
runtimeRepTy :: Type
runtimeRepTy = mkTyConTy runtimeRepTyCon
-- Type synonyms; see Note [TYPE and RuntimeRep] in TysPrim
-- Type synonyms; see Note [TYPE and RuntimeRep] in GHC.Builtin.Types.Prim
-- type Type = tYPE 'LiftedRep
liftedTypeKindTyCon :: TyCon
liftedTypeKindTyCon = buildSynTyCon liftedTypeKindTyConName
......@@ -1513,12 +1551,7 @@ mkListTy :: Type -> Type
mkListTy ty = mkTyConApp listTyCon [ty]
listTyCon :: TyCon
listTyCon =
buildAlgTyCon listTyConName alpha_tyvar [Representational]
Nothing []
(mkDataTyConRhs [nilDataCon, consDataCon])
False
(VanillaAlgTyCon $ mkPrelTyConRepName listTyConName)
listTyCon = pcTyCon listTyConName Nothing [alphaTyVar] [nilDataCon, consDataCon]
-- See also Note [Empty lists] in GHC.Hs.Expr.
nilDataCon :: DataCon
......@@ -1604,7 +1637,7 @@ mkTupleTy boxity tys = mkTupleTy1 boxity tys
-- | Make a tuple type. The list of types should /not/ include any
-- RuntimeRep specifications. Boxed 1-tuples are *not* flattened.
-- See Note [One-tuples] and Note [Don't flatten tuples from HsSyn]
-- in MkCore
-- in GHC.Core.Make
mkTupleTy1 :: Boxity -> [Type] -> Type
mkTupleTy1 Boxed tys = mkTyConApp (tupleTyCon Boxed (length tys)) tys
mkTupleTy1 Unboxed tys = mkTyConApp (tupleTyCon Unboxed (length tys))
......
module TysWiredIn where
module GHC.Builtin.Types where
import {-# SOURCE #-} TyCon ( TyCon )
import {-# SOURCE #-} TyCoRep (Type, Kind)
import {-# SOURCE #-} GHC.Core.TyCon ( TyCon )
import {-# SOURCE #-} GHC.Core.TyCo.Rep (Type, Kind)
import BasicTypes (Arity, TupleSort)
import Name (Name)
import GHC.Types.Basic (Arity, TupleSort)
import GHC.Types.Name (Name)
listTyCon :: TyCon
typeNatKind, typeSymbolKind :: Type
......@@ -15,6 +15,8 @@ coercibleTyCon, heqTyCon :: TyCon
unitTy :: Type
liftedTypeKind :: Kind
liftedTypeKindTyCon :: TyCon
constraintKind :: Kind
runtimeRepTyCon, vecCountTyCon, vecElemTyCon :: TyCon
......