Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

classic Classic list List threaded Threaded
8 messages Options
rhp
Reply | Threaded
Open this post in threaded view
|

Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

rhp
Hi all,

We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:

error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: lodash/lodash; exception: JavaException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
Please report this problem.
Unexpected variable Object
  Node(NAME Object): lodash.js.uncompressed.js:263:66
  var freeWindow = objectTypes[typeof window] && window && window.Object && window;
  Parent(AND): lodash.js.uncompressed.js:263:19
  var freeWindow = objectTypes[typeof window] && window && window.Object && window;

Our build profile looks like this:

var profile = {
    releaseDir: '../out',
    optimize: "closure",
    layerOptimize: 'closure',
    packages: [
      { name: "dojo", location: "./dojotoolkit/dojo", destLocation: "./dojotoolkit/dojo" },
      { name: "lodash", location: "./lodash", destLocation: "./lodash", main: "lodash.min" }
    ]
  }
};

The error occurs when using the java (1.8.0) and node (4.4.7) version of the build.
Any ideas on how to get this fixed (other than updating lodash to a newer version).

Kind regards, Ronald

________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

dylanks
The main difference between 1.11.x and 1.12.x with regards to builds is
that we updated the version of Closure Compiler to something much newer,
which also has support for ES6 features. There have been a couple of
other reports that this update has not gone as smoothly as we had hoped,
so there is definitely some work to be done here to figure out what is
going on.

That work hasn't happened yet as we've had our heads down on the Dojo 2
beta efforts, so we'd appreciate the help in tracking this down if you
have time.

Regards,
-Dylan

on 4/11/17, 03:12 (GMT-07:00) Pijnacker, Ronald said the following:

> Hi all,
>
> We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:
>
> error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: lodash/lodash; exception: JavaException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
> Please report this problem.
> Unexpected variable Object
>   Node(NAME Object): lodash.js.uncompressed.js:263:66
>   var freeWindow = objectTypes[typeof window] && window && window.Object && window;
>   Parent(AND): lodash.js.uncompressed.js:263:19
>   var freeWindow = objectTypes[typeof window] && window && window.Object && window;
>
> Our build profile looks like this:
>
> var profile = {
>     releaseDir: '../out',
>     optimize: "closure",
>     layerOptimize: 'closure',
>     packages: [
>       { name: "dojo", location: "./dojotoolkit/dojo", destLocation: "./dojotoolkit/dojo" },
>       { name: "lodash", location: "./lodash", destLocation: "./lodash", main: "lodash.min" }
>     ]
>   }
> };
>
> The error occurs when using the java (1.8.0) and node (4.4.7) version of the build.
> Any ideas on how to get this fixed (other than updating lodash to a newer version).
>
> Kind regards, Ronald
>
> ________________________________
> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/
rhp
Reply | Threaded
Open this post in threaded view
|

Re: Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

rhp
Hi Dylan,

Thanks for responding so swiftly.
I'm not really sure how to continue from here. The error seems to be with lodash's use of Object in the statement
     var freeWindow = objectTypes[typeof window] && window && window.Object && ...

Why the closure compiler is unhappy with that... I would not know.
Can you give some pointers where we could start digging?

Thanks, Ronald

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Dylan Schiemann
Sent: 11 April, 2017 13:55
To: [hidden email]
Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

The main difference between 1.11.x and 1.12.x with regards to builds is that we updated the version of Closure Compiler to something much newer, which also has support for ES6 features. There have been a couple of other reports that this update has not gone as smoothly as we had hoped, so there is definitely some work to be done here to figure out what is going on.

That work hasn't happened yet as we've had our heads down on the Dojo 2 beta efforts, so we'd appreciate the help in tracking this down if you have time.

Regards,
-Dylan

on 4/11/17, 03:12 (GMT-07:00) Pijnacker, Ronald said the following:

> Hi all,
>
> We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:
>
> error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: lodash/lodash; exception: JavaException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
> Please report this problem.
> Unexpected variable Object
>   Node(NAME Object): lodash.js.uncompressed.js:263:66
>   var freeWindow = objectTypes[typeof window] && window && window.Object && window;
>   Parent(AND): lodash.js.uncompressed.js:263:19
>   var freeWindow = objectTypes[typeof window] && window &&
> window.Object && window;
>
> Our build profile looks like this:
>
> var profile = {
>     releaseDir: '../out',
>     optimize: "closure",
>     layerOptimize: 'closure',
>     packages: [
>       { name: "dojo", location: "./dojotoolkit/dojo", destLocation: "./dojotoolkit/dojo" },
>       { name: "lodash", location: "./lodash", destLocation: "./lodash", main: "lodash.min" }
>     ]
>   }
> };
>
> The error occurs when using the java (1.8.0) and node (4.4.7) version of the build.
> Any ideas on how to get this fixed (other than updating lodash to a newer version).
>
> Kind regards, Ronald
>
> ________________________________
> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

dylanks
Hi Ronald,

The first thing I would try is to see if Closure itself can optimize
lodash without issue. Basically try to decouple whether it is the Dojo
build step that's having issues, or if it's Closure. Or perhaps dig
through lo-dash's issues with Closure Compiler at
https://github.com/lodash/lodash/issues?utf8=%E2%9C%93&q=is%3Aissue%20closure
and see if anything stands out? From what I can tell Closure Compiler
directly works fine with lodash.

So assuming that is the case, I'd probably start debugging our usage of
Closure and see where things fall apart. Basically just debugging it
until you find what the exact cause is. Experiment with the settings
we're passing to Closure, see if we're doing anything wrong or outdated,
etc.

Regards,
-Dylan

on 4/11/17, 08:05 (GMT-07:00) Pijnacker, Ronald said the following:

> Hi Dylan,
>
> Thanks for responding so swiftly.
> I'm not really sure how to continue from here. The error seems to be with lodash's use of Object in the statement
>      var freeWindow = objectTypes[typeof window] && window && window.Object && ...
>
> Why the closure compiler is unhappy with that... I would not know.
> Can you give some pointers where we could start digging?
>
> Thanks, Ronald
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Dylan Schiemann
> Sent: 11 April, 2017 13:55
> To: [hidden email]
> Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)
>
> The main difference between 1.11.x and 1.12.x with regards to builds is that we updated the version of Closure Compiler to something much newer, which also has support for ES6 features. There have been a couple of other reports that this update has not gone as smoothly as we had hoped, so there is definitely some work to be done here to figure out what is going on.
>
> That work hasn't happened yet as we've had our heads down on the Dojo 2 beta efforts, so we'd appreciate the help in tracking this down if you have time.
>
> Regards,
> -Dylan
>
> on 4/11/17, 03:12 (GMT-07:00) Pijnacker, Ronald said the following:
>> Hi all,
>>
>> We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:
>>
>> error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: lodash/lodash; exception: JavaException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
>> Please report this problem.
>> Unexpected variable Object
>>   Node(NAME Object): lodash.js.uncompressed.js:263:66
>>   var freeWindow = objectTypes[typeof window] && window && window.Object && window;
>>   Parent(AND): lodash.js.uncompressed.js:263:19
>>   var freeWindow = objectTypes[typeof window] && window &&
>> window.Object && window;
>>
>> Our build profile looks like this:
>>
>> var profile = {
>>     releaseDir: '../out',
>>     optimize: "closure",
>>     layerOptimize: 'closure',
>>     packages: [
>>       { name: "dojo", location: "./dojotoolkit/dojo", destLocation: "./dojotoolkit/dojo" },
>>       { name: "lodash", location: "./lodash", destLocation: "./lodash", main: "lodash.min" }
>>     ]
>>   }
>> };
>>
>> The error occurs when using the java (1.8.0) and node (4.4.7) version of the build.
>> Any ideas on how to get this fixed (other than updating lodash to a newer version).
>>
>> Kind regards, Ronald
>>
>> ________________________________
>> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
> --
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/
rhp
Reply | Threaded
Open this post in threaded view
|

Re: Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

rhp
Hi Dylan,

After fiddling around with Closure for a while my conclusions so far are:

1. using Closure directly to build lodash/lodash.js works without problems, with any setting of "--compilation_level". (I did have to pass an externs file containing declarations of "exports", "module", "global" and "define".)

2. toggling the "foldConstants" option off makes a difference in the dojo version of the build. When it is disabled, the build succeeds, when it is enabled the build fails with errors about the unknown variable Object. It does not matter whether this is with optimization level simple or advanced. I used a hacked version of optimizeRunner.js to test all Compiler Options set by the simple level. Only the foldConstants option makes the difference.

So it looks like something in the way dojo uses the compiler triggers this error, but I have not been able to pin-point the exact cause (since "foldConstants" is enabled in (1.) too).
It does not look very smart to me to disable foldConstants and looking at the closure sources this is considered one of the "safe optimizations".

Do you have any suggestions how to proceed?

Kind regards, Ronald

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Dylan Schiemann
Sent: 11 April, 2017 17:24
To: [hidden email]
Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

Hi Ronald,

The first thing I would try is to see if Closure itself can optimize lodash without issue. Basically try to decouple whether it is the Dojo build step that's having issues, or if it's Closure. Or perhaps dig through lo-dash's issues with Closure Compiler at https://github.com/lodash/lodash/issues?utf8=%E2%9C%93&q=is%3Aissue%20closure
and see if anything stands out? From what I can tell Closure Compiler directly works fine with lodash.

So assuming that is the case, I'd probably start debugging our usage of Closure and see where things fall apart. Basically just debugging it until you find what the exact cause is. Experiment with the settings we're passing to Closure, see if we're doing anything wrong or outdated, etc.

Regards,
-Dylan

on 4/11/17, 08:05 (GMT-07:00) Pijnacker, Ronald said the following:

> Hi Dylan,
>
> Thanks for responding so swiftly.
> I'm not really sure how to continue from here. The error seems to be with lodash's use of Object in the statement
>      var freeWindow = objectTypes[typeof window] && window && window.Object && ...
>
> Why the closure compiler is unhappy with that... I would not know.
> Can you give some pointers where we could start digging?
>
> Thanks, Ronald
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Dylan
> Schiemann
> Sent: 11 April, 2017 13:55
> To: [hidden email]
> Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error
> while building lodash (v 3.10.1)
>
> The main difference between 1.11.x and 1.12.x with regards to builds is that we updated the version of Closure Compiler to something much newer, which also has support for ES6 features. There have been a couple of other reports that this update has not gone as smoothly as we had hoped, so there is definitely some work to be done here to figure out what is going on.
>
> That work hasn't happened yet as we've had our heads down on the Dojo 2 beta efforts, so we'd appreciate the help in tracking this down if you have time.
>
> Regards,
> -Dylan
>
> on 4/11/17, 03:12 (GMT-07:00) Pijnacker, Ronald said the following:
>> Hi all,
>>
>> We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:
>>
>> error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: lodash/lodash; exception: JavaException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
>> Please report this problem.
>> Unexpected variable Object
>>   Node(NAME Object): lodash.js.uncompressed.js:263:66
>>   var freeWindow = objectTypes[typeof window] && window && window.Object && window;
>>   Parent(AND): lodash.js.uncompressed.js:263:19
>>   var freeWindow = objectTypes[typeof window] && window &&
>> window.Object && window;
>>
>> Our build profile looks like this:
>>
>> var profile = {
>>     releaseDir: '../out',
>>     optimize: "closure",
>>     layerOptimize: 'closure',
>>     packages: [
>>       { name: "dojo", location: "./dojotoolkit/dojo", destLocation: "./dojotoolkit/dojo" },
>>       { name: "lodash", location: "./lodash", destLocation: "./lodash", main: "lodash.min" }
>>     ]
>>   }
>> };
>>
>> The error occurs when using the java (1.8.0) and node (4.4.7) version of the build.
>> Any ideas on how to get this fixed (other than updating lodash to a newer version).
>>
>> Kind regards, Ronald
>>
>> ________________________________
>> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
> --
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
>
> [hidden email]
> To unsubscribe, visit:
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
rhp
Reply | Threaded
Open this post in threaded view
|

Re: Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

rhp
Dylan, any thoughts?

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Pijnacker, Ronald
Sent: 14 April, 2017 08:34
To: [hidden email]
Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

Hi Dylan,

After fiddling around with Closure for a while my conclusions so far are:

1. using Closure directly to build lodash/lodash.js works without problems, with any setting of "--compilation_level". (I did have to pass an externs file containing declarations of "exports", "module", "global" and "define".)

2. toggling the "foldConstants" option off makes a difference in the dojo version of the build. When it is disabled, the build succeeds, when it is enabled the build fails with errors about the unknown variable Object. It does not matter whether this is with optimization level simple or advanced. I used a hacked version of optimizeRunner.js to test all Compiler Options set by the simple level. Only the foldConstants option makes the difference.

So it looks like something in the way dojo uses the compiler triggers this error, but I have not been able to pin-point the exact cause (since "foldConstants" is enabled in (1.) too).
It does not look very smart to me to disable foldConstants and looking at the closure sources this is considered one of the "safe optimizations".

Do you have any suggestions how to proceed?

Kind regards, Ronald

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Dylan Schiemann
Sent: 11 April, 2017 17:24
To: [hidden email]
Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

Hi Ronald,

The first thing I would try is to see if Closure itself can optimize lodash without issue. Basically try to decouple whether it is the Dojo build step that's having issues, or if it's Closure. Or perhaps dig through lo-dash's issues with Closure Compiler at https://github.com/lodash/lodash/issues?utf8=%E2%9C%93&q=is%3Aissue%20closure
and see if anything stands out? From what I can tell Closure Compiler directly works fine with lodash.

So assuming that is the case, I'd probably start debugging our usage of Closure and see where things fall apart. Basically just debugging it until you find what the exact cause is. Experiment with the settings we're passing to Closure, see if we're doing anything wrong or outdated, etc.

Regards,
-Dylan

on 4/11/17, 08:05 (GMT-07:00) Pijnacker, Ronald said the following:

> Hi Dylan,
>
> Thanks for responding so swiftly.
> I'm not really sure how to continue from here. The error seems to be with lodash's use of Object in the statement
>      var freeWindow = objectTypes[typeof window] && window && window.Object && ...
>
> Why the closure compiler is unhappy with that... I would not know.
> Can you give some pointers where we could start digging?
>
> Thanks, Ronald
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Dylan
> Schiemann
> Sent: 11 April, 2017 13:55
> To: [hidden email]
> Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error
> while building lodash (v 3.10.1)
>
> The main difference between 1.11.x and 1.12.x with regards to builds is that we updated the version of Closure Compiler to something much newer, which also has support for ES6 features. There have been a couple of other reports that this update has not gone as smoothly as we had hoped, so there is definitely some work to be done here to figure out what is going on.
>
> That work hasn't happened yet as we've had our heads down on the Dojo 2 beta efforts, so we'd appreciate the help in tracking this down if you have time.
>
> Regards,
> -Dylan
>
> on 4/11/17, 03:12 (GMT-07:00) Pijnacker, Ronald said the following:
>> Hi all,
>>
>> We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:
>>
>> error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: lodash/lodash; exception: JavaException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
>> Please report this problem.
>> Unexpected variable Object
>>   Node(NAME Object): lodash.js.uncompressed.js:263:66
>>   var freeWindow = objectTypes[typeof window] && window && window.Object && window;
>>   Parent(AND): lodash.js.uncompressed.js:263:19
>>   var freeWindow = objectTypes[typeof window] && window &&
>> window.Object && window;
>>
>> Our build profile looks like this:
>>
>> var profile = {
>>     releaseDir: '../out',
>>     optimize: "closure",
>>     layerOptimize: 'closure',
>>     packages: [
>>       { name: "dojo", location: "./dojotoolkit/dojo", destLocation: "./dojotoolkit/dojo" },
>>       { name: "lodash", location: "./lodash", destLocation: "./lodash", main: "lodash.min" }
>>     ]
>>   }
>> };
>>
>> The error occurs when using the java (1.8.0) and node (4.4.7) version of the build.
>> Any ideas on how to get this fixed (other than updating lodash to a newer version).
>>
>> Kind regards, Ronald
>>
>> ________________________________
>> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
> --
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
>
> [hidden email]
> To unsubscribe, visit:
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

dylanks
Hi Ronald,

No obvious thoughts other than it not being a trivial fix, though we've
not had much time yet to investigate.

Regards,
-Dylan

on 4/24/17, 05:38 (GMT-07:00) Pijnacker, Ronald said the following:

> Dylan, any thoughts?
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Pijnacker, Ronald
> Sent: 14 April, 2017 08:34
> To: [hidden email]
> Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)
>
> Hi Dylan,
>
> After fiddling around with Closure for a while my conclusions so far are:
>
> 1. using Closure directly to build lodash/lodash.js works without problems, with any setting of "--compilation_level". (I did have to pass an externs file containing declarations of "exports", "module", "global" and "define".)
>
> 2. toggling the "foldConstants" option off makes a difference in the dojo version of the build. When it is disabled, the build succeeds, when it is enabled the build fails with errors about the unknown variable Object. It does not matter whether this is with optimization level simple or advanced. I used a hacked version of optimizeRunner.js to test all Compiler Options set by the simple level. Only the foldConstants option makes the difference.
>
> So it looks like something in the way dojo uses the compiler triggers this error, but I have not been able to pin-point the exact cause (since "foldConstants" is enabled in (1.) too).
> It does not look very smart to me to disable foldConstants and looking at the closure sources this is considered one of the "safe optimizations".
>
> Do you have any suggestions how to proceed?
>
> Kind regards, Ronald
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Dylan Schiemann
> Sent: 11 April, 2017 17:24
> To: [hidden email]
> Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)
>
> Hi Ronald,
>
> The first thing I would try is to see if Closure itself can optimize lodash without issue. Basically try to decouple whether it is the Dojo build step that's having issues, or if it's Closure. Or perhaps dig through lo-dash's issues with Closure Compiler at https://github.com/lodash/lodash/issues?utf8=%E2%9C%93&q=is%3Aissue%20closure
> and see if anything stands out? From what I can tell Closure Compiler directly works fine with lodash.
>
> So assuming that is the case, I'd probably start debugging our usage of Closure and see where things fall apart. Basically just debugging it until you find what the exact cause is. Experiment with the settings we're passing to Closure, see if we're doing anything wrong or outdated, etc.
>
> Regards,
> -Dylan
>
> on 4/11/17, 08:05 (GMT-07:00) Pijnacker, Ronald said the following:
>> Hi Dylan,
>>
>> Thanks for responding so swiftly.
>> I'm not really sure how to continue from here. The error seems to be with lodash's use of Object in the statement
>>      var freeWindow = objectTypes[typeof window] && window && window.Object && ...
>>
>> Why the closure compiler is unhappy with that... I would not know.
>> Can you give some pointers where we could start digging?
>>
>> Thanks, Ronald
>>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of Dylan
>> Schiemann
>> Sent: 11 April, 2017 13:55
>> To: [hidden email]
>> Subject: Re: [Dojo-interest] Updating to 1.12: Internal Compiler error
>> while building lodash (v 3.10.1)
>>
>> The main difference between 1.11.x and 1.12.x with regards to builds is that we updated the version of Closure Compiler to something much newer, which also has support for ES6 features. There have been a couple of other reports that this update has not gone as smoothly as we had hoped, so there is definitely some work to be done here to figure out what is going on.
>>
>> That work hasn't happened yet as we've had our heads down on the Dojo 2 beta efforts, so we'd appreciate the help in tracking this down if you have time.
>>
>> Regards,
>> -Dylan
>>
>> on 4/11/17, 03:12 (GMT-07:00) Pijnacker, Ronald said the following:
>>> Hi all,
>>>
>>> We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:
>>>
>>> error(356) The optimizer threw an exception; the module probably contains syntax errors. module identifier: lodash/lodash; exception: JavaException: java.lang.RuntimeException: INTERNAL COMPILER ERROR.
>>> Please report this problem.
>>> Unexpected variable Object
>>>   Node(NAME Object): lodash.js.uncompressed.js:263:66
>>>   var freeWindow = objectTypes[typeof window] && window && window.Object && window;
>>>   Parent(AND): lodash.js.uncompressed.js:263:19
>>>   var freeWindow = objectTypes[typeof window] && window &&
>>> window.Object && window;
>>>
>>> Our build profile looks like this:
>>>
>>> var profile = {
>>>     releaseDir: '../out',
>>>     optimize: "closure",
>>>     layerOptimize: 'closure',
>>>     packages: [
>>>       { name: "dojo", location: "./dojotoolkit/dojo", destLocation: "./dojotoolkit/dojo" },
>>>       { name: "lodash", location: "./lodash", destLocation: "./lodash", main: "lodash.min" }
>>>     ]
>>>   }
>>> };
>>>
>>> The error occurs when using the java (1.8.0) and node (4.4.7) version of the build.
>>> Any ideas on how to get this fixed (other than updating lodash to a newer version).
>>>
>>> Kind regards, Ronald
>>>
>>> ________________________________
>>> The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
>> --
>> Dojo Toolkit: http://dojotoolkit.org/
>> Tutorials: http://dojotoolkit.org/documentation/
>>
>> [hidden email]
>> To unsubscribe, visit:
>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
> --
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
> --
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/
Reply | Threaded
Open this post in threaded view
|

Re: Updating to 1.12: Internal Compiler error while building lodash (v 3.10.1)

neekfenwick
In reply to this post by rhp
On 11/04/17 17:12, Pijnacker, Ronald wrote:
> Hi all,
>
> We are trying to update our software from dojo 1.11.2 to 1.12.2. One of our dependencies is on lodash (version 3.10.1, taken from https://github.com/lodash/lodash/tree/3.10.1). Compiling with dojo 1.11 was ok, but 1.12 reports Internal Compiler errors:

FYI We also ran into this problem, using a rather old version of
lodash.  Its package.json includes:

   "name": "lodash-amd",
   "version": "3.10.2",
   "description": "Lodash module bundles for AMD.",
...
   "scripts": { "test": "echo \"This package has been discontinued.\"" }

i got around the build error by cloning and branching the repository and
applying this diff:

--- a/modern/main.js
+++ b/modern/main.js
@@ -257,10 +257,10 @@
    var freeGlobal = freeExports && freeModule && typeof global ==
'object' && global && global.Object && global;

    /** Detect free variable `self`. */
-  var freeSelf = objectTypes[typeof self] && self && self.Object && self;
+  var freeSelf = objectTypes[typeof self] && self && /*self.Object &&*/
self;

    /** Detect free variable `window`. */
-  var freeWindow = objectTypes[typeof window] && window &&
window.Object && window;
+  var freeWindow = objectTypes[typeof window] && window &&
/*window.Object && */window;

    /**
     * Used as a reference to the global object.

So basically just removing references to Object.

Since it looks like lodash now supports a completely different packaging
approach and the code I'm using is obsolete, it's not worth more
thought/time.  I do not know if the same build error would come up with
the more modern lodash.  However, I do wish we'd used the more modern
version of the library in the first place. Migrating to the new AMD
approach involves touching every single line of code that uses lodash,
which in our project is very extensive.

Nick
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest