Skip to content

Commit c6ef02a

Browse files
committed
Merge from rustc
2 parents 91eda7a + be63a2d commit c6ef02a

File tree

317 files changed

+9602
-5146
lines changed

Some content is hidden

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

317 files changed

+9602
-5146
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ indent_size = 2
1515

1616
[*.{yml,yaml}]
1717
indent_size = 2
18+
19+
[COMMIT_EDITMSG]
20+
max_line_length = unset

.github/workflows/autopublish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
publish:
14-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
14+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
1515
name: publish
1616
runs-on: ubuntu-latest
1717
steps:

.github/workflows/ci.yaml

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,48 @@ jobs:
3535
typescript:
3636
- 'editors/code/**'
3737
proc_macros:
38+
- 'crates/tt/**'
3839
- 'crates/proc-macro-api/**'
3940
- 'crates/proc-macro-srv/**'
4041
- 'crates/proc-macro-srv-cli/**'
4142
42-
rust:
43+
proc-macro-srv:
4344
needs: changes
45+
if: github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.proc_macros == 'true'
46+
name: proc-macro-srv
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
with:
52+
ref: ${{ github.event.pull_request.head.sha }}
53+
54+
- name: Install Rust toolchain
55+
run: |
56+
rustup update --no-self-update nightly
57+
rustup default nightly
58+
rustup component add --toolchain nightly rust-src rustfmt
59+
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
60+
- name: Install Rust Problem Matcher
61+
if: matrix.os == 'ubuntu-latest'
62+
run: echo "::add-matcher::.github/rust.json"
63+
64+
- name: Cache Dependencies
65+
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
66+
67+
- name: Bump opt-level
68+
if: matrix.os == 'ubuntu-latest'
69+
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
70+
71+
- name: Test
72+
run: cargo test --features sysroot-abi -p rust-analyzer -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -- --quiet
73+
74+
rust:
4475
if: github.repository == 'rust-lang/rust-analyzer'
4576
name: Rust
4677
runs-on: ${{ matrix.os }}
4778
env:
4879
CC: deny_c
49-
RUST_CHANNEL: "${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable' }}"
50-
USE_SYSROOT_ABI: "${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || '' }}"
5180

5281
strategy:
5382
fail-fast: false
@@ -62,22 +91,19 @@ jobs:
6291

6392
- name: Install Rust toolchain
6493
run: |
65-
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
66-
rustup default ${{ env.RUST_CHANNEL }}
67-
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rust-src
94+
rustup update --no-self-update stable
95+
rustup default stable
96+
rustup component add --toolchain stable rust-src
6897
# We always use a nightly rustfmt, regardless of channel, because we need
6998
# --file-lines.
70-
rustup toolchain add nightly --profile minimal
71-
rustup component add --toolchain nightly rustfmt
99+
rustup toolchain install nightly --profile minimal --component rustfmt
72100
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
73101
- name: Install Rust Problem Matcher
74102
if: matrix.os == 'ubuntu-latest'
75103
run: echo "::add-matcher::.github/rust.json"
76104

77105
- name: Cache Dependencies
78106
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
79-
with:
80-
key: ${{ env.RUST_CHANNEL }}
81107

82108
- name: Bump opt-level
83109
if: matrix.os == 'ubuntu-latest'
@@ -87,16 +113,16 @@ jobs:
87113
run: cargo codegen --check
88114

89115
- name: Compile (tests)
90-
run: cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
116+
run: cargo test --no-run --locked
91117

92118
# It's faster to `test` before `build` ¯\_(ツ)_/¯
93119
- name: Compile (rust-analyzer)
94120
if: matrix.os == 'ubuntu-latest'
95-
run: cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
121+
run: cargo build --quiet
96122

97123
- name: Test
98124
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
99-
run: cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
125+
run: cargo test -- --quiet
100126

