shinjixxxxx / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

calcdeps.py: Includes same dependency multiple times #343

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
file toy.zip contains the source which can be used to repro

Command:
  python <calcdeps.py>
    -i <folder containing contents of toy.zip>
    -p <closure-library/closure>
    -o list

The complete repo of what i am actually doing is
1. run calcdeps.py with -o script option
2. run output of above command through the closure compiler with the following 
options
'--compilation_level=SIMPLE_OPTIMIZATIONS'
'--jscomp_warning=checkTypes'
'--summary_detail_level=3'
'--generate_exports=0'
'--process_closure_primitives=1'
'--js=D:\workspace\we\umm/build/bin/closure_toy.debug.js'
'--js_output_file=D:\workspace\we\umm/build/bin/closure_toy.min.js'

What is the expected output? What do you see instead?
## Observed
A dependency may be emitted twice which when used with -o script option then 
compiled yields 1539: ERROR - namespace "toy.C2" cannot be provided twice

calcdeps.py: Scanning files...
calcdeps.py: Finding Closure dependencies...
D:\Archive\Programming\WebProjects\TOOLS\closure-library\closure\goog\base.js
D:\workspace\we\umm\js\lib\toy\C2.js
D:\workspace\we\umm\js\lib\toy\C1.js
D:\workspace\we\umm\js\lib\toy\C2.js <****** ISSUE
D:\workspace\we\umm\js\lib\toy\C3.js

## Expected
D:\Archive\Programming\WebProjects\TOOLS\closure-library\closure\goog\base.js
D:\workspace\we\umm\js\lib\toy\C2.js
D:\workspace\we\umm\js\lib\toy\C1.js
D:\workspace\we\umm\js\lib\toy\C3.js

What version of the product are you using? On what operating system?
Product version: unknown, latest available from 
http://code.google.com/closure/library/ as of Jul 2 2011
Windows Vista
Python 2.6.5

Please provide any additional information below.
I have made a fix locally (attached)
Within the function CalculateDependencies

change line
    result_list.append(input_file)

to
    if not input_file in result_list:
      result_list.append(input_file)

Original issue reported on code.google.com by ross.kor...@gmail.com on 3 Jul 2011 at 5:46

Attachments:

GoogleCodeExporter commented 8 years ago
We cannot take the patch without CLA being signed.  See contributor wiki page.. 
 We can write our own patch, however.  Assigned.

Original comment by nn...@google.com on 9 May 2012 at 10:32