New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 628971 link

Starred by 5 users

Issue metadata

Status: WontFix
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Closure compiler for WebUI on Windows

Project Member Reported by michae...@chromium.org, Jul 18 2016

Issue description

Using the closure compiler for WebUI on Windows doesn't seem to be supported. Since it's Java, I don't see why it shouldn't be.

The docs say "You can locally test that your code compiles on Linux or Mac." (https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md)

Running on Windows results in a bunch of errors: first, the good old "The command line is too long." for
    tools\gyp\gyp --no-circular-check third_party\closure_compiler\compiled_resources.gyp

For compiled_resources2.gyp, the GYP call succeeds, but ninja fails:

d:\dev\projects\chromium_google\c\src>ninja -C out/Default
ninja: Entering directory `out/Default'
[1/465] ACTION Compiling ui\webui\resources\js\event_tracker.js
FAILED: gen/closure/ui/webui/resources/js/event_tracker.js
C:\Python27\python.exe gyp-win-tool action-wrapper environment.x86 event_tracker_target_compile_js_ff8d678e94f28883c6390f989f569e7c..rsp
'"..\..\ui\webui\resources\js\setup_env.bat"' is not recognized as an internal or external command,
operable program or batch file.
[2/465] ACTION Compiling ui\webui\resources\js\assert.js
FAILED: gen/closure/ui/webui/resources/js/assert.js
C:\Python27\python.exe gyp-win-tool action-wrapper environment.x86 assert_target_compile_js_95552663774d0429883e333ec21f6d29..rsp
'"..\..\ui\webui\resources\js\setup_env.bat"' is not recognized as an internal or external command,
operable program or batch file.
[3/465] ACTION Compiling ui\webui\resources\js\parse_html_subset.js
FAILED: gen/closure/ui/webui/resources/js/parse_html_subset.js
C:\Python27\python.exe gyp-win-tool action-wrapper environment.x86 parse_html_subset_target_compile_js_7dd83cc5c793aad8ddd1a5a76e07d574..rsp
'"..\..\ui\webui\resources\js\setup_env.bat"' is not recognized as an internal or external command,
operable program or batch file.
[4/465] ACTION Compiling ui\webui\resources\js\action_link.js
FAILED: gen/closure/ui/webui/resources/js/action_link.js
C:\Python27\python.exe gyp-win-tool action-wrapper environment.x86 action_link_target_compile_js_3a3261bd59e4e79ef6e898827b18f942..rsp
'"..\..\ui\webui\resources\js\setup_env.bat"' is not recognized as an internal or external command,
operable program or batch file.
[5/465] ACTION Compiling ui\webui\reso...selector\cr_profile_avatar_selector.js
FAILED: gen/closure/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js
C:\Python27\python.exe gyp-win-tool action-wrapper environment.x86 cr_profile_avatar_selector_target_compile_js_883e5cab2f7dad0f6ee2f9d485dfd4cd..rsp
'"..\..\ui\webui\resources\cr_elements\cr_profile_avatar_selector\setup_env.bat"' is not recognized as an internal or external command,
operable program or batch file.
[6/465] ACTION Compiling ui\webui\reso...s\policy\cr_policy_network_behavior.js
FAILED: gen/closure/ui/webui/resources/cr_elements/policy/cr_policy_network_behavior.js
C:\Python27\python.exe gyp-win-tool action-wrapper environment.x86 cr_policy_network_behavior_target_compile_js_fe6f20e6dd0d28f885d0f6b805520317..rsp
'"..\..\ui\webui\resources\cr_elements\policy\setup_env.bat"' is not recognized as an internal or external command,
operable program or batch file.
ninja: build stopped: subcommand failed.
 
Cc: groby@chromium.org thakis@chromium.org dpa...@chromium.org
Components: -Tools Build
Cc: dpranke@chromium.org
 Issue 805001  has been merged into this issue.

Comment 3 by dpa...@chromium.org, Jan 23 2018

Cc: calamity@chromium.org
Linking to my response on the related chromium-dev thread here, to avoid duplicating. See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/8HPIeXIq8v8/_3C3TMm7BAAJ about previous attempts with NodeJS compiler and more.
Owner: dpranke@chromium.org
Status: Assigned (was: Untriaged)
I'm taking ownership of this for now, to ensure we can come to a decision (that isn't platform-specific).
Cc: jrw@google.com
jrw@, does dpapad's suggested tooling work for you?

Comment 6 by jrw@google.com, Jan 23 2018

It looks like neither Uglify nor the Node version of JSCompiler support a specific feature I need, which is to produce multiple JS output files from a larger set of JS input files, so I think the best solution for now is for me to roll my own script.  It's not as ugly a solution as I had originally thought, because I already have a list of files to concatenate in dependency order.
FYI, long-term I have yearnings to investigate bringing typescript into Chrome. I'm guessing we'll be living with some form of Closure compiler for quite a while though, since it won't be easy to migrate old codebases over.

Comment 8 by dpa...@chromium.org, Jan 24 2018

@calamity: Moreover than just the difficulty of migrating old codebases, Closure compiler includes a Chrome-specific pass, which was written to make the compiler understand things like cr.define, see [1].

Having said that, if we can make it such that new code (with no dependencies to any cr.define module, like cr.js), can use TS, and build within Chromium toolchain, and be served via WebUI mechanism, that would be already a huge leap forward. The key components already exist (meaning third_party/node), so from a technical perspective there are no blockers on trying a vanilla chrome://hello-ts.

[1] https://github.com/google/closure-compiler/blob/8fc82299c45b0a33f19834222acda4850fd77bc0/src/com/google/javascript/jscomp/ChromePass.java
Status: WontFix (was: Assigned)
I think we've reached the conclusion that we don't need Java at the moment, and we'll make do with a combination of the node version of JSCOmpiler and an additional script.

Sign in to add a comment