Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

new-build: Repeating build fails #3637

Closed
BardurArantsson opened this issue Jul 28, 2016 · 18 comments
Closed

new-build: Repeating build fails #3637

BardurArantsson opened this issue Jul 28, 2016 · 18 comments

Comments

@BardurArantsson
Copy link
Collaborator

Repeating a new-build command twice fails on my project with the error message

improveInstallPlanWithUpToDatePackages: dep on non lib package
CallStack (from HasCallStack):
error, called at ./Distribution/Client/ProjectBuilding.hs:358:7 in
main:Distribution.Client.ProjectBuilding

the second time I run the build. The command I'm running is

cabal new-build cqrs-{core,example,memory,postgresql,testkit}

and the repository is current 'master' here: https://github.com/BardurArantsson/cqrs/tree/master

@BardurArantsson
Copy link
Collaborator Author

Oh, and the exact cabal-install version I'm running is commit b7b666e

@23Skidoo
Copy link
Member

Any chance we can get a small test case?

@BardurArantsson
Copy link
Collaborator Author

I have absolutely no idea how I would go about making such a test case as I'm not familiar with any of the new-build stuff :).

Maybe someone who is can chime in on what I could try?

@23Skidoo
Copy link
Member

OK, since your library is open source the issue should be reproducible.

@BardurArantsson
Copy link
Collaborator Author

Hopefully, yes.

@ezyang
Copy link
Contributor

ezyang commented Jul 28, 2016

TBF, this is a lot of deps ;) (currently building...)

@ezyang
Copy link
Contributor

ezyang commented Jul 28, 2016

I cannot repro. I am also on b7b666e

Do I have to edit some files?

@BardurArantsson
Copy link
Collaborator Author

No, all my files are exactly as in that repo.

I'm assuming you did the "repeat the command" bit? (Just making sure.)

If it doesn't reproduce for you then some global state must be "leakin in" somewhere... Hum.

OK, I'll try wiping everything I can and try to build again. Anything I should wipe besides ~/.cabal and ~/.ghc...?

@ezyang
Copy link
Contributor

ezyang commented Jul 28, 2016

ezyang@sabre:~/Dev/labs/cqrs$ cabal new-build cqrs-{core,example,memory,postgresql,testkit}
In order, the following will be built (use -v for more details):
cqrs-example-0.11.0
Preprocessing executable 'cqrs-example' for cqrs-example-0.11.0...
ezyang@sabre:~/Dev/labs/cqrs$ cabal new-build cqrs-{core,example,memory,postgresql,testkit}
In order, the following will be built (use -v for more details):
cqrs-example-0.11.0
Preprocessing executable 'cqrs-example' for cqrs-example-0.11.0...

For some reason new-build is repeatedly building cqrs-example, which does seem like a bug.

Before you wipe everything, first try wiping dist-newstyle and trying again.

@BardurArantsson
Copy link
Collaborator Author

I did try dist-newstyle, but same result :( .

I'll try the "full wipe" tomorrow and report back.

@BardurArantsson
Copy link
Collaborator Author

OK, I've tried the full wipe of ~/.ghc and ~/.cabal. Issue remains.

Can you think of any other system-wide state that might influence this?

@ezyang : Just out of curiousity... did you do a completely clean build? (That is, with ~/.ghc and ~ /.cabal at least moved out of the way.)

@ezyang
Copy link
Contributor

ezyang commented Jul 31, 2016

Actually, I've reproduced this, but on a different project! The problem goes away if you make a modification to the project in question.

@grayjay
Copy link
Collaborator

grayjay commented Jul 31, 2016

I just encountered this when building cabal with cabal new-build cabal. I was using commit 9fea99d.

@ezyang
Copy link
Contributor

ezyang commented Jul 31, 2016

So, for #3644, I'm going to be rewriting this chunk of code. Maybe the problem will go away after I've done so.

@grayjay
Copy link
Collaborator

grayjay commented Jul 31, 2016

I ran git bisect and got commit 97cff5c.

@ezyang
Copy link
Contributor

ezyang commented Jul 31, 2016

OK... my guess what is going on is that improveInstallPlanWithUpToDatePackages used to handle the case where there was no cached InstalledPackageInfo, but when Duncan refactored it, he made it partial in this case.

Unfortunately, we do have to handle this case, because an inplace executable may be improved such that we don't need to rebuild it. I'll have to analyze preexisting more carefully to understand what we need to do here.

The steps to reproduce should be to build a package with an executable but no library twice.

@ezyang
Copy link
Contributor

ezyang commented Jul 31, 2016

So I guess there are two possible ways to fix this:

  1. Add a new case to GenericPlanPackage to represent installed executables (which don't have an InstalledPackageInfo)
  2. Don't bother updating the InstallPlan. It shouldn't matter if we have an "updated" entry in it, because no one can depend on it, and so we'll never actually query for it.

ezyang added a commit to ezyang/cabal that referenced this issue Jul 31, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Jul 31, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 2, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 3, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 5, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 5, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 5, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 7, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 7, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 7, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
ezyang added a commit to ezyang/cabal that referenced this issue Aug 11, 2016
The previous approach I took, though correct, was quite
confusing.  If I refactor InstallPlan to operate on a
per-component basis, then we'll automatically get support
for convenience libraries, which will ultimately cleaner.
(While we won't be able to get rid of support for whole
package installs, it will be safe to assume packages
using convenience libraries also support one-shot
configure.)

I think this may fix haskell#3637.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
@ezyang
Copy link
Contributor

ezyang commented Aug 21, 2016

This is now fixed.

@ezyang ezyang closed this as completed Aug 21, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants