Skip to content

Commit 5a2ae38

Browse files
authored
Merge pull request #106 from crablang/current
chore: sync with upstream
2 parents ffc41ab + 2be66b6 commit 5a2ae38

File tree

2,215 files changed

+56664
-32213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,215 files changed

+56664
-32213
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
env:
3939
CI_JOB_NAME: "${{ matrix.name }}"
4040
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
41+
HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
4142
SCCACHE_BUCKET: rust-lang-ci-sccache2
4243
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
4344
CACHE_DOMAIN: ci-caches.rust-lang.org
@@ -143,6 +144,17 @@ jobs:
143144
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
144145
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
145146
if: success() && !env.SKIP_JOB
147+
- name: create github artifacts
148+
run: src/ci/scripts/create-doc-artifacts.sh
149+
if: success() && !env.SKIP_JOB
150+
- name: upload artifacts to github
151+
uses: actions/upload-artifact@v3
152+
with:
153+
name: "${{ env.DOC_ARTIFACT_NAME }}"
154+
path: obj/artifacts/doc
155+
if-no-files-found: ignore
156+
retention-days: 5
157+
if: success() && !env.SKIP_JOB
146158
- name: upload artifacts to S3
147159
run: src/ci/scripts/upload-artifacts.sh
148160
env:
@@ -156,6 +168,7 @@ jobs:
156168
env:
157169
CI_JOB_NAME: "${{ matrix.name }}"
158170
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
171+
HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
159172
SCCACHE_BUCKET: rust-lang-ci-sccache2
160173
DEPLOY_BUCKET: rust-lang-ci2
161174
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
@@ -383,25 +396,15 @@ jobs:
383396
DIST_REQUIRE_ALL_TOOLS: 1
384397
JEMALLOC_SYS_WITH_LG_PAGE: 14
385398
os: macos-latest
386-
- name: x86_64-msvc-1
399+
- name: x86_64-msvc
387400
env:
388401
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
389-
SCRIPT: make ci-subset-1
402+
SCRIPT: make ci-msvc
390403
os: windows-2019-8core-32gb
391-
- name: x86_64-msvc-2
392-
env:
393-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
394-
SCRIPT: make ci-subset-2
395-
os: windows-2019-8core-32gb
396-
- name: i686-msvc-1
404+
- name: i686-msvc
397405
env:
398406
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
399-
SCRIPT: make ci-subset-1
400-
os: windows-2019-8core-32gb
401-
- name: i686-msvc-2
402-
env:
403-
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-msvc"
404-
SCRIPT: make ci-subset-2
407+
SCRIPT: make ci-msvc
405408
os: windows-2019-8core-32gb
406409
- name: x86_64-msvc-cargo
407410
env:
@@ -414,30 +417,16 @@ jobs:
414417
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --save-toolstates=/tmp/toolstate/toolstates.json"
415418
DEPLOY_TOOLSTATES_JSON: toolstates-windows.json
416419
os: windows-2019-8core-32gb
417-
- name: i686-mingw-1
420+
- name: i686-mingw
418421
env:
419422
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
420-
SCRIPT: make ci-mingw-subset-1
423+
SCRIPT: make ci-mingw
421424
NO_DOWNLOAD_CI_LLVM: 1
422425
CUSTOM_MINGW: 1
423426
os: windows-2019-8core-32gb
424-
- name: i686-mingw-2
427+
- name: x86_64-mingw
425428
env:
426-
RUST_CONFIGURE_ARGS: "--build=i686-pc-windows-gnu"
427-
SCRIPT: make ci-mingw-subset-2
428-
NO_DOWNLOAD_CI_LLVM: 1
429-
CUSTOM_MINGW: 1
430-
os: windows-2019-8core-32gb
431-
- name: x86_64-mingw-1
432-
env:
433-
SCRIPT: make ci-mingw-subset-1
434-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
435-
NO_DOWNLOAD_CI_LLVM: 1
436-
CUSTOM_MINGW: 1
437-
os: windows-2019-8core-32gb
438-
- name: x86_64-mingw-2
439-
env:
440-
SCRIPT: make ci-mingw-subset-2
429+
SCRIPT: make ci-mingw
441430
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-gnu --enable-profiler"
442431
NO_DOWNLOAD_CI_LLVM: 1
443432
CUSTOM_MINGW: 1
@@ -567,6 +556,17 @@ jobs:
567556
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
568557
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
569558
if: success() && !env.SKIP_JOB
559+
- name: create github artifacts
560+
run: src/ci/scripts/create-doc-artifacts.sh
561+
if: success() && !env.SKIP_JOB
562+
- name: upload artifacts to github
563+
uses: actions/upload-artifact@v3
564+
with:
565+
name: "${{ env.DOC_ARTIFACT_NAME }}"
566+
path: obj/artifacts/doc
567+
if-no-files-found: ignore
568+
retention-days: 5
569+
if: success() && !env.SKIP_JOB
570570
- name: upload artifacts to S3
571571
run: src/ci/scripts/upload-artifacts.sh
572572
env:
@@ -581,6 +581,7 @@ jobs:
581581
DIST_TRY_BUILD: 1
582582
CI_JOB_NAME: "${{ matrix.name }}"
583583
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
584+
HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
584585
SCCACHE_BUCKET: rust-lang-ci-sccache2
585586
DEPLOY_BUCKET: rust-lang-ci2
586587
TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
@@ -682,6 +683,17 @@ jobs:
682683
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
683684
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
684685
if: success() && !env.SKIP_JOB
686+
- name: create github artifacts
687+
run: src/ci/scripts/create-doc-artifacts.sh
688+
if: success() && !env.SKIP_JOB
689+
- name: upload artifacts to github
690+
uses: actions/upload-artifact@v3
691+
with:
692+
name: "${{ env.DOC_ARTIFACT_NAME }}"
693+
path: obj/artifacts/doc
694+
if-no-files-found: ignore
695+
retention-days: 5
696+
if: success() && !env.SKIP_JOB
685697
- name: upload artifacts to S3
686698
run: src/ci/scripts/upload-artifacts.sh
687699
env:

