Nothing Special   »   [go: up one dir, main page]

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

Add nix packaging support using haskell.nix #483

Merged
merged 17 commits into from
Jul 21, 2024

Conversation

chaserhkj
Copy link
Contributor

This PR adds nix packaging for BNFC using haskell.nix, allowing it to be integrated directly with the nix ecosystem, producing more reproducible builds as well.

Note that this does not invalidate the current stack-based build system, this is just additional nix build scripts that can be used by nix systems, quite like the Dockerfile we are already providing. This does not create multiple sources of truth for building as well since haskell.nix reads stack yaml configurations and generate build instructions on the fly.

@andreasabel
Copy link
Member

Thanks for the contribution!

Would be great if this could be tested by a GitHub workflow (CI), so that it does not bit-rot.
Do you think you can add such a workflow?
I have seen it e.g. at https://github.com/haskell/hackage-server/blob/8a8d7391b819921f67aa446c134a2bf83da1b9b4/.github/workflows/nix-flake.yml

@chaserhkj
Copy link
Contributor Author

Workflow is added, should be working now for both os x and linux builds using nix. A few notes:

  • Currently I only added building with GHC 9.8 branch in nix workflow. Let me know if you feel building all supported versions makes more sense.
  • I saw that they were testing development environments in other example workflows. But our configured development environments includes Haskell language server that needs to be compiled. And that would take a ridiculously longer period of time (>20mins), so I just disabled it for now.
  • For nix flake check to pass I need to do some workarounds in flake.nix to deal with hydraJobs and doctests, see comments there.

@andreasabel andreasabel added the nix Building with nix label Jul 21, 2024
@andreasabel
Copy link
Member

Excellent, I'll merge this now!

I cannot promise to maintain this, unfortunately, as I lack the nix skills. So further involvement would be appreciated.

@andreasabel andreasabel merged commit 4496a35 into BNFC:master Jul 21, 2024
27 checks passed
@andreasabel andreasabel added this to the 2.9.5.1 milestone Jul 21, 2024
@chaserhkj chaserhkj deleted the nix-packaging branch July 22, 2024 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nix Building with nix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants