-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Re-add rust-analyzer as a subtree #99465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6e9c963
a1ff3ca
1f02840
9fdfa9f
06ee4d6
98a5811
46d2271
05ca0a2
8b07898
439a513
07d78b6
312ac83
7a0774d
6fc5c3c
c6f776c
b7e3f52
f780145
f9379df
817082c
96ff235
1ef5e14
1064c75
29f01cd
f410fdf
36fadc4
472ae16
19fad54
e0c17e8
2642f64
32b40de
21642a2
5107123
434e718
6ecabe3
9e6bff7
c80c348
45fd5e6
401a71d
9ea8d58
353829f
900b420
e3b1303
5bb123d
82c1b31
0dbc091
fb6278e
e4e2a46
f536766
45b8960
b74e96f
408fa14
dcb4837
bef89e9
7f1fac7
f6c0bf8
4c39546
bdbffdd
9eaf96c
8b3ec12
6407727
36d2b43
b0102bd
979d951
2ff505a
7f9c054
461c0cc
e417992
6420840
ce36446
ddddca8
7d0e5ae
f8c416e
531e152
9165e3b
58d5c69
8e764a8
e5e5a09
8489cd7
ed44fe5
994f3cf
e715195
9a12d0d
ec78b6b
622b516
ea7ea70
cd42b20
d4b79ad
f2963cf
30680df
d101439
afdbd6c
649e1f5
d1ac462
0039d6f
cc0bb71
e394000
212f84a
416787d
c7c314d
e6fcb23
2af61bc
791f2a0
87572be
b24ece5
6669f38
2d3f0b4
9e7ca80
a3011e5
5381811
e05e6c6
78beb4c
993a19a
75b2232
ccf854b
5235732
e1a8c0b
db49ac8
383ee6a
6edf624
976d07e
2926ca0
0d9737a
441e659
fee5555
b9ba9fa
0f2eba5
ad5a851
00194ad
75fb3de
0360ed5
d2fd137
c46570e
3248601
c296e77
f0af913
6f819e3
09abd76
6c6ae96
df4ed94
7181a39
c419aa9
603b6fc
2836dd1
21062f9
638abba
666343b
03a62c1
b43708c
1b138b1
7b1b711
0e38961
d03ed83
8e889ac
2c9e395
358d6c6
a059e79
cb38145
5342f47
4b3164f
eaebead
6e55716
195ceea
f0649f2
dfcbed0
e3bde57
d9ab7f2
f7bb932
df66eb7
caf23f2
ebfbb31
4cbf23c
84a6bc9
fc47ce5
def89af
90b5097
ec51dcb
794ecd5
a5ad4de
075ab03
796641b
4cbde4e
5af3ef5
fbba1d7
073b325
6b823b0
029184d
7ff6c36
f4fe2ea
248fa55
b49f2a2
4ad9185
25090f0
2e9d5b5
d3796ad
b96f8f1
96481b7
c205c62
f2c2c36
0a4065d
3d7da51
ac526e0
01d2517
766c5f0
b9b42e8
a96f0aa
a0fd58b
667fd25
15f7300
83177a7
db6a85d
d9336a4
897a7ec
ea19e70
b5aa3b3
8e379ce
6cb0746
ee2d5fe
be30c4d
e2eaa99
5ad981b
e01de19
188c0e4
ea41617
ec1142c
38c11be
22e53f1
fac6a64
530eb27
d17a5ef
dc05192
567a5e9
474f5ea
88515b9
1b41647
307be7c
7d20ff3
0424e75
7a03bf4
0b33563
81597bd
b189b49
ba4b8b2
8990e37
c213c23
6150a0a
380eeaa
378fc76
a005294
a6214e8
2582a1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -301,6 +301,61 @@ impl Step for CodegenBackend { | |||||
} | ||||||
} | ||||||
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | ||||||
pub struct RustAnalyzer { | ||||||
pub target: TargetSelection, | ||||||
} | ||||||
|
||||||
impl Step for RustAnalyzer { | ||||||
type Output = (); | ||||||
const ONLY_HOSTS: bool = true; | ||||||
const DEFAULT: bool = true; | ||||||
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { | ||||||
run.paths(&["src/tools/rust-analyzer", "rust-analyzer"]) | ||||||
} | ||||||
|
||||||
fn make_run(run: RunConfig<'_>) { | ||||||
run.builder.ensure(RustAnalyzer { target: run.target }); | ||||||
} | ||||||
|
||||||
fn run(self, builder: &Builder<'_>) { | ||||||
let compiler = builder.compiler(builder.top_stage, builder.config.build); | ||||||
let target = self.target; | ||||||
|
||||||
builder.ensure(Rustc { target }); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't look right, rust-analyzer doesn't use rustc_private. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I copied that from the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, those use rustc_private. Rust-analyzer doesn't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm looking at this again and, without it, I get some failures like:
I think we need at least There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Continued here: #99603 (comment) |
||||||
|
||||||
let mut cargo = prepare_tool_cargo( | ||||||
builder, | ||||||
compiler, | ||||||
Mode::ToolRustc, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
target, | ||||||
cargo_subcommand(builder.kind), | ||||||
"src/tools/rust-analyzer", | ||||||
SourceType::InTree, | ||||||
&["rust-analyzer/in-rust-tree".to_owned()], | ||||||
); | ||||||
|
||||||
// For ./x.py clippy, don't run with --all-targets because | ||||||
// linting tests and benchmarks can produce very noisy results | ||||||
if builder.kind != Kind::Clippy { | ||||||
cargo.arg("--all-targets"); | ||||||
} | ||||||
|
||||||
builder.info(&format!( | ||||||
"Checking stage{} {} artifacts ({} -> {})", | ||||||
builder.top_stage, "rust-analyzer", &compiler.host.triple, target.triple | ||||||
)); | ||||||
run_cargo(builder, cargo, args(builder), &stamp(builder, compiler, target), vec![], true); | ||||||
|
||||||
/// Cargo's output path in a given stage, compiled by a particular | ||||||
/// compiler for the specified target. | ||||||
fn stamp(builder: &Builder<'_>, compiler: Compiler, target: TargetSelection) -> PathBuf { | ||||||
builder.cargo_out(compiler, Mode::ToolRustc, target).join(".rust-analyzer-check.stamp") | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
macro_rules! tool_check_step { | ||||||
($name:ident, $path:literal, $($alias:literal, )* $source_type:path $(, $default:literal )?) => { | ||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[alias] | ||
xtask = "run --package xtask --bin xtask --" | ||
tq = "test -- -q" | ||
qt = "tq" | ||
lint = "clippy --all-targets -- -Aclippy::collapsible_if -Aclippy::needless_pass_by_value -Aclippy::nonminimal_bool -Aclippy::redundant_pattern_matching --cap-lints warn" | ||
|
||
[target.x86_64-pc-windows-msvc] | ||
linker = "rust-lld" | ||
|
||
[env] | ||
CARGO_WORKSPACE_DIR = { value = "", relative = true } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# https://EditorConfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
|
||
[*.{rs,toml}] | ||
indent_size = 4 | ||
|
||
[*.ts] | ||
indent_size = 4 | ||
[*.js] | ||
indent_size = 4 | ||
[*.json] | ||
indent_size = 4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# for this file to take effect make sure you use git ^2.23 and | ||
# add ignoreFile to your git configuration: | ||
# ``` | ||
# git config --global blame.ignoreRevsFile .git-blame-ignore-revs | ||
# ``` | ||
|
||
# prettier format | ||
f247090558c9ba3c551566eae5882b7ca865225f |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
* text=auto eol=lf | ||
# git grep shouldn't match entries in this benchmark data | ||
bench_data/** binary | ||
crates/syntax/test_data/** -text eof=LF | ||
# Older git versions try to fix line endings on images, this prevents it. | ||
*.png binary | ||
*.jpg binary | ||
*.ico binary |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: Blank Issue | ||
about: Create a blank issue. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
name: Bug report | ||
about: Create a bug report for rust-analyzer. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- | ||
Troubleshooting guide: https://rust-analyzer.github.io/manual.html#troubleshooting | ||
Forum for questions: https://users.rust-lang.org/c/ide/14 | ||
|
||
Before submitting, please make sure that you're not running into one of these known issues: | ||
|
||
1. extension doesn't load in VSCodium: #11080 | ||
2. on-the-fly diagnostics are mostly unimplemented (`cargo check` diagnostics will be shown when saving a file): #3107 | ||
|
||
Otherwise please try to provide information which will help us to fix the issue faster. Minimal reproducible examples with few dependencies are especially lovely <3. | ||
--> | ||
|
||
**rust-analyzer version**: (eg. output of "Rust Analyzer: Show RA Version" command) | ||
|
||
**rustc version**: (eg. output of `rustc -V`) | ||
|
||
**relevant settings**: (eg. client settings, or environment variables like `CARGO`, `RUSTUP_HOME` or `CARGO_HOME`) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: Critical Nightly Regression | ||
about: You are using nightly rust-analyzer and the latest version is unusable. | ||
title: '' | ||
labels: '' | ||
assignees: 'matklad' | ||
|
||
--- | ||
|
||
<!-- | ||
Troubleshooting guide: https://rust-analyzer.github.io/manual.html#troubleshooting | ||
|
||
Please try to provide information which will help us to fix the issue faster. Minimal reproducible examples with few dependencies are especially lovely <3. | ||
--> | ||
|
||
This is a serious regression in nightly and it's important to fix it before the next release. | ||
@matklad, please take a look. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM node:slim | ||
|
||
COPY . /action | ||
WORKDIR /action | ||
|
||
RUN npm install --production | ||
|
||
ENTRYPOINT ["node", "/action/main.js"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# github-release | ||
|
||
Copy-pasted from | ||
https://github.com/bytecodealliance/wasmtime/tree/8acfdbdd8aa550d1b84e0ce1e6222a6605d14e38/.github/actions/github-release | ||
|
||
An action used to publish GitHub releases for `wasmtime`. | ||
|
||
As of the time of this writing there's a few actions floating around which | ||
perform github releases but they all tend to have their set of drawbacks. | ||
Additionally nothing handles deleting releases which we need for our rolling | ||
`dev` release. | ||
|
||
To handle all this this action rolls-its-own implementation using the | ||
actions/toolkit repository and packages published there. These run in a Docker | ||
container and take various inputs to orchestrate the release from the build. | ||
|
||
More comments can be found in `main.js`. | ||
|
||
Testing this is really hard. If you want to try though run `npm install` and | ||
then `node main.js`. You'll have to configure a bunch of env vars though to get | ||
anything reasonably working. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: 'wasmtime github releases' | ||
description: 'wasmtime github releases' | ||
inputs: | ||
token: | ||
description: '' | ||
required: true | ||
name: | ||
description: '' | ||
required: true | ||
files: | ||
description: '' | ||
required: true | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That second one is redundant, the builder already has logic that lets you abbreviate to the last component of the path.