Compiler hanging on v11.4 with uncurried enabled

Hello there !

I’m updating our modules to the latest ReScript version (from 11.0.0 curried to 11.1.4 uncurried) and I noticed that API module won’t compile as it hang on some files and my processor (Macbook pro M1) stays at 80% of usage.
Do you have ever noticed something this ?

I’m thinking if it’s a performance issue, maybe it’s because of our heavy usage of ppx-spice ?

I haven’t heard of similar experiences, could you maybe try to come up with a minimal repro?

Could be related to the usage of PPXes.

Do you use the built-in rescript builder or rewatch?

We’re using the built-in rescript builder. I checked the amount of @spice and found out around 2600 :sweat_smile: (of course it includes variant aliasing and not just type declaration)

I’m not sure how to make a repro but I’ll try to reduce the amount of compiled files to reduce the scope and iterate over it

you could try with rewatch to see if it’s the builder or the compiler.

Did you try using older versions of the compiler?

I tried rewatch and have the same issue, sometimes it can parse every files but hang on the next step or it hangs during the parsing.

I tried the 11.1.0 without success, and I have a strange issue with 11.0.0 and the uncurried mode with rescript-react (latest version)

PS: the rewatch compile time is impressive, the first build of our toolkit module is at least 2x faster !

3 Likes

Yeah, rewatch is very fast!

Si there’s no error with 11.1.4? It just hangs? Weird. Could you try with the latest v12 alpha maybe?

A little delay, I’m trying to upgrade to v12 but after updating this package, I’m struggling with an other error : DckRescriptPromise is compiled in script mode while its dependent is not. I’ve checked Github but I don’t have much more informations about this.

hmm this seems to be a not very descriptive error message caused by an invalid package name. Are you sure you didn’t update the name or namespace during the upgrade?

I had to turn on the namespace because of module name conflict.
It seems that my first attempt was incorrect to overload the Promise module of the core lib. I was doing this :

module Promise = {
  include RescriptPromise
}

But by using the bsc-flags : -open RescriptPromise it seems okay !

I pursue the update and keep you up to date :slight_smile:

1 Like

Unfortunately, I have the same behavior with the latest alpha version (12) with rewatch or bsc.
The process still seems blocked but doesn’t use much CPU. By deleting.

By removing a lot a code, I finally got it running but even with the removal it takes some times to compiles

 31 files changed, 14 insertions(+), 20368 deletions(-)

did you try removing spice?

I just tried and indeed it’s related, I have all the errors (related to the missing ppx)

Any luck? Was the issue happened during migration to v12-alpah? Polyvariant issue with rescript 12 alpha · Issue #90 · green-labs/ppx_spice · GitHub

No sadly I have the same behavior on v11.4 and 12 alpha.

Can you identify which part of the source code is causing the hanging? If it’s reproducible, I can look at it together with you. If you’re okay with it, please invite me as a collaborator to the repo so we can find the cause together. Let me know if you need help.

1 Like