Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
On Mar 16, 2012 3:12 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 17 March 2012 09:02, Erik de Castro Lopo mle...@mega-nerd.com wrote: Ivan Lazar Miljenovic wrote: One trivial solution is to assume ~/.cabal/bin is on the PATH and to ignore system-wide packages, which I think is even *more* sub-optimal (why install a new version of alex when it's already available?). The tool should only install alex in ~/.cabal/bin if alex is not already available. So how does it know whether the *correct version* is available? Add --version parsers for every single possible build-tool to cabal-install? That is (probably) how it knows that the necessary version of alex is not available. There actually is a standard format for checking version numbers of the core haskell build tools: --numeric-version produces output that is easily parsed (and matches the default parser for cabal Program values). I'm not at a computer to check alex specifically right now, but I'm fairly certain it is one of the builtin Programs that cabal can check. (you can also write your own, and put them in setup.hs if you need a special build tool.) There is, of course, nothing that says ask the build tools are going to be available on hackage (or even in haskell). I'm not sure how to fix this, really. We could make the build tools section produce more detailed instructions for installing missing tools in the case that cabal can't install them. -Rogan -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com http://IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
Hi all, With a base system with just ghc and cabal-install, if I try to install bytestring-lexing I get: $ cabal install bytestring-lexing Resolving dependencies... Configuring bytestring-lexing-0.4.0... cabal: The program alex version =2.3 is required but it could not be found. cabal: Error: some packages failed to install: bytestring-lexing-0.4.0 failed during the configure step. The exception was: ExitFailure 1 The cabal file for bytestring-lexing contains Build-Tools: alex = 2.3 Is there any way to make the cabal install of bytestring-lexing force the install of alex first? Cheers, Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
Hi, Am Freitag, den 16.03.2012, 21:00 +1100 schrieb Erik de Castro Lopo: With a base system with just ghc and cabal-install, if I try to install bytestring-lexing I get: $ cabal install bytestring-lexing Resolving dependencies... Configuring bytestring-lexing-0.4.0... cabal: The program alex version =2.3 is required but it could not be found. cabal: Error: some packages failed to install: bytestring-lexing-0.4.0 failed during the configure step. The exception was: ExitFailure 1 The cabal file for bytestring-lexing contains Build-Tools: alex = 2.3 Is there any way to make the cabal install of bytestring-lexing force the install of alex first? no, cabal-install does not automatically install build-tools at all, only Cabal checks them for compilation. I guess the reason is that build-tools needs to be put on the PATH, and that is beyond the scope of cabal-install. Greetings, Joachim -- Joachim nomeata Breitner Debian Developer nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
Joachim Breitner wrote: no, cabal-install does not automatically install build-tools at all, only Cabal checks them for compilation. I guess the reason is that build-tools needs to be put on the PATH, and that is beyond the scope of cabal-install. This is rather sub-optimal. One place where people are running into this problem is when installing Yesod. Yesod depends on warp which depends on bytestring-lexing which requires alex at build time. The problem is that many of the people trying out Yesod are newcomers to Haskell. They are going to try cabal install yesod and have it fail because alex is missing. This is not a good introduction Haskell/Yesod. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
On 16 March 2012 21:56, Erik de Castro Lopo mle...@mega-nerd.com wrote: Joachim Breitner wrote: no, cabal-install does not automatically install build-tools at all, only Cabal checks them for compilation. I guess the reason is that build-tools needs to be put on the PATH, and that is beyond the scope of cabal-install. This is rather sub-optimal. It is, but the only way it would work is for cabal-install be much closer to a _real_ package management system: * Needs to keep track of installed packages. This is achieved in recent versions with a ~/.cabal/world file. * Keep track of which versions are installed. The world file states which versions it was *told* to install, not which are currently installed. For libraries, it doesn't matter: it gets that information from ghc-pkg. For binaries, this doesn't work (since there's no required standard for version reporting in Haskell build-tools). * Ensure that binaries are installed to somewhere in the PATH (not possible AFAIK). One trivial solution is to assume ~/.cabal/bin is on the PATH and to ignore system-wide packages, which I think is even *more* sub-optimal (why install a new version of alex when it's already available?). -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com http://IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
Alex is supplied as part of the Platform though which is the recommended system for beginners, is Yesod currently in advance of the Platform? On 16 March 2012 10:56, Erik de Castro Lopo mle...@mega-nerd.com wrote: The problem is that many of the people trying out Yesod are newcomers to Haskell. They are going to try cabal install yesod and have it fail because alex is missing. This is not a good introduction Haskell/Yesod. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
The Yesod docs all state very explicitly that we depend on the Haskell Platform, and in particular that alex needs to be installed. However, that doesn't stop this issue from confusing people. I think a good short term solution could be what Alan Zimmerman did with language-javascript: include the files generated by alex in the tarball, so that there is no alex dependency for installing from Hackage. You would only need alex for developing. Ideally I think cabal-install should be able to handle installation of build tools- possibly to its own private folder where it's properly versioned. Michael On Fri, Mar 16, 2012 at 4:37 PM, Stephen Tetley stephen.tet...@gmail.com wrote: Alex is supplied as part of the Platform though which is the recommended system for beginners, is Yesod currently in advance of the Platform? On 16 March 2012 10:56, Erik de Castro Lopo mle...@mega-nerd.com wrote: The problem is that many of the people trying out Yesod are newcomers to Haskell. They are going to try cabal install yesod and have it fail because alex is missing. This is not a good introduction Haskell/Yesod. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
On 3/16/12 6:00 AM, Erik de Castro Lopo wrote: Hi all, With a base system with just ghc and cabal-install, if I try to install bytestring-lexing I get: $ cabal install bytestring-lexing Resolving dependencies... Configuring bytestring-lexing-0.4.0... cabal: The program alex version=2.3 is required but it could not be found. cabal: Error: some packages failed to install: bytestring-lexing-0.4.0 failed during the configure step. The exception was: ExitFailure 1 The cabal file for bytestring-lexing contains Build-Tools: alex= 2.3 Is there any way to make the cabal install of bytestring-lexing force the install of alex first? FWIW, the Alex dependency is part of the code I inherited when taking over bytestring-lexing. Apparently older versions of the library included pre-generated versions of the files that Alex builds, prior to when Cabal understood about build tools at all. I'm willing to go back that direction if that's what folks want--- especially if there's a way to tell Cabal to switch between the pregenerated files vs using Alex. I've noticed that the code generated by Alex causes a lot of warnings, some of them are of the it will break in the future variety. I've considered rewriting the parsers for Double manually, but I'm not sure exactly what the performance bottlenecks are in that context nor whether anyone is actually using the current functions in performance-critical regions. To Erik specifically: my emails to you off-list have been bouncing/timing out. Is there a chance I've ended up on a blacklist or there's some configuration issue at mega-nerd.com? -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
Ivan Lazar Miljenovic wrote: One trivial solution is to assume ~/.cabal/bin is on the PATH and to ignore system-wide packages, which I think is even *more* sub-optimal (why install a new version of alex when it's already available?). The tool should only install alex in ~/.cabal/bin if alex is not already available. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] cabal-install problem with alex dependency in bytestring-lexing
On 17 March 2012 09:02, Erik de Castro Lopo mle...@mega-nerd.com wrote: Ivan Lazar Miljenovic wrote: One trivial solution is to assume ~/.cabal/bin is on the PATH and to ignore system-wide packages, which I think is even *more* sub-optimal (why install a new version of alex when it's already available?). The tool should only install alex in ~/.cabal/bin if alex is not already available. So how does it know whether the *correct version* is available? Add --version parsers for every single possible build-tool to cabal-install? -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com http://IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe