Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

improving the build/installation process #1002

Closed
@2mol

Description

@2mol

Hi everybody!

I spent some time trying to figure out how HIE is built and I found a bunch of problems that might be pretty easy to fix.

This is me getting started on that and soliciting feedback.

My end-goal is to create a PR that makes the installation more pleasant for first time users, including some readme polish. Please note that I'm neither extremely experienced with makefiles, nor with other build tools or tricky dependency handling, so I'm not promising that I'll be extremely fast. I will track progress here.

The problems. Numbered so you can comment on them:

  1. building everything seems robust-ish, but is very time intensive and uses up loads of harddisk.
  2. building a targeted ghc version is broken in my opinion:
    • The submodules will use different resolvers. The redundancy in downloads and compilations is pretty nuts. Incorrect, they will use the resolver from the stack build command.
    • The selection of ghc version doesn't propagate to the other build commands.
    • The command to check the ghc version (GHC := $(shell stack path --compiler-exe)) will use the main stack.yaml instead of the targeted one. This will also attempt to download an entire resolver set, just to tell you its ghc version.
  3. The resolvers in stack.yaml and stack-8.6.3.yaml are two different nightly ones, which I think could be aligned to use the same one, improving build-all.
  4. It's unclear what I have to have on my system and what can get reused. If I have the latest cabal, no need to compile the whole thing.
  5. happy gets compiled and installed with each version, effectively overwriting itself 7 times.

I really think installing one, maybe two specific versions is the right use-case for most intermediate users, especially those installing hie for the first time.

As an example, I managed to get an amazing fast install experience (for ghc 8.4.4) by doing the following:

  • remove the dependencies on cabal and submodules from hie-%: in the Makefile
    • not fully necessary, but nice in case we already have the right cabal version.
  • copy stack-8.4.4.yaml over stack.yaml
  • change the resolvers of submodules/HaRe and submodules/brittany to use the same one as HIE (and create a stack-8.4.4.yaml for the latter)
    • not necessary
  • make sure that cabal is installed. I happened to have it via ghcup so I have no idea if it even needed cabal update, I only did cabal new-update. It seems it's also not mandatory to install via stack.
  • make build-doc-8.4.4 at the end.
  • everything works in projects with 8.4.4. Amazing!
    • space cost: 200Mb. Would be 100Mb, but there is both hie-8.4 and hie-8.4.4. Does it need both? Who knows. md5 says they're the same thing. Would a symlink do?

Now the challenge is to make it equally nice without having to tweak any files.

I gotta run now, but I will update this post with goals and a todo list.

Chime in if you have comments!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions