New issue
Advanced search Search tips

Issue 600043 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 3
Type: Bug



Sign in to add a comment

git cl upload fails from third_party\pdfium directory

Project Member Reported by brucedaw...@chromium.org, Apr 2 2016

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.

 
Cc: tsepez@chromium.org thestig@chromium.org
So, the problem here is that it isn't a full checkout. It looks like chrome just does a git clone. None of the deps content is pulled into the build. This means we're missing the buildtools directory.

I'm not sure if/how we can make this work. I don't think we want to skip checkdeps in this case as it does find issues.

Locally, I removed the pdfium directory from chromium, added a symlink to my standalone repo and the upload works (With the needed custom_deps entry in .gclient).

I don't know if windows has symlinks? So, not sure if the same thing can be done?
I guess the other question is, can we make it pickup checkdeps from the chromium buildtools directory?
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.
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.
Project Member

Comment 5 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)
Better error message is in, please re-open if it isn't sufficient.
Project Member

Comment 7 by bugdroid1@chromium.org, 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