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

Build of colour package is broken by #5284 #5318

Closed
cocreature opened this issue May 13, 2018 · 10 comments · Fixed by #5319
Closed

Build of colour package is broken by #5284 #5318

cocreature opened this issue May 13, 2018 · 10 comments · Fixed by #5319
Milestone

Comments

@cocreature
Copy link
Collaborator

Running cabal new-build in a project that depends on the colour package (assuming that the colour package is not already in the store) fails as follows:

Configuring library for colour-2.3.4..
Preprocessing library for colour-2.3.4..
Building library for colour-2.3.4..
[ 1 of 14] Compiling Data.Colour.CIE.Chromaticity ( Data/Colour/CIE/Chromaticity.hs, dist/build/Data/Colour/CIE/Chromaticity.o )
[ 2 of 14] Compiling Data.Colour.CIE.Illuminant ( Data/Colour/CIE/Illuminant.hs, dist/build/Data/Colour/CIE/Illuminant.o )
[ 3 of 14] Compiling Data.Colour.Chan ( Data/Colour/Chan.hs, dist/build/Data/Colour/Chan.o )
[ 4 of 14] Compiling Data.Colour.Internal ( Data/Colour/Internal.hs, dist/build/Data/Colour/Internal.o )
[ 5 of 14] Compiling Data.Colour.Matrix ( Data/Colour/Matrix.hs, dist/build/Data/Colour/Matrix.o )
[ 6 of 14] Compiling Data.Colour.RGB  ( Data/Colour/RGB.hs, dist/build/Data/Colour/RGB.o )
[ 7 of 14] Compiling Data.Colour.RGBSpace.HSL ( Data/Colour/RGBSpace/HSL.hs, dist/build/Data/Colour/RGBSpace/HSL.o )
[ 8 of 14] Compiling Data.Colour.RGBSpace.HSV ( Data/Colour/RGBSpace/HSV.hs, dist/build/Data/Colour/RGBSpace/HSV.o )
[ 9 of 14] Compiling Data.Colour.SRGB.Linear ( Data/Colour/SRGB/Linear.hs, dist/build/Data/Colour/SRGB/Linear.o )
[10 of 14] Compiling Data.Colour.RGBSpace ( Data/Colour/RGBSpace.hs, dist/build/Data/Colour/RGBSpace.o )
[11 of 14] Compiling Data.Colour.SRGB ( Data/Colour/SRGB.hs, dist/build/Data/Colour/SRGB.o )
[12 of 14] Compiling Data.Colour      ( Data/Colour.hs, dist/build/Data/Colour.o )
[13 of 14] Compiling Data.Colour.Names ( Data/Colour/Names.hs, dist/build/Data/Colour/Names.o )
[14 of 14] Compiling Data.Colour.CIE  ( Data/Colour/CIE.hs, dist/build/Data/Colour/CIE.o )
: getDirectoryContents:openDirStream: does not exist (No such file or directory)

I ran git bisect and the problem was introduced in #5284 and is still present in current HEAD (765de7b).

The problem only occurs when colour is registered into the store, if you cabal get colour and then try to build that package as an inplace package it works fine.

I tried playing with verbose options but haven’t managed to get any useful info out of this so far.

The colour package doesn’t seem to use any globs and cabal check is happy, so this looks like a bug in cabal (rather than a bug in the cabal file of colour).

cc @quasicomputational

@quasicomputational
Copy link
Contributor

Reproduced it by setting up a sandbox for a package depending on colour and then running cabal install --dependencies-only. It doesn't look like anything weird is in colour.cabal, so this definitely looks like a bug in Cabal. I shall see if I can debug it.

@quasicomputational
Copy link
Contributor

I've got the bug: the default data-dir is null, and that's causing havoc when it's passed to matchDirFileGlob. Now I'm fighting with the tests I've written!

quasicomputational added a commit to quasicomputational/cabal that referenced this issue May 13, 2018
PR haskell#5284 changed things around, and now matchDirFileGlob will break if
it's passed a null directory, which happens to be the default value
for data-dir. Its call sites have been fixed to check for this and to
substitute '.' for an empty path, which is the desired behaviour; in
addition, matchDirFileGlob itself will now warn about this if it's
detected, so that new broken call sites can't sneak in.

Fixes haskell#5318.
quasicomputational added a commit to quasicomputational/cabal that referenced this issue May 13, 2018
PR haskell#5284 changed things around, and now matchDirFileGlob will break if
it's passed a null directory, which happens to be the default value
for data-dir. Its call sites have been fixed to check for this and to
substitute '.' for an empty path, which is the desired behaviour; in
addition, matchDirFileGlob itself will now warn about this if it's
detected, so that new broken call sites can't sneak in.

Fixes haskell#5318.
quasicomputational added a commit to quasicomputational/cabal that referenced this issue May 13, 2018
PR haskell#5284 changed things around, and now matchDirFileGlob will break if
it's passed a null directory, which happens to be the default value
for data-dir. Its call sites have been fixed to check for this and to
substitute '.' for an empty path, which is the desired behaviour; in
addition, matchDirFileGlob itself will now warn about this if it's
detected, so that new broken call sites can't sneak in.

