-
Notifications
You must be signed in to change notification settings - Fork 701
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
improve dist/setup-config format mismatch detection #2251
Comments
/cc @ttuegel |
In the previous text based format we included info about the version of Cabal that wrote it and reported an appropriate message if the version did not match (and iirc, that was one of the cases where we'd automatically reconfigure). |
fwiw, @svenpanne experienced this issue some time ago too: https://www.haskell.org/pipermail/ghc-devs/2014-October/006962.html |
@dcoutts |
For those who come here by googling the error message: to fix this issue, just delete |
The new code should be more robust to format changes, in the sense that |
+1 on this.
I think I had this happen to me with a new Cabal, but I don't know how to reproduce (the problem went away after a reconfigure). It'd help if someone could attach a Which version of |
The https://launchpad.net/~hvr/+archive/ubuntu/ghc/+sourcepub/4539223/+listing-archive-extra (i.e. 7ece59b) whereas the |
@hvr |
+1 on better handling of version mismatches. i like the idea of sticking with the old header format and automatically reconfiguring. I've also been seeing this type of error a lot, working with recent cabal versions. I know how to fix it, but it's probably going to bite lots of users, in particular in mixed cabal version setups (and i'll have to keep asking ghc 7.8 users to upgrade their cabal library to use ghcjs) |
I just triggered a rebuild for one of my projects, and things seem to work now: https://travis-ci.org/haskell-opengl/StateVar/jobs/40772431 @hvr: Have the Ubuntu packages been updated? The only funny thing is the warning https://travis-ci.org/haskell-opengl/StateVar/jobs/40772431#L96 ("Warning: /tmp/pkgConf-StateVar-1.0.12205.0: Unrecognized field data-dir on line 19"). Not a show-stopper, but I really try to keep all builds warning-free, so what's going on there? |
I think the |
Hmmm, will GHC 7.8.4 contain the right Cabal library then? Having to live with the warning would be extremely annoying. Usual scenario: Install Haskell Platform, |
It should go away when you install an updated Cabal library. In the current situation you probably have a This means that setup executables in your |
Fixed in 9ece664. If you are using an older git version, you may get a message about |
I don't think this is really fixed, the same problem showed up again recently: https://travis-ci.org/haskell-opengl/OpenGLRaw/builds/49116074 This time not only for cabal-HEAD/ghc-HEAD, but for cabal-1.22/ghc-7.10.1, too, which is a bit scary given the fact that 7.10 should be released soon. |
Same issue here: https://travis-ci.org/nikita-volkov/record/jobs/48711367. Also I randomly experience this on other projects locally. I run a freshly installed OS X 10.10.2 with the following setup:
|
Can we please re-open this bug? |
Reopened. |
This should be more robust (the Cabal format is subject to changes, haskell/cabal#2251 discusses issues with ongoing changes). Moreover, the tool currently does not work on Travis! We currently get: package-info.hs: Prelude.read: no parse This looks like a version mismatch problem, but let's start from easy things.
This should be more robust (the Cabal format is subject to changes, haskell/cabal#2251 discusses issues with ongoing changes). Moreover, the tool currently does not work on Travis! We currently get: package-info.hs: Prelude.read: no parse This looks like a version mismatch problem, but let's start from easy things.
The fundamental problem is that cabal-install tries to read the I see that we try and read the file with some degree of error handling, but that will fail for older binary lib versions that just throw exceptions. We should look again in One of my colleagues is actually getting this bug with building Cabal head itself (using cabal-install version 1.22.0.0 using version 1.22.0.0 of the Cabal library). I cannot reproduce it. We're using the same version of the binary package. |
One option of course is to go back to the text format and use the old code that I wrote carefully to avoid these problems :-) until we can sort things out to use a binary format properly. |
@cocreature What version of |
@edsko Well, GHC stack traces are never as helpful as you hope, but that gives me an idea where to look. Thanks! |
@ttuegel 1.22.0.0 from the nix haskellngPackages. |
@cocreature Thank you! I can finally reproduce this. |
This seems to be unrelated to the version of |
Actually, I think it does depend on the version of I will switch over to using our wrapper around |
Fixed in #2428. |
Cool, thanks. @hvr: Could you build an updated Ubuntu package and put that into your ppa? This would unbreak lots of Travis CI projects... |
Is this a bug in |
It is unexpected and avoidable, but technically correct (impossible to catch exceptions in pure code). I have submitted a patch. |
Interestingly enough, the problem reported by @edsko recently started happening on Travis with 7.10. What I don't get is why #2428 should help, but why is it failing at all? |
I know that I'm probably repeating myself, but I have problems with GHC 7.10 and Cabal 1.22 for months now, too, see e.g. https://travis-ci.org/haskell-opengl/GLURaw/jobs/53960254 to name just a few. https://launchpad.net/~hvr/+archive/ubuntu/ghc contains only relatively old cabal-install 1.22 versions, so could somebody please clarify what the current state of affairs is? To be honest, I don't understand things anymore. 😕 Which versions are expected to work together? How can I test this on Travis CI? The current situation is quite frustrating: I can either ignore failures with 7.10 and 1.22 via |
Cabal and cabal-install must always have the same major version, in this case |
@23Skidoo The proximate cause of that error is Travis not using cabal-install built with the latest Cabal. Not sure yet why it insists on reconfiguring, but we would get a more meaningful explanation if Travis used the latest Cabal. |
What's interesting is that the same version of |
I understand that it doesn't include your fix (#2428) for the uncaught exception problem, which is why we get |
Hmmm, even after all those explanations my question remains: What shall I (and lots of other people) do to get their Travis builds green again? I don't fully understand the details yet, but having to do seemingly unrelated things in lockstep is a horrible user experience, and this should mitigated somehow. In the C/C++ world: Imagine if gcc/make/rpm/... would have to be kept tightly in sync somehow... 😱 |
@svenpanne I'm not sure what you mean by keeping things in lockstep here. The bug is fixed in Cabal-1.22.1.1. Travis does not use this version, so you do not get the bug fix. That's the extent of the problem blocking builds. There is an unrelated issue that cabal-install sometimes reconfigures when it doesn't need to. In Cabal < 1.22.1.1, this also triggers the |
I don't think that the reconfigure logic is at fault. The |
Just to clarify: The only missing thing to get Travis CI builds with 7.10 green again is a new version (1.22.1.1) of cabal-install in https://launchpad.net/~hvr/+archive/ubuntu/ghc, correct? GHC seems to be updated quite regularly there, but not cabal-install. Can we somehow arrange to get that soon? 7.10 is already at release candidate 3, and I haven't been able to get consistently green builds for that. Given the heavy reliance of lots of packages on Travis CI (not only mine), we should probably have some automated PPA where there relevant packages (GHC, cabal-install, etc.) live. |
That's up to @hvr, who maintains that PPA. |
@23Skidoo Well, I know that, and I think Herbert is really doing a great job, but he's probably overloaded with work, so he couldn't update the PPA. My proposal was to replace that "single point of failure" for all those Haskell projects using Travis CI with something automatic, i.e. have a PPA somewhere with GHC, cabal-install etc. on it. |
I don't think that the reconfigure logic is at fault. The Main.reconfigure function reconfigures only if necessary. buildAction unconditionally calls reconfigure, which tries to load setup-config with tryGetPersistBuildConfig, which raises the Prelude.chr exception. I think you're right. I just checked, and the |
Looks like @hvr has updated his PPA or something; this problem no longer happens for |
@dcoutts asked me to file this:
I was having this weird issues with the devel version of
cabal
where somecabal
invocations would fail with the following rather non-obvious error messageEven with
-v3
this is the very first output you get fromcabal
. Onlystrace
provided the hint thatsetup-config
was the last file read before that error message was emitted.(the underlying problem was most likely that
cabal
had been compiled against an older snapshot of theCabal
lib than theCabal
lib snapshot registered in the pkg db. And those two snapshots probably disagreed on thesetup-config
schema)The text was updated successfully, but these errors were encountered: