Skip to content

recompile node-browserchannel with advanced optimizations #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wenzowski opened this issue Feb 19, 2014 · 6 comments
Closed

recompile node-browserchannel with advanced optimizations #34

wenzowski opened this issue Feb 19, 2014 · 6 comments

Comments

@wenzowski
Copy link
Collaborator

New closure-library optimizations appear to be causing issues with node-bcsocket. Falling back to simple optimizations results in a green test suite but is unacceptably large.

Don't know the closure-library svn tag intended to be used for node-browserchannel compilation, assuming there is/was a published tag at all.

Following node-browserchannel instructions, the patch wenzowski/closure-library@6181ead appears (I think?) to have applied cleanly to latest closure-library wenzowski/closure-library@f26bb31

@josephg
Copy link
Owner

josephg commented Feb 19, 2014

Fascinating. I wonder if changes in the compiler or the closure library have broken things. And is it the patch or the bcsocket code which breaks it? I last updated the patch at closure-library r2519 - although I may well have last compiled using a more recent version of the closure-library.

If its the patch, it simply fixes some small problems where manually closing connections can leave dangling requests. The requests aren't retried anyway, so mostly its just a problem for nodejs-based clients. I'll dig into it.

@wenzowski
Copy link
Collaborator Author

Same results compiled with patch and without.

@josephg
Copy link
Owner

josephg commented Feb 19, 2014

Alright - its either a change in the latest closure compiler or closure code. I recompiled using the latest of both a few months ago and it worked fine. I'll play with it....

@josephg
Copy link
Owner

josephg commented Feb 20, 2014

-> Had a play with this. Turns out its a change in the closure library. r151cc367517746ec52575 from november works, and HEAD doesn't work. The bug is related to eventtarget.js:219:

/** @override */
goog.events.EventTarget.prototype.listen = function(
    type, listener, opt_useCapture, opt_listenerScope) {
  this.assertInitialized_();
  return this.eventTargetListeners_.add(
      String(type), listener, false /* callOnce */, opt_useCapture,
      opt_listenerScope);
};

... The call to add() doesn't get minified (maybe because type annotations are missing?), and there's no add property on whatever object its calling on. There might be more information in the stack trace. For now I'm going to leave this issue open until someone has time to track it down.

Git bisect would do it.

@josephg
Copy link
Owner

josephg commented Feb 20, 2014

sephsmac:closure-library josephg$ git bisect bad
83c6a0b97bd16e23a8578ddb1a53d8e1a21fb4cf is the first bad commit
commit 83c6a0b97bd16e23a8578ddb1a53d8e1a21fb4cf
Author: Nathan Naze <[email protected]>
Date:   Tue Feb 18 14:39:37 2014 -0500

    Migrate Closure from goog.base to static base class methods.

    Refactoring: java/com/google/javascript/refactoring/examples:googbaseA
    Note: this refactoring currently requires a patch to the compiler so that goog.base isn't rewritten prior to AST inspection.

.. This is from yesterday. The note is quite useful - they probably just haven't re-released the closure compiler since then.

@wenzowski
Copy link
Collaborator Author

The last known working commit of closure-compiler is therefore df47692b1bacd494548a3b00b150d9f6a428d58a.

Note to self: remember, if java -version is not ~1.7 build fails and cryptic stack traces abound.

Closing.

wenzowski pushed a commit to wenzowski/node-browserchannel that referenced this issue Feb 20, 2014
Compiled Using
--------------
- [Closure Library] `df47692b1bac`, included
  closure-terminate-fixes-r2519.patch applied
- [Closure Compiler] `v20140110`

Notes
-----
A newer version of closure-library has been committed,
however closure-library#83c6a0b97bd1 causes josephg#34

[Closure Library]: https://code.google.com/p/closure-library/source/detail?r=df47692b1bacd494548a3b00b150d9f6a428d58a
[Closure Compiler]: http://dl.google.com/closure-compiler/compiler-20140110.tar.gz
wenzowski pushed a commit to wenzowski/node-browserchannel that referenced this issue Feb 20, 2014
Compiled Using
--------------
- [Closure Library] `df47692b1bac` with included closure-terminate-fixes-r2519.patch applied
- [Closure Compiler] `v20140110`

Notes
-----
A newer closure-library exists but causes josephg#34 (closure-library#83c6a0b97bd1)

[Closure Library]: https://code.google.com/p/closure-library/source/detail?r=df47692b1bacd494548a3b00b150d9f6a428d58a
[Closure Compiler]: http://dl.google.com/closure-compiler/compiler-20140110.tar.gz
wenzowski pushed a commit to wenzowski/node-browserchannel that referenced this issue Feb 20, 2014
Compiled Using
--------------
- [Closure Library] `df47692b1bac` with included closure-terminate-fixes-r2519.patch applied
- [Closure Compiler] `v20140110`

Notes
-----
A newer closure-library exists but causes josephg#34 (closure-library#83c6a0b97bd1)

[Closure Library]: https://code.google.com/p/closure-library/source/detail?r=df47692b1bacd494548a3b00b150d9f6a428d58a
[Closure Compiler]: http://dl.google.com/closure-compiler/compiler-20140110.tar.gz
wenzowski pushed a commit to wenzowski/node-browserchannel that referenced this issue Feb 20, 2014
Compiled Using
--------------
- [Closure Library] `df47692b1bac` with included closure-terminate-fixes-r2519.patch applied
- [Closure Compiler] `v20140110`

Notes
-----
A newer closure-library exists but causes josephg#34 (closure-library#83c6a0b97bd1)

[Closure Library]: https://code.google.com/p/closure-library/source/detail?r=df47692b1bacd494548a3b00b150d9f6a428d58a
[Closure Compiler]: http://dl.google.com/closure-compiler/compiler-20140110.tar.gz
wenzowski pushed a commit that referenced this issue Feb 20, 2014
Compiled Using
--------------
- [Closure Library] `df47692b1bac` with included
closure-terminate-fixes-r2519.patch applied
- [Closure Compiler] `v20140110`

Notes
-----
Previous build failed due to use of Java ~1.6.
Java ~1.7 is a hard requirement and should be added to the docs.

A newer closure-library exists but causes #34
(closure-library#83c6a0b97bd1)

[Closure Library]:
https://code.google.com/p/closure-library/source/detail?r=df47692b1bacd494548a3b00b150d9f6a428d58a
[Closure Compiler]:
http://dl.google.com/closure-compiler/compiler-20140110.tar.gz
wenzowski pushed a commit that referenced this issue Feb 20, 2014
wenzowski pushed a commit that referenced this issue Feb 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants