Commit Graph

39 Commits (c13b0540e635f194048ff8cd1fad8806d3e32dab)

Author SHA1 Message Date
hinoka@chromium.org 199bc5f92c Use gsutil.py for download_from_google_storage instead of the builtin one
This pins gsutil to a vanilla 4.7 instead of the weird custom 3.4 we have in depot_tools

BUG=
R=pgervais@chromium.org

Review URL: https://codereview.chromium.org/797663003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293413 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
hinoka@chromium.org 7b1cb6f56d Run prune in git cache update bootstrap to remove loose objects
BUG=411236

Review URL: https://codereview.chromium.org/545213002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291865 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org 42f9adffd3 Make git cache delete a defunct directory instead of moving it
So the original intention of moving it to a different directory to be deleted later
was to (1) save it for diagnosis (2) be a single inode swap rather than a long
rmtree delete.

1. No one is actually looking at these directories
2. The tmpdir sometimes end up on a different partition, so it ends up being
   a copy + delete instead.  Since we're not getting timeouts from that, its
   probably actually better to just straight up delete it.

BUG=410727

Review URL: https://codereview.chromium.org/538993002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291818 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org a5cda1e5db Remove the old cache dir before moving the bootstrapped cache dir into the real location
Seems like some combination of things (bad cache dir, shallow checkout, etc) causes
git cache to not clean up properly before trying to move new directory A into
already existing directory B.

So the logic is all there to detect that the cache is invalid, its just not
being cleaned up properly during shallow checkouts.

BUG=406864
TBR=iannucci

Review URL: https://codereview.chromium.org/499123002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291587 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 84c560061d Do threading.Lock the Right Way.
R=cmp@chromium.org, dnj@chromium.org, iannucci@chromium.org
BUG=

Review URL: https://codereview.chromium.org/499003002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291573 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org c532504d17 Fix thread lock around cachepath access.
R=cmp@chromium.org, agable@chromium.org
BUG=

Review URL: https://codereview.chromium.org/468253003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291571 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 1132f5f896 Add thread locking around GetCachePath().
BUG=406662
R=cmp@chromium.org, agable@chromium.org

Review URL: https://codereview.chromium.org/469073004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291569 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 965c44f41c Non-destructive editing of git cache config.
R=agable@chromium.org,iannucci@chromium.org
BUG=

Review URL: https://codereview.chromium.org/485663003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@290665 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org b9f2751b87 Added hyphen-only options
Some options have words separated by underscores. Added options with
same name and underscores replaced by hyphens.

BUG=400953

Review URL: https://codereview.chromium.org/436963005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@288366 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org f314511616 Add 'git cache fetch' subcommand.
If you're in a git checkout cloned from the git cache, this will:
  - Update the cache with the latest upstream commits.
  - Update the cwd with the latest commits from the cache.

For example:

> cd $HOME/workspace/chromium/src
> git cache fetch

R=agable@chromium.org,iannucci@chromium.org
BUG=

Review URL: https://codereview.chromium.org/440213005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@288140 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org 4e2ad84696 Git Cache speculative fix for windows
Git cache sometimes fail on:
Traceback (most recent call last):
  File "E:\b\depot_tools\\gclient.py", line 2064, in <module>
    sys.exit(Main(sys.argv[1:]))
  File "E:\b\depot_tools\\gclient.py", line 2052, in Main
    return dispatcher.execute(OptionParser(), argv)
  File "E:\b\depot_tools\subcommand.py", line 245, in execute
    return command(parser, args[1:])
  File "E:\b\depot_tools\\gclient.py", line 1830, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "E:\b\depot_tools\\gclient.py", line 1342, in RunOnDeps
    work_queue.flush(revision_overrides, command, args, options=self._options)
  File "E:\b\depot_tools\gclient_utils.py", line 852, in flush
    self._run_one_task(self.queued.pop(i), args, kwargs)
  File "E:\b\depot_tools\gclient_utils.py", line 944, in _run_one_task
    task_item.run(*args, **kwargs)
  File "E:\b\depot_tools\\gclient.py", line 744, in run
    file_list)
  File "E:\b\depot_tools\gclient_scm.py", line 160, in RunCommand
    return getattr(self, command)(options, args, file_list)
  File "E:\b\depot_tools\gclient_scm.py", line 387, in update
    self._UpdateMirror(mirror, options)
  File "E:\b\depot_tools\gclient_scm.py", line 802, in _UpdateMirror
    ignore_lock=options.ignore_locks)
  File "E:\b\depot_tools\git_cache.py", line 409, in populate
    os.rename(tempdir, self.mirror_path)
