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

Attempt to build stack project fails with: <mypkg>.cabal was modified manually... #89

Open
doyougnu opened this issue Apr 13, 2020 · 1 comment

Comments

@doyougnu
Copy link

doyougnu commented Apr 13, 2020

Trying to statically build my personal project (here). All dependencies build or found in cachix/nixpkgs but the build fails with a <mypkg>.cabal was modified manually, please use --force... error:

System Details

❯ nix --version
nix (Nix) 2.3.3

OS: NixOS 19.09.2331.64a3ccb852d (Loris)

resolver: lts-12.25

Using the default stack-project-builder script and default command to build

❯ stack --version
2.1.3.1 x86_64 hpack-0.32.0

The Error

patching script interpreter paths in /nix/store/0vmwrghjzi3zjd9xyc50k0zfcrpaw3mi-hpack-0.28.2
checking for references to /build/ in /nix/store/0vmwrghjzi3zjd9xyc50k0zfcrpaw3mi-hpack-0.28.2...
cannot find section .dynamic
building '/nix/store/zik2b383wxvqfafvssvh80bqfkkw8sny-vsat-0.1.0.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/p2l0j6hwl8c7dlxb318wwkji2hzsphki-ghc-8.4.4.
unpacking sources
unpacking source archive /nix/store/grpbilla8pl5kw9njcd174a22ia4gkrg-haskell
source root is haskell
patching sources
compileBuildDriverPhase
Determined cabalPackageId as Cabal-2.2.0.1-FmPcs9btIHM2Dcb9OsF5gI
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded -package-id Cabal-2.2.0.1-FmPcs9btIHM2Dcb9OsF5gI
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
updateAutotoolsGnuConfigScriptsPhase
configuring
vsat.cabal was modified manually, please use --force to overwrite.
builder for '/nix/store/zik2b383wxvqfafvssvh80bqfkkw8sny-vsat-0.1.0.0.drv' failed with exit code 1
error: build of '/nix/store/zik2b383wxvqfafvssvh80bqfkkw8sny-vsat-0.1.0.0.drv' failed

Note that I received the same error after deleting my cabal file, figuring Hpack would generate a new one.

@doyougnu doyougnu changed the title Attempt to build stack project failes with: <mypkg>.cabal was modified manually... Attempt to build stack project fails with: <mypkg>.cabal was modified manually... Apr 13, 2020
@nh2
Copy link
Owner

nh2 commented Apr 18, 2020

Yes, this is a common error with hpack.

In practice, just deleting the .cabal or package.yaml in preConfigure fixes that stuff.

But I'm not happy yet with the UX, especially because I've made some effort in the past so that things like that don't happen: NixOS/cabal2nix@5721bed But that fix was for cabal2nix, while for you it happends during configure phase. I'm not quite sure what invokes hpack here, Cabal itself?

Could you give me the full reproducer for it (I couldn't find the files you use to build the above error above), so I can check that?

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

No branches or pull requests

2 participants