Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Issue 664253005: Simplify and optimize FindCycles (Closed)

Created:
6 years, 2 months ago by cjhopman
Modified:
6 years, 2 months ago
Reviewers:
scottmg
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp.git@master
Visibility:
Public.

Description

Simplify and optimize FindCycles Finding cycles in a directed graph only requires a simple depth first traversal, it does not require checking every path in the graph. This is now fast enough to actually identify and print cycles between targets. Changes the error message slightly for file and target cycles, and adds tests for both those cases. Patch from cjhopman@chromium.org. R=scottmg@chromium.org Committed: https://code.google.com/p/gyp/source/detail?r=1992

Patch Set 1 #

Patch Set 2 : Fix cycle output ordering #

Total comments: 10

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : Add test for file cycle and fix file full cycle case #

Total comments: 2

Patch Set 6 : #

Patch Set 7 : Change tuples to lists in tests #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -48 lines) Patch
M pylib/gyp/input.py View 1 2 3 4 5 3 chunks +38 lines, -31 lines 0 comments Download
M pylib/gyp/input_test.py View 1 2 3 4 5 6 3 chunks +7 lines, -7 lines 0 comments Download
A test/errors/dependency_cycle.gyp View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
A + test/errors/file_cycle0.gyp View 1 2 3 4 1 chunk +6 lines, -5 lines 0 comments Download
A + test/errors/file_cycle1.gyp View 1 2 3 4 1 chunk +2 lines, -5 lines 0 comments Download
M test/errors/gyptest-errors.py View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (1 generated)
cjhopman
scottmg: *
6 years, 2 months ago (2014-10-21 02:40:22 UTC) #2
scottmg
https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py File pylib/gyp/input.py (right): https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py#newcode1802 pylib/gyp/input.py:1802: raise DependencyGraphNode.CircularException, \ Why not CircularException(...)? https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py#newcode1803 pylib/gyp/input.py:1803: 'Cycles ...
6 years, 2 months ago (2014-10-21 02:50:23 UTC) #3
scottmg
https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py File pylib/gyp/input.py (right): https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py#newcode1569 pylib/gyp/input.py:1569: results.append(tuple([child] + path[:path.index(child) + 1])) Does this have to ...
6 years, 2 months ago (2014-10-21 02:53:07 UTC) #4
scottmg
https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py File pylib/gyp/input.py (right): https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py#newcode1572 pylib/gyp/input.py:1572: Visit(child, [child] + path) I'm probably reading this wrong, ...
6 years, 2 months ago (2014-10-21 03:22:42 UTC) #5
cjhopman
https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py File pylib/gyp/input.py (right): https://codereview.chromium.org/664253005/diff/20001/pylib/gyp/input.py#newcode1569 pylib/gyp/input.py:1569: results.append(tuple([child] + path[:path.index(child) + 1])) On 2014/10/21 02:53:07, scottmg ...
6 years, 2 months ago (2014-10-21 18:22:23 UTC) #6
scottmg
Thanks! lgtm https://codereview.chromium.org/664253005/diff/80001/pylib/gyp/input.py File pylib/gyp/input.py (right): https://codereview.chromium.org/664253005/diff/80001/pylib/gyp/input.py#newcode1808 pylib/gyp/input.py:1808: raise DependencyGraphNode.CircularException, \ I meant this \ ...
6 years, 2 months ago (2014-10-21 18:31:47 UTC) #7
cjhopman
Do the gyp try bots not work? Also, I'm not a gyp committer, could you ...
6 years, 2 months ago (2014-10-21 19:52:54 UTC) #8
scottmg
On 2014/10/21 19:52:54, cjhopman wrote: > Do the gyp try bots not work? It's "git ...
6 years, 2 months ago (2014-10-21 20:01:42 UTC) #9
cjhopman
On 2014/10/21 20:01:42, scottmg wrote: > On 2014/10/21 19:52:54, cjhopman wrote: > > Do the ...
6 years, 2 months ago (2014-10-22 23:43:21 UTC) #10
scottmg
6 years, 2 months ago (2014-10-22 23:57:51 UTC) #11
Message was sent while issue was closed.
Committed patchset #8 (id:140001) manually as 1992 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698