Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full Nix and project infrastructure rework #196

Merged
merged 2 commits into from
Nov 2, 2021
Merged

Conversation

sir4ur0n
Copy link
Contributor

@sir4ur0n sir4ur0n commented Oct 22, 2021

So this ends up being a HUGE PR, sorry about that, it's never convenient when exploring infrastructure rework 🙇

Hopefully exhaustive list of changes or impacts of this PR:

  • Build now relies on Stack both for developers and CI (previous haskell.nix infrastructure meant developers used Stack and CI used haskell.nix, and haskell.nix provides poor developer experience with Stack, see their documentation for more information)
    • Removing haskell.nix also means removing the sluggishness caused by immaterializations, so shells should be faster
  • Stack integration should be much better now: commands like stack build, stack test, stack repl funflow, stack haddock, stack ide targets, etc., just work
  • Haskell Language Server integration should be much better now: I removed hie.yaml as the project is now a standard Stack project, which HLS (via hie-bios) auto detects correctly
    • E.g. code completion, documentation display, navigation, typechecking, work in all libraries, including in tests!
  • I copied and homogenized LICENSE files in each package
  • Some packages had a package.yaml (i.e. Hpack), some directly had a xx.cabal file (i.e. Cabal), so I homogenized to a package.yaml for each package, and I also versioned all generated cabal files (it's the recommended way)
    • cas-store gave me a hard time because there is some OS-specific logic which I had to translate to Hpack, but I think I somehow managed
  • I updated the Stackage resolver from 16.16 to 18.13.
    • Many dependencies are thus more up to date
    • GHC version thus bumped from 8.8.4 to 8.10.7
    • I also updated the extra-dependencies, in particular hvega and IHaskell
    • A few dependencies no longer need specific pinning (e.g. sqlite-simple)
    • A few minor code changes were required (e.g. add File to imports of Path in various Haskell files and notebooks, e.g. funflow/test/flows/TestFunflow.hs)
  • Nix dependencies are now managed by Niv
    • It makes updating them easier
    • I have pushed jupyterWith dependency which was hardcoded to Niv depency too
  • Reformatted Haskell code (which unfortunately leads to a big diff as many files were not formatted 😞 )
  • Reworked the documentation according to all other changes
  • Documented use of Direnv to improve Shell integration with Nix
  • Fix broken Haddock for funflow-examples/makefile-tool/src/Types.hs
  • Reformat all Nix files
  • Build documentation and pages
  • Check that test failure fails CI
  • Move jupyterWith dependency to Niv (currently hardcoded)
  • shell.nix seems to build docker-client and funflow (because of overlays?)
  • Document using Direnv (and nix-direnv) for smooth shell integration
  • Do a round of documentation
  • Squash all commits and reuse the PR description in commit message

Closes #193

@sir4ur0n sir4ur0n force-pushed the sir4ur0n/reworkNix2 branch 5 times, most recently from 59f59b9 to b448087 Compare October 26, 2021 15:09
@sir4ur0n sir4ur0n marked this pull request as ready for review October 26, 2021 16:20
@sir4ur0n sir4ur0n changed the title Draft or full Nix infrastructure rework Full Nix and project infrastructure rework Oct 26, 2021
Copy link
Contributor

@GuillaumeDesforges GuillaumeDesforges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work! 🎉

nix/shell-stack.nix Show resolved Hide resolved
Copy link
Contributor

@dorranh dorranh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for preparing this, @sir4ur0n - I know it was a lot of work! The changes here make sense to me and really do improve the experience of working on the project. HLS integration works way better and is much faster than it previously was. The only thing which would be nice in the future is breaking out the global formatting run into a separate PR to make the changes more readable. LGTM though - please feel free to squash and merge 🙂

Julien Debon added 2 commits November 2, 2021 10:03
* Build now relies on Stack both for developers and CI (previous `haskell.nix` infrastructure meant developers used Stack and CI used `haskell.nix`, and `haskell.nix` provides poor developer experience with Stack, see [their documentation](https://input-output-hk.github.io/haskell.nix/tutorials/development/) for more information)
  * Removing `haskell.nix` also means removing the sluggishness caused by immaterializations, so shells should be faster
* Stack integration should be **much better** now: commands like `stack build`, `stack test`, `stack repl funflow`, `stack haddock`, `stack ide targets`, etc.,  **just work**
* Haskell Language Server integration should be **much better** now: I removed `hie.yaml` as the project is now a standard Stack project, which HLS (via hie-bios) auto detects correctly
  * E.g. code completion, documentation display, navigation, typechecking, work in all libraries, including in tests!
* I copied and homogenized `LICENSE` files in each package
* Some packages had a `package.yaml` (i.e. Hpack), some directly had a `xx.cabal` file (i.e. Cabal), so I homogenized to a `package.yaml` for each package, and I also versioned all generated cabal files (it's the recommended way)
  * `cas-store` gave me a hard time because there is some OS-specific logic which I had to translate to Hpack, but I think I somehow managed
* I updated the Stackage resolver from 16.16 to 18.13.
  * Many dependencies are thus more up to date
  * GHC version thus bumped from 8.8.4 to 8.10.7
  * I also updated the extra-dependencies, in particular `hvega` and `IHaskell`
  * A few dependencies no longer need specific pinning (e.g. `sqlite-simple`)
  * A few minor code changes were required (e.g. add `File` to imports of `Path` in various Haskell files and notebooks, e.g. `funflow/test/flows/TestFunflow.hs`)
* Nix dependencies are now managed by Niv
  * It makes updating them easier
  * I have pushed `jupyterWith` dependency which was hardcoded to Niv depency too
* Reworked the documentation according to all other changes
* Documented use of Direnv to improve Shell integration with Nix
* Fix broken Haddock for `funflow-examples/makefile-tool/src/Types.hs`
* Reformat all Nix files
@sir4ur0n
Copy link
Contributor Author

sir4ur0n commented Nov 2, 2021

I have reworked the commit tree, now there are 2 commits:

  • the major commit with all the changes except the reformatting
  • reformatting

@sir4ur0n sir4ur0n merged commit e273cfa into master Nov 2, 2021
@sir4ur0n sir4ur0n deleted the sir4ur0n/reworkNix2 branch November 2, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tutorial Nix shell must be nested within the root Nix shell
3 participants