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

Freeze the package versions based on the ones from nixpkgs #117

Merged
merged 3 commits into from
Jun 28, 2023

Conversation

robbert-vdh
Copy link
Member

This prevents the plain Cabal and the Nix builds from using different versions. This is especially important when using Nix, as Cabal may start using more up to date versions of the package from Hackage if the user has run cabal update before and a local package database exists. Cabal can also be forced to use only the global package registry in which case this problem also doesn't exist, but that requires either breaking non-Nix builds or wrapping the cabal command.

I also added the freeze files to the Nix builds so we'll get alerted if nixpkgs gets updated without also updating the freeze file.

This prevents Icepeak from being built using the wrong versions after a
`cabal update`. We could disable Hackage completely but that would break
non-Nix builds.
@robbert-vdh robbert-vdh requested a review from fatho June 28, 2023 09:40
@robbert-vdh robbert-vdh force-pushed the robbert-vdh/freeze-cabal-deps branch from dfafbf1 to 9f77477 Compare June 28, 2023 10:03
@robbert-vdh
Copy link
Member Author

I changed the check to just use cabal build --dry-run all instead of making it part of the Nix build. Having it be part of the Nix build could cause problems if the derivation was included as part of a nixpkgs overlay with a different nixpkgs version.

@@ -43,6 +43,10 @@ blocks:
- echo "max-jobs = auto" >> ~/.config/nix/nix.conf

jobs:
- name: "Check frozen versions"
commands:
- "cabal build --dry-run all"
Copy link
Member

Choose a reason for hiding this comment

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

Might need a nix develop - it failed on CI because it cannot find cabal

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, I forgot there's no devenv there. Should be fixed now.

Copy link
Member

@fatho fatho left a comment

Choose a reason for hiding this comment

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

LGTM

@robbert-vdh
Copy link
Member Author

Thanks!

@OpsBotPrime merge

@OpsBotPrime
Copy link
Contributor

Pull request approved for merge by @robbert-vdh, rebasing now.

robbert-vdh and others added 2 commits June 28, 2023 14:05
This makes sure the package versions from nixpkgs and the versions
specified in the freeze file are in sync.
@OpsBotPrime
Copy link
Contributor

Rebased as 4173a02, waiting for CI …

@OpsBotPrime
Copy link
Contributor

CI job 🟡 started.

@OpsBotPrime OpsBotPrime force-pushed the robbert-vdh/freeze-cabal-deps branch from be71b32 to 4173a02 Compare June 28, 2023 12:11
@OpsBotPrime OpsBotPrime merged commit 4173a02 into master Jun 28, 2023
1 check was pending
@OpsBotPrime OpsBotPrime deleted the robbert-vdh/freeze-cabal-deps branch June 28, 2023 12:11
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.

None yet

3 participants