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

Issue 729191 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

vulcanize_gn.py: Don't write twice to output files

Project Member Reported by dpa...@chromium.org, Jun 2 2017

Issue description

When a file is declared as an output file (see example [1]) of a GN rule, its timestamp determines whether the rule needs to re-run or not. Writing twice to the same file confuses the build system. Concrete example

1) Add an intentional syntax error after a JS file is processed by crisper, but before passed to Uglify (specifically after line at [2])
2) Execute the following command from within your out/<...> folder
ninja -d explain chrome/browser/resources/settings:vulcanize_app
3) Observer syntax error thrown in the console
4) Re-run same command

Expected: vulcanize_gn.py is re-executed.
Actual: vulcanize_gn.py is not executed, because the build system things that all outputs exist and they have a later timestamp than previous invocation of the same target.

[1] https://cs.chromium.org/chromium/src/chrome/browser/resources/settings/BUILD.gn?l=16
[2] https://cs.chromium.org/chromium/src/chrome/browser/resources/vulcanize_gn.py?l=165
 
Status: Started (was: Available)
Will give it a shot to fix. At first glance the fix seems trivial (make crisper output to a temporary file, make uglify output to the final file, the one that GN cares about).
Owner: dpa...@chromium.org
Candidate fix at https://codereview.chromium.org/2915393002.
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4309919f5a61e0701e073f21ed312e4d14cfc322

commit 4309919f5a61e0701e073f21ed312e4d14cfc322
Author: dpapad <dpapad@chromium.org>
Date: Tue Jun 06 20:33:48 2017

vulcanize_gn.py: Stop writing twice to the declared GN output file.

This confuses the build system when an error happens after the 1st write
and before the script completely finishes.

BUG= 729191 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2915393002
Cr-Commit-Position: refs/heads/master@{#477390}

[modify] https://crrev.com/4309919f5a61e0701e073f21ed312e4d14cfc322/chrome/browser/resources/vulcanize_gn.py
[modify] https://crrev.com/4309919f5a61e0701e073f21ed312e4d14cfc322/chrome/browser/resources/vulcanize_gn_test.py

Status: Fixed (was: Started)

Sign in to add a comment