Skip to content

Commit 15d8741

Browse files
authored
Merge pull request #19391 from Veykril/push-rnrskpqoltpl
chore: Clean up proc-macro-srv CI job
2 parents 5742bdf + 56c9f33 commit 15d8741

File tree

4 files changed

+17
-30
lines changed

4 files changed

+17
-30
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
CARGO_NET_RETRY: 10
1616
CI: 1
1717
RUST_BACKTRACE: short
18-
RUSTFLAGS: "-D warnings -D elided_lifetimes_in_paths -D explicit_outlives_requirements -D unsafe_op_in_unsafe_fn -D unused_extern_crates -D unused_lifetimes -D unreachable_pub"
18+
RUSTFLAGS: "-D warnings"
1919
RUSTUP_MAX_RETRIES: 10
2020

2121
jobs:
@@ -58,18 +58,15 @@ jobs:
5858
rustup component add --toolchain nightly rust-src rustfmt
5959
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
6060
- name: Install Rust Problem Matcher
61-
if: matrix.os == 'ubuntu-latest'
6261
run: echo "::add-matcher::.github/rust.json"
6362

64-
- name: Cache Dependencies
65-
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
63+
# We don't cache this job, as it will be invalidated every day due to nightly usage
6664

6765
- name: Bump opt-level
68-
if: matrix.os == 'ubuntu-latest'
6966
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
7067

7168
- 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
69+
run: cargo test --features sysroot-abi -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -- --quiet
7370

7471
rust:
7572
if: github.repository == 'rust-lang/rust-analyzer'
@@ -79,7 +76,6 @@ jobs:
7976
CC: deny_c
8077

8178
strategy:
82-
fail-fast: false
8379
matrix:
8480
os: [ubuntu-latest, windows-latest, macos-latest]
8581

@@ -103,7 +99,11 @@ jobs:
10399
run: echo "::add-matcher::.github/rust.json"
104100

105101
- name: Cache Dependencies
106-
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
102+
uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844
103+
with:
104+
workspaces: |
105+
. -> target
106+
crates/proc-macro-srv/proc-macro-test/imp -> target
107107
108108
- uses: taiki-e/install-action@nextest
109109

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
target/
2-
Cargo.lock

crates/proc-macro-srv/proc-macro-test/imp/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rust-analyzer/tests/slow-tests/main.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,26 +1140,12 @@ fn root_contains_symlink_out_dirs_check() {
11401140
}
11411141

11421142
#[test]
1143-
#[cfg(any(feature = "sysroot-abi", rust_analyzer))]
11441143
fn resolve_proc_macro() {
11451144
use expect_test::expect;
1146-
use vfs::AbsPathBuf;
11471145
if skip_slow_tests() {
11481146
return;
11491147
}
11501148

1151-
let mut sysroot = project_model::Sysroot::discover(
1152-
&AbsPathBuf::assert_utf8(std::env::current_dir().unwrap()),
1153-
&Default::default(),
1154-
);
1155-
let loaded_sysroot =
1156-
sysroot.load_workspace(&project_model::RustSourceWorkspaceConfig::default_cargo());
1157-
if let Some(loaded_sysroot) = loaded_sysroot {
1158-
sysroot.set_workspace(loaded_sysroot);
1159-
}
1160-
1161-
let proc_macro_server_path = sysroot.discover_proc_macro_srv().unwrap();
1162-
11631149
let server = Project::with_fixture(
11641150
r###"
11651151
//- /foo/Cargo.toml
@@ -1171,12 +1157,8 @@ edition = "2021"
11711157
bar = {path = "../bar"}
11721158
11731159
//- /foo/src/main.rs
1174-
#![allow(internal_features)]
1175-
#![feature(rustc_attrs, decl_macro)]
11761160
use bar::Bar;
11771161
1178-
#[rustc_builtin_macro]
1179-
macro derive($item:item) {}
11801162
trait Bar {
11811163
fn bar();
11821164
}
@@ -1233,11 +1215,10 @@ pub fn foo(_input: TokenStream) -> TokenStream {
12331215
"buildScripts": {
12341216
"enable": true
12351217
},
1236-
"sysroot": null,
1218+
"sysroot": "discover",
12371219
},
12381220
"procMacro": {
12391221
"enable": true,
1240-
"server": proc_macro_server_path.as_path().as_str(),
12411222
}
12421223
}))
12431224
.root("foo")
@@ -1248,7 +1229,7 @@ pub fn foo(_input: TokenStream) -> TokenStream {
12481229
let res = server.send_request::<HoverRequest>(HoverParams {
12491230
text_document_position_params: TextDocumentPositionParams::new(
12501231
server.doc_id("foo/src/main.rs"),
1251-
Position::new(12, 9),
1232+
Position::new(8, 9),
12521233
),
12531234
work_done_progress_params: Default::default(),
12541235
});

0 commit comments

Comments
 (0)