haskell.nix icon indicating copy to clipboard operation
haskell.nix copied to clipboard

.cabal was modified manually, please use --force to overwrite.

Open locallycompact opened this issue 5 years ago • 7 comments

Hi, I'm trying to use an external git repo as an extra-dep in stack-to-nix and getting the error

.cabal was modified manually, please use --force to overwrite.

It doesn't seem like this is the case as I've tried regenerating it from the hpack but it reports the same. If I delete the cabal file, then it works.

Log here:

https://gitlab.com/shakebook-site/shakebook-lib/-/jobs/645114372

locallycompact avatar Jul 18 '20 10:07 locallycompact

Hm, maybe different versions of hpack? I would hope that different versions would produce the same .cabal file from something with the same spec-version...

michaelpj avatar Jul 20 '20 08:07 michaelpj

Is there a way to grab the generated copy of the cabal file for the nix version of that build to compare?

locallycompact avatar Jul 20 '20 11:07 locallycompact

Maybe just run the hpack yourself? If you build haskell-nix.haskellPackages.hpack.components.exes.hpack and run the hpack from there yourself on your package.yaml that'll presumably give you the same objection.

michaelpj avatar Jul 20 '20 15:07 michaelpj

I think this might be a bug in haskell.nix. If both a .cabal file and a package.yaml file are present in a directory should we be running hpack at all or just using the .cabal file?

hamishmack avatar Jul 21 '20 00:07 hamishmack

I hit this error by having both a .cabal file and package.yaml file.

peterbecich avatar Mar 07 '22 18:03 peterbecich

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 28 '22 14:09 stale[bot]

I think this has been fixed for cabalProject (it now prefers .cabal file over package.yaml if both are present). I am not sure about stackProject though.

hamishmack avatar Oct 10 '22 13:10 hamishmack