101127
- name: Switch to stable toolchain
102128
run: |
@@ -157,7 +183,7 @@ jobs:
157183
158184
typescript:
159185
needs: changes
160-
if: github.repository == 'rust-lang/rust-analyzer'
186+
if: github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
161187
name: TypeScript
162188
strategy:
163189
fail-fast: false
@@ -169,21 +195,18 @@ jobs:
169195
steps:
170196
- name: Checkout repository
171197
uses: actions/checkout@v4
172-
if: needs.changes.outputs.typescript == 'true'
173198

174199
- name: Install Nodejs
175200
uses: actions/setup-node@v4
176201
with:
177-
node-version: 18
178-
if: needs.changes.outputs.typescript == 'true'
202+
node-version: 22
179203

180204
- name: Install xvfb
181-
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
205+
if: matrix.os == 'ubuntu-latest'
182206
run: sudo apt-get install -y xvfb
183207

184208
- run: npm ci
185209
working-directory: ./editors/code
186-
if: needs.changes.outputs.typescript == 'true'
187210

188211
# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
189212
# if: runner.os == 'Linux'
@@ -192,35 +215,31 @@ jobs:
192215
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
193216
- run: npm run typecheck
194217
working-directory: ./editors/code
195-
if: needs.changes.outputs.typescript == 'true'
196218

197219
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
198220
- run: npm run lint
199221
working-directory: ./editors/code
200-
if: needs.changes.outputs.typescript == 'true'
201222

202223
# To fix this steps, please run `npm run format`.
203224
- run: npm run format:check
204225
working-directory: ./editors/code
205-
if: needs.changes.outputs.typescript == 'true'
206226

207227
- name: Run VS Code tests (Linux)
208-
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
228+
if: matrix.os == 'ubuntu-latest'
209229
env:
210230
VSCODE_CLI: 1
211231
run: xvfb-run npm test
212232
working-directory: ./editors/code
213233

214234
- name: Run VS Code tests (Windows)
215-
if: matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
235+
if: matrix.os == 'windows-latest'
216236
env:
217237
VSCODE_CLI: 1
218238
run: npm test
219239
working-directory: ./editors/code
220240

221241
- run: npm run package --scripts-prepend-node-path
222242
working-directory: ./editors/code
223-
if: needs.changes.outputs.typescript == 'true'
224243

225244
typo-check:
226245
name: Typo Check
@@ -242,7 +261,7 @@ jobs:
242261
run: typos
243262

244263
conclusion:
245-
needs: [rust, rust-cross, typescript, typo-check]
264+
needs: [rust, rust-cross, typescript, typo-check, proc-macro-srv]
246265
# We need to ensure this job does *not* get skipped if its dependencies fail,
247266
# because a skipped job is considered a success by GitHub. So we have to
248267
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -257,5 +276,5 @@ jobs:
257276
run: |
258277
# Print the dependent jobs to see them in the CI log
259278
jq -C <<< '${{ toJson(needs) }}'
260-
# Check if all jobs that we depend on (in the needs array) were successful.
261-
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
279+
# Check if all jobs that we depend on (in the needs array) were successful (or have been skipped).
280+
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'

.github/workflows/fuzz.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919

2020
jobs:
2121
rust:
22-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
22+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
2323
name: Rust
2424
runs-on: ubuntu-latest
2525
env:

.github/workflows/publish-libs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
publish-libs:
12-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
12+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
1313
name: publish
1414
runs-on: ubuntu-latest
1515
steps:

.github/workflows/release.yaml

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ env:
1717
RUSTUP_MAX_RETRIES: 10
1818
FETCH_DEPTH: 0 # pull in the tags for the version string
1919
MACOSX_DEPLOYMENT_TARGET: 13.0
20-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
21-
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
20+
ZIG_VERSION: 0.13.0
21+
ZIGBUILD_VERSION: 0.19.8
2222

