Skip to content

Commit e459bfb

Browse files
committed
Added CI script for automatically rebasing onto nightly.
1 parent 4c2cfc6 commit e459bfb

File tree

9 files changed

+28
-22
lines changed

9 files changed

+28
-22
lines changed

.github/workflows/sync.yml renamed to .github/workflows/nightly.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: sync
1+
name: nightly
22
on: workflow_dispatch
33
permissions:
44
contents: read
@@ -21,7 +21,12 @@ jobs:
2121
- uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
24+
- name: Install LLVM
25+
run: |
26+
sudo apt-get install llvm
27+
- name: Install ninja
28+
run: sudo apt-get install ninja-build
2429
- name: Rebase
2530
run: src/ci/scripts/sync.sh
2631
- name: Build
27-
run: ./x.py build --stage 1 library
32+
run: ./x.py build --stage 1 library --set llvm.download-ci-llvm=false

src/ci/scripts/sync.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/bin/bash
22
ORIGIN="https://github.com/rust-lang"
3+
LLVM_FORK="https://github.com/borrow-sanitizer/llvm-project.git"
34
RUST_UPSTREAM="$ORIGIN/rust.git"
45
LLVM_UPSTREAM="$ORIGIN/llvm-project.git"
5-
BRANCH="bsan"
6-
7-
git checkout $BRANCH || exit
6+
MAIN_BRANCH="bsan"
7+
BASE_TAG="base"
8+
BASE_COMMIT=$(git rev-list -n 1 $BASE_TAG)
9+
git checkout "$MAIN_BRANCH" || exit
810

911
init_upstream() {
1012
local upstream=$1
@@ -32,17 +34,16 @@ fi
3234

3335
NIGHTLY_TOOLCHAIN="nightly-$DATE"
3436
git submodule update --init --no-recommend-shallow src/llvm-project
35-
3637
(cd src/llvm-project && init_upstream $LLVM_UPSTREAM)
3738
init_upstream $RUST_UPSTREAM
38-
git branch -D nightly &> /dev/null
39+
git branch -D nightly
3940
git checkout -b nightly "$NIGHTLY_COMMIT_HASH" || exit
40-
4141
git submodule update --rebase src/llvm-project
42-
if ! git diff-index --quiet HEAD --; then
43-
git add src/llvm-project
44-
git commit -m "$NIGHTLY_TOOLCHAIN"
45-
fi
46-
47-
git checkout $BRANCH || exit
48-
git rebase nightly || exit
42+
git submodule set-url -- src/llvm-project $LLVM_FORK
43+
git submodule set-branch --branch $MAIN_BRANCH -- src/llvm-project
44+
git add src/llvm-project .gitmodules
45+
git commit -m "$NIGHTLY_TOOLCHAIN"
46+
git tag -D $BASE_TAG
47+
git tag -a $BASE_TAG -m "$NIGHTLY_TOOLCHAIN"
48+
git checkout "$MAIN_BRANCH" || exit
49+
git rebase --onto nightly "$BASE_COMMIT" $MAIN_BRANCH || exit

src/doc/book

Submodule book updated 884 files

0 commit comments

Comments
 (0)