Commit Graph

87 Commits

Author SHA1 Message Date
Geoffrey White
9efb6ea995 Rust: Cargo fmt. 2025-08-27 19:16:43 +01:00
Geoffrey White
2e747bb05c Merge branch 'main' into oldpaths1 (some generated files are left unmerged). 2025-08-27 16:56:06 +01:00
Paolo Tranquilli
02b4c1fa85 Rust: downgrade uncompiled source files from warning to info 2025-08-26 11:56:53 +02:00
Geoffrey White
456f56096f Rust: Remove ResolvePaths enum and resolve_paths arguments up to Translator::new (hardcode to false). 2025-08-26 09:46:20 +01:00
Geoffrey White
d6d0645d7b Rust: Remove skip_path_resolution config variable (hardhoded to true). 2025-08-26 09:33:52 +01:00
Paolo Tranquilli
223f0c8684 Rust: fix macro expansion in library code
There was a mismatch between a `self.macro_context_level += 1` and the
corresponding `self.macro_context_level -= 1`, which resulted in an
`usize` underflow (panic in debug mode, wrong behaviour in release
mode).

This fixes it and adds a relevant assertion and test. In order to
properly test library mode extraction, a special option enforcing that
on source code as well is added.
2025-07-01 17:31:26 +02:00
Arthur Baars
089f35330f Merge branch 'main' into redsun82/cargo-upgrade-3 2025-06-20 19:07:39 +02:00
Paolo Tranquilli
7edae1eb17 Rust: suppress some expected macro expansion warnings 2025-06-20 17:56:09 +02:00
Arthur Baars
a253b319d5 Rust: limit number of diagnostics to 100 per trap file 2025-06-18 16:05:11 +02:00
Arthur Baars
19283102da Rust: delete leftover log statement 2025-05-28 15:51:42 +02:00
Arthur Baars
ac724d2671 Update rust/extractor/src/main.rs
Co-authored-by: Simon Friis Vindum <simonfv@gmail.com>
2025-05-27 13:08:20 +02:00
Arthur Baars
765afdbae0 Rust: add option to extract dependencies as source files 2025-05-26 18:21:35 +02:00
Arthur Baars
b62d52ede0 Rust: prevent source files from being extracted in both source and library mode
When analysing a repository with multiple separate but related sub-projects there is a
risk that some source file are extracted in library mode as well as source  mode.

To prevent this we pre-fill 'processed_files' set with all source files, even though they have
not be processed yet, but are known to be processed later..

This prevents source file to be
2025-05-23 10:35:16 +02:00
Arthur Baars
7e5f6523c5 Rust: disable ResolvePaths when extracting library source files 2025-05-22 11:35:54 +02:00
Arthur Baars
c69aa224c7 Rust: restrict to library files 2025-05-22 09:53:34 +02:00
Arthur Baars
44a404571f Rust: fixes 2025-05-22 09:53:12 +02:00
Arthur Baars
dd5c487628 Rust: extract source files of depdendencies 2025-05-22 09:51:33 +02:00
Paolo Tranquilli
a99556e021 Merge branch 'main' into redsun82/rust-expand-attr-macros 2025-05-13 16:21:29 +02:00
Arthur Baars
53b2e9708c Rust: extract declarations of builtin types 2025-05-01 14:27:21 +02:00
Paolo Tranquilli
49cf1739a4 Rust: expand attribute macros 2025-04-25 16:16:49 +02:00
Arthur Baars
fa79dbc89a Merge pull request #18228 from github/aibaars/crate-graph
Rust: extract crate graph
2025-03-13 10:00:48 +01:00
Paolo Tranquilli
79e06153ed Merge pull request #18813 from github/redsun82/rust-turn-off-ra-resolution
Rust: add flag to turn off extractor path resolution
2025-03-10 14:52:07 +01:00
Arthur Baars
c601adfc65 Rust: add ExtractionStep::CrateGraph 2025-03-10 10:16:18 +01:00
Arthur Baars
e21a7f5336 Rust: extract crate graph 2025-03-10 10:16:13 +01:00
Paolo Tranquilli
a444bbc080 Merge branch 'main' into redsun82/rust-turn-off-ra-resolution 2025-02-27 11:11:06 +01:00
Paolo Tranquilli
6089a75262 Rust/Ruby/Python: format code 2025-02-25 13:19:03 +01:00
Paolo Tranquilli
d0461e2c08 Merge branch 'main' into redsun82/rust-config 2025-02-19 17:09:04 +01:00
Paolo Tranquilli
c1df8d0e13 Rust: add flag to turn off extractor path resolution 2025-02-19 09:44:09 +01:00
Paolo Tranquilli
a6f58c9fd2 Rust: add option for proc macro server 2025-02-13 15:37:54 +01:00
Arthur Baars
18cf39d063 Rust: add verbosity and flamegraph as extractor options 2025-02-12 15:29:27 +01:00
Arthur Baars
64f0908d0d Rust: keep FlushGuard in a variable 2025-02-12 10:27:34 +01:00
Arthur Baars
5621eecc86 Rust: config: replace verbose with verbosity 2025-02-12 10:27:33 +01:00
Arthur Baars
3218faee6c Rust: make flame_log a config option 2025-02-12 10:27:32 +01:00
Arthur Baars
0442d24204 Rust: drop tracing:: qualifiers 2025-02-12 10:27:30 +01:00
Arthur Baars
c602e82ac4 Rust: use tracing-subscriber 2025-02-12 10:27:29 +01:00
Paolo Tranquilli
3c064284b0 Rust: aggregate projects into workspaces 2025-01-15 17:17:19 +01:00
Paolo Tranquilli
7988729ee6 Rust: run sysroot discovery once 2025-01-13 16:13:55 +01:00
Paolo Tranquilli
4f79199498 Rust: replace std::fs::canonicalize with dunce::canonicalize
Rust-analyzer turned out to be quite picky about paths, where
`//?/`-prefixed paths can lead to flaky failures. See

https://github.com/rust-lang/rust-analyzer/issues/18894

for details.

This makes paths always be canonicalized with `dunce`. Previously,
`dunce` was used as a fallback, but that stopped working somewhere
after version 0.0.248 of rust-analyzer.
2025-01-09 15:43:15 +01:00
Paolo Tranquilli
b57a37479b Rust: make File usable in codegen 2024-12-02 15:15:46 +01:00
Paolo Tranquilli
4e7115538b Rust: move steps breakdown from JSON diagnostics to the DB 2024-11-27 14:55:46 +01:00
Paolo Tranquilli
27738eaacc Rust: reorganize perf diagnostics 2024-11-27 12:05:06 +01:00
Paolo Tranquilli
24eb65692f Rust: add some performance diagnostics
This outputs some duration counts for various parts of the extraction
process in the database in the form of telemetry diagnostics.

The diagnostics format was preferred to putting things in the relational
database as that will scale better to code scanning and is more flexible
as for the data we can put into it without passing through the dbscheme.
Also, although it's not the case yet, it will be possible to output
diagnostics even if creation of the database fails.
2024-11-26 16:35:38 +01:00
Paolo Tranquilli
abd73e16d4 Revert "Revert "Rust: allow to specify more cargo configuration options"" 2024-11-18 15:52:03 +01:00
Paolo Tranquilli
04072591c4 Revert "Rust: allow to specify more cargo configuration options" 2024-11-18 15:36:06 +01:00
Paolo Tranquilli
be45e3deed Rust: allow to specify more cargo configuration options
This allows to tweak via extractor options some aspects of the cargo
configuration:
* the target architecture
* features (including `*` for all, which we must understand whether to
  set by default)
* cfg overrides

Integration tests will be added in a follow-up commit.
2024-11-08 12:23:16 +01:00
Paolo Tranquilli
083394073a Rust: rename target_dir to cargo_target_dir, add to extraction options
Also removed the now unused `extract_dependencies` one.
2024-11-08 09:53:50 +01:00
Paolo Tranquilli
4f6fda0100 Rust: allow to specify the target directory 2024-11-07 12:45:20 +01:00
Paolo Tranquilli
2987743e44 Rust: exclude uncompiled files from semantics and surface semanticless reason 2024-11-06 15:22:28 +01:00
Paolo Tranquilli
6848a22c65 Rust: fix semantic merge conflict about semantics 2024-11-04 10:04:40 +01:00
Paolo Tranquilli
bde517fcb1 Merge pull request #17849 from github/aibaars/single-semantics
Rust: try to speed things up a bit
2024-11-04 09:24:26 +01:00