Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,246
    • Issues 4,246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 397
    • Merge Requests 397
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Merge Requests
  • !3950

Open
Opened Aug 31, 2020 by fendor@fendorDeveloper2 of 14 tasks completed2/14 tasks
  • Report abuse
Report abuse

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch "https://gitlab.haskell.org/fendor/ghc.git" "wip/multi-home-units"
git checkout -b "fendor/ghc-wip/multi-home-units" FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "master"
git merge --no-ff "fendor/ghc-wip/multi-home-units"

Step 4. Push the result of the merge to GitLab

git push origin "master"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

WIP: Implement Multiple Home Units for GHC (#10827)

  • Overview 0
  • Commits 9
  • Pipelines 6
  • Changes 86

Thank you for your contribution to GHC!

Please take a few moments to verify that your commits fulfill the following:

  • are either individually buildable or squashed
  • have commit messages which describe what they do (referring to [Notes][notes] and tickets using #NNNN syntax when appropriate)
  • 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.
  • replace this message with a description motivating your change

Motivation

The main motivation can be found in #10827.

Structure

The MR is split into multiple commits that are all individually buildable (although not all pass the testsuite).

There are two commits that are should not be merged with this MR:

  • Modify hie.yaml to only load the compiler package
    • Modifications for hie.yaml as I saw fit for developing GHC code-base. Can be removed, once approved.
  • Debug Output
    • Adds debug output that helped me debugging. It is not intended that this commit is merged.

This MR also subsumes !935 and includes the changes from it in the commit:

  • Implement basics for multi-unit support in HscEnv
    • If desired, this commit can be integrated in the main changes entirely. Changes are squashed, as they are individually not useful.

The main changes of this MR are in the commits:

  • Design API for multiple home units
    • Design an API for end-users and GHC to work with multiple home-units.
  • Implement multiple home unit support
    • Main changes. Make GHC work with Multiple Home Units
  • Implement GHCi interface for multiple home units
    • Purely interface changes for GHC and GHCi.
    • This MR re-implements clumsily !3897 (merged), I would prefer if that MR gets merged and this MR is rebased on top it.

UI Design and general comments have been added to the wiki multiple-packages-per-session page.

Open Issues

A few issues that need to be taken care of:

  • There are quite a lot of "TODO:" lines
  • Remove or fix the commit "Dubious commit, review each line"
    • It is the result of three months of rebasing and changing code.
  • Test-coverage is far from sufficient. At least the following test-cases must be covered:
    • Produce compiler artifacts with multiple home units
    • Produce compiler artifacts with multiple home units using only a singleton home units (should have same behaviour as --make)
  • Discuss design decisions regarding GHC UI.
  • Discuss how to handle statefulness in GHC API.
    • In particular, prefer explicit UnitId parameters over implicit changes to HscEnv and vice versa.
  • Maybe individual commits need more explanations.

Testing in the wild

Testing this MR in the wild is doable with a fork of cabal and HEAD.Hackage. Example:

$ cabal init --libandexe --no-comments --source-dir=src --application-dir=app -p example
$ $HEADHackage/scripts/head.hackage.sh init
$ cabal update
$ cabal repl lib:example exe:example --allow-newer=base,ghc-prim

If there is something missing for this MR, I happy to add it.

cc @Ericson2314, @mpickering, @hsyl20

Edited Aug 31, 2020 by fendor
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
Reference: ghc/ghc!3950
Source branch: wip/multi-home-units