git cl upload fails from third_party\pdfium directory |
||
Issue description
When in third_party\pdfium inside of a chromium enlistment "git cl upload" fails, as shown below:
c:\src\analyze_chromium\src\third_party\pdfium>git cl upload
Using 50% similarity for rename/copy detection. Override with --similarity.
Running presubmit upload checks ...
Traceback (most recent call last):
File "C:\src\depot_tools\git_cl.py", line 4620, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\src\depot_tools\git_cl.py", line 4602, in main
return dispatcher.execute(OptionParser(), argv)
File "C:\src\depot_tools\subcommand.py", line 252, in execute
return command(parser, args[1:])
File "C:\src\depot_tools\git_cl.py", line 3311, in CMDupload
change=change)
File "C:\src\depot_tools\git_cl.py", line 1291, in RunHook
rietveld_obj=self._codereview_impl.GetRieveldObjForPresubmit())
File "C:\src\depot_tools\presubmit_support.py", line 1477, in DoPresubmitChecks
results += executer.ExecPresubmitScript(presubmit_script, filename)
File "C:\src\depot_tools\presubmit_support.py", line 1394, in ExecPresubmitScript
result = eval(function_name + '(*__args)', context)
File "<string>", line 1, in <module>
File "<string>", line 93, in CheckChangeOnUpload
File "<string>", line 50, in _CheckUnwantedDependencies
ImportError: No module named checkdeps
The error is identical on Linux and Windows. It start happening sometime within the last month or so.
This is from a branch within the pdfium repo, following the normal procedures, and is a 100% repro. The upload process works from a standalone pdfium repo.
,
Apr 4 2016
I guess the other question is, can we make it pickup checkdeps from the chromium buildtools directory?
,
Apr 4 2016
Windows does have sym links but usually what you want is direction junctions. In fact, webrtc is just moving from sym links to junctions: https://codereview.webrtc.org/1845943004/ Using the chromium buildtools directory would also be a good solution. Avoiding the need for a stand alone pdfium directory would be nice, but failing that just a good error message works fine also.
,
Apr 5 2016
So, it seems not many projects use checkdeps, heh. I see chromium, v8 and us. All three of them import and use it the same way:
# We need to wait until we have an input_api object and use this
# roundabout construct to import checkdeps because this file is
# eval-ed and thus doesn't have __file__.
original_sys_path = sys.path
try:
sys.path = sys.path + [input_api.os_path.join(
input_api.PresubmitLocalPath(), 'buildtools', 'checkdeps')]
import checkdeps
from cpp_checker import CppChecker
from rules import Rule
finally:
# Restore sys.path to what it was before.
sys.path = original_sys_path
I'm not sure how I could tell it where the buildtools path is? We could try adding a catch in there and injecting a presubmit error though.
,
Apr 5 2016
The following revision refers to this bug: https://pdfium.googlesource.com/pdfium.git/+/4cd49e1c6076bd9ef2d18480d893038822668262 commit 4cd49e1c6076bd9ef2d18480d893038822668262 Author: dsinclair <dsinclair@chromium.org> Date: Tue Apr 05 17:28:48 2016 Better error for checkdeps. If the checkdeps script can not be found the following error will be issued instead of a stacktrace: ** Presubmit ERRORS ** Unable to run checkdeps, does pdfium/buildtools/checkdeps exist? BUG= chromium:600043 Review URL: https://codereview.chromium.org/1860803003 [modify] https://crrev.com/4cd49e1c6076bd9ef2d18480d893038822668262/PRESUBMIT.py
,
Apr 5 2016
Better error message is in, please re-open if it isn't sufficient.
,
Apr 5 2016
The following revision refers to this bug: https://pdfium.googlesource.com/pdfium.git/+/4cd49e1c6076bd9ef2d18480d893038822668262 commit 4cd49e1c6076bd9ef2d18480d893038822668262 Author: dsinclair <dsinclair@chromium.org> Date: Tue Apr 05 17:28:48 2016 Better error for checkdeps. If the checkdeps script can not be found the following error will be issued instead of a stacktrace: ** Presubmit ERRORS ** Unable to run checkdeps, does pdfium/buildtools/checkdeps exist? BUG= chromium:600043 Review URL: https://codereview.chromium.org/1860803003 [modify] https://crrev.com/4cd49e1c6076bd9ef2d18480d893038822668262/PRESUBMIT.py |
||
►
Sign in to add a comment |
||
Comment 1 by dsinclair@chromium.org
, Apr 4 2016