WindowsError: [Error 183] Cannot create a file when that file already exists

It would appear that its being racy, but otherwise it doesn't make any sense.  A theory
is that this could be running twice and stepping on each other.  Allowing this
to pass on OSError allows us to test this theory.

BUG=395333

Review URL: https://codereview.chromium.org/408653002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@284272 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org aa1e1a4f2f Have git cache bootstrap repo if repo is corrupt
We're seeing fetches fail in interesting ways:
running "git fetch -v --progress origin +refs/heads/*:refs/heads/*" in "/mnt/scratch0/b_used/build/slave/cache_dir/chrome--internal.googlesource.com-chrome-src--internal"
error: object file ./objects/a1/4bd89aa4cc7d7bbad7594cba0ae73e99dbb54c is empty
error: object file ./objects/a1/4bd89aa4cc7d7bbad7594cba0ae73e99dbb54c is empty
fatal: loose object a14bd89aa4cc7d7bbad7594cba0ae73e99dbb54c (stored in ./objects/a1/4bd89aa4cc7d7bbad7594cba0ae73e99dbb54c) is corrupt
fatal: The remote end hung up unexpectedly

And then the cache becomes corrupted.  This blows the cache away if this happens.

BUG=261741

Review URL: https://codereview.chromium.org/352543003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@280123 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 108eced497 Add --ignore-lock option.
Unfortunately, the locking mechanism is still flaky on Windows.
bot_update.py will use this, since we can be certain that there
won't be overlapping access to the cache.

R=hinoka@google.com, agable@chromium.org, hinoka@chromium.org
BUG=

Review URL: https://codereview.chromium.org/340953003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@278490 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org c8444f3a2d Allow pruning other files when uploading bootstrap tarball
BUG=366748

Review URL: https://codereview.chromium.org/337763005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@278190 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 3341849a69 Don't os.listdir() on a non-existent dir (it raises).
TBR=agable@chromium.org,iannucci@chromium.org
BUG=

Review URL: https://codereview.chromium.org/342753003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@278141 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org b0a13a2a2f Refactor cache-updating code to eliminate unnecessary fetches.
This is an update of the following reverted change:

https://codereview.chromium.org/344443002/

R=hinoka@chromium.org,agable@chromium.org
BUG=

Review URL: https://codereview.chromium.org/343523002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@277931 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 1cbf1048a6 Clean up temp dirs when breaking locks.
A number of bots have been running out of disk space because they
are accumulating temp dirs and temp pack files.  Be more careful
to clean up temp dirs whenever UnlockAll() is called.

R=hinoka@chromium.org,agable@chromium.org
BUG=

Review URL: https://codereview.chromium.org/335253002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@277812 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 301a7c3dd1 Tweak git gc settings, and periodically re-bootstrap.
BUG=383455
R=hinoka@chromium.org,iannucci@chromium.org

Review URL: https://codereview.chromium.org/331913003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@277473 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org cdfcd7cf83 Clean up temporary git pack files when breaking locks.
When a git-cache operation is interrupted, it can leave behind large
temporary pack files.  Over time, these pack files will fill up
disks.

R=agable@chromium.org,hinoka@chromium.org,iannucci@chromium.org
BUG=352268

Review URL: https://codereview.chromium.org/326203003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@276208 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org c58d11dd54 Have git_cache print out download progress when bootstrapping the git cache
BUG=261741,380958

Review URL: https://codereview.chromium.org/325903005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@275872 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org c2bc22d69d Fixed bad arguments to gsutil
boto is required.

BUG=261741
TBR=iannucci

Review URL: https://codereview.chromium.org/315343002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@275244 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org 1fddd11b2d Fix for authenticating to internal repos
Last patch (https://codereview.chromium.org/313933005/) forgot to take into account using a boto file (setting boto to os.devnull
means connect unauthenticated, setting it to None will allow it to do the default
behavior)

This patch will always use a boto file, which should be fine.

BUG=261741

Review URL: https://codereview.chromium.org/314203002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@275230 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org f8fa23dd8a Add internal buckets for bootstrapping internal repos
BUG=261741

Review URL: https://codereview.chromium.org/313933005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@274969 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 2c391af008 Add --quiet option.
This is need, e.g., to suppress logging message for 'exists'.

TBR=agable@chromium.org,hinoka@chromium.org
BUG=

Review URL: https://codereview.chromium.org/299163002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@272450 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 174766fb97 Added Mirror.UnlockAll with logic fixes.
BUG=

Review URL: https://codereview.chromium.org/278103002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@270205 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@google.com 776a2c3fc7 Python fallback for git cache bootstrap
This is because the version of unzip on osx doesn't support zip64, so it can't
unzip large repositories like blink.

BUG=261741

Review URL: https://codereview.chromium.org/251413002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@266151 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org f372610b02 Make Lockfile._remove_lockfile more robust on win32
Sometimes, removing lockfiles fails on windows, for obscure reasons.
Following advice from gclient_utils.rmtree, lock file removal has
been improved by using the builtin executable 'del' and retrying 3
times in case it fails.

BUG=

Review URL: https://codereview.chromium.org/240653002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@264557 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 4039b31851 Fix to path search redux.
TBR=agable@chromium.org,hinoka@chromium.org
BUG=

Review URL: https://codereview.chromium.org/232093002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@262832 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 6b5faf51dd Fix PATH searching for Windows.
I am TBR-ing everything today.

TBR=agable@chromium.org,hinoka@chromium.org

Review URL: https://codereview.chromium.org/232083002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@262831 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 848fd49331 Make git_cache.py import-able.
Evidence indicates that running non-builtin git commands is very
slow in msysgit, slow enough to dominate the running time of
gclient sync.  With this change, gclient never shells out to
git-cache; it import the lib directly instead.

R=agable@chromium.org,hinoka@chromium.org
BUG=

Review URL: https://codereview.chromium.org/229653002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@262759 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@google.com 563559cdb1 Add a way for git cache to bootstrap off Google Storage.
This is based off the svn tarball bootstrap script in gclient_scm.py
Also included is a new command to create a new zarchive/zipball.

BUG=261741

Review URL: https://codereview.chromium.org/220423002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@261002 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 38a0f57c23 Suppress spurious warning about overriding cache dir.
R=iannucci@chromium.org,hinoka@chromium.org
BUG=

Review URL: https://codereview.chromium.org/216013002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@260078 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org fc61638380 Rationalize the git config settings for index-pack performance.
BUG=

Review URL: https://codereview.chromium.org/202753003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@257728 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
agable@chromium.org 99f9c92f73 Accept remote urls as gospel in git_cache.
git_cache rewrites all urls to https://netloc/path when
setting them as remote urls. This doesn't work when the
remote is actually local on disk, and the "url" is a
/path/to/repo. This seems like an unlikely case, but it
is leveraged by testing, and it doesn't hurt to support
it, so now we do.

R=iannucci@chromium.org
BUG=261619

Review URL: https://codereview.chromium.org/196493002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256386 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@google.com b16a16551d Be more aggressive about breaking locks
There is an issue where:
1. Lock for asdf.git acquires, which creates asdf.lock
2. asdf.git is cloned into tmp_asdf.git
3. Buildbot crashes, because timeouts
4. neither asdf.lock or tmp_asdf.git/config.lock gets cleaned out on the next unlock.

This aims to fix this issue by aggressively unlocking everything it can find that
vaguely resembles a lock.

BUG=339171

Review URL: https://codereview.chromium.org/187283005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@255138 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@google.com 267f33e6ad Make gclient_scm.py use cache_dir
Instead of having custom logic for dealing with cache directories, use
git_cache.py to populate caches.

Also fixes a bug in git_cache.py where it was looking for lockfiles in cwd rather than the cache dir.

Other changes:
* _Run now returns output.
* Always print to stdout in CheckCallAndFilterOutput, even if it gets a carriage return.  This is done because git progress report are carriage returns and not newlines and we don't want everything on the same line and not strip out the CRs.
* Removed members changed tests, its not very useful to know a new import is added.

BUG=339171

Review URL: https://codereview.chromium.org/180243006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@254248 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
hinoka@chromium.org fc330cb102 Add +refs/tags/*:refs/tags/* to git cache config
For some reason "--tags" wasn't working on some versions of git (pre-1.9)

BUG=339171

Review URL: https://codereview.chromium.org/183813004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253929 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
agable@chromium.org c3553743cf Remove --update-shallow from git-cache.
R=hinoka@chromium.org
BUG=339171

Review URL: https://codereview.chromium.org/183643002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253887 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
agable@chromium.org 5a306a2aa6 Create "git cache" command.
The git cache command is a central place to manage a machine's git cache.

It provides two subcommands:
* populate -- creates or updates the cache of a given repository
* exists -- prints the path to the cache of a repo, if it exists

Gclient, deps2git, bot_update, and any other tools that touch the cache will
be able to use this command to make sure that everyone is interacting with
the cache in the same way.

R=hinoka@chromium.org, iannucci@chromium.org
BUG=339168

Review URL: https://codereview.chromium.org/164823002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@253007 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago