Commit graph

366 commits

Author SHA1 Message Date
Lukas Wirth
34e7d60e30
Merge pull request #19644 from ChayimFriedman2/const-syms
internal: Make predefined symbols `const` instead of `static`
2025-04-21 12:34:59 +00:00
Chayim Refael Friedman
0f325c7ff8 Remove unnecessary predefined symbol clones
Now that they're const it's no longer needed.

Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
2025-04-21 03:10:13 +03:00
jyn
3b964a7105 allow using null to unset an environment variable
this makes three changes:
- all callsites of `toolchain::command` are changed to use
  `command(path, extra_env)`, instead of manually adding the env after
  the fact.
- all `map<str, str>` are changed to `map<str, option<str>>`.
- `command` checks for None and calls `env_remove` if so.

this caught several places where environment variables weren't being
propagated:
- when running `rustc --print=target-libdir`
- when running `cargo rustc -- --print=target-spec-json`
- when running the custom DiscoverLinkedProjects config. I *think* this
  is for use with non-cargo build systems, so I didn't change it.
2025-04-19 12:15:22 -04:00
Lukas Wirth
e7ce86ddea fix: Fix format_args lowering for >=1.87 2025-04-06 10:05:56 +02:00
Prajwal S N
865681d779
feat(project-model): provide flag for no deps
A Cargo project can now be built without any dependency metadata being fetched.

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-04 18:57:10 +05:30
Lukas Wirth
faf1b49a9a fix: Fix, clarify and require a value for proc_macro_cwd of CrateData 2025-03-29 08:08:48 +01:00
Lukas Wirth
7a1e9c4b0c ci: Require miri step 2025-03-25 08:10:27 +01:00
Lukas Wirth
500ea05aef chore: Bump dependencies 2025-03-23 08:46:10 +01:00
HKalbasi
0c1b4838ce
Merge pull request #19005 from duncanawoods/18955---fix-running-tests-for-packages-with-multiple-targets
fix testing packages with multiple targets
2025-03-17 19:54:49 +00:00
Lukas Wirth
b5eedad8e3 refactor: Remove unnecessary Arc 2025-03-16 10:27:48 +01:00
Lukas Wirth
7edfeb9674 refactor: Remove CrateGraphBuilder::iter_mut 2025-03-16 10:24:15 +01:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +01:00
BenjaminBrienen
87f837cec7 fix clippy::doc_overindented_list_items 2025-03-15 21:32:01 +01:00
Chayim Refael Friedman
c94e9efbef Salsify the crate graph
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
2025-03-12 21:02:30 +02:00
Lukas Wirth
0424e2e2bf Move project MSRV back to 1.78 2025-03-07 07:51:53 +01:00
Arthur Baars
e98c98fa31 Change %e to ?e to include detailed error message 2025-03-06 12:42:35 +00:00
Arthur Baars
c053cc72a7
Improve tracing log format in cargo_workspace.rs 2025-03-05 12:49:42 +01:00
Arthur Baars
55d61be9a3
Add warning and debug information when cargo metadata fails
The errors are silently dropped elsewhere, which make it really hard to debug issues due to dependency download failures.
2025-03-05 10:40:11 +01:00
Lukas Wirth
b685ada098
Merge pull request #19243 from Veykril/push-qrrqsywkwyzp
Allow unsetting default cfgs
2025-03-03 11:42:40 +00:00
Lukas Wirth
5e18ad0770 Allow unsetting default cfgs 2025-02-27 17:34:29 +01:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +01:00
duncan
2f5a7a619d fix testing for packages with multiple targets
fix test running by invoking cargo per package

remove hack_recover_crate_name

make clippy happy

fix testing for packages with multiple targets

fix test running by invoking cargo per package

remove hack_recover_crate_name

make clippy happy

fix testing for packages with multiple targets

fix bad merge

replace TargetKind::fmt with TargetKind::as_cargo_target to clarify intention

dedupulicate requested test runs

replace ParseFromLine with CargoParser

formatting - remove trailing space

formatting for rustfmt CI
2025-02-27 12:37:50 +00:00
Lukas Wirth
d81341372b Fix sysroot crate-graph construction not mapping crate-ids for proc-macros 2025-02-27 13:20:19 +01:00
David Richey
18a678e693 Drop support for stitched sysroot 2025-02-26 14:18:52 -06:00
David Richey
ca5a35e97f Allow rust-project.json to specify sysroot workspace 2025-02-26 14:18:48 -06:00
Shirayama Kazatsuyu
64a869c714 Allow "package/feature" format feature flag 2025-02-22 22:27:30 +09:00
Laurențiu Nicola
a7547a473b Switch back to RUST_SRC_PATH 2025-02-22 09:07:52 +02:00
Mehul Arora
3a31741627 Use correct working directory for non-workspace proc-macro execution 2025-02-17 10:36:32 -05:00
Lukas Wirth
b9f76287c2 Set RUSTUP_TOOLCHAIN when loading sysroot workspace 2025-02-16 10:54:08 +01:00
David Richey
a297d438bc Apply cfg.setTest to json projects 2025-02-12 14:05:34 -06:00
Lukas Wirth
172a504b56 Rename sysroot src/lib related things 2025-02-12 16:51:27 +01:00
Lukas Wirth
8a8ff99273 Spawn toolchain querying processes in parallel 2025-02-12 16:24:49 +01:00
Lukas Wirth
ab5e821d97 Expose symbol of CrateName 2025-02-04 14:38:58 +01:00
David Richey
c0c7d5a2e1 Explicitly add buildfiles when constructing ProjectFolders 2025-01-24 09:59:06 -06:00
Lukas Wirth
8acea502ee
Merge pull request #18994 from Wilfred/failed_rustc_cfg_as_warning
internal: Treat cfg fetching failures as a warning
2025-01-24 13:31:00 +00:00
Wilfred Hughes
86a4b2fdd7 manual: Document all rust-project.json fields
Ensure that all the fields that rust-analyzer understands are in the
manual, they all have doc comments, and they use consistent
punctuation (`;` rather than mixing `,` and `;`).

Whilst we're here, fix the `sysroot_src` example and add 2024 as a
legal value for Rust edition.
2025-01-21 12:00:13 -08:00
Wilfred Hughes
8f6a1e5ee5 internal: Treat cfg fetching failures as a warning
If the user doesn't have rustc on $PATH, rust-analyzer won't be able
to run `rustc --print cfg`. This isn't really an error, as
rust-analyzer can still proceed without it.

This is particularly noticeable when loading crates defined in a
rust-project.json. Until the configuration is loaded, the opened files
are briefly treated as detached files and users see this error.

Environments with rust-project.json generally have a sysroot and rustc
elsewhere, so the error confuses users.
2025-01-21 11:07:07 -08:00
Lukas Wirth
0f7b85a9d6 fix: cargo rustc --print needs unstable-options 2025-01-18 12:04:57 +01:00
Lukas Wirth
52a6f430ef Partially back out "fix: Fix sourceroot construction for virtual manifests" 2025-01-16 10:02:26 +01:00
Nicholas Rishel
1f9686993a Add config setting which allows adding additional include paths to the VFS. 2025-01-08 10:57:46 -08:00
Lukas Wirth
619af1871b
Merge pull request #18867 from Veykril/push-ntmxlropxkrr
internal: target-triple -> target-tuple + version fetching cleanup
2025-01-07 13:46:58 +00:00
Lukas Wirth
59c8e27acc Add some smoke tests to toolchain_info 2025-01-07 14:33:24 +01:00
Lukas Wirth
b8a0488740 Align toolchain version fetching with other toolchain info querying
Fix --target flag argument order in rustc_cfg fetching
2025-01-07 14:30:46 +01:00
Lukas Wirth
2ac803ec71 target-triple -> target-tuple 2025-01-07 14:25:43 +01:00
Lukas Wirth
86d35a55a6
Merge pull request #18788 from Veykril/push-zxystwnotuvq
Remove `rust-analyzer.cargo.sysrootQueryMetadata` config again
2025-01-07 13:14:29 +00:00
Lukas Wirth
f1c0d176f3 Remove rust-analyzer.cargo.sysrootQueryMetadata config again 2025-01-07 14:00:22 +01:00
Bogdan Mircea
4382331a36 project-model: fix JSON project PackageRoot buildfile inclusion 2025-01-07 13:47:17 +02:00
Lukas Wirth
72b9427162
Merge pull request #18846 from Veykril/push-kmspklwynynu
minor: New clippy lints
2025-01-06 17:12:14 +00:00
Lukas Wirth
4b6007115a minor: New clippy lints 2025-01-06 17:57:17 +01:00
Lukas Wirth
cf2bfd427a fix: Fix relative .cargo env vars not working 2025-01-06 08:50:41 +01:00