diff --git a/.buildbot.config.toml b/.buildbot.config.toml index 1c68779eaf3..83fd549e06d 100644 --- a/.buildbot.config.toml +++ b/.buildbot.config.toml @@ -12,6 +12,8 @@ tools = ["cargo", "rustdoc"] [llvm] assertions = true # Turn on assertions in LLVM. -[install] -prefix = "build/ykrustc-stage2-latest" -sysconfdir = "etc" +# `x.py install` is currently broken. +# https://github.com/rust-lang/rust/issues/80683 +#[install] +#prefix = "build/ykrustc-stage2-latest" +#sysconfdir = "etc" diff --git a/.buildbot.sh b/.buildbot.sh index 2bba3a0b84f..20d21fa255f 100644 --- a/.buildbot.sh +++ b/.buildbot.sh @@ -11,6 +11,7 @@ TARBALL_TOPDIR=`pwd`/build/ykrustc-stage2-latest TARBALL_NAME=ykrustc-${STD_TRACER_MODE}-stage2-${COMMIT_HASH}.tar.bz2 SYMLINK_NAME=ykrustc-${STD_TRACER_MODE}-stage2-latest.tar.bz2 SNAP_DIR=/opt/ykrustc-bin-snapshots +PLATFORM_BUILD_DIR=build/x86_64-unknown-linux-gnu # Ensure the build fails if it uses excessive amounts of memory. ulimit -d $((1024 * 1024 * 10)) # 10 GiB @@ -27,7 +28,12 @@ ulimit -d $((1024 * 1024 * 10)) # 10 GiB # Build extended tools and install into TARBALL_TOPDIR. mkdir -p ${TARBALL_TOPDIR} -/usr/bin/time -v ./x.py install --config .buildbot.config.toml +# `x.py install` is currently broken, so we use a workaround for now. +# https://github.com/rust-lang/rust/issues/80683 +#/usr/bin/time -v ./x.py install --config .buildbot.config.toml +/usr/bin/time -v ./x.py build --stage 2 --config .buildbot.config.toml library/std rustdoc cargo +cp -r ${PLATFORM_BUILD_DIR}/stage2/* ${TARBALL_TOPDIR} +cp -r ${PLATFORM_BUILD_DIR}/stage2-tools-bin/cargo ${TARBALL_TOPDIR}/bin # Archive the build and put it in /opt git show -s HEAD > ${TARBALL_TOPDIR}/VERSION diff --git a/.buildbot_patch_yk_dep.py b/.buildbot_patch_yk_dep.py index f5a6e1e06d4..70ed9ddce36 100644 --- a/.buildbot_patch_yk_dep.py +++ b/.buildbot_patch_yk_dep.py @@ -24,7 +24,12 @@ def get_pr_no(): proc = subprocess.run(["git", "log", "-1", "--pretty=format:%s"], capture_output=True, check=True) line = proc.stdout.decode('utf-8') - assert line.startswith(('Merge #', 'Try #')) + + # If the build is manual or forced from the web interface there may not be + # a bors merge commit, in which case we don't do any patching. + if not line.startswith(('Merge #', 'Try #')): + return None + pr_no = line.split(" ", maxsplit=1)[1] pr_no = pr_no.rstrip(":") # Colon present on 'Try' only it seems. assert pr_no.startswith('#') @@ -69,13 +74,14 @@ def write_cargo_toml(git_url, branch): if __name__ == "__main__": pr_no = get_pr_no() - url, branch = get_yk_branch(pr_no) - - # x.py gets upset if you try to patch the dep to the default path: - # "patch for `ykpack` in `https://github.com/softdevteam/yk` points to the - # same source, but patches must point to different sources" - if (url, branch) != (f"https://github.com/{SOFTDEV_USER}/{YK_REPO}", - DEFAULT_BRANCH): - # For the sake of the CI logs, print the override. - print(f"Patching yk dependency to: {url} {branch}") - write_cargo_toml(url, branch) + if pr_no is not None: + url, branch = get_yk_branch(pr_no) + + # x.py gets upset if you try to patch the dep to the default path: + # "patch for `ykpack` in `https://github.com/softdevteam/yk` points to + # the same source, but patches must point to different sources" + if (url, branch) != (f"https://github.com/{SOFTDEV_USER}/{YK_REPO}", + DEFAULT_BRANCH): + # For the sake of the CI logs, print the override. + print(f"Patching yk dependency to: {url} {branch}") + write_cargo_toml(url, branch)