.github/workflows/dependencies.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Automatically run `cargo update` periodically
2+
3+
---
4+
name: Bump dependencies in Cargo.lock
5+
on:
6+
schedule:
7+
# Run weekly
8+
- cron: '0 0 * * Sun'
9+
workflow_dispatch:
10+
# Needed so we can run it manually
11+
permissions:
12+
contents: read
13+
defaults:
14+
run:
15+
shell: bash
16+
env:
17+
# So cargo doesn't complain about unstable features
18+
RUSTC_BOOTSTRAP: 1
19+
PR_TITLE: Weekly `cargo update`
20+
PR_MESSAGE: |
21+
Automation to keep dependencies in `Cargo.lock` current.
22+
23+
The following is the output from `cargo update`:
24+
COMMIT_MESSAGE: "cargo update \n\n"
25+
26+
jobs:
27+
not-waiting-on-bors:
28+
name: skip if S-waiting-on-bors
29+
runs-on: ubuntu-latest
30+
steps:
31+
- env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
# Fetch state and labels of PR
35+
# Or exit successfully if PR does not exist
36+
JSON=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json labels,state || exit 0)
37+
STATE=$(echo "$JSON" | jq -r '.state')
38+
WAITING_ON_BORS=$(echo "$JSON" | jq '.labels[] | any(.name == "S-waiting-on-bors"; .)')
39+
40+
# Exit with error if open and S-waiting-on-bors
41+
if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then
42+
exit 1
43+
fi
44+
45+
update:
46+
name: update dependencies
47+
needs: not-waiting-on-bors
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: checkout the source code
51+
uses: actions/checkout@v3
52+
with:
53+
submodules: recursive
54+
- name: install the bootstrap toolchain
55+
run: |
56+
# Extract the stage0 version
57+
TOOLCHAIN=$(jq -r '.compiler | {version,date} | join("-")' -- src/stage0.json)
58+
# Install and set as default
59+
rustup toolchain install --no-self-update --profile minimal $TOOLCHAIN
60+
rustup default $TOOLCHAIN
61+
62+
- name: cargo update
63+
# Remove first line that always just says "Updating crates.io index"
64+
run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
65+
- name: upload Cargo.lock artifact for use in PR
66+
uses: actions/upload-artifact@v3
67+
with:
68+
name: Cargo-lock
69+
path: Cargo.lock
70+
retention-days: 1
71+
- name: upload cargo-update log artifact for use in PR
72+
uses: actions/upload-artifact@v3
73+
with:
74+
name: cargo-updates
75+
path: cargo_update.log
76+
retention-days: 1
77+
78+
pr:
79+
name: amend PR
80+
needs: update
81+
runs-on: ubuntu-latest
82+
permissions:
83+
contents: write
84+
pull-requests: write
85+
steps:
86+
- name: checkout the source code
87+
uses: actions/checkout@v3
88+
89+
- name: download Cargo.lock from update job
90+
uses: actions/download-artifact@v3
91+
with:
92+
name: Cargo-lock
93+
- name: download cargo-update log from update job
94+
uses: actions/download-artifact@v3
95+
with:
96+
name: cargo-updates
97+
98+
- name: craft PR body and commit message
99+
run: |
100+
echo "${COMMIT_MESSAGE}" > commit.txt
101+
cat cargo_update.log >> commit.txt
102+
103+
echo "${PR_MESSAGE}" > body.md
104+
echo '```txt' >> body.md
105+
cat cargo_update.log >> body.md
106+
echo '```' >> body.md
107+
108+
- name: commit
109+
run: |
110+
git config user.name github-actions
111+
git config user.email [email protected]
112+
git switch --force-create cargo_update
113+
git add ./Cargo.lock
114+
git commit --no-verify --file=commit.txt
115+
116+
- name: push
117+
run: git push --no-verify --force --set-upstream origin cargo_update
118+
119+
- name: edit existing open pull request
120+
id: edit
121+
# Don't fail job if we need to open new PR
122+
continue-on-error: true
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
run: |
126+
# Exit with error if PR is closed
127+
STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state')
128+
if [[ "$STATE" != "OPEN" ]]; then
129+
exit 1
130+
fi
131+
132+
gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY
133+
134+
- name: open new pull request
135+
# Only run if there wasn't an existing PR
136+
if: steps.edit.outcome != 'success'
137+
env:
138+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139+
run: gh pr create --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY

0 commit comments

Comments
 (0)