Skip to content

Commit 727a7d4

Browse files
committed
Merge branch 'main' into unreachable4
2 parents c7112ef + 5490975 commit 727a7d4

File tree

80 files changed

+819
-327
lines changed

Some content is hidden

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

80 files changed

+819
-327
lines changed

go/extractor/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ toolchain go1.23.1
99
// when adding or removing dependencies, run
1010
// bazel mod tidy
1111
require (
12-
golang.org/x/mod v0.21.0
12+
golang.org/x/mod v0.22.0
1313
golang.org/x/tools v0.26.0
1414
)
1515

go/extractor/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
2-
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
1+
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
2+
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
33
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
44
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
55
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=

java/ql/lib/semmle/code/java/dataflow/TypeFlow.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ private module Input implements TypeFlowInput<Location> {
127127
n2.asSsa().(BaseSsaUpdate).getDefiningExpr().(VariableAssign).getSource() = n1.asExpr()
128128
or
129129
n2.asSsa().(BaseSsaImplicitInit).captures(n1.asSsa())
130+
or
131+
n2.asExpr().(NotNullExpr).getExpr() = n1.asExpr()
130132
}
131133

132134
/**

rust/codeql-extractor.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ options:
2323
title: Controls compression for the TRAP files written by the extractor.
2424
description: >
2525
This option is only intended for use in debugging the extractor. Accepted
26-
values are 'gzip' (the default, to write gzip-compressed TRAP) and 'none'
27-
(to write uncompressed TRAP).
26+
values are 'gzip' (to write gzip-compressed TRAP) and 'none'
27+
(currently the default, to write uncompressed TRAP).
2828
type: string
2929
pattern: "^(none|gzip)$"
30-
extract_dependencies:
31-
title: Whether to extract dependencies.
30+
cargo_target_dir:
31+
title: Directory to use for cargo output files.
3232
description: >
33-
Extract the source code of dependencies and the standard libraries in addition to
34-
normal source code.
33+
This value is an optional path to use as `CARGO_TARGET_DIR` for the internal
34+
cargo commands the extractor uses. Pointing it to a persistent directory may
35+
reduce execution time of consecutive extractor runs. By default, a new scratch
36+
directory is used for each run.
3537
type: string
36-
pattern: "^(false|true)$"

rust/extractor/macros/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ pub fn extractor_cli_config(_attr: TokenStream, item: TokenStream) -> TokenStrea
2121
#id: bool,
2222
};
2323
}
24+
if p.path.segments.len() == 1 && p.path.segments[0].ident == "Option" {
25+
return quote! {
26+
#[arg(long)]
27+
#id: #ty,
28+
};
29+
}
2430
}
2531
if id == &format_ident!("verbose") {
2632
quote! {

rust/extractor/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct Config {
3737
pub scratch_dir: PathBuf,
3838
pub trap_dir: PathBuf,
3939
pub source_archive_dir: PathBuf,
40-
pub extract_dependencies: bool,
40+
pub cargo_target_dir: Option<PathBuf>,
4141
pub verbose: u8,
4242
pub compression: Compression,
4343
pub inputs: Vec<PathBuf>,

rust/extractor/src/generated/.generated.list

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/extractor/src/generated/top.rs

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

rust/extractor/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ fn main() -> anyhow::Result<()> {
130130
}
131131
extractor.extract_without_semantics(file, "no manifest found");
132132
}
133+
let target_dir = &cfg
134+
.cargo_target_dir
135+
.unwrap_or_else(|| cfg.scratch_dir.join("target"));
133136
for (manifest, files) in map.values().filter(|(_, files)| !files.is_empty()) {
134-
if let Some((ref db, ref vfs)) = RustAnalyzer::load_workspace(manifest, &cfg.scratch_dir) {
137+
if let Some((ref db, ref vfs)) = RustAnalyzer::load_workspace(manifest, target_dir) {
135138
let semantics = Semantics::new(db);
136139
for file in files {
137140
let Some(id) = path_to_file_id(file, vfs) else {

rust/extractor/src/rust_analyzer.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ pub struct ParseResult<'a> {
4545
impl<'a> RustAnalyzer<'a> {
4646
pub fn load_workspace(
4747
project: &ProjectManifest,
48-
scratch_dir: &Path,
48+
target_dir: &Path,
4949
) -> Option<(RootDatabase, Vfs)> {
5050
let config = CargoConfig {
5151
sysroot: Some(RustLibSource::Discover),
52-
target_dir: ra_ap_paths::Utf8PathBuf::from_path_buf(scratch_dir.to_path_buf())
53-
.map(|x| x.join("target"))
54-
.ok(),
52+
target_dir: ra_ap_paths::Utf8PathBuf::from_path_buf(target_dir.to_path_buf()).ok(),
5553
..Default::default()
5654
};
5755
let progress = |t| (log::trace!("progress: {}", t));

0 commit comments

Comments
 (0)