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

Builder doesn't run Setup.hs hooks (autoreconf etc.) #778

Closed
thomasjm opened this issue Jul 22, 2020 · 4 comments
Closed

Builder doesn't run Setup.hs hooks (autoreconf etc.) #778

thomasjm opened this issue Jul 22, 2020 · 4 comments
Labels
bug Something isn't working wontfix

Comments

@thomasjm
Copy link
Contributor

I have a project that needs you to run autoreconf -i to generate a configure script before it can be built. Building it works fine with normal stack/cabal but it doesn't work with haskell.nix.

My repo is here: https://github.com/codedownio/statvfs/tree/38fcb950982525aa1737418685cd8fca2f7452e2. You can try running nix-build -A statvfs.components.library to see the problem.

Setup.hs just invokes autoconfUserHooks:

module Main (main) where

import Distribution.Simple

main :: IO ()
main = defaultMainWithHooks autoconfUserHooks

I get the following error:

Warning: The 'build-type' is 'Configure' but there is no 'configure' script.
You probably need to run 'autoreconf -i' to generate it.
Setup: configure script not found.

Installing an override as mentioned in #768 worked, but I think this should be automatic:

  modules = [
    {
      packages.statvfs.components.library.preConfigure = ''
        ${pkgs.autoconf}/bin/autoreconf -i
      '';
    }
  ];
@peterbecich
Copy link
Contributor

peterbecich commented Nov 7, 2021

Another example of this; old-time requires autoreconf -i:
https://github.com/peterbecich/old-time/tree/build-with-nix

nix build -f default.nix
...
       > Configuring library for old-time-1.1.0.3..
       > Warning: The flag --disable-executable-profiling is deprecated. Please use
       > --disable-profiling instead.
       > Warning: The 'build-type' is 'Configure' but there is no 'configure' script.
       > You probably need to run 'autoreconf -i' to generate it.
       > Setup: configure script not found.
       >
       For full logs, run 'nix log /nix/store/0az17fxv89gyciiykr3a05q50ay0q76c-old-time-lib-old-time-1.1.0.3.drv'.
error: 1 dependencies of derivation '/nix/store/5bcf2csq9652rjz0ns5hr3dqzfqzwl46-project-coverage-report.drv' failed to build
error: build of '/nix/store/325whvhzfvw62s99ldq1g421kiym291b-ghc-shell-for-old-time.drv', '/nix/store/5bcf2csq9652rjz0ns5hr3dqzfqzwl46-project-coverage-report.drv' failed

Copying the post above, this override fixes it:
https://github.com/peterbecich/old-time/blob/6d1b00c6353c574af8d4f517d54ea70668ff4cf2/default.nix#L16-L22

peterbecich referenced this issue in peterbecich/old-time Nov 7, 2021
@peterbecich
Copy link
Contributor

peterbecich commented Nov 7, 2021

@peterbecich
Copy link
Contributor

peterbecich commented Jun 12, 2022

I believe this also prevents the network library from building successfully with haskell.nix and GHCJS.

Some of these essential extra-source-files are not checked into version control: https://github.com/haskell/network/blob/53519f0ff9f282b69fa67a9b32c3a4e61bf8478b/network.cabal#L40-L47
When building network with haskell.nix and GHCJS, this results in errors such as:

> cabal: sdist of network-3.1.2.7: filepath wildcard 'configure' does not match any files.
> cabal: sdist of network-3.1.2.7: filepath wildcard 'include/HsNetworkConfig.h.in' does not match any files.

By itself the network library does support building with GHCJS: haskell/network#431


As an aside, there is another issue with building network using haskell.nix and GHCJS, which should be solved separately: haskell/network@80ea53f#diff-9c966208fd0a0c8e24a1526da6904887c378283b9b645b9740c19339884174d9R1753

@stale
Copy link

stale bot commented Jan 18, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix
Projects
None yet
Development

No branches or pull requests

3 participants