Fixes haskell#5318.
@hvr hvr added the type: bug label May 13, 2018
@hvr hvr added this to the 3.0 milestone May 13, 2018
quasicomputational added a commit to quasicomputational/cabal that referenced this issue May 13, 2018
PR haskell#5284 changed things around, and now matchDirFileGlob will break if
it's passed a null directory, which happens to be the default value
for data-dir. Its call sites have been fixed to check for this and to
substitute '.' for an empty path, which is the desired behaviour; in
addition, matchDirFileGlob itself will now warn about this if it's
detected, so that new broken call sites can't sneak in.

Fixes haskell#5318.
phadej pushed a commit that referenced this issue May 19, 2018
PR #5284 changed things around, and now matchDirFileGlob will break if
it's passed a null directory, which happens to be the default value
for data-dir. Its call sites have been fixed to check for this and to
substitute '.' for an empty path, which is the desired behaviour; in
addition, matchDirFileGlob itself will now warn about this if it's
detected, so that new broken call sites can't sneak in.

Fixes #5318.
@TerrorJack
Copy link
Collaborator

TerrorJack commented Jun 8, 2018

I'm encountering a similar issue when running cabal new-build happy, using a fresh cabal-install/Cabal built from 449a3c3. The same failure also occurs with an old-style cabal build.

The build fails as:

[1 of 1] Compiling Main             ( /home/terrorjack/asterius/dist-newstyle/tmp/src-2937/happy-1.19.9/dist/setup/setup.hs, /home/terrorjack/asterius/dist-newstyle/tmp/src-2937/happy-1.19.9/dist/setup/Main.o )
Linking /home/terrorjack/asterius/dist-newstyle/tmp/src-2937/happy-1.19.9/dist/setup/setup ...
Warning: happy.cabal:25:2: Tabs used as indentation at 25:2, 26:2, 27:2, 28:2,
29:2, 30:2, 31:2, 32:2, 33:2, 34:2, 35:2, 36:2, 37:2, 38:2, 39:2, 40:2, 41:2,
42:2, 43:2, 44:2, 45:2, 46:2, 47:2, 48:2, 49:2, 50:2, 51:2, 52:2, 53:2, 54:2,
55:2, 56:2, 57:2, 58:2, 59:2, 60:2, 61:2, 62:2, 63:2, 64:2, 65:2, 66:2, 67:2,
68:2, 69:2, 70:2, 71:2, 72:2, 73:2, 74:2, 75:2, 76:2, 77:2, 78:2, 79:2, 80:2,
81:2, 82:2, 83:2, 84:2, 85:2, 86:2, 87:2, 88:2, 89:2, 90:2, 91:2, 92:2, 93:2,
94:2, 95:2, 96:2, 97:2, 98:2, 99:2, 100:2, 101:2, 102:2, 103:2, 104:2, 105:2,
106:2, 107:2, 108:2, 109:2, 110:2, 111:2, 112:2, 113:2, 114:2, 115:2, 116:2,
117:2, 118:2, 119:2, 120:2, 121:2, 122:2
Configuring happy-1.19.9...
Preprocessing executable 'happy' for happy-1.19.9..
Building executable 'happy' for happy-1.19.9..
[ 1 of 19] Compiling AbsSyn           ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o )
[ 2 of 19] Compiling GenUtils         ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o )
[ 3 of 19] Compiling NameSet          ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o )
[ 4 of 19] Compiling ParamRules       ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o )
[ 5 of 19] Compiling ParseMonad       ( src/ParseMonad.hs, dist/build/happy/happy-tmp/ParseMonad.o )
[ 6 of 19] Compiling Lexer            ( src/Lexer.lhs, dist/build/happy/happy-tmp/Lexer.o )
[ 7 of 19] Compiling AttrGrammar      ( src/AttrGrammar.lhs, dist/build/happy/happy-tmp/AttrGrammar.o )
[ 8 of 19] Compiling AttrGrammarParser ( src/AttrGrammarParser.hs, dist/build/happy/happy-tmp/AttrGrammarParser.o )
[ 9 of 19] Compiling Grammar          ( src/Grammar.lhs, dist/build/happy/happy-tmp/Grammar.o )
[10 of 19] Compiling LALR             ( src/LALR.lhs, dist/build/happy/happy-tmp/LALR.o )
[11 of 19] Compiling First            ( src/First.lhs, dist/build/happy/happy-tmp/First.o )
[12 of 19] Compiling Parser           ( src/Parser.hs, dist/build/happy/happy-tmp/Parser.o )
[13 of 19] Compiling Paths_happy      ( dist/build/happy/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o )
[14 of 19] Compiling Info             ( src/Info.lhs, dist/build/happy/happy-tmp/Info.o )
[15 of 19] Compiling PrettyGrammar    ( src/PrettyGrammar.hs, dist/build/happy/happy-tmp/PrettyGrammar.o )
[16 of 19] Compiling ProduceGLRCode   ( src/ProduceGLRCode.lhs, dist/build/happy/happy-tmp/ProduceGLRCode.o )
[17 of 19] Compiling Target           ( src/Target.lhs, dist/build/happy/happy-tmp/Target.o )
[18 of 19] Compiling ProduceCode      ( src/ProduceCode.lhs, dist/build/happy/happy-tmp/ProduceCode.o )
[19 of 19] Compiling Main             ( src/Main.lhs, dist/build/happy/happy-tmp/Main.o )
Linking dist/build/happy/happy ...
: getDirectoryContents:openDirStream: does not exist (No such file or directory)

EDIT: with ghc-8.4.3 it's fine, while using ghc-8.5.20180607 the problem shows up. So I'll do some bisect and pin down the problematic ghc commit, it's likely not a Cabal issue.

@quasicomputational
Copy link
Contributor

@TerrorJack You might also want to try with GHC HEAD against Cabal commit 218c7bf, if your bisection doesn't find an obvious GHC bug. That's the last Cabal commit before the globstar change; if that works but Cabal HEAD doesn't, it's probably something else that I managed to break...

@TerrorJack
Copy link
Collaborator

TerrorJack commented Jun 10, 2018

@quasicomputational Thanks for pointing that out! I built ghc-head with your specified commit and it worked. Cabal HEAD doesn't work though, even when I'm using cabal-install-2.2.

@quasicomputational
Copy link
Contributor

quasicomputational commented Jun 10, 2018

GHC's Cabal submodule is cbdb135, but this bug's fix was merged in later (the very next commit, in fact).

Just to be clear, since there are two sets of Cabal versions involved: you're seeing the failures with GHC HEAD plus cabal-install HEAD but with the Cabal submodule set to that commit, right? And you haven't touched the Cabal submodule? If that's the situation, then bumping GHC's Cabal submodule ought to make this go away.

(I'm still building GHC from a dead start, so I can't test this myself yet, but I'll do that as soon as I'm able...)

@23Skidoo
Copy link
Member

/cc @bgamari

@quasicomputational
Copy link
Contributor

One more piece of the puzzle: happy uses a custom Setup.hs, so it's using the buggy Cabal that comes with GHC HEAD. My build finally finished and I reproduced the failure, so now I'm building GHC HEAD + Cabal HEAD and seeing if that fixes it.

@quasicomputational
Copy link
Contributor

The bug indeed vanishes with a bumped Cabal submodule. I'll open a GHC ticket about that, since there's not much to do from the Cabal side now.

@23Skidoo
Copy link
Member

quasicomputational added a commit to quasicomputational/cabal that referenced this issue Jun 27, 2018
This also significantly improves the error when trying to refer to
missing directories, hopefully making it clear that it's coming from
Cabal. haskell#5318 and snowleopard/hadrian#634 are two bugs which manifested
as Cabal trying to glob in a non-existent directory and both took some
debugging because of the obscurity of the error.
quasicomputational added a commit to quasicomputational/cabal that referenced this issue Jun 27, 2018
This also significantly improves the error when trying to refer to
missing directories, hopefully making it clear that it's coming from
Cabal. haskell#5318 and snowleopard/hadrian#634 are two bugs which manifested
as Cabal trying to glob in a non-existent directory and both took some
debugging because of the obscurity of the error.
quasicomputational added a commit to quasicomputational/cabal that referenced this issue Jun 28, 2018
This also significantly improves the error when trying to refer to
missing directories, hopefully making it clear that it's coming from
Cabal. haskell#5318 and snowleopard/hadrian#634 are two bugs which manifested
as Cabal trying to glob in a non-existent directory and both took some
debugging because of the obscurity of the error.
quasicomputational added a commit to quasicomputational/cabal that referenced this issue Jul 4, 2018
This also significantly improves the error when trying to refer to
missing directories, hopefully making it clear that it's coming from
Cabal. haskell#5318 and snowleopard/hadrian#634 are two bugs which manifested
as Cabal trying to glob in a non-existent directory and both took some
debugging because of the obscurity of the error.
quasicomputational added a commit to quasicomputational/cabal that referenced this issue Jul 8, 2018
This also significantly improves the error when trying to refer to
missing directories, hopefully making it clear that it's coming from
Cabal. haskell#5318 and snowleopard/hadrian#634 are two bugs which manifested
as Cabal trying to glob in a non-existent directory and both took some
debugging because of the obscurity of the error.
typedrat pushed a commit that referenced this issue Jul 9, 2018
This also significantly improves the error when trying to refer to
missing directories, hopefully making it clear that it's coming from
Cabal. #5318 and snowleopard/hadrian#634 are two bugs which manifested
as Cabal trying to glob in a non-existent directory and both took some
debugging because of the obscurity of the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants