-
Notifications
You must be signed in to change notification settings - Fork 685
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
Fix native Closure Compiler to work. #995
Conversation
emsdk.py
Outdated
closure_compiler_native = 'google-closure-compiler-windows' | ||
|
||
if closure_compiler_native: | ||
closure_compiler_native += '@20220104.0.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this need updating every time we do an npm update on the emscripten-side? (iirc we have updated several times over the years so any one value here might be work).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it does, and that is quite unfortunate. I wrote a little bit about that earlier in #802 (comment) . I don't see another way but to keep these in sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe do something like this:
closure_version = json.load('package.json')['dependencies']['google-closure-compiler']
# Manually install the appropriate native Closure Compiler package | ||
# This is currently needed because npm ci will install the packages | ||
# for Closure for all platforms, adding 180MB to the download size | ||
# There are two problems here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since npm ci
is actually run above, perhaps mention either up there, or here in this comment that the above command deliberately excludes the native versions of closure compiler by the use of the --no-optional
flag.
emsdk.py
Outdated
closure_compiler_native = 'google-closure-compiler-windows' | ||
|
||
if closure_compiler_native: | ||
closure_compiler_native += '@20220104.0.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe do something like this:
closure_version = json.load('package.json')['dependencies']['google-closure-compiler']
That is a great idea! I'll look into that a bit later. |
… was a great mistake, as it caused Emscripten to silently fall back to Java version of the Closure Compiler. After this PR, Closure Compiler will work on user platforms that do not have Java installed. Also forcibly remove Java version of Closure Compiler on systems where installing the native version succeeds, in order to save on code size.
70b9341
to
fc92dbd
Compare
fc92dbd
to
09cc9cb
Compare
… the emscripten branch in package.json
Fix native Closure Compiler to work.
Reverts my earlier PR #803 which was a great mistake, as it caused Emscripten to silently fall back to Java version of the Closure Compiler.
After this PR, Closure Compiler will work on user platforms that do not have Java installed.
Also forcibly remove Java version of Closure Compiler on systems where installing the native version succeeds, in order to save on disk size.