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

Run the 'configure' command first #4

Closed
Nexmean opened this issue Aug 3, 2022 · 11 comments
Closed

Run the 'configure' command first #4

Nexmean opened this issue Aug 3, 2022 · 11 comments

Comments

@Nexmean
Copy link

Nexmean commented Aug 3, 2022

I have done everything from instruction after cabal clean. But when I run cabal-hoogle generate I'm getting following error message: Run the 'configure' command first.

@kokobd
Copy link
Owner

kokobd commented Aug 4, 2022

@Nexmean Have you run cabal build before cabal-hoogle generate? See: https://github.com/kokobd/cabal-hoogle#build-project-with-cabal

And, what Cabal version are you using? Can you share a link to your repository? Sharing the structure of your dist-newstyle may also help (for example with command like tree)

@Nexmean
Copy link
Author

Nexmean commented Aug 4, 2022

I did run cabal build all before cabal-hoogle generate. Sorry, but I can't share my repository. I can only share structure of dist-newstyle where I removed info about most modules and renamed some packages: https://gist.github.com/Nexmean/3e36772a320946dcbfbf1aeec5da93d2

@Nexmean Nexmean closed this as completed Aug 4, 2022
@Nexmean Nexmean reopened this Aug 4, 2022
@kokobd
Copy link
Owner

kokobd commented Aug 4, 2022

Please try not to disable the optimization, and see if it works.

From your dist-newstyle structure, I see docs reside in noopt subdirectory, indicating you were using something like --disable-optimization or -O0 when calling cabal build all. However, cabal-hoogle currently only reads the default build product.

In the future, cabal-hoogle will call cabal build automatically, so that this will not happen.

@Nexmean
Copy link
Author

Nexmean commented Aug 4, 2022

Yeah, I have optimization: False in my cabal.project.local. So I'll try to disable it later and run it again.

@Nexmean
Copy link
Author

Nexmean commented Aug 5, 2022

I've tried to build w/o optimizations and now I get following error when call cabal-hoogle generate:

$ cabal-hoogle generate
cabal-hoogle: Saved package config file is outdated:
• the Cabal version changed from Cabal-3.2.1.0 to Cabal-3.6.2.0
Re-run the 'configure' command.

cabal --version:

$ cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library

@kokobd
Copy link
Owner

kokobd commented Aug 5, 2022

This indicates some files are generated by Cabal-3.2.1.0.

  1. Make sure you specified Cabal version when installing cabal-hoogle, for example: cabal install --constraint="Cabal == 3.6.2.0" --install-method=copy --overwrite-policy=always cabal-hoogle
  2. Please try rm -rf dist-newstyle, and run cabal build all.

BTW, are you using a custom Setup.hs?

@Nexmean
Copy link
Author

Nexmean commented Aug 5, 2022

  1. I'm sure that I specified Cabal version 3.6.2.0. I did it via cabal.project.local in local copy of cabal-hoogle repo:
constraints:
   Cabal == 3.6.2.0
  1. I did cabal clean. So ok, I can try rm -rf dist-newstyle instead.
  2. Yeah, I'm using custom Setup.hs in one small package of project to get git revision.

@kokobd
Copy link
Owner

kokobd commented Aug 5, 2022

Ah, thank you for your patience! I see, packages with custom Setup.hs effectively use Cabal from the dependencies of Setup.hs. Maybe that version is 3.2 I guess.

I will:

  1. Publish a version that allows partial failure in a multi-package repo very soon.
  2. Look into how to use Setup.hs from cabal-hoogle

@kokobd
Copy link
Owner

kokobd commented Aug 6, 2022

@Nexmean I've merged a PR to allow partial failure in a multi-package project. You can try the latest main branch.

Meanwhile, a workaround to Setup.hs issue is by adding Cabal == 3.6.2.0 constraint to YOUR PROJECT's cabal.project.local too, so that your project's Setup.hs generates files for Cabal 3.6.2.0.

@Nexmean
Copy link
Author

Nexmean commented Aug 23, 2022

I've merged a PR to allow partial failure in a multi-package project. You can try the latest main branch.

I've tried and it works for me.

Meanwhile, a workaround to Setup.hs issue is by adding Cabal == 3.6.2.0 constraint to YOUR PROJECT's cabal.project.local too, so that your project's Setup.hs generates files for Cabal 3.6.2.0.

My build became broken when I set Cabal == 3.6.2.0, so I can't use it.

@Nexmean Nexmean closed this as completed Aug 23, 2022
@kokobd
Copy link
Owner

kokobd commented Aug 23, 2022

Maybe worth noting that handling Cabal version mismatch when a custom Setup.hs is used is not easy. It's blocked by upstream. Created another issue to track that: #9

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