Preparations for hacking on Agda

Hacking preparations (as of 2022-11-07):

  • Have a working GHC 9.x with cabal (and possibly stack). All of these can be installed with ghcup.
  • Clone the Agda repository and the submodules
        git clone --recurse-submodules git@github.com:agda/agda.git
        cd agda
    
    
  • If you want to use stack, choose a GHC version x.y.z and copy/rename the file stack-x.y.z.yaml to stack.yaml. This changes the behaviour of the make commands below (except for the last one) to use stack. GHC 9.4.3 does not yet seem to be supported by stack.
  • Run all of the following commands to (v1-cabal) build and install Agda with various optimization levels:
        make install-bin
        make fast-install-bin
        make quicker-install-bin
        make type-check
    
    
    These four goals install the following executables in the installdir as given in $HOME/.cabal/config, assuming master is on Agda version 2.6.4. Also, if you build for the first time, these are expected durations on a not-too-old laptop:
    • 30min: agda-2.6.4
    • 7min: agda-fast
    • 5min: agda-quicker
    • 1min: (type-check does not build an executable)
    Subsequent builds are quite a bit faster, this is why we prebuild everything.
  • Optionally, build tags files for e.g. emacs
        cd somewhere_else_outside_of_a_cabal_project
        cabal install hs-tags -w ghc-x.y.z
        ## ghc-x.y.z should be an installed GHC < 9.2
        ## Or, you could use stack to install hs-tags
        stack install hs-tags
        ## Assuming hs-tags is installed:
        cd agda
        make TAGS
    
    
  • Install fix-whitespace
        cd somewhere_else_outside_of_a_cabal_project
        cabal install fix-whitespace
        ## OR
        stack install fix-whitespace
        ## 
        cd agda
        fix-whitespace --check
    
    
  • Run the testsuite to see if everything is set up correctly.
        make test
    
    

Further useful information at: https://github.com/agda/agda/blob/master/HACKING.md

Page last modified on November 09, 2022, at 10:21 pm
Powered by PmWiki