Skip to content

Commit 31c8e4e

Browse files
committed
QL: Fix the autobuilder (temporary bad fix)
1 parent 7a9e41c commit 31c8e4e

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

ql/autobuilder/src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,29 @@ fn main() -> std::io::Result<()> {
1515
let mut cmd = Command::new(codeql);
1616
cmd.arg("database")
1717
.arg("index-files")
18-
.arg("--include-extension=.ql")
19-
.arg("--include-extension=.qll")
20-
.arg("--include-extension=.dbscheme")
21-
.arg("--include=**/qlpack.yml")
2218
.arg("--size-limit=5m")
2319
.arg("--language=ql")
2420
.arg("--working-dir=.")
2521
.arg(db);
2622

23+
let mut has_include_dir = false; // TODO: This is a horrible hack, wait for the post-merge discussion in https://github.com/github/codeql/pull/7444 to be resolved
2724
for line in env::var("LGTM_INDEX_FILTERS")
2825
.unwrap_or_default()
2926
.split('\n')
3027
{
3128
if let Some(stripped) = line.strip_prefix("include:") {
3229
cmd.arg("--include").arg(stripped);
30+
has_include_dir = true;
3331
} else if let Some(stripped) = line.strip_prefix("exclude:") {
3432
cmd.arg("--exclude").arg(stripped);
3533
}
3634
}
35+
if !has_include_dir {
36+
cmd.arg("--include-extension=.ql")
37+
.arg("--include-extension=.qll")
38+
.arg("--include-extension=.dbscheme")
39+
.arg("--include=**/qlpack.yml");
40+
}
3741
let exit = &cmd.spawn()?.wait()?;
3842
std::process::exit(exit.code().unwrap_or(1))
3943
}

ql/extractor/src/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ fn main() -> std::io::Result<()> {
127127
lines
128128
.par_iter()
129129
.try_for_each(|line| {
130+
// only consider files that end with .ql/.qll/.dbscheme/qlpack.yml
131+
// TODO: This is a bad fix, wait for the post-merge discussion in https://github.com/github/codeql/pull/7444 to be resolved
132+
if !line.ends_with(".ql")
133+
&& !line.ends_with(".qll")
134+
&& !line.ends_with(".dbscheme")
135+
&& !line.ends_with("qlpack.yml")
136+
{
137+
return Ok(());
138+
}
130139
let path = PathBuf::from(line).canonicalize()?;
131140
let src_archive_file = path_for(&src_archive_dir, &path, "");
132141
let source = std::fs::read(&path)?;

0 commit comments

Comments
 (0)