2323
jobs:
2424
dist:
25-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
25+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
2626
strategy:
2727
matrix:
2828
include:
@@ -36,13 +36,15 @@ jobs:
3636
code-target: win32-arm64
3737
- os: ubuntu-latest
3838
target: x86_64-unknown-linux-gnu
39+
zig_target: x86_64-unknown-linux-gnu.2.28
3940
code-target: linux-x64
40-
container: rockylinux:8
4141
- os: ubuntu-latest
4242
target: aarch64-unknown-linux-gnu
43+
zig_target: aarch64-unknown-linux-gnu.2.28
4344
code-target: linux-arm64
4445
- os: ubuntu-latest
4546
target: arm-unknown-linux-gnueabihf
47+
zig_target: arm-unknown-linux-gnueabihf.2.28
4648
code-target: linux-armhf
4749
- os: macos-13
4850
target: x86_64-apple-darwin
@@ -64,40 +66,33 @@ jobs:
6466
with:
6567
fetch-depth: ${{ env.FETCH_DEPTH }}
6668

67-
- name: Install toolchain dependencies
68-
if: matrix.container == 'rockylinux:8'
69-
shell: bash
70-
run: |
71-
dnf install -y gcc
72-
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
73-
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
69+
- name: Install Node.js toolchain
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: 22
7473

7574
- name: Install Rust toolchain
7675
run: |
7776
rustup update --no-self-update stable
78-
rustup target add ${{ matrix.target }}
7977
rustup component add rust-src
78+
rustup target add ${{ matrix.target }}
8079
81-
- name: Install Node.js
82-
uses: actions/setup-node@v4
83-
with:
84-
node-version: 18
85-
86-
- name: Update apt repositories
87-
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
88-
run: sudo apt-get update
89-
90-
- name: Install AArch64 target toolchain
91-
if: matrix.target == 'aarch64-unknown-linux-gnu'
92-
run: sudo apt-get install gcc-aarch64-linux-gnu
93-
94-
- name: Install ARM target toolchain
95-
if: matrix.target == 'arm-unknown-linux-gnueabihf'
96-
run: sudo apt-get install gcc-arm-linux-gnueabihf
80+
- name: Install Zig toolchain
81+
if: ${{ matrix.zig_target }}
82+
run: |
83+
which cargo
84+
curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | sudo tar JxC /usr/local
85+
sudo ln -s "/usr/local/zig-linux-$(uname -m)-${ZIG_VERSION}/zig" /usr/local/bin/zig
86+
curl -L "https://github.com/rust-cross/cargo-zigbuild/releases/download/v${ZIGBUILD_VERSION}/cargo-zigbuild-v${ZIGBUILD_VERSION}.x86_64-unknown-linux-musl.tar.gz" | tar zxC ~/.cargo/bin
9787
98-
- name: Dist
88+
- name: Dist (plain)
89+
if: ${{ !matrix.zig_target }}
9990
run: cargo xtask dist --client-patch-version ${{ github.run_number }}
10091

92+
- name: Dist (using zigbuild)
93+
if: ${{ matrix.zig_target }}
94+
run: RA_TARGET=${{ matrix.zig_target}} cargo xtask dist --client-patch-version ${{ github.run_number }} --zig
95+
10196
- run: npm ci
10297
working-directory: editors/code
10398

@@ -139,7 +134,7 @@ jobs:
139134
path: ./dist
140135

141136
dist-x86_64-unknown-linux-musl:
142-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
137+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
143138
name: dist (x86_64-unknown-linux-musl)
144139
runs-on: ubuntu-latest
145140
env:
@@ -185,15 +180,15 @@ jobs:
185180
path: ./dist
186181

187182
publish:
188-
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
183+
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
189184
name: publish
190185
runs-on: ubuntu-latest
191186
needs: ["dist", "dist-x86_64-unknown-linux-musl"]
192187
steps:
193188
- name: Install Nodejs
194189
uses: actions/setup-node@v4
195190
with:
196-
node-version: 20
191+
node-version: 22
197192

198193
- run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
199194
if: github.ref == 'refs/heads/release'

.typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ extend-ignore-re = [
1818
"INOUT",
1919
"optin",
2020
"=Pn",
21+
# ignore `// spellchecker:off` until `// spellchecker:on`
22+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
2123
]
2224

2325
[default.extend-words]

0 commit comments

Comments
 (0)