Auto merge of #23434 - jdm:wpt-fix, r=Manishearth

Fix nightly WPT sync job

These changes were tested by triggering the daily hook with a branch that included them, and they caused #23433 to be opened successfully.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23434)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-05-21 23:58:05 -04:00 committed by GitHub
commit 415b26e4f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 11 deletions

View file

@ -475,8 +475,7 @@ def macos_nightly():
def update_wpt():
# Reuse the release build that was made for landing the PR
build_task = decisionlib.Task.find("build.macos_x64_release." + CONFIG.git_sha)
build_task = macos_release_build()
update_task = (
macos_task("WPT update")
.with_python2()
@ -491,7 +490,8 @@ def update_wpt():
"etc/taskcluster/macos/Brewfile-wpt",
"etc/taskcluster/macos/Brewfile-gstreamer",
])
.with_repo()
# Pushing the new changes to the git remote requires a full repo clone.
.with_repo(shallow=False)
.with_curl_artifact_script(build_task, "target.tar.gz")
.with_script("""
export PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig/"
@ -504,8 +504,8 @@ def update_wpt():
)
def macos_wpt():
build_task = (
def macos_release_build():
return (
macos_build_task("Release build")
.with_treeherder("macOS x64", "Release")
.with_script("""
@ -520,6 +520,10 @@ def macos_wpt():
.with_artifacts("repo/target.tar.gz")
.find_or_create("build.macos_x64_release." + CONFIG.git_sha)
)
def macos_wpt():
build_task = macos_release_build()
def macos_run_task(name):
task = macos_task(name).with_python2()
return (
@ -771,6 +775,7 @@ def macos_build_task(name):
.with_repo()
.with_python2()
.with_rustup()
.with_index_and_artifacts_expire_in(build_artifacts_expire_in)
# Debugging for surprising generic-worker behaviour
.with_early_script("ls")
.with_script("ls target || true")

View file

@ -427,7 +427,7 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
self.with_early_script("set PATH=%HOMEDRIVE%%HOMEPATH%\\{};%PATH%".format(p))
return self
def with_repo(self, sparse_checkout=None):
def with_repo(self, sparse_checkout=None, shallow=True):
"""
Make a shallow clone the git repository at the start of the task.
This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`,
@ -452,9 +452,9 @@ class WindowsGenericWorkerTask(GenericWorkerTask):
type .git\\info\\sparse-checkout
"""
git += """
git fetch --depth 1 %GIT_URL% %GIT_REF%
git fetch {depth} %GIT_URL% %GIT_REF%
git reset --hard %GIT_SHA%
"""
""".format(depth="--depth 1" if shallow else "")
return self \
.with_git() \
.with_script(git) \
@ -560,7 +560,7 @@ class UnixTaskMixin(Task):
super().__init__(*args, **kwargs)
self.curl_scripts_count = 0
def with_repo(self):
def with_repo(self, shallow=True):
"""
Make a shallow clone the git repository at the start of the task.
This uses `CONFIG.git_url`, `CONFIG.git_ref`, and `CONFIG.git_sha`
@ -578,9 +578,9 @@ class UnixTaskMixin(Task):
.with_early_script("""
git init repo
cd repo
git fetch --depth 1 "$GIT_URL" "$GIT_REF"
git fetch {depth} "$GIT_URL" "$GIT_REF"
git reset --hard "$GIT_SHA"
""")
""".format(depth="--depth 1" if shallow else ""))
def with_curl_script(self, url, file_path):
self.curl_scripts_count += 1