Re: Usage of Template Haskell quotes in GHC source tree vs. usage of GHC as a library

2023-07-12 Thread Simon Peyton Jones
Gergo

I'm not close enough to this to have a well-formed opinion, but it looks
like a good question to me, esp if the new dependence on TH is optional.

Would you like to transfer the text into a GHC ticket?

Simon

On Wed, 12 Jul 2023 at 04:40, Gergő Érdi  wrote:

> Hi,
>
>
>
> A recent commit 983ce55815f2dd57f84ee86eee97febf7d80b470 starts using
> TemplateHaskellQuotes in the GHC codebase. It seems this is at odds with
> using GHC as a library, a la ghc-lib.
>
>
>
> The `ghc-lib` approach is to basically take the module hierarchy from the
> `compiler/` subtree, and compile it as a completely vanilla Haskell
> library, with no direct attachment to the host GHC version. This enables
> using e.g. GHC 9.4 to compile a program using the GHC 9.6 API, and so on.
> In particular, it also makes it very easy to apply patches to the version
> of GHC used as a library, since in this setup it doesn’t need to be able to
> bootstrap.
>
>
>
> So what is the problem with using TemplateHaskellQuotes? The problem is
> the dependency on the template-haskell package. When a module inside
> GHC-as-a-library containing TH quotes is compiled, the quotes are
> translated into applications of the constructors defined by the *host*
> GHC’s TH package. But because GHC is tightly coupled to the TH support
> library, GHC-as-a-library needs to ship with its own internal version of
> the library. So the code that tries to process the results of these quotes
> is using the *target* GHC’s TH definitions. And that leads to a conflict:
> code like
>
>
>
> leftName :: Namel
>
> leftName = ‘Left
>
>
> is now a type mismatch between the type of `’Left` being
> template-haskell-2.19.0.0:Language.Haskell.TH.Syntax.Name (example when
> using GHC 9.4.5 as the host) and the type of `leftName` being
> ghc-lib-9.9.20230712:Language.Haskell.TH.Syntax.Name (example when the
> target version is built from recent `master`).
>
>
>
> Currently, `ghc-lib-gen` has a pre-processing step on the GHC source tree
> that replaces these quotations with applications containing direct
> references to the target TH constructors:
> https://github.com/digital-asset/ghc-lib/blob/ab01fb2b4d1e3a9338390e9c10ccd769bbf37aeb/ghc-lib-gen/src/Ghclibgen.hs#L419-L467
> but I am worried that this is very fragile.
>
>
>
> So any ideas on how to tackle this situation better?
>
>
>
> Thanks,
>
> Gergo
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Can't build nofib

2023-07-12 Thread Simon Peyton Jones
Friends

With a clean HEAD I can't build nofib.  See below.  What should I do?

Thanks

Simon

(cd nofib; cabal v2-run -- nofib-run
--compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: nofib-0.1.0.0 (user goal)
[__1] next goal: base (dependency of nofib)
[__1] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict: nofib =>
base>=4.5 && <4.17)
[__1] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=4.5 && <4.17' from 'nofib')
[__1] rejecting: base-4.16.4.0, base-4.16.3.0, base-4.16.2.0, base-4.16.1.0,
base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
[__1] fail (backjumping, conflict set: base, nofib)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, nofib

make: *** [/home/simonpj/code/Makefile-spj:39: nofib] Error 1
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build nofib

2023-07-12 Thread Andreas Klebinger

Try adding --allow-newer we probably just haven't updated the bounds yet.

(cd nofib; cabal v2-run --allow-newer -- nofib-run
--compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)

Am 12/07/2023 um 13:38 schrieb Simon Peyton Jones:

Friends

With a clean HEAD I can't build nofib.  See below.  What should I do?

Thanks

Simon

(cd nofib; cabal v2-run -- nofib-run
--compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: nofib-0.1.0.0 (user goal)
[__1] next goal: base (dependency of nofib)
[__1] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict: nofib =>
base>=4.5 && <4.17)
[__1] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=4.5 && <4.17' from 'nofib')
[__1] rejecting: base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
base-4.16.1.0,
base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
[__1] fail (backjumping, conflict set: base, nofib)
After searching the rest of the dependency tree exhaustively, these
were the
goals I've had most trouble fulfilling: base, nofib

make: *** [/home/simonpj/code/Makefile-spj:39: nofib] Error 1


___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build nofib

2023-07-12 Thread Rodrigo Mesquita
From the error message it looks like you’re using ghc-9.6(and base 4.18) while 
nofib requires base < 4.17.
I’d say as a temporary workaround you can likely run your invocation 
additionally with —allow-newer, and hope that doesn’t break. Otherwise you 
could downgrade to 9.4 or bump the version manually in the cabal file of nofib?

Rodrigo

> On 12 Jul 2023, at 12:38, Simon Peyton Jones  
> wrote:
> 
> Friends
> 
> With a clean HEAD I can't build nofib.  See below.  What should I do?
> 
> Thanks
> 
> Simon
> 
> (cd nofib; cabal v2-run -- nofib-run 
> --compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)
> Resolving dependencies...
> Error: cabal: Could not resolve dependencies:
> [__0] trying: nofib-0.1.0.0 (user goal)
> [__1] next goal: base (dependency of nofib)
> [__1] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict: nofib =>
> base>=4.5 && <4.17)
> [__1] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0 (has the same
> characteristics that caused the previous version to fail: excluded by
> constraint '>=4.5 && <4.17' from 'nofib')
> [__1] rejecting: base-4.16.4.0, base-4.16.3.0, base-4.16.2.0, base-4.16.1.0,
> base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
> base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
> base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
> base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
> base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
> base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
> base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
> base-3.0.3.1 (constraint from non-upgradeable package requires installed
> instance)
> [__1] fail (backjumping, conflict set: base, nofib)
> After searching the rest of the dependency tree exhaustively, these were the
> goals I've had most trouble fulfilling: base, nofib
> 
> make: *** [/home/simonpj/code/Makefile-spj:39: nofib] Error 1
> 
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build nofib

2023-07-12 Thread Simon Peyton Jones
Thanks.  That is very unfortunate: ./configure does not issue any complaint.

I upgraded from 9.2 because GHC won't compile with 9.2 any more.  But now
you are saying that nofib won't build with 9.6?  So that leaves 9.4 only.

Well I can install 9.4 and rebuild everything.  But really, it would be
good if configure complained if you are using a boot compiler that won't
work.  That's what configure is for!

Simon

On Wed, 12 Jul 2023 at 12:41, Rodrigo Mesquita 
wrote:

> From the error message it looks like you’re using ghc-9.6(and base 4.18)
> while nofib requires base < 4.17.
> I’d say as a temporary workaround you can likely run your invocation
> additionally with —allow-newer, and hope that doesn’t break. Otherwise you
> could downgrade to 9.4 or bump the version manually in the cabal file of
> nofib?
>
> Rodrigo
>
> On 12 Jul 2023, at 12:38, Simon Peyton Jones 
> wrote:
>
> Friends
>
> With a clean HEAD I can't build nofib.  See below.  What should I do?
>
> Thanks
>
> Simon
>
> (cd nofib; cabal v2-run -- nofib-run
> --compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)
> Resolving dependencies...
> Error: cabal: Could not resolve dependencies:
> [__0] trying: nofib-0.1.0.0 (user goal)
> [__1] next goal: base (dependency of nofib)
> [__1] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict: nofib =>
> base>=4.5 && <4.17)
> [__1] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0 (has the same
> characteristics that caused the previous version to fail: excluded by
> constraint '>=4.5 && <4.17' from 'nofib')
> [__1] rejecting: base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
> base-4.16.1.0,
> base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
> base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
> base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
> base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
> base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
> base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
> base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
> base-3.0.3.1 (constraint from non-upgradeable package requires installed
> instance)
> [__1] fail (backjumping, conflict set: base, nofib)
> After searching the rest of the dependency tree exhaustively, these were
> the
> goals I've had most trouble fulfilling: base, nofib
>
> make: *** [/home/simonpj/code/Makefile-spj:39: nofib] Error 1
>
> ___
> ghc-devs mailing list
> ghc-devs@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build nofib

2023-07-12 Thread Rodrigo Mesquita
I would recommend —allow-newer rather than rebuilding with 9.4. In retrospect, 
9.4 implies base == 4.17, but nofib seems to only allow < 4.17, which would 
leave 9.4 out.

Rodrigo

> On 12 Jul 2023, at 12:48, Simon Peyton Jones  
> wrote:
> 
> Thanks.  That is very unfortunate: ./configure does not issue any complaint.
> 
> I upgraded from 9.2 because GHC won't compile with 9.2 any more.  But now you 
> are saying that nofib won't build with 9.6?  So that leaves 9.4 only.
> 
> Well I can install 9.4 and rebuild everything.  But really, it would be good 
> if configure complained if you are using a boot compiler that won't work.  
> That's what configure is for!
> 
> Simon
> 
> On Wed, 12 Jul 2023 at 12:41, Rodrigo Mesquita  > wrote:
>> From the error message it looks like you’re using ghc-9.6(and base 4.18) 
>> while nofib requires base < 4.17.
>> I’d say as a temporary workaround you can likely run your invocation 
>> additionally with —allow-newer, and hope that doesn’t break. Otherwise you 
>> could downgrade to 9.4 or bump the version manually in the cabal file of 
>> nofib?
>> 
>> Rodrigo
>> 
>>> On 12 Jul 2023, at 12:38, Simon Peyton Jones >> > wrote:
>>> 
>>> Friends
>>> 
>>> With a clean HEAD I can't build nofib.  See below.  What should I do?
>>> 
>>> Thanks
>>> 
>>> Simon
>>> 
>>> (cd nofib; cabal v2-run -- nofib-run 
>>> --compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)
>>> Resolving dependencies...
>>> Error: cabal: Could not resolve dependencies:
>>> [__0] trying: nofib-0.1.0.0 (user goal)
>>> [__1] next goal: base (dependency of nofib)
>>> [__1] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict: nofib =>
>>> base>=4.5 && <4.17)
>>> [__1] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0 (has the same
>>> characteristics that caused the previous version to fail: excluded by
>>> constraint '>=4.5 && <4.17' from 'nofib')
>>> [__1] rejecting: base-4.16.4.0, base-4.16.3.0, base-4.16.2.0, base-4.16.1.0,
>>> base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
>>> base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
>>> base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
>>> base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
>>> base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
>>> base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
>>> base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
>>> base-3.0.3.1 (constraint from non-upgradeable package requires installed
>>> instance)
>>> [__1] fail (backjumping, conflict set: base, nofib)
>>> After searching the rest of the dependency tree exhaustively, these were the
>>> goals I've had most trouble fulfilling: base, nofib
>>> 
>>> make: *** [/home/simonpj/code/Makefile-spj:39: nofib] Error 1
>>> 
>>> ___
>>> ghc-devs mailing list
>>> ghc-devs@haskell.org 
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>> 

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build nofib

2023-07-12 Thread Andreas Klebinger

The nofib master branch has updated bounds. It's just ghcs submodule
that's lagging behind.

Am 12/07/2023 um 13:49 schrieb Rodrigo Mesquita:

I would recommend —allow-newer rather than rebuilding with 9.4. In
retrospect, 9.4 implies base == 4.17, but nofib seems to only allow <
4.17, which would leave 9.4 out.

Rodrigo


On 12 Jul 2023, at 12:48, Simon Peyton Jones
 wrote:

Thanks.  That is very unfortunate: ./configure does not issue any
complaint.

I upgraded from 9.2 because GHC won't compile with 9.2 any more.  But
now you are saying that nofib won't build with 9.6? So that leaves
9.4 only.

Well I can install 9.4 and rebuild everything.  But really, it would
be good if configure complained if you are using a boot compiler that
won't work.  That's what configure is for!

Simon

On Wed, 12 Jul 2023 at 12:41, Rodrigo Mesquita
 wrote:

From the error message it looks like you’re using ghc-9.6(and
base 4.18) while nofib requires base < 4.17.
I’d say as a temporary workaround you can likely run your
invocation additionally with —allow-newer, and hope that doesn’t
break. Otherwise you could downgrade to 9.4 or bump the version
manually in the cabal file of nofib?

Rodrigo


On 12 Jul 2023, at 12:38, Simon Peyton Jones
 wrote:

Friends

With a clean HEAD I can't build nofib.  See below.  What should
I do?

Thanks

Simon

(cd nofib; cabal v2-run -- nofib-run
--compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: nofib-0.1.0.0 (user goal)
[__1] next goal: base (dependency of nofib)
[__1] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict:
nofib =>
base>=4.5 && <4.17)
[__1] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0 (has
the same
characteristics that caused the previous version to fail:
excluded by
constraint '>=4.5 && <4.17' from 'nofib')
[__1] rejecting: base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
base-4.16.1.0,
base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0,
base-4.14.2.0,
base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0,
base-4.11.1.0,
base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0,
base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2,
base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0,
base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0,
base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0,
base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires
installed
instance)
[__1] fail (backjumping, conflict set: base, nofib)
After searching the rest of the dependency tree exhaustively,
these were the
goals I've had most trouble fulfilling: base, nofib

make: *** [/home/simonpj/code/Makefile-spj:39: nofib] Error 1

___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs





___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


Re: Can't build nofib

2023-07-12 Thread Simon Peyton Jones
>
> I would recommend —allow-newer rather than rebuilding with 9.4. In
> retrospect, 9.4 implies base == 4.17, but nofib seems to only allow < 4.17,
> which would leave 9.4 out.


Oh wow -- so there is *no* version of GHC that works as a bootstrap GHC.
That seems bad.  Very bad.

I see a patch from Andreas -- maybe that fixes it?

Meanwhile, --allow-newer I guess.

Simon

On Wed, 12 Jul 2023 at 12:50, Rodrigo Mesquita 
wrote:

> I would recommend —allow-newer rather than rebuilding with 9.4. In
> retrospect, 9.4 implies base == 4.17, but nofib seems to only allow < 4.17,
> which would leave 9.4 out.
>
> Rodrigo
>
> On 12 Jul 2023, at 12:48, Simon Peyton Jones 
> wrote:
>
> Thanks.  That is very unfortunate: ./configure does not issue any
> complaint.
>
> I upgraded from 9.2 because GHC won't compile with 9.2 any more.  But now
> you are saying that nofib won't build with 9.6?  So that leaves 9.4 only.
>
> Well I can install 9.4 and rebuild everything.  But really, it would be
> good if configure complained if you are using a boot compiler that won't
> work.  That's what configure is for!
>
> Simon
>
> On Wed, 12 Jul 2023 at 12:41, Rodrigo Mesquita <
> rodrigo.m.mesqu...@gmail.com> wrote:
>
>> From the error message it looks like you’re using ghc-9.6(and base 4.18)
>> while nofib requires base < 4.17.
>> I’d say as a temporary workaround you can likely run your invocation
>> additionally with —allow-newer, and hope that doesn’t break. Otherwise you
>> could downgrade to 9.4 or bump the version manually in the cabal file of
>> nofib?
>>
>> Rodrigo
>>
>> On 12 Jul 2023, at 12:38, Simon Peyton Jones 
>> wrote:
>>
>> Friends
>>
>> With a clean HEAD I can't build nofib.  See below.  What should I do?
>>
>> Thanks
>>
>> Simon
>>
>> (cd nofib; cabal v2-run -- nofib-run
>> --compiler=`pwd`/../_build/stage1/bin/ghc --output=`date -I`)
>> Resolving dependencies...
>> Error: cabal: Could not resolve dependencies:
>> [__0] trying: nofib-0.1.0.0 (user goal)
>> [__1] next goal: base (dependency of nofib)
>> [__1] rejecting: base-4.18.0.0/installed-4.18.0.0 (conflict: nofib =>
>> base>=4.5 && <4.17)
>> [__1] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0 (has the same
>> characteristics that caused the previous version to fail: excluded by
>> constraint '>=4.5 && <4.17' from 'nofib')
>> [__1] rejecting: base-4.16.4.0, base-4.16.3.0, base-4.16.2.0,
>> base-4.16.1.0,
>> base-4.16.0.0, base-4.15.1.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
>> base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
>> base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
>> base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
>> base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
>> base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
>> base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
>> base-3.0.3.1 (constraint from non-upgradeable package requires installed
>> instance)
>> [__1] fail (backjumping, conflict set: base, nofib)
>> After searching the rest of the dependency tree exhaustively, these were
>> the
>> goals I've had most trouble fulfilling: base, nofib
>>
>> make: *** [/home/simonpj/code/Makefile-spj:39: nofib] Error 1
>>
>> ___
>> ghc-devs mailing list
>> ghc-devs@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>
>>
>>
>
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


RE: [External] Re: Usage of Template Haskell quotes in GHC source tree vs. usage of GHC as a library

2023-07-12 Thread Erdi, Gergo via ghc-devs
PUBLIC

https://gitlab.haskell.org/ghc/ghc/-/issues/23647

From: ghc-devs  On Behalf Of Simon Peyton Jones
Sent: Wednesday, July 12, 2023 7:25 PM
To: Gergő Érdi 
Cc: GHC Devs 
Subject: [External] Re: Usage of Template Haskell quotes in GHC source tree vs. 
usage of GHC as a library

ATTENTION: This email came from an external source. Do not open attachments or 
click on links from unknown senders or unexpected emails. Always report 
suspicious emails using the Report As Phishing button in Outlook to protect the 
Bank and our clients.

Gergo

I'm not close enough to this to have a well-formed opinion, but it looks like a 
good question to me, esp if the new dependence on TH is optional.

Would you like to transfer the text into a GHC ticket?

Simon

On Wed, 12 Jul 2023 at 04:40, Gergő Érdi mailto:ge...@erdi.hu>> 
wrote:
Hi,

A recent commit 983ce55815f2dd57f84ee86eee97febf7d80b470 starts using 
TemplateHaskellQuotes in the GHC codebase. It seems this is at odds with using 
GHC as a library, a la ghc-lib.

The `ghc-lib` approach is to basically take the module hierarchy from the 
`compiler/` subtree, and compile it as a completely vanilla Haskell library, 
with no direct attachment to the host GHC version. This enables using e.g. GHC 
9.4 to compile a program using the GHC 9.6 API, and so on. In particular, it 
also makes it very easy to apply patches to the version of GHC used as a 
library, since in this setup it doesn't need to be able to bootstrap.

So what is the problem with using TemplateHaskellQuotes? The problem is the 
dependency on the template-haskell package. When a module inside 
GHC-as-a-library containing TH quotes is compiled, the quotes are translated 
into applications of the constructors defined by the *host* GHC's TH package. 
But because GHC is tightly coupled to the TH support library, GHC-as-a-library 
needs to ship with its own internal version of the library. So the code that 
tries to process the results of these quotes is using the *target* GHC's TH 
definitions. And that leads to a conflict: code like

leftName :: Namel
leftName = 'Left

is now a type mismatch between the type of `'Left` being 
template-haskell-2.19.0.0:Language.Haskell.TH.Syntax.Name
 (example when using GHC 9.4.5 as the host) and the type of `leftName` being 
ghc-lib-9.9.20230712:Language.Haskell.TH.Syntax.Name
 (example when the target version is built from recent `master`).

Currently, `ghc-lib-gen` has a pre-processing step on the GHC source tree that 
replaces these quotations with applications containing direct references to the 
target TH constructors: 
https://github.com/digital-asset/ghc-lib/blob/ab01fb2b4d1e3a9338390e9c10ccd769bbf37aeb/ghc-lib-gen/src/Ghclibgen.hs#L419-L467
 but I am worried that this is very fragile.

So any ideas on how to tackle this situation better?

Thanks,
Gergo
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

This email and any attachments are confidential and may also be privileged. If 
you are not the intended recipient, please delete all copies and notify the 
sender immediately. You may wish to refer to the incorporation details of 
Standard Chartered PLC, Standard Chartered Bank and their subsidiaries at 
https: //www.sc.com/en/our-locations

Where you have a Financial Markets relationship with Standard Chartered PLC, 
Standard Chartered Bank and their subsidiaries (the "Group"), information on 
the regulatory standards we adhere to and how it may affect you can be found in 
our Regulatory Compliance Statement at https: //www.sc.com/rcs/ and Regulatory 
Compliance Disclosures at http: //www.sc.com/rcs/fm

Insofar as this communication is not sent by the Global Research team and 
contains any market commentary, the market commentary has been prepared by the 
sales and/or trading desk of Standard Chartered Bank or its affiliate. It is 
not and does not constitute research material, independent research, 
recommendation or financial advice. Any market commentary is for information 
purpose only and shall not be relied on for any other purpose and is subject to 
the relevant disclaimers available at https: 
//www.sc.com/en/regulatory-disclosures/#market-disclaimer.

Insofar