Skip to content
This repository was archived by the owner on Jan 7, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .buildbot.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
8 changes: 7 additions & 1 deletion .buildbot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
28 changes: 17 additions & 11 deletions .buildbot_patch_yk_dep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('#')
Expand Down Expand Up @@ -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)