nick8325 / quickspec

Equational laws for free
BSD 3-Clause "New" or "Revised" License
247 stars 24 forks source link

build problem with nix #72

Closed zoranbosnjak closed 1 year ago

zoranbosnjak commented 1 year ago

quickspec package is marked broken in a nix package set. I belive the problem is that a twee-lib included in nix packages by default is twee-lib-2.4.2, while the quickspec explicitly requires version 2.4.

After a quick analysis it looks like the Arity class was removed from the twee-lib and the quickspec is still using this class. What was to reason for removal? Could this be removed from quickspec too? This might fix the nix build problem.

Steps to reproduce the problem:

git clone https://github.com/nick8325/quickspec.git
cd quickspec/
cabal2nix --shell . > default.nix
nix-build
# ...
# Configuring quickspec-2.1.5...
# Setup: Encountered missing or private dependencies:
# twee-lib ==2.4
ashwinmathi commented 1 year ago

I was able to reproduce the problem on my machine and after making the changes it's able to build with nix.

I'm new to open source so I'd appreciate any critique on my quick fix, but here's my fork where I add an internal Arity typeclass and redirect references/imports/dependencies. I added it to the bottom of QuickSpec.Internal.Type

https://github.com/ashwinmathi/quickspec

zoranbosnjak commented 1 year ago

@ashwinmathi, thanks. It fixes the build problem, with a small additional fix in the cabal file. It's up to the author, but my preference would be to squash your intermediate commits to a single commit, for example like this: https://github.com/zoranbosnjak/quickspec/commits/nixfix

ashwinmathi commented 1 year ago

Thanks, that makes sense. Are you going to open a PR from your fork / should I close my open one?

zoranbosnjak commented 1 year ago

@ashwinmathi OK, a new PR is created. You can close yours now.