libv8 5.7.492.65.1 → 5.9.211.38.0beta0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +8 -2
- data/CHANGELOG.md +4 -0
- data/README.md +4 -3
- data/Rakefile +27 -10
- data/ext/libv8/builder.rb +4 -0
- data/lib/libv8/version.rb +1 -1
- data/libv8.gemspec +1 -1
- data/patches/0001-Build-a-standalone-static-library.patch +5 -5
- data/patches/0002-Don-t-compile-unnecessary-stuff.patch +20 -24
- data/patches/0003-Use-the-fPIC-flag-for-the-static-library.patch +5 -5
- data/patches/0004-Do-not-embed-debug-symbols-in-macOS-libraries.patch +5 -5
- data/patches/0005-Fix-GCC-7-build-errors.patch +147 -0
- data/scaleway.png +0 -0
- data/vendor/depot_tools/.gitattributes +52 -0
- data/vendor/depot_tools/.gitignore +10 -0
- data/vendor/depot_tools/README.md +7 -3
- data/vendor/depot_tools/apply_issue.bat +4 -3
- data/vendor/depot_tools/apply_issue.py +0 -10
- data/vendor/depot_tools/autoninja +12 -0
- data/vendor/depot_tools/autoninja.bat +9 -0
- data/vendor/depot_tools/autoninja.py +70 -0
- data/vendor/depot_tools/bootstrap/win/README.md +108 -26
- data/vendor/depot_tools/bootstrap/win/git-bash.template.sh +3 -3
- data/vendor/depot_tools/bootstrap/win/git.template.bat +2 -2
- data/vendor/depot_tools/bootstrap/win/manifest.txt +18 -0
- data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +18 -0
- data/vendor/depot_tools/bootstrap/win/python27.new.bat +49 -0
- data/vendor/depot_tools/bootstrap/win/win_tools.bat +55 -59
- data/vendor/depot_tools/bootstrap/win/win_tools.py +335 -0
- data/vendor/depot_tools/cipd +16 -2
- data/vendor/depot_tools/cipd.bat +20 -2
- data/vendor/depot_tools/cipd.ps1 +36 -22
- data/vendor/depot_tools/cipd_bin_setup.bat +6 -0
- data/vendor/depot_tools/cipd_bin_setup.sh +10 -0
- data/vendor/depot_tools/cipd_client_version +1 -1
- data/vendor/depot_tools/cipd_manifest.txt +9 -0
- data/vendor/depot_tools/cit.bat +12 -11
- data/vendor/depot_tools/clang-format.bat +4 -3
- data/vendor/depot_tools/clang_format_merge_driver.bat +12 -11
- data/vendor/depot_tools/commit_queue.bat +4 -3
- data/vendor/depot_tools/cpplint.bat +9 -3
- data/vendor/depot_tools/cpplint.py +3 -3
- data/vendor/depot_tools/depot-tools-auth.bat +4 -3
- data/vendor/depot_tools/download_from_google_storage.bat +5 -3
- data/vendor/depot_tools/download_from_google_storage.py +6 -1
- data/vendor/depot_tools/fetch.bat +5 -4
- data/vendor/depot_tools/fetch.py +4 -5
- data/vendor/depot_tools/gclient-new-workdir.py +82 -46
- data/vendor/depot_tools/gclient.bat +5 -4
- data/vendor/depot_tools/gclient.py +713 -319
- data/vendor/depot_tools/gclient_eval.py +284 -0
- data/vendor/depot_tools/gclient_utils.py +70 -4
- data/vendor/depot_tools/gerrit_client.py +26 -1
- data/vendor/depot_tools/gerrit_util.py +120 -127
- data/vendor/depot_tools/git-crrev-parse +1 -0
- data/vendor/depot_tools/git-gs +1 -1
- data/vendor/depot_tools/git_cl.py +731 -415
- data/vendor/depot_tools/git_common.py +23 -3
- data/vendor/depot_tools/git_drover.py +10 -1
- data/vendor/depot_tools/git_footers.py +62 -22
- data/vendor/depot_tools/git_hyper_blame.py +3 -2
- data/vendor/depot_tools/git_map.py +30 -3
- data/vendor/depot_tools/git_map_branches.py +18 -4
- data/vendor/depot_tools/git_number.py +8 -2
- data/vendor/depot_tools/git_retry.py +21 -0
- data/vendor/depot_tools/gn.bat +4 -3
- data/vendor/depot_tools/infra/config/cq.cfg +1 -5
- data/vendor/depot_tools/infra/config/recipes.cfg +18 -16
- data/vendor/depot_tools/led +12 -0
- data/vendor/depot_tools/led.bat +7 -0
- data/vendor/depot_tools/man/html/git-cl.html +9 -1
- data/vendor/depot_tools/man/html/git-drover.html +22 -18
- data/vendor/depot_tools/man/man1/git-cl.1 +8 -3
- data/vendor/depot_tools/man/man1/git-drover.1 +22 -20
- data/vendor/depot_tools/man/src/git-cl.txt +3 -0
- data/vendor/depot_tools/man/src/git-drover.txt +8 -0
- data/vendor/depot_tools/my_activity.py +8 -5
- data/vendor/depot_tools/owners.py +103 -11
- data/vendor/depot_tools/owners_finder.py +14 -2
- data/vendor/depot_tools/presubmit_canned_checks.py +25 -67
- data/vendor/depot_tools/presubmit_support.py +87 -35
- data/vendor/depot_tools/recipes/OWNERS +2 -0
- data/vendor/depot_tools/recipes/README.recipes.md +842 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +5 -3
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +181 -60
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/{example.expected → examples/full.expected}/apply_gerrit_ref.json +4 -2
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +82 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +149 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/buildbot.json +82 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +149 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +122 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +149 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +149 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_shallow.json +149 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +148 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange.json +150 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/{example.expected → examples/full.expected}/trychange_oauth2.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2_buildbot.json +152 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2_json.json +150 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/trychange_oauth2_json_win.json +150 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob.json +156 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +91 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +118 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +118 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +202 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle_deprecated.json +158 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +196 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8.json +202 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +202 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +162 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +162 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +149 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/{example.py → examples/full.py} +46 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +139 -133
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +25 -13
- data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +40 -9
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/basic.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/basic_pkg.json +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/describe-failed.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/describe-many-instances.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/mac64.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/pkg_bad_file.json +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/pkg_bad_mode.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/pkg_bad_verfile.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.expected → examples/full.expected}/win64.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/{example.py → examples/full.py} +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.py +59 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/{example.expected → examples/full.expected}/basic.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/{example.expected → examples/full.expected}/win.json +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/{example.py → examples/full.py} +2 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +1 -4
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +28 -14
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +10 -235
- data/vendor/depot_tools/recipes/recipe_modules/gclient/{example.expected → examples/full.expected}/basic.json +9 -9
- data/vendor/depot_tools/recipes/recipe_modules/gclient/{example.expected → examples/full.expected}/buildbot.json +9 -9
- data/vendor/depot_tools/recipes/recipe_modules/gclient/{example.expected → examples/full.expected}/revision.json +9 -9
- data/vendor/depot_tools/recipes/recipe_modules/gclient/{example.expected → examples/full.expected}/tryserver.json +9 -9
- data/vendor/depot_tools/recipes/recipe_modules/gclient/{example.py → examples/full.py} +5 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +45 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +97 -2
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +283 -0
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/{example.py → examples/full.py} +31 -2
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/test_api.py +30 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +1 -4
- data/vendor/depot_tools/recipes/recipe_modules/git/api.py +7 -35
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/basic.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/basic_branch.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/basic_file_name.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/basic_hash.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/basic_ref.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/basic_submodule_update_force.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/can_fail_build.json +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/cannot_fail_build.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/cat-file_test.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/count-objects_delta.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/count-objects_failed.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/count-objects_with_bad_output.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/count-objects_with_bad_output_fails_build.json +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/curl_trace_file.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/git-cache-checkout.json +6 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +223 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/rebase_failed.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/remote_not_origin.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.expected → examples/full.expected}/set_got_revision.json +3 -3
- data/vendor/depot_tools/recipes/recipe_modules/git/{example.py → examples/full.py} +2 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/resources/git_setup.py +12 -21
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/__init__.py +1 -4
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +13 -11
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/{example.expected → examples/full.expected}/basic.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/{example.py → examples/full.py} +4 -2
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/OWNERS +3 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/__init__.py +7 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +135 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +537 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.py +61 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +192 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/test_api.py +95 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/{example.expected → examples/full.expected}/basic.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/{example.py → examples/full.py} +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/__init__.py +0 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/{example.expected → examples/full.expected}/basic.json +3 -2
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/{example.expected → examples/full.expected}/paths_buildbot_linux.json +3 -2
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/{example.expected → examples/full.expected}/paths_buildbot_mac.json +3 -2
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/{example.expected → examples/full.expected}/paths_buildbot_win.json +3 -2
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/{example.expected → examples/full.expected}/paths_generic_linux.json +3 -2
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/{example.expected → examples/full.expected}/paths_generic_mac.json +3 -2
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_win.json +16 -0
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_linux.json +16 -0
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_mac.json +16 -0
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_win.json +16 -0
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/{example.py → examples/full.py} +2 -1
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/path_config.py +12 -3
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +2 -2
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/{example.expected → examples/full.expected}/basic.json +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/{example.py → examples/full.py} +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/__init__.py +0 -4
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/{example.expected → examples/full.expected}/basic.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/{example.expected → examples/full.expected}/buildbot.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/examples/full.expected/no_auth.json +27 -0
- data/vendor/depot_tools/recipes/recipe_modules/rietveld/{example.py → examples/full.py} +9 -1
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +3 -5
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +21 -96
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected → examples/full.expected}/basic_tags.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected → examples/full.expected}/set_failure_hash_with_no_steps.json +0 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +56 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected/with_gerrit_patch_deprecated.json → examples/full.expected/with_git_patch.json} +2 -2
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected/with_gerrit_patch.json → examples/full.expected/with_git_patch_luci.json} +2 -2
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected → examples/full.expected}/with_rietveld_patch.json +0 -20
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected → examples/full.expected}/with_rietveld_patch_new.json +0 -20
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected → examples/full.expected}/with_wrong_patch.json +1 -13
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.expected → examples/full.expected}/with_wrong_patch_new.json +1 -13
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/{example.py → examples/full.py} +3 -17
- data/vendor/depot_tools/recipes/recipes.py +141 -96
- data/vendor/depot_tools/rietveld.py +8 -1
- data/vendor/depot_tools/roll-dep-svn.bat +12 -10
- data/vendor/depot_tools/roll-dep.bat +5 -3
- data/vendor/depot_tools/scm.py +8 -1
- data/vendor/depot_tools/setup_color.py +0 -0
- data/vendor/depot_tools/split_cl.py +193 -0
- data/vendor/depot_tools/third_party/schema/.editorconfig +15 -0
- data/vendor/depot_tools/third_party/schema/.gitignore +174 -0
- data/vendor/depot_tools/third_party/schema/.travis.yml +37 -0
- data/vendor/depot_tools/third_party/schema/LICENSE-MIT +19 -0
- data/vendor/depot_tools/third_party/schema/MANIFEST.in +1 -0
- data/vendor/depot_tools/third_party/schema/README.chromium +12 -0
- data/vendor/depot_tools/third_party/schema/README.rst +382 -0
- data/vendor/depot_tools/third_party/schema/__init__.py +1 -0
- data/vendor/depot_tools/third_party/schema/schema.py +338 -0
- data/vendor/depot_tools/third_party/schema/setup.cfg +5 -0
- data/vendor/depot_tools/third_party/schema/setup.py +30 -0
- data/vendor/depot_tools/third_party/schema/test_schema.py +556 -0
- data/vendor/depot_tools/third_party/schema/tox.ini +33 -0
- data/vendor/depot_tools/third_party/upload.py +4 -0
- data/vendor/depot_tools/update_depot_tools +4 -16
- data/vendor/depot_tools/update_depot_tools.bat +4 -17
- data/vendor/depot_tools/update_depot_tools_toggle.py +38 -0
- data/vendor/depot_tools/vpython +12 -0
- data/vendor/depot_tools/vpython.bat +7 -0
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +17 -5
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +63 -33
- metadata +161 -113
- data/vendor/depot_tools/bootstrap/gclient.bat +0 -22
- data/vendor/depot_tools/bootstrap/win/get_file.js +0 -119
- data/vendor/depot_tools/bootstrap/win/git_bootstrap.py +0 -193
- data/vendor/depot_tools/bootstrap/win/git_version.txt +0 -1
- data/vendor/depot_tools/bootstrap/win/git_version_bleeding_edge.txt +0 -1
- data/vendor/depot_tools/bootstrap/win/python276.new.bat +0 -8
- data/vendor/depot_tools/bootstrap/win/svn.new.bat +0 -4
- data/vendor/depot_tools/bootstrap/win/svnversion.new.bat +0 -4
- data/vendor/depot_tools/bootstrap/win/unzip.js +0 -91
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/basic.json +0 -53
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/basic_output_manifest.json +0 -60
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/basic_with_branch_heads.json +0 -54
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/buildbot.json +0 -53
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/clobber.json +0 -54
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/gerrit_no_rebase_patch_ref.json +0 -54
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/gerrit_no_reset.json +0 -54
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/no_shallow.json +0 -54
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/reset_root_solution_revision.json +0 -53
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/trychange.json +0 -55
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/trychange_oauth2_buildbot.json +0 -57
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/trychange_oauth2_json.json +0 -55
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/trychange_oauth2_json_win.json +0 -55
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob.json +0 -59
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob_fail.json +0 -62
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob_fail_patch.json +0 -83
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob_fail_patch_download.json +0 -84
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle.json +0 -60
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob_gerrit_angle_deprecated.json +0 -60
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob_v8.json +0 -62
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/example.expected/tryjob_v8_head_by_default.json +0 -62
- data/vendor/depot_tools/recipes/recipe_modules/gclient/bundle_extra_paths.txt +0 -4
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/example.expected/basic.json +0 -66
- data/vendor/depot_tools/recipes/recipe_modules/git/bundle_extra_paths.txt +0 -28
- data/vendor/depot_tools/recipes/recipe_modules/git/example.expected/platform_win.json +0 -237
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/example.expected/paths_generic_win.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_linux.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_mac.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/example.expected/paths_kitchen_win.json +0 -15
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/bundle_extra_paths.txt +0 -30
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/example.expected/with_git_patch.json +0 -109
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/example.expected/with_git_patch_luci.json +0 -8
@@ -0,0 +1,18 @@
|
|
1
|
+
# CIPD manifest for Windows tools.
|
2
|
+
#
|
3
|
+
# We must install anything that we want included on PATH to a different
|
4
|
+
# subdirectory than Git, as Git's msys bash strips its root directory
|
5
|
+
# from PATH, hence the subdirs.
|
6
|
+
#
|
7
|
+
# If any paths or package layouts change, updates will be required in
|
8
|
+
# "win_tools.bat" and "win_tools.py" templates.
|
9
|
+
#
|
10
|
+
# "win_tools.bat" has a hard requirement that the Python package contains the
|
11
|
+
# string "cpython" and ends with the CIPD tag "version:VERSION". It uses this
|
12
|
+
# to extract VERSION.
|
13
|
+
|
14
|
+
@Subdir python
|
15
|
+
infra/python/cpython/${platform} version:2.7.13.chromium7
|
16
|
+
|
17
|
+
@Subdir git
|
18
|
+
infra/git/${platform} version:2.10.0
|
@@ -0,0 +1,49 @@
|
|
1
|
+
@echo off
|
2
|
+
:: Copyright 2017 The Chromium Authors. All rights reserved.
|
3
|
+
:: Use of this source code is governed by a BSD-style license that can be
|
4
|
+
:: found in the LICENSE file.
|
5
|
+
|
6
|
+
setlocal
|
7
|
+
set PYTHON_BAT_RUNNER=1
|
8
|
+
|
9
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
10
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
11
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
12
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
13
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
14
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
15
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
16
|
+
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
17
|
+
|
18
|
+
:: This file is automatically generated by "bootstrap\win\win_tools.py", and
|
19
|
+
:: should not be modified.
|
20
|
+
::
|
21
|
+
:: The previous "::" block acts as a nop-sled. Each time a batch file executes
|
22
|
+
:: a command, it reloads itself and seeks to its previous execution offset to
|
23
|
+
:: begin execution. Updating this batch file is, therefore, risky, since any
|
24
|
+
:: running Python instance that is using the old batch file will reload the new
|
25
|
+
:: batch file once the Python command terminates and resume at some unknown
|
26
|
+
:: offset.
|
27
|
+
::
|
28
|
+
:: With the sled in place, a previous instance will resume mid-label. We are
|
29
|
+
:: assuming that the offset of the Python invocation is greater than the
|
30
|
+
:: PYTHON_BAT_RUNNER set command, which is the case since the old instance has
|
31
|
+
:: a large PATH set block before the Python execution. Old instances will hit
|
32
|
+
:: the next block of code without PYTHON_BAT_RUNNER set. New instances will have
|
33
|
+
:: it set.
|
34
|
+
::
|
35
|
+
:: We remedy this in the future by having the batch file load its core paths
|
36
|
+
:: from an external file via "set /p", removing the need to modify "python.bat"
|
37
|
+
:: during upgrade.
|
38
|
+
::
|
39
|
+
:: After all of the old batch files are believed to be replaced, we can remove
|
40
|
+
:: the PYTHON_BAT_RUNNER block and the sled. For this update, old instances
|
41
|
+
:: will resume past the end of the file and terminate.
|
42
|
+
|
43
|
+
if not "%PYTHON_BAT_RUNNER%" == "1" goto :END
|
44
|
+
|
45
|
+
set /p PYTHON_BIN_RELDIR=<%~dp0python_bin_reldir.txt
|
46
|
+
set PATH=%~dp0%PYTHON_BIN_RELDIR%;%~dp0%PYTHON_BIN_RELDIR%\Scripts;%PATH%
|
47
|
+
"%~dp0%PYTHON_BIN_RELDIR%\python.exe" %*
|
48
|
+
|
49
|
+
:END
|
@@ -1,78 +1,74 @@
|
|
1
1
|
@echo off
|
2
|
-
:: Copyright (c)
|
2
|
+
:: Copyright (c) 2017 The Chromium Authors. All rights reserved.
|
3
3
|
:: Use of this source code is governed by a BSD-style license that can be
|
4
4
|
:: found in the LICENSE file.
|
5
5
|
|
6
|
-
:: This script will determine if python
|
7
|
-
:: returns
|
6
|
+
:: This script will determine if python or git binaries need updates. It
|
7
|
+
:: returns !0 as failure
|
8
8
|
|
9
|
-
::
|
10
|
-
::
|
11
|
-
|
12
|
-
set CHROME_INFRA_URL=https://storage.googleapis.com/chrome-infra/
|
13
|
-
:: It used to be %~dp0 but ADODB.Stream may fail to write to this directory if
|
14
|
-
:: the directory DACL is set to elevated integrity level.
|
15
|
-
set ZIP_DIR=%TEMP%
|
9
|
+
:: Note: we set EnableDelayedExpansion so we can perform string manipulations
|
10
|
+
:: in our manifest parsing loop. This only works on Windows XP+.
|
11
|
+
setlocal EnableDelayedExpansion
|
16
12
|
|
17
13
|
:: Get absolute root directory (.js scripts don't handle relative paths well).
|
18
14
|
pushd %~dp0..\..
|
19
15
|
set WIN_TOOLS_ROOT_DIR=%CD%
|
20
16
|
popd
|
21
17
|
|
22
|
-
|
23
|
-
|
24
|
-
shift /1
|
25
|
-
)
|
26
|
-
|
27
|
-
|
28
|
-
:PYTHON_CHECK
|
29
|
-
if not exist "%WIN_TOOLS_ROOT_DIR%\python276_bin" goto :PY27_INSTALL
|
30
|
-
if not exist "%WIN_TOOLS_ROOT_DIR%\python.bat" goto :PY27_INSTALL
|
31
|
-
set ERRORLEVEL=0
|
32
|
-
goto :GIT_CHECK
|
33
|
-
|
34
|
-
|
35
|
-
:PY27_INSTALL
|
36
|
-
echo Installing python 2.7.6...
|
37
|
-
:: Cleanup python directory if it was existing.
|
38
|
-
set PYTHON_URL=%CHROME_INFRA_URL%python276_bin.zip
|
39
|
-
if exist "%WIN_TOOLS_ROOT_DIR%\python276_bin\." rd /q /s "%WIN_TOOLS_ROOT_DIR%\python276_bin"
|
40
|
-
if exist "%ZIP_DIR%\python276.zip" del "%ZIP_DIR%\python276.zip"
|
41
|
-
echo Fetching from %PYTHON_URL%
|
42
|
-
cscript //nologo //e:jscript "%~dp0get_file.js" %PYTHON_URL% "%ZIP_DIR%\python276_bin.zip"
|
43
|
-
if errorlevel 1 goto :PYTHON_FAIL
|
44
|
-
:: Will create python276_bin\...
|
45
|
-
cscript //nologo //e:jscript "%~dp0unzip.js" "%ZIP_DIR%\python276_bin.zip" "%WIN_TOOLS_ROOT_DIR%"
|
46
|
-
:: Create the batch files.
|
47
|
-
call copy /y "%~dp0python276.new.bat" "%WIN_TOOLS_ROOT_DIR%\python.bat" 1>nul
|
48
|
-
call copy /y "%~dp0pylint.new.bat" "%WIN_TOOLS_ROOT_DIR%\pylint.bat" 1>nul
|
49
|
-
del "%ZIP_DIR%\python276_bin.zip"
|
50
|
-
set ERRORLEVEL=0
|
51
|
-
goto :GIT_CHECK
|
52
|
-
|
18
|
+
:: Extra arguments to pass to our "win_tools.py" script.
|
19
|
+
set WIN_TOOLS_EXTRA_ARGS=
|
53
20
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
21
|
+
:: Determine if we're running a bleeding-edge installation.
|
22
|
+
if not exist "%WIN_TOOLS_ROOT_DIR%\.bleeding_edge" (
|
23
|
+
set CIPD_MANIFEST=manifest.txt
|
24
|
+
) else (
|
25
|
+
set CIPD_MANIFEST=manifest_bleeding_edge.txt
|
26
|
+
set WIN_TOOLS_EXTRA_ARGS=%WIN_TOOLS_EXTRA_ARGS% --bleeding-edge
|
27
|
+
)
|
59
28
|
|
60
|
-
|
29
|
+
:: Parse our CIPD manifest and identify the "cpython" version. We do this by
|
30
|
+
:: reading it line-by-line, identifying the line containing "cpython", and
|
31
|
+
:: stripping all text preceding "version:". This leaves us with the version
|
32
|
+
:: string.
|
33
|
+
::
|
34
|
+
:: This method requires EnableDelayedExpansion, and extracts the Python version
|
35
|
+
:: from our CIPD manifest. Variables referenced using "!" instead of "%" are
|
36
|
+
:: delayed expansion variables.
|
37
|
+
for /F "tokens=*" %%A in (%~dp0%CIPD_MANIFEST%) do (
|
38
|
+
set LINE=%%A
|
39
|
+
if not "x!LINE:cpython=!" == "x!LINE!" set PYTHON_VERSION=!LINE:*version:=!
|
40
|
+
)
|
41
|
+
if "%PYTHON_VERSION%" == "" (
|
42
|
+
@echo Could not extract Python version from manifest.
|
43
|
+
set ERRORLEVEL=1
|
44
|
+
goto :END
|
45
|
+
)
|
61
46
|
|
62
|
-
::
|
63
|
-
::
|
64
|
-
|
47
|
+
:: We will take the version string, replace "." with "_", and surround it with
|
48
|
+
:: "win-tools-<PYTHON_VERSION>_bin" so that it matches "win_tools.py"'s cleanup
|
49
|
+
:: expression and ".gitignore".
|
50
|
+
::
|
51
|
+
:: We incorporate PYTHON_VERSION into the "win_tools" directory name so that
|
52
|
+
:: new installations don't interfere with long-running Python processes if
|
53
|
+
:: Python is upgraded.
|
54
|
+
set WIN_TOOLS_NAME=win_tools-%PYTHON_VERSION:.=_%_bin
|
55
|
+
set WIN_TOOLS_PATH=%WIN_TOOLS_ROOT_DIR%\%WIN_TOOLS_NAME%
|
56
|
+
set WIN_TOOLS_EXTRA_ARGS=%WIN_TOOLS_EXTRA_ARGS% --win-tools-name "%WIN_TOOLS_NAME%"
|
65
57
|
|
66
|
-
::
|
67
|
-
::
|
68
|
-
|
58
|
+
:: Install our CIPD packages. The CIPD client self-bootstraps.
|
59
|
+
:: See "//cipd.bat" and "//cipd.ps1" for more information.
|
60
|
+
set CIPD_EXE=%WIN_TOOLS_ROOT_DIR%\cipd.bat
|
61
|
+
call "%CIPD_EXE%" ensure -ensure-file "%~dp0%CIPD_MANIFEST%" -root "%WIN_TOOLS_PATH%"
|
62
|
+
if errorlevel 1 goto :END
|
69
63
|
|
70
|
-
|
71
|
-
|
64
|
+
:: This executes "win_tools.py" using the bundle's Python interpreter.
|
65
|
+
set WIN_TOOLS_PYTHON_BIN=%WIN_TOOLS_PATH%\python\bin\python.exe
|
66
|
+
call "%WIN_TOOLS_PYTHON_BIN%" "%~dp0win_tools.py" %WIN_TOOLS_EXTRA_ARGS%
|
72
67
|
|
73
|
-
:returncode
|
74
|
-
set WIN_TOOLS_ROOT_DIR=
|
75
|
-
exit /b %ERRORLEVEL%
|
76
68
|
|
77
69
|
:END
|
78
|
-
|
70
|
+
set EXPORT_ERRORLEVEL=%ERRORLEVEL%
|
71
|
+
endlocal & (
|
72
|
+
set ERRORLEVEL=%EXPORT_ERRORLEVEL%
|
73
|
+
)
|
74
|
+
exit /b %ERRORLEVEL%
|
@@ -0,0 +1,335 @@
|
|
1
|
+
# Copyright 2016 The Chromium Authors. All rights reserved.
|
2
|
+
# Use of this source code is governed by a BSD-style license that can be
|
3
|
+
# found in the LICENSE file.
|
4
|
+
|
5
|
+
import argparse
|
6
|
+
import collections
|
7
|
+
import contextlib
|
8
|
+
import fnmatch
|
9
|
+
import hashlib
|
10
|
+
import logging
|
11
|
+
import os
|
12
|
+
import platform
|
13
|
+
import posixpath
|
14
|
+
import shutil
|
15
|
+
import string
|
16
|
+
import subprocess
|
17
|
+
import sys
|
18
|
+
import tempfile
|
19
|
+
|
20
|
+
|
21
|
+
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
|
22
|
+
ROOT_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..'))
|
23
|
+
|
24
|
+
DEVNULL = open(os.devnull, 'w')
|
25
|
+
|
26
|
+
BAT_EXT = '.bat' if sys.platform.startswith('win') else ''
|
27
|
+
|
28
|
+
# Top-level stubs to generate that fall through to executables within the Git
|
29
|
+
# directory.
|
30
|
+
STUBS = {
|
31
|
+
'git.bat': 'cmd\\git.exe',
|
32
|
+
'gitk.bat': 'cmd\\gitk.exe',
|
33
|
+
'ssh.bat': 'usr\\bin\\ssh.exe',
|
34
|
+
'ssh-keygen.bat': 'usr\\bin\\ssh-keygen.exe',
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
# Accumulated template parameters for generated stubs.
|
39
|
+
class Template(collections.namedtuple('Template', (
|
40
|
+
'PYTHON_RELDIR', 'PYTHON_BIN_RELDIR', 'PYTHON_BIN_RELDIR_UNIX',
|
41
|
+
'GIT_BIN_RELDIR', 'GIT_BIN_RELDIR_UNIX', 'GIT_PROGRAM',
|
42
|
+
))):
|
43
|
+
|
44
|
+
@classmethod
|
45
|
+
def empty(cls):
|
46
|
+
return cls(**{k: None for k in cls._fields})
|
47
|
+
|
48
|
+
def maybe_install(self, name, dst_path):
|
49
|
+
"""Installs template |name| to |dst_path| if it has changed.
|
50
|
+
|
51
|
+
This loads the template |name| from THIS_DIR, resolves template parameters,
|
52
|
+
and installs it to |dst_path|. See `maybe_update` for more information.
|
53
|
+
|
54
|
+
Args:
|
55
|
+
name (str): The name of the template to install.
|
56
|
+
dst_path (str): The destination filesystem path.
|
57
|
+
|
58
|
+
Returns (bool): True if |dst_path| was updated, False otherwise.
|
59
|
+
"""
|
60
|
+
template_path = os.path.join(THIS_DIR, name)
|
61
|
+
with open(template_path, 'r') as fd:
|
62
|
+
t = string.Template(fd.read())
|
63
|
+
return maybe_update(t.safe_substitute(self._asdict()), dst_path)
|
64
|
+
|
65
|
+
|
66
|
+
def maybe_update(content, dst_path):
|
67
|
+
"""Writes |content| to |dst_path| if |dst_path| does not already match.
|
68
|
+
|
69
|
+
This function will ensure that there is a file at |dst_path| containing
|
70
|
+
|content|. If |dst_path| already exists and contains |content|, no operation
|
71
|
+
will be performed, preserving filesystem modification times and avoiding
|
72
|
+
potential write contention.
|
73
|
+
|
74
|
+
Args:
|
75
|
+
content (str): The file content.
|
76
|
+
dst_path (str): The destination filesystem path.
|
77
|
+
|
78
|
+
Returns (bool): True if |dst_path| was updated, False otherwise.
|
79
|
+
"""
|
80
|
+
# If the path already exists and matches the new content, refrain from writing
|
81
|
+
# a new one.
|
82
|
+
if os.path.exists(dst_path):
|
83
|
+
with open(dst_path, 'r') as fd:
|
84
|
+
if fd.read() == content:
|
85
|
+
return False
|
86
|
+
|
87
|
+
logging.debug('Updating %r', dst_path)
|
88
|
+
with open(dst_path, 'w') as fd:
|
89
|
+
fd.write(content)
|
90
|
+
return True
|
91
|
+
|
92
|
+
|
93
|
+
def maybe_copy(src_path, dst_path):
|
94
|
+
"""Writes the content of |src_path| to |dst_path| if needed.
|
95
|
+
|
96
|
+
See `maybe_update` for more information.
|
97
|
+
|
98
|
+
Args:
|
99
|
+
src_path (str): The content source filesystem path.
|
100
|
+
dst_path (str): The destination filesystem path.
|
101
|
+
|
102
|
+
Returns (bool): True if |dst_path| was updated, False otherwise.
|
103
|
+
"""
|
104
|
+
with open(src_path, 'r') as fd:
|
105
|
+
content = fd.read()
|
106
|
+
return maybe_update(content, dst_path)
|
107
|
+
|
108
|
+
|
109
|
+
def call_if_outdated(stamp_path, stamp_version, fn):
|
110
|
+
"""Invokes |fn| if the stamp at |stamp_path| doesn't match |stamp_version|.
|
111
|
+
|
112
|
+
This can be used to keep a filesystem record of whether an operation has been
|
113
|
+
performed. The record is stored at |stamp_path|. To invalidate a record,
|
114
|
+
change the value of |stamp_version|.
|
115
|
+
|
116
|
+
After |fn| completes successfully, |stamp_path| will be updated to match
|
117
|
+
|stamp_version|, preventing the same update from happening in the future.
|
118
|
+
|
119
|
+
Args:
|
120
|
+
stamp_path (str): The filesystem path of the stamp file.
|
121
|
+
stamp_version (str): The desired stamp version.
|
122
|
+
fn (callable): A callable to invoke if the current stamp version doesn't
|
123
|
+
match |stamp_version|.
|
124
|
+
|
125
|
+
Returns (bool): True if an update occurred.
|
126
|
+
"""
|
127
|
+
|
128
|
+
stamp_version = stamp_version.strip()
|
129
|
+
if os.path.isfile(stamp_path):
|
130
|
+
with open(stamp_path, 'r') as fd:
|
131
|
+
current_version = fd.read().strip()
|
132
|
+
if current_version == stamp_version:
|
133
|
+
return False
|
134
|
+
|
135
|
+
fn()
|
136
|
+
|
137
|
+
with open(stamp_path, 'w') as fd:
|
138
|
+
fd.write(stamp_version)
|
139
|
+
return True
|
140
|
+
|
141
|
+
|
142
|
+
def _in_use(path):
|
143
|
+
"""Checks if a Windows file is in use.
|
144
|
+
|
145
|
+
When Windows is using an executable, it prevents other writers from
|
146
|
+
modifying or deleting that executable. We can safely test for an in-use
|
147
|
+
file by opening it in write mode and checking whether or not there was
|
148
|
+
an error.
|
149
|
+
|
150
|
+
Returns (bool): True if the file was in use, False if not.
|
151
|
+
"""
|
152
|
+
try:
|
153
|
+
with open(path, 'r+'):
|
154
|
+
return False
|
155
|
+
except IOError:
|
156
|
+
return True
|
157
|
+
|
158
|
+
|
159
|
+
def _toolchain_in_use(toolchain_path):
|
160
|
+
"""Returns (bool): True if a toolchain rooted at |path| is in use.
|
161
|
+
"""
|
162
|
+
# Look for Python files that may be in use.
|
163
|
+
for python_dir in (
|
164
|
+
os.path.join(toolchain_path, 'python', 'bin'), # CIPD
|
165
|
+
toolchain_path, # Legacy ZIP distributions.
|
166
|
+
):
|
167
|
+
for component in (
|
168
|
+
os.path.join(python_dir, 'python.exe'),
|
169
|
+
os.path.join(python_dir, 'DLLs', 'unicodedata.pyd'),
|
170
|
+
):
|
171
|
+
if os.path.isfile(component) and _in_use(component):
|
172
|
+
return True
|
173
|
+
return False
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
def _check_call(argv, stdin_input=None, **kwargs):
|
178
|
+
"""Wrapper for subprocess.check_call that adds logging."""
|
179
|
+
logging.info('running %r', argv)
|
180
|
+
if stdin_input is not None:
|
181
|
+
kwargs['stdin'] = subprocess.PIPE
|
182
|
+
proc = subprocess.Popen(argv, **kwargs)
|
183
|
+
proc.communicate(input=stdin_input)
|
184
|
+
if proc.returncode:
|
185
|
+
raise subprocess.CalledProcessError(proc.returncode, argv, None)
|
186
|
+
|
187
|
+
|
188
|
+
def _safe_rmtree(path):
|
189
|
+
if not os.path.exists(path):
|
190
|
+
return
|
191
|
+
|
192
|
+
def _make_writable_and_remove(path):
|
193
|
+
st = os.stat(path)
|
194
|
+
new_mode = st.st_mode | 0200
|
195
|
+
if st.st_mode == new_mode:
|
196
|
+
return False
|
197
|
+
try:
|
198
|
+
os.chmod(path, new_mode)
|
199
|
+
os.remove(path)
|
200
|
+
return True
|
201
|
+
except Exception:
|
202
|
+
return False
|
203
|
+
|
204
|
+
def _on_error(function, path, excinfo):
|
205
|
+
if not _make_writable_and_remove(path):
|
206
|
+
logging.warning('Failed to %s: %s (%s)', function, path, excinfo)
|
207
|
+
|
208
|
+
shutil.rmtree(path, onerror=_on_error)
|
209
|
+
|
210
|
+
|
211
|
+
def clean_up_old_installations(skip_dir):
|
212
|
+
"""Removes Python installations other than |skip_dir|.
|
213
|
+
|
214
|
+
This includes an "in-use" check against the "python.exe" in a given directory
|
215
|
+
to avoid removing Python executables that are currently ruinning. We need
|
216
|
+
this because our Python bootstrap may be run after (and by) other software
|
217
|
+
that is using the bootstrapped Python!
|
218
|
+
"""
|
219
|
+
root_contents = os.listdir(ROOT_DIR)
|
220
|
+
for f in ('win_tools-*_bin', 'python27*_bin', 'git-*_bin'):
|
221
|
+
for entry in fnmatch.filter(root_contents, f):
|
222
|
+
full_entry = os.path.join(ROOT_DIR, entry)
|
223
|
+
if full_entry == skip_dir or not os.path.isdir(full_entry):
|
224
|
+
continue
|
225
|
+
|
226
|
+
logging.info('Cleaning up old installation %r', entry)
|
227
|
+
if not _toolchain_in_use(full_entry):
|
228
|
+
_safe_rmtree(full_entry)
|
229
|
+
else:
|
230
|
+
logging.info('Toolchain at %r is in-use; skipping', full_entry)
|
231
|
+
|
232
|
+
|
233
|
+
# Version of "git_postprocess" system configuration (see |git_postprocess|).
|
234
|
+
GIT_POSTPROCESS_VERSION = '1'
|
235
|
+
|
236
|
+
|
237
|
+
def git_get_mingw_dir(git_directory):
|
238
|
+
"""Returns (str) The "mingw" directory in a Git installation, or None."""
|
239
|
+
for candidate in ('mingw64', 'mingw32'):
|
240
|
+
mingw_dir = os.path.join(git_directory, candidate)
|
241
|
+
if os.path.isdir(mingw_dir):
|
242
|
+
return mingw_dir
|
243
|
+
return None
|
244
|
+
|
245
|
+
|
246
|
+
def git_postprocess(template, git_directory):
|
247
|
+
# Update depot_tools files for "git help <command>"
|
248
|
+
mingw_dir = git_get_mingw_dir(git_directory)
|
249
|
+
if mingw_dir:
|
250
|
+
docsrc = os.path.join(ROOT_DIR, 'man', 'html')
|
251
|
+
git_docs_dir = os.path.join(mingw_dir, 'share', 'doc', 'git-doc')
|
252
|
+
for name in os.listdir(docsrc):
|
253
|
+
maybe_copy(
|
254
|
+
os.path.join(docsrc, name),
|
255
|
+
os.path.join(git_docs_dir, name))
|
256
|
+
else:
|
257
|
+
logging.info('Could not find mingw directory for %r.', git_directory)
|
258
|
+
|
259
|
+
# Create Git templates and configure its base layout.
|
260
|
+
for stub_name, relpath in STUBS.iteritems():
|
261
|
+
stub_template = template._replace(GIT_PROGRAM=relpath)
|
262
|
+
stub_template.maybe_install(
|
263
|
+
'git.template.bat',
|
264
|
+
os.path.join(ROOT_DIR, stub_name))
|
265
|
+
|
266
|
+
# Set-up our system configuration environment. The following set of
|
267
|
+
# parameters is versioned by "GIT_POSTPROCESS_VERSION". If they change,
|
268
|
+
# update "GIT_POSTPROCESS_VERSION" accordingly.
|
269
|
+
def configure_git_system():
|
270
|
+
git_bat_path = os.path.join(ROOT_DIR, 'git.bat')
|
271
|
+
_check_call([git_bat_path, 'config', '--system', 'core.autocrlf', 'false'])
|
272
|
+
_check_call([git_bat_path, 'config', '--system', 'core.filemode', 'false'])
|
273
|
+
_check_call([git_bat_path, 'config', '--system', 'core.preloadindex',
|
274
|
+
'true'])
|
275
|
+
_check_call([git_bat_path, 'config', '--system', 'core.fscache', 'true'])
|
276
|
+
|
277
|
+
call_if_outdated(
|
278
|
+
os.path.join(git_directory, '.git_postprocess'),
|
279
|
+
GIT_POSTPROCESS_VERSION,
|
280
|
+
configure_git_system)
|
281
|
+
|
282
|
+
|
283
|
+
def main(argv):
|
284
|
+
parser = argparse.ArgumentParser()
|
285
|
+
parser.add_argument('--verbose', action='store_true')
|
286
|
+
parser.add_argument('--win-tools-name', required=True,
|
287
|
+
help='The directory of the Python installation.')
|
288
|
+
parser.add_argument('--bleeding-edge', action='store_true',
|
289
|
+
help='Force bleeding edge Git.')
|
290
|
+
args = parser.parse_args(argv)
|
291
|
+
|
292
|
+
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.WARN)
|
293
|
+
|
294
|
+
template = Template.empty()._replace(
|
295
|
+
PYTHON_RELDIR=os.path.join(args.win_tools_name, 'python'),
|
296
|
+
PYTHON_BIN_RELDIR=os.path.join(args.win_tools_name, 'python', 'bin'),
|
297
|
+
PYTHON_BIN_RELDIR_UNIX=posixpath.join(
|
298
|
+
args.win_tools_name, 'python', 'bin'),
|
299
|
+
GIT_BIN_RELDIR=os.path.join(args.win_tools_name, 'git'),
|
300
|
+
GIT_BIN_RELDIR_UNIX=posixpath.join(args.win_tools_name, 'git'))
|
301
|
+
|
302
|
+
win_tools_dir = os.path.join(ROOT_DIR, args.win_tools_name)
|
303
|
+
git_postprocess(template, os.path.join(win_tools_dir, 'git'))
|
304
|
+
|
305
|
+
# Clean up any old Python and Git installations.
|
306
|
+
clean_up_old_installations(win_tools_dir)
|
307
|
+
|
308
|
+
# Emit our Python bin depot-tools-relative directory. This is ready by
|
309
|
+
# "python.bat" to identify the path of the current Python installation.
|
310
|
+
#
|
311
|
+
# We use this indirection so that upgrades can change this pointer to
|
312
|
+
# redirect "python.bat" to a new Python installation. We can't just update
|
313
|
+
# "python.bat" because batch file executions reload the batch file and seek
|
314
|
+
# to the previous cursor in between every command, so changing the batch
|
315
|
+
# file contents could invalidate any existing executions.
|
316
|
+
#
|
317
|
+
# The intention is that the batch file itself never needs to change when
|
318
|
+
# switching Python versions.
|
319
|
+
maybe_update(
|
320
|
+
template.PYTHON_BIN_RELDIR,
|
321
|
+
os.path.join(ROOT_DIR, 'python_bin_reldir.txt'))
|
322
|
+
|
323
|
+
# Re-evaluate and regenerate our root templated files.
|
324
|
+
for src_name, dst_name in (
|
325
|
+
('git-bash.template.sh', 'git-bash'),
|
326
|
+
('pylint.new.bat', 'pylint.bat'),
|
327
|
+
('python27.new.bat', 'python.bat'),
|
328
|
+
):
|
329
|
+
template.maybe_install(src_name, os.path.join(ROOT_DIR, dst_name))
|
330
|
+
|
331
|
+
return 0
|
332
|
+
|
333
|
+
|
334
|
+
if __name__ == '__main__':
|
335
|
+
sys.exit(main(sys.argv[1:]))
|