How to install new GHC ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
PY
Reply | Threaded
Open this post in threaded view
|

How to install new GHC ?

PY
Hello, All,

I want to switch to the new GHC (8.2.2) because I hit some
bug in GHC and suppose that it may be fixed in the new version. So, to
try it I changed "resolver: XXX" in my .yaml-files to "lts-9.18". Also I
done something else (I don't remember what exactly) and call
`stack setup ... --reinstall ...`. New GHC have been installed. And I
switched to new LTS - I see it 100%.
But when I run `stack build`, IMHO compiller is old, because if I call
`stack ghci` I see that old GHC (8.0.2) is calling. I'm not familiar
with stack/Haskell tools in-depth and may miss something! For example,
I know that LTS-9.18 is last stable, GHC 8.2.2 is last too, but in
Stackage seems that 9.18 corresponds to 8.2.2.

If I run `stack setup` in the directory with my project again I get:

--cut--
stack will use a sandboxed GHC it installed
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
--cut--

Would somebody explain me what is wrong here and how I can test a
project with new 8.2.2 GHC?

===
Best regards, Paul
_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Sylvain Henry-2
Hi,

LTS-9.18 uses GHC 8.0.2. You can try a nightly resolver to test GHC
8.2.2, e.g. https://www.stackage.org/nightly-2017-12-10

Sylvain


On 12/12/2017 12:56, Baa wrote:

> Hello, All,
>
> I want to switch to the new GHC (8.2.2) because I hit some
> bug in GHC and suppose that it may be fixed in the new version. So, to
> try it I changed "resolver: XXX" in my .yaml-files to "lts-9.18". Also I
> done something else (I don't remember what exactly) and call
> `stack setup ... --reinstall ...`. New GHC have been installed. And I
> switched to new LTS - I see it 100%.
> But when I run `stack build`, IMHO compiller is old, because if I call
> `stack ghci` I see that old GHC (8.0.2) is calling. I'm not familiar
> with stack/Haskell tools in-depth and may miss something! For example,
> I know that LTS-9.18 is last stable, GHC 8.2.2 is last too, but in
> Stackage seems that 9.18 corresponds to 8.2.2.
>
> If I run `stack setup` in the directory with my project again I get:
>
> --cut--
> stack will use a sandboxed GHC it installed
> For more information on paths, see 'stack path' and 'stack exec env'
> To use this GHC and packages outside of a project, consider using:
> stack ghc, stack ghci, stack runghc, or stack exec
> --cut--
>
> Would somebody explain me what is wrong here and how I can test a
> project with new 8.2.2 GHC?
>
> ===
> Best regards, Paul
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Francesco Ariis
In reply to this post by PY
On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:
> Would somebody explain me what is wrong here and how I can test a
> project with new 8.2.2 GHC?

Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
nightly or download/install ghc from here and compile your project
with the new `cabal new-build`.

[1] https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
PY
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

PY
@Francesco: unfortunately nightly misses some package. So, I tried:

  $ stack --resolver=ghc-8.2.2 setup --reinstall
  Preparing to install GHC (tinfo6) to an isolated location. This will not
  interfere with any system-level installation. Already downloaded.                      
  Installed GHC.

  stack will use a sandboxed GHC it installed
  For more information on paths, see 'stack path' and 'stack exec env'
  To use this GHC and packages outside of a project, consider using:
  stack ghc, stack ghci, stack runghc, or stack exec

So seems that 8.2.2 was installed, right? But how to build the project
with new GHC now? I never used cabal before, `stack ghci` still runs
8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not correspond
to .yaml file LTS - maybe this is a reason why old 8.0.2 is stil used...

When I try cabal build/new-build/repl I get:

  cabal: The program 'ghc' version >=6.4 is required but it could not be
  found.

So, cabal does not know about installed GHC versions (at least 8.0.2,
used by stack). I tried --require-sandbox but without success.


> On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:
> > Would somebody explain me what is wrong here and how I can test a
> > project with new 8.2.2 GHC?  
>
> Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
> nightly or download/install ghc from here and compile your project
> with the new `cabal new-build`.
>
> [1] https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

David McBride
The short of it is that to have stack ghci choose a particular version of ghc, you probably need to modify ~/.stack/global/stack.yaml, change resolver to something here https://www.stackage.org/snapshots that has your version of ghc and dependencies similar to what your project wants.  For example 'nightly-2017-12-10'.

On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]> wrote:
@Francesco: unfortunately nightly misses some package. So, I tried:

  $ stack --resolver=ghc-8.2.2 setup --reinstall
  Preparing to install GHC (tinfo6) to an isolated location. This will not
  interfere with any system-level installation. Already downloaded.
  Installed GHC.

  stack will use a sandboxed GHC it installed
  For more information on paths, see 'stack path' and 'stack exec env'
  To use this GHC and packages outside of a project, consider using:
  stack ghc, stack ghci, stack runghc, or stack exec

So seems that 8.2.2 was installed, right? But how to build the project
with new GHC now? I never used cabal before, `stack ghci` still runs
8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not correspond
to .yaml file LTS - maybe this is a reason why old 8.0.2 is stil used...

When I try cabal build/new-build/repl I get:

  cabal: The program 'ghc' version >=6.4 is required but it could not be
  found.

So, cabal does not know about installed GHC versions (at least 8.0.2,
used by stack). I tried --require-sandbox but without success.


> On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:
> > Would somebody explain me what is wrong here and how I can test a
> > project with new 8.2.2 GHC?
>
> Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
> nightly or download/install ghc from here and compile your project
> with the new `cabal new-build`.
>
> [1] https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Francesco Ariis
In reply to this post by PY
On Tue, Dec 12, 2017 at 02:53:47PM +0200, Baa wrote:

> @Francesco: unfortunately nightly misses some package. So, I tried:
>
>   $ stack --resolver=ghc-8.2.2 setup --reinstall
>   Preparing to install GHC (tinfo6) to an isolated location. This will not
>   interfere with any system-level installation. Already downloaded.                      
>   Installed GHC.
>
>   stack will use a sandboxed GHC it installed
>   For more information on paths, see 'stack path' and 'stack exec env'
>   To use this GHC and packages outside of a project, consider using:
>   stack ghc, stack ghci, stack runghc, or stack exec
>
> So seems that 8.2.2 was installed, right? But how to build the project
> with new GHC now? I never used cabal before, `stack ghci` still runs
> 8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not correspond
> to .yaml file LTS - maybe this is a reason why old 8.0.2 is stil used...
>
> When I try cabal build/new-build/repl I get:
>
>   cabal: The program 'ghc' version >=6.4 is required but it could not be
>   found.
>
> So, cabal does not know about installed GHC versions (at least 8.0.2,
> used by stack). I tried --require-sandbox but without success.

Hey Paul,
    four-step plan:

1. check where stack installed ghc, it should be something like:

    ~/.stack/programs/x86_32-linux/ghc-nopie-8.2.1/lib/ghc-8.2.1/bin

2. add these two lines to your `~/.bashrc`:

    export PATH=~/.cabal/bin:$PATH   # path to stuff built with cabal
    export PATH=~/the.stackpathabove:$PATH # path to ghc

3. check the right ghc version has been selected:

    ghc -v
    # should be 8.2.2

4. cd into your project and `cabal new-build` and then open a repl on it
   with `cabal new-repl`.

Let us know if this works!

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
PY
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

PY
1. GHC 8.2.2 is here:
   ~/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.2/bin
2. done
3. yes, it's 8.2.2
4. `cabal new-build` said to me call `cabal update`, I done it, then run
it again and got:
    $ cabal new-build
    Resolving dependencies...
    cabal: Could not resolve dependencies:
    trying: XXX-0.5.0.0 (user goal)
    next goal: YYY-utils (dependency of XXX-0.5.0.0)
    Dependency tree exhaustively searched.

> On Tue, Dec 12, 2017 at 02:53:47PM +0200, Baa wrote:
> > @Francesco: unfortunately nightly misses some package. So, I tried:
> >
> >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> >   Preparing to install GHC (tinfo6) to an isolated location. This
> > will not interfere with any system-level installation. Already
> > downloaded. Installed GHC.
> >
> >   stack will use a sandboxed GHC it installed
> >   For more information on paths, see 'stack path' and 'stack exec
> > env' To use this GHC and packages outside of a project, consider
> > using: stack ghc, stack ghci, stack runghc, or stack exec
> >
> > So seems that 8.2.2 was installed, right? But how to build the
> > project with new GHC now? I never used cabal before, `stack ghci`
> > still runs 8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not
> > correspond to .yaml file LTS - maybe this is a reason why old 8.0.2
> > is stil used...
> >
> > When I try cabal build/new-build/repl I get:
> >
> >   cabal: The program 'ghc' version >=6.4 is required but it could
> > not be found.
> >
> > So, cabal does not know about installed GHC versions (at least
> > 8.0.2, used by stack). I tried --require-sandbox but without
> > success.  
>
> Hey Paul,
>     four-step plan:
>
> 1. check where stack installed ghc, it should be something like:
>
>     ~/.stack/programs/x86_32-linux/ghc-nopie-8.2.1/lib/ghc-8.2.1/bin
>
> 2. add these two lines to your `~/.bashrc`:
>
>     export PATH=~/.cabal/bin:$PATH   # path to stuff built with cabal
>     export PATH=~/the.stackpathabove:$PATH # path to ghc
>
> 3. check the right ghc version has been selected:
>
>     ghc -v
>     # should be 8.2.2
>
> 4. cd into your project and `cabal new-build` and then open a repl on
> it with `cabal new-repl`.
>
> Let us know if this works!
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
PY
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

PY
In reply to this post by David McBride
@David: I tried to switch to nightly but in project's .yaml file and
got error about missing of some library (as I understand, it is missing
in last nightly). So, if I try to do it through .yaml file then how to
use new GHC (8.2.2) but with LTS for 8.0.2? Is it possible? I need last
stable LTS where all libraries (using in the projects) exist, but with
new GHC 8.2.2 which is too new for stable LTS. As I read somewhere, GHC
version and Stackage version are linked together hardly in stack tool,
or?

> You can see how to configure stack here:
> https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
>
> The short of it is that to have stack ghci choose a particular
> version of ghc, you probably need to modify
> ~/.stack/global/stack.yaml, change resolver to something here
> https://www.stackage.org/snapshots that has your version of ghc and
> dependencies similar to what your project wants.  For example
> 'nightly-2017-12-10'.
>
> On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]> wrote:
>
> > @Francesco: unfortunately nightly misses some package. So, I tried:
> >
> >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> >   Preparing to install GHC (tinfo6) to an isolated location. This
> > will not interfere with any system-level installation. Already
> > downloaded. Installed GHC.
> >
> >   stack will use a sandboxed GHC it installed
> >   For more information on paths, see 'stack path' and 'stack exec
> > env' To use this GHC and packages outside of a project, consider
> > using: stack ghc, stack ghci, stack runghc, or stack exec
> >
> > So seems that 8.2.2 was installed, right? But how to build the
> > project with new GHC now? I never used cabal before, `stack ghci`
> > still runs 8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not
> > correspond to .yaml file LTS - maybe this is a reason why old 8.0.2
> > is stil used...
> >
> > When I try cabal build/new-build/repl I get:
> >
> >   cabal: The program 'ghc' version >=6.4 is required but it could
> > not be found.
> >
> > So, cabal does not know about installed GHC versions (at least
> > 8.0.2, used by stack). I tried --require-sandbox but without
> > success.
> >
> >  
> > > On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:  
> > > > Would somebody explain me what is wrong here and how I can test
> > > > a project with new 8.2.2 GHC?  
> > >
> > > Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
> > > nightly or download/install ghc from here and compile your project
> > > with the new `cabal new-build`.
> > >
> > > [1] https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
> > >
> > >
> > > _______________________________________________
> > > Beginners mailing list
> > > [hidden email]
> > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners 
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >  

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Francesco Ariis
In reply to this post by PY
On Tue, Dec 12, 2017 at 03:38:30PM +0200, Baa wrote:

> 1. GHC 8.2.2 is here:
>    ~/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.2/bin
> 2. done
> 3. yes, it's 8.2.2
> 4. `cabal new-build` said to me call `cabal update`, I done it, then run
> it again and got:
>     $ cabal new-build
>     Resolving dependencies...
>     cabal: Could not resolve dependencies:
>     trying: XXX-0.5.0.0 (user goal)
>     next goal: YYY-utils (dependency of XXX-0.5.0.0)
>     Dependency tree exhaustively searched.

Good, we're almost there!

I strongly suspect it is a base constraint. Go in your something.cabal
file, build-depends section(s) and modify it from:

    base >= 4.somenumber && < 4.10

to

    base >= 4.somenumber && < 4.11

And try cabal new-build again. If that fails, please include the content
of your `build-depends:` portion in your message
-F
_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Michael Snoyman
In reply to this post by PY
Hi Paul,

A Stackage snapshot specifies both a GHC version and a set of packages. Stackage snapshots are built and tested to ensure that the packages are compatible. While you could tell Stack to use a different GHC version with a snapshot[1], this is unlikely to work, since GHC major releases usually break some packages.

I think everyone who's trying to help you (both with Cabal and Stack workflows) would be able to do so better if you explain which package you're trying to use which is no longer available in Stackage Nightly. In some cases, you can simply add it as an extra dependencies for Stack (e.g., `extra-deps: [acme-missiles-0.3]`), while in others there is some inherent incompatibility.

Right now, you'll just be getting guesses about how to theoretically get some unknown package to build with a bunch of others.

Michael

[1] Using a setting like `compiler: ghc-8.2.2`

On Tue, Dec 12, 2017 at 3:43 PM, Baa <[hidden email]> wrote:
@David: I tried to switch to nightly but in project's .yaml file and
got error about missing of some library (as I understand, it is missing
in last nightly). So, if I try to do it through .yaml file then how to
use new GHC (8.2.2) but with LTS for 8.0.2? Is it possible? I need last
stable LTS where all libraries (using in the projects) exist, but with
new GHC 8.2.2 which is too new for stable LTS. As I read somewhere, GHC
version and Stackage version are linked together hardly in stack tool,
or?

> You can see how to configure stack here:
> https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
>
> The short of it is that to have stack ghci choose a particular
> version of ghc, you probably need to modify
> ~/.stack/global/stack.yaml, change resolver to something here
> https://www.stackage.org/snapshots that has your version of ghc and
> dependencies similar to what your project wants.  For example
> 'nightly-2017-12-10'.
>
> On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]> wrote:
>
> > @Francesco: unfortunately nightly misses some package. So, I tried:
> >
> >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> >   Preparing to install GHC (tinfo6) to an isolated location. This
> > will not interfere with any system-level installation. Already
> > downloaded. Installed GHC.
> >
> >   stack will use a sandboxed GHC it installed
> >   For more information on paths, see 'stack path' and 'stack exec
> > env' To use this GHC and packages outside of a project, consider
> > using: stack ghc, stack ghci, stack runghc, or stack exec
> >
> > So seems that 8.2.2 was installed, right? But how to build the
> > project with new GHC now? I never used cabal before, `stack ghci`
> > still runs 8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not
> > correspond to .yaml file LTS - maybe this is a reason why old 8.0.2
> > is stil used...
> >
> > When I try cabal build/new-build/repl I get:
> >
> >   cabal: The program 'ghc' version >=6.4 is required but it could
> > not be found.
> >
> > So, cabal does not know about installed GHC versions (at least
> > 8.0.2, used by stack). I tried --require-sandbox but without
> > success.
> >
> >
> > > On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:
> > > > Would somebody explain me what is wrong here and how I can test
> > > > a project with new 8.2.2 GHC?
> > >
> > > Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
> > > nightly or download/install ghc from here and compile your project
> > > with the new `cabal new-build`.
> > >
> > > [1] https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
> > >
> > >
> > > _______________________________________________
> > > Beginners mailing list
> > > [hidden email]
> > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

David McBride
In reply to this post by PY
This is just trending into how to a stack tutorial.

But to use stack in your project you generate a stack.yaml file.  In that file you can put in the extra-deps stanza something like this:

extra-deps:
  - process-streaming-0.9.1.2
  - conceit-0.4.0.0
  - pipes-transduce-0.4
  - haskell-asterisk-types-0.1.0.0
  - haskell-asterisk-0.2.0.0
  - haskell-restapi-spec-0.1.0.0

Basically you list specific versions of programs that are not in stackage, and they will be pulled from hackage, if they exist.  But you are still at the mercy of version bounds.  If a package you need doesn't work with a newer ghc (which would explain why it isn't in nightly) or some other package you are using, you are out of luck.


On Tue, Dec 12, 2017 at 8:43 AM, Baa <[hidden email]> wrote:
@David: I tried to switch to nightly but in project's .yaml file and
got error about missing of some library (as I understand, it is missing
in last nightly). So, if I try to do it through .yaml file then how to
use new GHC (8.2.2) but with LTS for 8.0.2? Is it possible? I need last
stable LTS where all libraries (using in the projects) exist, but with
new GHC 8.2.2 which is too new for stable LTS. As I read somewhere, GHC
version and Stackage version are linked together hardly in stack tool,
or?

> You can see how to configure stack here:
> https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
>
> The short of it is that to have stack ghci choose a particular
> version of ghc, you probably need to modify
> ~/.stack/global/stack.yaml, change resolver to something here
> https://www.stackage.org/snapshots that has your version of ghc and
> dependencies similar to what your project wants.  For example
> 'nightly-2017-12-10'.
>
> On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]> wrote:
>
> > @Francesco: unfortunately nightly misses some package. So, I tried:
> >
> >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> >   Preparing to install GHC (tinfo6) to an isolated location. This
> > will not interfere with any system-level installation. Already
> > downloaded. Installed GHC.
> >
> >   stack will use a sandboxed GHC it installed
> >   For more information on paths, see 'stack path' and 'stack exec
> > env' To use this GHC and packages outside of a project, consider
> > using: stack ghc, stack ghci, stack runghc, or stack exec
> >
> > So seems that 8.2.2 was installed, right? But how to build the
> > project with new GHC now? I never used cabal before, `stack ghci`
> > still runs 8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not
> > correspond to .yaml file LTS - maybe this is a reason why old 8.0.2
> > is stil used...
> >
> > When I try cabal build/new-build/repl I get:
> >
> >   cabal: The program 'ghc' version >=6.4 is required but it could
> > not be found.
> >
> > So, cabal does not know about installed GHC versions (at least
> > 8.0.2, used by stack). I tried --require-sandbox but without
> > success.
> >
> >
> > > On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:
> > > > Would somebody explain me what is wrong here and how I can test
> > > > a project with new 8.2.2 GHC?
> > >
> > > Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
> > > nightly or download/install ghc from here and compile your project
> > > with the new `cabal new-build`.
> > >
> > > [1] https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
> > >
> > >
> > > _______________________________________________
> > > Beginners mailing list
> > > [hidden email]
> > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

agander
In reply to this post by PY
I put:

compiler: ghc-8.2.1

in the stack.yaml of my project which picks up the right version.

This didnt work prior to my current stack version 1.6.1

Giles


On 12 December 2017 at 14:38, Baa <[hidden email]> wrote:
1. GHC 8.2.2 is here:
   ~/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.2/bin
2. done
3. yes, it's 8.2.2
4. `cabal new-build` said to me call `cabal update`, I done it, then run
it again and got:
    $ cabal new-build
    Resolving dependencies...
    cabal: Could not resolve dependencies:
    trying: XXX-0.5.0.0 (user goal)
    next goal: YYY-utils (dependency of XXX-0.5.0.0)
    Dependency tree exhaustively searched.

> On Tue, Dec 12, 2017 at 02:53:47PM +0200, Baa wrote:
> > @Francesco: unfortunately nightly misses some package. So, I tried:
> >
> >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> >   Preparing to install GHC (tinfo6) to an isolated location. This
> > will not interfere with any system-level installation. Already
> > downloaded. Installed GHC.
> >
> >   stack will use a sandboxed GHC it installed
> >   For more information on paths, see 'stack path' and 'stack exec
> > env' To use this GHC and packages outside of a project, consider
> > using: stack ghc, stack ghci, stack runghc, or stack exec
> >
> > So seems that 8.2.2 was installed, right? But how to build the
> > project with new GHC now? I never used cabal before, `stack ghci`
> > still runs 8.0.2 instead of 8.2.2. Installed GHC 8.2.2 does not
> > correspond to .yaml file LTS - maybe this is a reason why old 8.0.2
> > is stil used...
> >
> > When I try cabal build/new-build/repl I get:
> >
> >   cabal: The program 'ghc' version >=6.4 is required but it could
> > not be found.
> >
> > So, cabal does not know about installed GHC versions (at least
> > 8.0.2, used by stack). I tried --require-sandbox but without
> > success.
>
> Hey Paul,
>     four-step plan:
>
> 1. check where stack installed ghc, it should be something like:
>
>     ~/.stack/programs/x86_32-linux/ghc-nopie-8.2.1/lib/ghc-8.2.1/bin
>
> 2. add these two lines to your `~/.bashrc`:
>
>     export PATH=~/.cabal/bin:$PATH   # path to stuff built with cabal
>     export PATH=~/the.stackpathabove:$PATH # path to ghc
>
> 3. check the right ghc version has been selected:
>
>     ghc -v
>     # should be 8.2.2
>
> 4. cd into your project and `cabal new-build` and then open a repl on
> it with `cabal new-repl`.
>
> Let us know if this works!
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
PY
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

PY
In reply to this post by Francesco Ariis
I done it, but got the same error. My project uses several my packages
(libraries), they are called 'my-*'. I changed in their .cabal-files
versions range of "base" too, but error is the same. Build-depends
stanza of executable looks like:

  build-depends:       base >= 4.9 && < 4.11
                     , text
                     , my-common-utils
                     , my-atlassian-utils
                     , my-jenkins-utils
                     , my-git-utils
                     , aeson
                     , network-uri
                     , network-info
                     , text-show
                     , hslogger
                     , bytestring
                     , transformers
                     , aeson-pretty
                     , time
                     , email-validate
                     , streaming
                     , containers
                     , sqlite-simple
                     , directory
                     , tuple
                     , async
                     , mime-mail
                     , HaskellNet
                     , HaskellNet-SSL
                     , mustache
                     , path
                     , exceptions
                     , mono-traversable
                     , data-default-class
                     , path-io
                     , split
                     , microlens
                     , microlens-th
                     , regex-pcre
                     , pcre-utils
                     , unordered-containers
                     , formatting


> On Tue, Dec 12, 2017 at 03:38:30PM +0200, Baa wrote:
> > 1. GHC 8.2.2 is here:
> >    ~/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.2/bin
> > 2. done
> > 3. yes, it's 8.2.2
> > 4. `cabal new-build` said to me call `cabal update`, I done it,
> > then run it again and got:
> >     $ cabal new-build
> >     Resolving dependencies...
> >     cabal: Could not resolve dependencies:
> >     trying: XXX-0.5.0.0 (user goal)
> >     next goal: YYY-utils (dependency of XXX-0.5.0.0)
> >     Dependency tree exhaustively searched.  
>
> Good, we're almost there!
>
> I strongly suspect it is a base constraint. Go in your something.cabal
> file, build-depends section(s) and modify it from:
>
>     base >= 4.somenumber && < 4.10
>
> to
>
>     base >= 4.somenumber && < 4.11
>
> And try cabal new-build again. If that fails, please include the
> content of your `build-depends:` portion in your message
> -F
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

David McBride
If your original goal was to test for a ghc panic in newer ghc, my final suggestion would be to get a minimal example that panics without all these extra dependencies.  If you happen to find that the bug exists in newer ghc,  you'd have to do that anyways to submit a useful bug report.

On Tue, Dec 12, 2017 at 9:06 AM, Baa <[hidden email]> wrote:
I done it, but got the same error. My project uses several my packages
(libraries), they are called 'my-*'. I changed in their .cabal-files
versions range of "base" too, but error is the same. Build-depends
stanza of executable looks like:

  build-depends:       base >= 4.9 && < 4.11
                     , text
                     , my-common-utils
                     , my-atlassian-utils
                     , my-jenkins-utils
                     , my-git-utils
                     , aeson
                     , network-uri
                     , network-info
                     , text-show
                     , hslogger
                     , bytestring
                     , transformers
                     , aeson-pretty
                     , time
                     , email-validate
                     , streaming
                     , containers
                     , sqlite-simple
                     , directory
                     , tuple
                     , async
                     , mime-mail
                     , HaskellNet
                     , HaskellNet-SSL
                     , mustache
                     , path
                     , exceptions
                     , mono-traversable
                     , data-default-class
                     , path-io
                     , split
                     , microlens
                     , microlens-th
                     , regex-pcre
                     , pcre-utils
                     , unordered-containers
                     , formatting


> On Tue, Dec 12, 2017 at 03:38:30PM +0200, Baa wrote:
> > 1. GHC 8.2.2 is here:
> >    ~/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.2/bin
> > 2. done
> > 3. yes, it's 8.2.2
> > 4. `cabal new-build` said to me call `cabal update`, I done it,
> > then run it again and got:
> >     $ cabal new-build
> >     Resolving dependencies...
> >     cabal: Could not resolve dependencies:
> >     trying: XXX-0.5.0.0 (user goal)
> >     next goal: YYY-utils (dependency of XXX-0.5.0.0)
> >     Dependency tree exhaustively searched.
>
> Good, we're almost there!
>
> I strongly suspect it is a base constraint. Go in your something.cabal
> file, build-depends section(s) and modify it from:
>
>     base >= 4.somenumber && < 4.10
>
> to
>
>     base >= 4.somenumber && < 4.11
>
> And try cabal new-build again. If that fails, please include the
> content of your `build-depends:` portion in your message
> -F
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Francesco Ariis
In reply to this post by PY
On Tue, Dec 12, 2017 at 04:06:44PM +0200, Baa wrote:
> I done it, but got the same error. My project uses several my packages
> (libraries), they are called 'my-*'. I changed in their .cabal-files
> versions range of "base" too, but error is the same. Build-depends
> stanza of executable looks like:
>
> [...]

Ok, most likey some package maintainer hasn't update their boundaries
to work with 8.2.2.
Go with

    cabal new-build --allow-newer

and maybe politely nudge maintainers to relax their dep.bounds
appropriately
-F
_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
PY
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

PY
In reply to this post by Michael Snoyman
@Michael Snoyman:

I returned back all .cabal-files and added compiler: ghc-8.2.2, `stack build`
printed out this:

---cut---
  Error: While constructing the build plan, the following exceptions were encountered:

  In the dependencies for Cabal-1.24.2.0:
      process-1.6.1.0 from stack configuration does not match >=1.1.0.1 && <1.5 (latest matching version is 1.4.3.0)
  needed due to my-common-utils-0.2.0.0 -> Cabal-1.24.2.0

  In the dependencies for versions-3.1.1:
      base-4.10.1.0 from stack configuration does not match >=4.8 && <4.10 (latest matching version is 4.9.1.0)
  needed due to my-common-utils-0.2.0.0 -> versions-3.1.1

  Some potential ways to resolve this:

    * Recommended action: try adding the following to your extra-deps in /home/pavel/prj/automation/revcompl-mon/stack.yaml:

  - base-4.9.1.0
  - process-1.4.3.0

    * Set 'allow-newer: true' to ignore all version constraints and build anyway.

    * You may also want to try using the 'stack solver' command.

  Plan construction failed.
---cut---

After adding "allow-newer: true" build process starts, all looked fine until:

   .../SimpleTagging.hs:281:51: error:
        • Couldn't match type ‘Type’ with ‘DerivClause’
          Expected type: [DerivClause]
            Actual type: [Type]
        • In the sixth argument of ‘DataD’, namely ‘derivs'’
          In the expression: DataD [] ty' tyVars Nothing newCs derivs'
          In the first argument of ‘(++)’, namely
            ‘[DataD [] ty' tyVars Nothing newCs derivs']’
        |
    281 |       return $ [DataD [] ty' tyVars Nothing newCs derivs'] ++ showInst
        |                                                   ^^^^^^^

which IMHO means that TemplateHaskell ("API") was changed from 8.0.2 to
8.2.2 because the same code is compiling with old GHC 8.0.2.


> Hi Paul,
>
> A Stackage snapshot specifies both a GHC version and a set of
> packages. Stackage snapshots are built and tested to ensure that the
> packages are compatible. While you could tell Stack to use a
> different GHC version with a snapshot[1], this is unlikely to work,
> since GHC major releases usually break some packages.
>
> I think everyone who's trying to help you (both with Cabal and Stack
> workflows) would be able to do so better if you explain which package
> you're trying to use which is no longer available in Stackage
> Nightly. In some cases, you can simply add it as an extra
> dependencies for Stack (e.g., `extra-deps: [acme-missiles-0.3]`),
> while in others there is some inherent incompatibility.
>
> Right now, you'll just be getting guesses about how to theoretically
> get some unknown package to build with a bunch of others.
>
> Michael
>
> [1] Using a setting like `compiler: ghc-8.2.2`
>
> On Tue, Dec 12, 2017 at 3:43 PM, Baa <[hidden email]> wrote:
>
> > @David: I tried to switch to nightly but in project's .yaml file and
> > got error about missing of some library (as I understand, it is
> > missing in last nightly). So, if I try to do it through .yaml file
> > then how to use new GHC (8.2.2) but with LTS for 8.0.2? Is it
> > possible? I need last stable LTS where all libraries (using in the
> > projects) exist, but with new GHC 8.2.2 which is too new for stable
> > LTS. As I read somewhere, GHC version and Stackage version are
> > linked together hardly in stack tool, or?
> >  
> > > You can see how to configure stack here:
> > > https://github.com/commercialhaskell/stack/blob/release/doc/yaml_ 
> > configuration.md  
> > >
> > > The short of it is that to have stack ghci choose a particular
> > > version of ghc, you probably need to modify
> > > ~/.stack/global/stack.yaml, change resolver to something here
> > > https://www.stackage.org/snapshots that has your version of ghc
> > > and dependencies similar to what your project wants.  For example
> > > 'nightly-2017-12-10'.
> > >
> > > On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]> wrote:
> > >  
> > > > @Francesco: unfortunately nightly misses some package. So, I
> > > > tried:
> > > >
> > > >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> > > >   Preparing to install GHC (tinfo6) to an isolated location.
> > > > This will not interfere with any system-level installation.
> > > > Already downloaded. Installed GHC.
> > > >
> > > >   stack will use a sandboxed GHC it installed
> > > >   For more information on paths, see 'stack path' and 'stack
> > > > exec env' To use this GHC and packages outside of a project,
> > > > consider using: stack ghc, stack ghci, stack runghc, or stack
> > > > exec
> > > >
> > > > So seems that 8.2.2 was installed, right? But how to build the
> > > > project with new GHC now? I never used cabal before, `stack
> > > > ghci` still runs 8.0.2 instead of 8.2.2. Installed GHC 8.2.2
> > > > does not correspond to .yaml file LTS - maybe this is a reason
> > > > why old 8.0.2 is stil used...
> > > >
> > > > When I try cabal build/new-build/repl I get:
> > > >
> > > >   cabal: The program 'ghc' version >=6.4 is required but it
> > > > could not be found.
> > > >
> > > > So, cabal does not know about installed GHC versions (at least
> > > > 8.0.2, used by stack). I tried --require-sandbox but without
> > > > success.
> > > >
> > > >  
> > > > > On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:  
> > > > > > Would somebody explain me what is wrong here and how I can
> > > > > > test a project with new 8.2.2 GHC?  
> > > > >
> > > > > Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
> > > > > nightly or download/install ghc from here and compile your
> > > > > project with the new `cabal new-build`.
> > > > >
> > > > > [1]
> > > > > https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Beginners mailing list
> > > > > [hidden email]
> > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners 
> > > >
> > > > _______________________________________________
> > > > Beginners mailing list
> > > > [hidden email]
> > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > >  
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >  

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
PY
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

PY
In reply to this post by David McBride
@Francesco: seems that code which I tried to test with new compiler is
out-of-date for it's Template Haskell "API".

@David: I planned to check existing code with new compiler (to be sure
that my code is OK), but seems that it needs to re-wrire the code, so
I will comment problematic test, GHC bug happens only is the test and
not in usual application code.

@all: Thanks a lot for all tips and help!!

PS. IMHO seems that Template Haskell gives more problems then solves
them :)

===
Best regards, Paul

> If your original goal was to test for a ghc panic in newer ghc, my
> final suggestion would be to get a minimal example that panics
> without all these extra dependencies.  If you happen to find that the
> bug exists in newer ghc,  you'd have to do that anyways to submit a
> useful bug report.
>
> On Tue, Dec 12, 2017 at 9:06 AM, Baa <[hidden email]> wrote:
>
> > I done it, but got the same error. My project uses several my
> > packages (libraries), they are called 'my-*'. I changed in
> > their .cabal-files versions range of "base" too, but error is the
> > same. Build-depends stanza of executable looks like:
> >
> >   build-depends:       base >= 4.9 && < 4.11
> >                      , text
> >                      , my-common-utils
> >                      , my-atlassian-utils
> >                      , my-jenkins-utils
> >                      , my-git-utils
> >                      , aeson
> >                      , network-uri
> >                      , network-info
> >                      , text-show
> >                      , hslogger
> >                      , bytestring
> >                      , transformers
> >                      , aeson-pretty
> >                      , time
> >                      , email-validate
> >                      , streaming
> >                      , containers
> >                      , sqlite-simple
> >                      , directory
> >                      , tuple
> >                      , async
> >                      , mime-mail
> >                      , HaskellNet
> >                      , HaskellNet-SSL
> >                      , mustache
> >                      , path
> >                      , exceptions
> >                      , mono-traversable
> >                      , data-default-class
> >                      , path-io
> >                      , split
> >                      , microlens
> >                      , microlens-th
> >                      , regex-pcre
> >                      , pcre-utils
> >                      , unordered-containers
> >                      , formatting
> >
> >  
> > > On Tue, Dec 12, 2017 at 03:38:30PM +0200, Baa wrote:  
> > > > 1. GHC 8.2.2 is here:
> > > >    ~/.stack/programs/x86_64-linux/ghc-tinfo6-8.2.2/bin
> > > > 2. done
> > > > 3. yes, it's 8.2.2
> > > > 4. `cabal new-build` said to me call `cabal update`, I done it,
> > > > then run it again and got:
> > > >     $ cabal new-build
> > > >     Resolving dependencies...
> > > >     cabal: Could not resolve dependencies:
> > > >     trying: XXX-0.5.0.0 (user goal)
> > > >     next goal: YYY-utils (dependency of XXX-0.5.0.0)
> > > >     Dependency tree exhaustively searched.  
> > >
> > > Good, we're almost there!
> > >
> > > I strongly suspect it is a base constraint. Go in your
> > > something.cabal file, build-depends section(s) and modify it from:
> > >
> > >     base >= 4.somenumber && < 4.10
> > >
> > > to
> > >
> > >     base >= 4.somenumber && < 4.11
> > >
> > > And try cabal new-build again. If that fails, please include the
> > > content of your `build-depends:` portion in your message
> > > -F
> > > _______________________________________________
> > > Beginners mailing list
> > > [hidden email]
> > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners 
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >  

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Michael Snoyman
In reply to this post by PY

That's right, the template-haskell API frequently changes between major releases of GHC.


On Tue, Dec 12, 2017, 4:35 PM Baa <[hidden email]> wrote:
@Michael Snoyman:

I returned back all .cabal-files and added compiler: ghc-8.2.2, `stack build`
printed out this:

---cut---
  Error: While constructing the build plan, the following exceptions were encountered:

  In the dependencies for Cabal-1.24.2.0:
      process-1.6.1.0 from stack configuration does not match >=1.1.0.1 && <1.5 (latest matching version is 1.4.3.0)
  needed due to my-common-utils-0.2.0.0 -> Cabal-1.24.2.0

  In the dependencies for versions-3.1.1:
      base-4.10.1.0 from stack configuration does not match >=4.8 && <4.10 (latest matching version is 4.9.1.0)
  needed due to my-common-utils-0.2.0.0 -> versions-3.1.1

  Some potential ways to resolve this:

    * Recommended action: try adding the following to your extra-deps in /home/pavel/prj/automation/revcompl-mon/stack.yaml:

  - base-4.9.1.0
  - process-1.4.3.0

    * Set 'allow-newer: true' to ignore all version constraints and build anyway.

    * You may also want to try using the 'stack solver' command.

  Plan construction failed.
---cut---

After adding "allow-newer: true" build process starts, all looked fine until:

   .../SimpleTagging.hs:281:51: error:
        • Couldn't match type ‘Type’ with ‘DerivClause’
          Expected type: [DerivClause]
            Actual type: [Type]
        • In the sixth argument of ‘DataD’, namely ‘derivs'’
          In the expression: DataD [] ty' tyVars Nothing newCs derivs'
          In the first argument of ‘(++)’, namely
            ‘[DataD [] ty' tyVars Nothing newCs derivs']’
        |
    281 |       return $ [DataD [] ty' tyVars Nothing newCs derivs'] ++ showInst
        |                                                   ^^^^^^^

which IMHO means that TemplateHaskell ("API") was changed from 8.0.2 to
8.2.2 because the same code is compiling with old GHC 8.0.2.


> Hi Paul,
>
> A Stackage snapshot specifies both a GHC version and a set of
> packages. Stackage snapshots are built and tested to ensure that the
> packages are compatible. While you could tell Stack to use a
> different GHC version with a snapshot[1], this is unlikely to work,
> since GHC major releases usually break some packages.
>
> I think everyone who's trying to help you (both with Cabal and Stack
> workflows) would be able to do so better if you explain which package
> you're trying to use which is no longer available in Stackage
> Nightly. In some cases, you can simply add it as an extra
> dependencies for Stack (e.g., `extra-deps: [acme-missiles-0.3]`),
> while in others there is some inherent incompatibility.
>
> Right now, you'll just be getting guesses about how to theoretically
> get some unknown package to build with a bunch of others.
>
> Michael
>
> [1] Using a setting like `compiler: ghc-8.2.2`
>
> On Tue, Dec 12, 2017 at 3:43 PM, Baa <[hidden email]> wrote:
>
> > @David: I tried to switch to nightly but in project's .yaml file and
> > got error about missing of some library (as I understand, it is
> > missing in last nightly). So, if I try to do it through .yaml file
> > then how to use new GHC (8.2.2) but with LTS for 8.0.2? Is it
> > possible? I need last stable LTS where all libraries (using in the
> > projects) exist, but with new GHC 8.2.2 which is too new for stable
> > LTS. As I read somewhere, GHC version and Stackage version are
> > linked together hardly in stack tool, or?
> >
> > > You can see how to configure stack here:
> > > https://github.com/commercialhaskell/stack/blob/release/doc/yaml_
> > configuration.md
> > >
> > > The short of it is that to have stack ghci choose a particular
> > > version of ghc, you probably need to modify
> > > ~/.stack/global/stack.yaml, change resolver to something here
> > > https://www.stackage.org/snapshots that has your version of ghc
> > > and dependencies similar to what your project wants.  For example
> > > 'nightly-2017-12-10'.
> > >
> > > On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]> wrote:
> > >
> > > > @Francesco: unfortunately nightly misses some package. So, I
> > > > tried:
> > > >
> > > >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> > > >   Preparing to install GHC (tinfo6) to an isolated location.
> > > > This will not interfere with any system-level installation.
> > > > Already downloaded. Installed GHC.
> > > >
> > > >   stack will use a sandboxed GHC it installed
> > > >   For more information on paths, see 'stack path' and 'stack
> > > > exec env' To use this GHC and packages outside of a project,
> > > > consider using: stack ghc, stack ghci, stack runghc, or stack
> > > > exec
> > > >
> > > > So seems that 8.2.2 was installed, right? But how to build the
> > > > project with new GHC now? I never used cabal before, `stack
> > > > ghci` still runs 8.0.2 instead of 8.2.2. Installed GHC 8.2.2
> > > > does not correspond to .yaml file LTS - maybe this is a reason
> > > > why old 8.0.2 is stil used...
> > > >
> > > > When I try cabal build/new-build/repl I get:
> > > >
> > > >   cabal: The program 'ghc' version >=6.4 is required but it
> > > > could not be found.
> > > >
> > > > So, cabal does not know about installed GHC versions (at least
> > > > 8.0.2, used by stack). I tried --require-sandbox but without
> > > > success.
> > > >
> > > >
> > > > > On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:
> > > > > > Would somebody explain me what is wrong here and how I can
> > > > > > test a project with new 8.2.2 GHC?
> > > > >
> > > > > Hello Paul, I don't think stack lts has 8.2.2 just yet. Use a
> > > > > nightly or download/install ghc from here and compile your
> > > > > project with the new `cabal new-build`.
> > > > >
> > > > > [1]
> > > > > https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Beginners mailing list
> > > > > [hidden email]
> > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > >
> > > > _______________________________________________
> > > > Beginners mailing list
> > > > [hidden email]
> > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > >
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
PY
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

PY
@Michael, so my newbie's questions:

- how Haskellers proceed in this case? Rewrites Template Haskells code
  after every switch to new versions? Or it's not common practice to
  switch projects from one GHC version to another? What about LTS? Do
  you switch to new one often? Is there a practice to keep project on
  one LTS/GHC versions and never to update them (I mean common, good
  known, convenient practice in Haskell)? For example, no problem to
  use out-of-date libraries in C/C++, in embedded development, etc, but
  what about Haskell?

IMHO it's better to update due to bug fixing, new features, but it's
interesting common practice in Haskell projects.

===
Best regards, Paul

> That's right, the template-haskell API frequently changes between
> major releases of GHC.
>
> On Tue, Dec 12, 2017, 4:35 PM Baa <[hidden email]> wrote:
>
> > @Michael Snoyman:
> >
> > I returned back all .cabal-files and added compiler: ghc-8.2.2,
> > `stack build`
> > printed out this:
> >
> > ---cut---
> >   Error: While constructing the build plan, the following
> > exceptions were encountered:
> >
> >   In the dependencies for Cabal-1.24.2.0:
> >       process-1.6.1.0 from stack configuration does not match
> > >=1.1.0.1 && <1.5 (latest matching version is 1.4.3.0)
> >   needed due to my-common-utils-0.2.0.0 -> Cabal-1.24.2.0
> >
> >   In the dependencies for versions-3.1.1:
> >       base-4.10.1.0 from stack configuration does not match >=4.8
> > && <4.10 (latest matching version is 4.9.1.0)
> >   needed due to my-common-utils-0.2.0.0 -> versions-3.1.1
> >
> >   Some potential ways to resolve this:
> >
> >     * Recommended action: try adding the following to your
> > extra-deps in /home/pavel/prj/automation/revcompl-mon/stack.yaml:
> >
> >   - base-4.9.1.0
> >   - process-1.4.3.0
> >
> >     * Set 'allow-newer: true' to ignore all version constraints and
> > build anyway.
> >
> >     * You may also want to try using the 'stack solver' command.
> >
> >   Plan construction failed.
> > ---cut---
> >
> > After adding "allow-newer: true" build process starts, all looked
> > fine until:
> >
> >    .../SimpleTagging.hs:281:51: error:
> >         • Couldn't match type ‘Type’ with ‘DerivClause’
> >           Expected type: [DerivClause]
> >             Actual type: [Type]
> >         • In the sixth argument of ‘DataD’, namely ‘derivs'’
> >           In the expression: DataD [] ty' tyVars Nothing newCs
> > derivs' In the first argument of ‘(++)’, namely
> >             ‘[DataD [] ty' tyVars Nothing newCs derivs']’
> >         |
> >     281 |       return $ [DataD [] ty' tyVars Nothing newCs
> > derivs'] ++ showInst
> >         |                                                   ^^^^^^^
> >
> > which IMHO means that TemplateHaskell ("API") was changed from
> > 8.0.2 to 8.2.2 because the same code is compiling with old GHC
> > 8.0.2.
> >
> >  
> > > Hi Paul,
> > >
> > > A Stackage snapshot specifies both a GHC version and a set of
> > > packages. Stackage snapshots are built and tested to ensure that
> > > the packages are compatible. While you could tell Stack to use a
> > > different GHC version with a snapshot[1], this is unlikely to
> > > work, since GHC major releases usually break some packages.
> > >
> > > I think everyone who's trying to help you (both with Cabal and
> > > Stack workflows) would be able to do so better if you explain
> > > which package you're trying to use which is no longer available
> > > in Stackage Nightly. In some cases, you can simply add it as an
> > > extra dependencies for Stack (e.g., `extra-deps:
> > > [acme-missiles-0.3]`), while in others there is some inherent
> > > incompatibility.
> > >
> > > Right now, you'll just be getting guesses about how to
> > > theoretically get some unknown package to build with a bunch of
> > > others.
> > >
> > > Michael
> > >
> > > [1] Using a setting like `compiler: ghc-8.2.2`
> > >
> > > On Tue, Dec 12, 2017 at 3:43 PM, Baa <[hidden email]> wrote:
> > >  
> > > > @David: I tried to switch to nightly but in project's .yaml
> > > > file and got error about missing of some library (as I
> > > > understand, it is missing in last nightly). So, if I try to do
> > > > it through .yaml file then how to use new GHC (8.2.2) but with
> > > > LTS for 8.0.2? Is it possible? I need last stable LTS where all
> > > > libraries (using in the projects) exist, but with new GHC 8.2.2
> > > > which is too new for stable LTS. As I read somewhere, GHC
> > > > version and Stackage version are linked together hardly in
> > > > stack tool, or?
> > > > > You can see how to configure stack here:
> > > > > https://github.com/commercialhaskell/stack/blob/release/doc/yaml_ 
> > > > configuration.md  
> > > > >
> > > > > The short of it is that to have stack ghci choose a particular
> > > > > version of ghc, you probably need to modify
> > > > > ~/.stack/global/stack.yaml, change resolver to something here
> > > > > https://www.stackage.org/snapshots that has your version of
> > > > > ghc and dependencies similar to what your project wants.  For
> > > > > example 'nightly-2017-12-10'.
> > > > >
> > > > > On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]>
> > > > > wrote:
> > > > > > @Francesco: unfortunately nightly misses some package. So, I
> > > > > > tried:
> > > > > >
> > > > > >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> > > > > >   Preparing to install GHC (tinfo6) to an isolated location.
> > > > > > This will not interfere with any system-level installation.
> > > > > > Already downloaded. Installed GHC.
> > > > > >
> > > > > >   stack will use a sandboxed GHC it installed
> > > > > >   For more information on paths, see 'stack path' and 'stack
> > > > > > exec env' To use this GHC and packages outside of a project,
> > > > > > consider using: stack ghc, stack ghci, stack runghc, or
> > > > > > stack exec
> > > > > >
> > > > > > So seems that 8.2.2 was installed, right? But how to build
> > > > > > the project with new GHC now? I never used cabal before,
> > > > > > `stack ghci` still runs 8.0.2 instead of 8.2.2. Installed
> > > > > > GHC 8.2.2 does not correspond to .yaml file LTS - maybe
> > > > > > this is a reason why old 8.0.2 is stil used...
> > > > > >
> > > > > > When I try cabal build/new-build/repl I get:
> > > > > >
> > > > > >   cabal: The program 'ghc' version >=6.4 is required but it
> > > > > > could not be found.
> > > > > >
> > > > > > So, cabal does not know about installed GHC versions (at
> > > > > > least 8.0.2, used by stack). I tried --require-sandbox but
> > > > > > without success.
> > > > > >
> > > > > >  
> > > > > > > On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:  
> > > > > > > > Would somebody explain me what is wrong here and how I
> > > > > > > > can test a project with new 8.2.2 GHC?  
> > > > > > >
> > > > > > > Hello Paul, I don't think stack lts has 8.2.2 just yet.
> > > > > > > Use a nightly or download/install ghc from here and
> > > > > > > compile your project with the new `cabal new-build`.
> > > > > > >
> > > > > > > [1]
> > > > > > > https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
> > > > > > >
> > > > > > >
> > > > > > > _______________________________________________
> > > > > > > Beginners mailing list
> > > > > > > [hidden email]
> > > > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners 
> > > > > >
> > > > > > _______________________________________________
> > > > > > Beginners mailing list
> > > > > > [hidden email]
> > > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > > > >  
> > > >
> > > > _______________________________________________
> > > > Beginners mailing list
> > > > [hidden email]
> > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > >  
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >  

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: How to install new GHC ?

Michael Snoyman
IMO, there are two different cases you need to care about:

1. If you're writing an application, keeping broad support for lots of compiler and library versions isn't vital. You can dictate exactly which versions of dependencies your application is compiled with. I use this for web applications I write and command line tools (including Stack), for example. In this case: pick an LTS snapshot, add extra-deps on demand if absolutely necessary, and then when you see a strong need (like upstream bug fixes), update your stack.yaml to a newer snapshot to get new GHC and library versions.
2. If you're writing a library that you expect others to be using, keep as broad a support base as possible. This is encouraged by things like the complex Travis config in the Stack docs[1], which build with many different LTS snapshots, as well as using many versions of GHC and cabal-install (to cover the dep solver case). This allows consumers of your library to more easily mix and match which versions of dependencies they want to put together.

When there is an upstream breaking change, it's tempting to just drop support for the old version, add a lower bound in your cabal file to say "I no longer support the old version," and move on. But IMO a nicer solution for your users is to introduce conditional compilation, e.g.:

#if MIN_VERSION_transformers(0, 5, 0)
-- use transformers 0.5 or later
#else
-- use transformers 0.4 or earlier
#endif

This definitely adds extra burden to you as a writer, but it helps others significantly. This is also strong motivation to try to avoid breaking backwards compatibility in your APIs, as every such breakage can cause a cascade of downstream pain[2].

I hope that answers your questions, let me know if you want me to clarify any points here.

[2] In case anyone's wondering: this has nothing to do with bounds in your cabal file, I'm talking about actual code breakage

On Tue, Dec 12, 2017 at 5:25 PM, Baa <[hidden email]> wrote:
@Michael, so my newbie's questions:

- how Haskellers proceed in this case? Rewrites Template Haskells code
  after every switch to new versions? Or it's not common practice to
  switch projects from one GHC version to another? What about LTS? Do
  you switch to new one often? Is there a practice to keep project on
  one LTS/GHC versions and never to update them (I mean common, good
  known, convenient practice in Haskell)? For example, no problem to
  use out-of-date libraries in C/C++, in embedded development, etc, but
  what about Haskell?

IMHO it's better to update due to bug fixing, new features, but it's
interesting common practice in Haskell projects.

===
Best regards, Paul

> That's right, the template-haskell API frequently changes between
> major releases of GHC.
>
> On Tue, Dec 12, 2017, 4:35 PM Baa <[hidden email]> wrote:
>
> > @Michael Snoyman:
> >
> > I returned back all .cabal-files and added compiler: ghc-8.2.2,
> > `stack build`
> > printed out this:
> >
> > ---cut---
> >   Error: While constructing the build plan, the following
> > exceptions were encountered:
> >
> >   In the dependencies for Cabal-1.24.2.0:
> >       process-1.6.1.0 from stack configuration does not match
> > >=1.1.0.1 && <1.5 (latest matching version is 1.4.3.0)
> >   needed due to my-common-utils-0.2.0.0 -> Cabal-1.24.2.0
> >
> >   In the dependencies for versions-3.1.1:
> >       base-4.10.1.0 from stack configuration does not match >=4.8
> > && <4.10 (latest matching version is 4.9.1.0)
> >   needed due to my-common-utils-0.2.0.0 -> versions-3.1.1
> >
> >   Some potential ways to resolve this:
> >
> >     * Recommended action: try adding the following to your
> > extra-deps in /home/pavel/prj/automation/revcompl-mon/stack.yaml:
> >
> >   - base-4.9.1.0
> >   - process-1.4.3.0
> >
> >     * Set 'allow-newer: true' to ignore all version constraints and
> > build anyway.
> >
> >     * You may also want to try using the 'stack solver' command.
> >
> >   Plan construction failed.
> > ---cut---
> >
> > After adding "allow-newer: true" build process starts, all looked
> > fine until:
> >
> >    .../SimpleTagging.hs:281:51: error:
> >         • Couldn't match type ‘Type’ with ‘DerivClause’
> >           Expected type: [DerivClause]
> >             Actual type: [Type]
> >         • In the sixth argument of ‘DataD’, namely ‘derivs'’
> >           In the expression: DataD [] ty' tyVars Nothing newCs
> > derivs' In the first argument of ‘(++)’, namely
> >             ‘[DataD [] ty' tyVars Nothing newCs derivs']’
> >         |
> >     281 |       return $ [DataD [] ty' tyVars Nothing newCs
> > derivs'] ++ showInst
> >         |                                                   ^^^^^^^
> >
> > which IMHO means that TemplateHaskell ("API") was changed from
> > 8.0.2 to 8.2.2 because the same code is compiling with old GHC
> > 8.0.2.
> >
> >
> > > Hi Paul,
> > >
> > > A Stackage snapshot specifies both a GHC version and a set of
> > > packages. Stackage snapshots are built and tested to ensure that
> > > the packages are compatible. While you could tell Stack to use a
> > > different GHC version with a snapshot[1], this is unlikely to
> > > work, since GHC major releases usually break some packages.
> > >
> > > I think everyone who's trying to help you (both with Cabal and
> > > Stack workflows) would be able to do so better if you explain
> > > which package you're trying to use which is no longer available
> > > in Stackage Nightly. In some cases, you can simply add it as an
> > > extra dependencies for Stack (e.g., `extra-deps:
> > > [acme-missiles-0.3]`), while in others there is some inherent
> > > incompatibility.
> > >
> > > Right now, you'll just be getting guesses about how to
> > > theoretically get some unknown package to build with a bunch of
> > > others.
> > >
> > > Michael
> > >
> > > [1] Using a setting like `compiler: ghc-8.2.2`
> > >
> > > On Tue, Dec 12, 2017 at 3:43 PM, Baa <[hidden email]> wrote:
> > >
> > > > @David: I tried to switch to nightly but in project's .yaml
> > > > file and got error about missing of some library (as I
> > > > understand, it is missing in last nightly). So, if I try to do
> > > > it through .yaml file then how to use new GHC (8.2.2) but with
> > > > LTS for 8.0.2? Is it possible? I need last stable LTS where all
> > > > libraries (using in the projects) exist, but with new GHC 8.2.2
> > > > which is too new for stable LTS. As I read somewhere, GHC
> > > > version and Stackage version are linked together hardly in
> > > > stack tool, or?
> > > > > You can see how to configure stack here:
> > > > > https://github.com/commercialhaskell/stack/blob/release/doc/yaml_
> > > > configuration.md
> > > > >
> > > > > The short of it is that to have stack ghci choose a particular
> > > > > version of ghc, you probably need to modify
> > > > > ~/.stack/global/stack.yaml, change resolver to something here
> > > > > https://www.stackage.org/snapshots that has your version of
> > > > > ghc and dependencies similar to what your project wants.  For
> > > > > example 'nightly-2017-12-10'.
> > > > >
> > > > > On Tue, Dec 12, 2017 at 7:53 AM, Baa <[hidden email]>
> > > > > wrote:
> > > > > > @Francesco: unfortunately nightly misses some package. So, I
> > > > > > tried:
> > > > > >
> > > > > >   $ stack --resolver=ghc-8.2.2 setup --reinstall
> > > > > >   Preparing to install GHC (tinfo6) to an isolated location.
> > > > > > This will not interfere with any system-level installation.
> > > > > > Already downloaded. Installed GHC.
> > > > > >
> > > > > >   stack will use a sandboxed GHC it installed
> > > > > >   For more information on paths, see 'stack path' and 'stack
> > > > > > exec env' To use this GHC and packages outside of a project,
> > > > > > consider using: stack ghc, stack ghci, stack runghc, or
> > > > > > stack exec
> > > > > >
> > > > > > So seems that 8.2.2 was installed, right? But how to build
> > > > > > the project with new GHC now? I never used cabal before,
> > > > > > `stack ghci` still runs 8.0.2 instead of 8.2.2. Installed
> > > > > > GHC 8.2.2 does not correspond to .yaml file LTS - maybe
> > > > > > this is a reason why old 8.0.2 is stil used...
> > > > > >
> > > > > > When I try cabal build/new-build/repl I get:
> > > > > >
> > > > > >   cabal: The program 'ghc' version >=6.4 is required but it
> > > > > > could not be found.
> > > > > >
> > > > > > So, cabal does not know about installed GHC versions (at
> > > > > > least 8.0.2, used by stack). I tried --require-sandbox but
> > > > > > without success.
> > > > > >
> > > > > >
> > > > > > > On Tue, Dec 12, 2017 at 01:56:03PM +0200, Baa wrote:
> > > > > > > > Would somebody explain me what is wrong here and how I
> > > > > > > > can test a project with new 8.2.2 GHC?
> > > > > > >
> > > > > > > Hello Paul, I don't think stack lts has 8.2.2 just yet.
> > > > > > > Use a nightly or download/install ghc from here and
> > > > > > > compile your project with the new `cabal new-build`.
> > > > > > >
> > > > > > > [1]
> > > > > > > https://www.haskell.org/ghc/download_ghc_8_2_2.html#binaries
> > > > > > >
> > > > > > >
> > > > > > > _______________________________________________
> > > > > > > Beginners mailing list
> > > > > > > [hidden email]
> > > > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > > > >
> > > > > > _______________________________________________
> > > > > > Beginners mailing list
> > > > > > [hidden email]
> > > > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > > > >
> > > >
> > > > _______________________________________________
> > > > Beginners mailing list
> > > > [hidden email]
> > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > > >
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
12