[GHC] #16259: Hadrian does not work with a cabal v2-installed "happy"

#16259: Hadrian does not work with a cabal v2-installed "happy" -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Keywords: | Operating System: Linux Architecture: | Type of failure: Building GHC Unknown/Multiple | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I installed happy with: {{{ cabal new-install --symlink-bindir=~/Software/ghc-8.6.3/bin happy }}} where `~/Software/ghc-8.6.3/bin` is in my PATH. When I run `hadrian/build.sh -c --flavour=devel2` I get the following error: {{{ happy: /home/roland/.cabal/share/x86_64-linux-ghc-8.6.3/happy-1.19.9 /HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory) }}} It's correct, I don't have a file `.cabal/share/x86_64-linux- ghc-8.6.3/happy-1.19.9/HappyTemplate-arrays-coerce`. However I have a file `.cabal/store/ghc-8.6.3/happy-1.19.9-84db80555b9a8f54be2ca475bccbc751401ffbff30194c8c26d08a002a665431/share /HappyTemplate-arrays-coerce`. If I do an old-fashioned `cabal v1-install happy`, it creates the missing file `.cabal/share/x86_64-linux-ghc-8.6.3/happy-1.19.9/HappyTemplate- arrays-coerce` and Hadrian is now able to build! Hadrian should not depend on old-style cabal installs! Program versions: {{{ roland@goms:~/Projekte/ghc$ cat /etc/issue Debian GNU/Linux 9 \n \l roland@goms:~/Projekte/ghc$ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.6.3 roland@goms:~/Projekte/ghc$ hadrian/build.sh --version Up to date Shake build system, version 0.17.4 roland@goms:~/Projekte/ghc$ happy --version Happy Version 1.19.9 Copyright (c) 1993-1996 Andy Gill, Simon Marlow (c) 1997-2005 Simon Marlow Happy is a Yacc for Haskell, and comes with ABSOLUTELY NO WARRANTY. This program is free software; you can redistribute it and/or modify it under the terms given in the file 'LICENSE' distributed with the Happy sources. roland@goms:~/Projekte/ghc$ cabal --version cabal-install version 2.4.1.0 compiled using version 2.4.1.0 of the Cabal library }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16259 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16259: Hadrian does not work with a cabal v2-installed "Happy" -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by RolandSenn: Old description:
I installed happy with:
{{{ cabal new-install --symlink-bindir=~/Software/ghc-8.6.3/bin happy }}}
where `~/Software/ghc-8.6.3/bin` is in my PATH.
When I run `hadrian/build.sh -c --flavour=devel2` I get the following error:
{{{ happy: /home/roland/.cabal/share/x86_64-linux-ghc-8.6.3/happy-1.19.9 /HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory) }}}
It's correct, I don't have a file `.cabal/share/x86_64-linux- ghc-8.6.3/happy-1.19.9/HappyTemplate-arrays-coerce`.
However I have a file `.cabal/store/ghc-8.6.3/happy-1.19.9-84db80555b9a8f54be2ca475bccbc751401ffbff30194c8c26d08a002a665431/share /HappyTemplate-arrays-coerce`.
If I do an old-fashioned `cabal v1-install happy`, it creates the missing file `.cabal/share/x86_64-linux-ghc-8.6.3/happy-1.19.9/HappyTemplate- arrays-coerce` and Hadrian is now able to build!
Hadrian should not depend on old-style cabal installs!
Program versions:
{{{ roland@goms:~/Projekte/ghc$ cat /etc/issue Debian GNU/Linux 9 \n \l
roland@goms:~/Projekte/ghc$ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.6.3
roland@goms:~/Projekte/ghc$ hadrian/build.sh --version Up to date Shake build system, version 0.17.4
roland@goms:~/Projekte/ghc$ happy --version Happy Version 1.19.9 Copyright (c) 1993-1996 Andy Gill, Simon Marlow (c) 1997-2005 Simon Marlow
Happy is a Yacc for Haskell, and comes with ABSOLUTELY NO WARRANTY. This program is free software; you can redistribute it and/or modify it under the terms given in the file 'LICENSE' distributed with the Happy sources.
roland@goms:~/Projekte/ghc$ cabal --version cabal-install version 2.4.1.0 compiled using version 2.4.1.0 of the Cabal library }}}
New description: I installed Happy with: {{{ cabal new-install --symlink-bindir=~/Software/ghc-8.6.3/bin happy }}} where `~/Software/ghc-8.6.3/bin` is in my PATH. When I run `hadrian/build.sh -c --flavour=devel2` I get the following error: {{{ happy: /home/roland/.cabal/share/x86_64-linux-ghc-8.6.3/happy-1.19.9 /HappyTemplate-arrays-coerce: openFile: does not exist (No such file or directory) }}} It's correct, I don't have a file `.cabal/share/x86_64-linux- ghc-8.6.3/happy-1.19.9/HappyTemplate-arrays-coerce`. However I have a file `.cabal/store/ghc-8.6.3/happy-1.19.9-84db80555b9a8f54be2ca475bccbc751401ffbff30194c8c26d08a002a665431/share /HappyTemplate-arrays-coerce`. If I do an old-fashioned `cabal v1-install happy`, it creates the missing file `.cabal/share/x86_64-linux-ghc-8.6.3/happy-1.19.9/HappyTemplate- arrays-coerce` and Hadrian is now able to build! Hadrian should not depend on old-style cabal installs! Program versions: {{{ roland@goms:~/Projekte/ghc$ cat /etc/issue Debian GNU/Linux 9 \n \l roland@goms:~/Projekte/ghc$ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.6.3 roland@goms:~/Projekte/ghc$ hadrian/build.sh --version Up to date Shake build system, version 0.17.4 roland@goms:~/Projekte/ghc$ happy --version Happy Version 1.19.9 Copyright (c) 1993-1996 Andy Gill, Simon Marlow (c) 1997-2005 Simon Marlow Happy is a Yacc for Haskell, and comes with ABSOLUTELY NO WARRANTY. This program is free software; you can redistribute it and/or modify it under the terms given in the file 'LICENSE' distributed with the Happy sources. roland@goms:~/Projekte/ghc$ cabal --version cabal-install version 2.4.1.0 compiled using version 2.4.1.0 of the Cabal library }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16259#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16259: Hadrian does not work with a cabal v2-installed "Happy" -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by snowleopard): * cc: snowleopard, alpmestan (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16259#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16259: Hadrian does not work with a cabal v2-installed "Happy" -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hvr): Ok, so the problem here is that `happy` gets demoted into an inplace package (and this basically means that the resulting executable can't be invoked without setting a couple of env-vars, which `cabal {run,exec}` would do -- but if you don't invoke it that way you'd be responsible for doing this... long story), because it picked up a local dependency, namely the intree-`Cabal` for its `setup-depends`; a simple way to workaround this is inject a constraint to prevent Setup.hs scripts from using an unreleased version of lib:Cabal, via e.g. {{{#!diff diff --git a/hadrian/cabal.project b/hadrian/cabal.project index 176d1ee..d8e5e79 100644 --- a/hadrian/cabal.project +++ b/hadrian/cabal.project @@ -1,2 +1,4 @@ packages: ./ ../libraries/Cabal/Cabal/ + +constraints: setup.Cabal < 2.5 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16259#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16259: Hadrian does not work with a cabal v2-installed "Happy" -------------------------------------+------------------------------------- Reporter: RolandSenn | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Linux | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by snowleopard): * cc: NeilMitchell (added) Comment:
a simple way to workaround this is inject a constraint to prevent Setup.hs scripts from using an unreleased version of lib:Cabal, via e.g.
@hvr: The fact that Hadrian currently depends on the in-tree Cabal library has proven to be both slow and fragile. Neil and I have recently been thinking that we should revert to depending on a stable release of Cabal instead. Pros: * This will make Hadrian faster to build if the (stable) Cabal library is shared with other projects on the same machine. * We don't need to adapt/rebuild Hadrian every time the in-tree Cabal library is changed. We will upgrade to a new Cabal version only when need be. * This will hopefully allow us to avoid issues like the one described in this ticket. Cons: * We will not be able to parse GHC's `.cabal` files if they use bleeding- edge features of Cabal. And arguably, they shouldn't. Any thoughts on this? I could spawn this into a separate ticket. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16259#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC