Skip to content

Commit 31d1604

Browse files
author
Paolo Tranquilli
committed
Bulk model generator: switch from json to yml configuration files
1 parent 76c6d71 commit 31d1604

File tree

5 files changed

+64
-88
lines changed

5 files changed

+64
-88
lines changed

cpp/misc/bulk_generation_targets.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

cpp/misc/bulk_generation_targets.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: cpp
2+
strategy: dca
3+
destination: cpp/ql/lib/ext/generated
4+
targets:
5+
- name: openssl
6+
with-sinks: false
7+
with-sources: false
8+
- name: sqlite
9+
with-sinks: false
10+
with-sources: false

misc/scripts/models-as-data/bulk_generate_mad.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
import requests
1616
import zipfile
1717
import tarfile
18-
from functools import cmp_to_key
18+
19+
try:
20+
import yaml
21+
except ImportError:
22+
print("ERROR: PyYAML is not installed. Please install it with 'pip install pyyaml'.")
23+
sys.exit(1)
1924

2025
import generate_mad as mad
2126

@@ -492,9 +497,9 @@ def main(config, args) -> None:
492497
sys.exit(1)
493498
try:
494499
with open(args.config, "r") as f:
495-
config = json.load(f)
496-
except json.JSONDecodeError as e:
497-
print(f"ERROR: Failed to parse JSON file {args.config}: {e}")
500+
config = yaml.safe_load(f)
501+
except yaml.YAMLError as e:
502+
print(f"ERROR: Failed to parse YAML file {args.config}: {e}")
498503
sys.exit(1)
499504

500505
main(config, args)

rust/misc/bulk_generation_targets.json

Lines changed: 0 additions & 75 deletions
This file was deleted.

rust/misc/bulk_generation_targets.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
strategy: repo
2+
language: rust
3+
destination: rust/ql/lib/ext/generated
4+
extractor_options:
5+
- cargo_features='*'
6+
targets:
7+
- git_repo: https://github.com/rust-lang/libc
8+
git_tag: 0.2.172
9+
name: libc
10+
- git_repo: https://github.com/rust-lang/log
11+
git_tag: 0.4.27
12+
name: log
13+
- git_repo: https://github.com/BurntSushi/memchr
14+
git_tag: 2.7.4
15+
name: memchr
16+
- git_repo: https://github.com/matklad/once_cell
17+
git_tag: v1.21.3
18+
name: once_cell
19+
- git_repo: https://github.com/rust-random/rand
20+
git_tag: 0.9.1
21+
name: rand
22+
- git_repo: https://github.com/servo/rust-smallvec
23+
git_tag: v1.15.0
24+
name: smallvec
25+
- git_repo: https://github.com/serde-rs/serde
26+
git_tag: v1.0.219
27+
name: serde
28+
- git_repo: https://github.com/tokio-rs/tokio
29+
git_tag: tokio-1.45.0
30+
name: tokio
31+
- git_repo: https://github.com/seanmonstar/reqwest
32+
git_tag: v0.12.15
33+
name: reqwest
34+
- git_repo: https://github.com/SergioBenitez/Rocket
35+
git_tag: v0.5.1
36+
name: rocket
37+
- git_repo: https://github.com/actix/actix-web
38+
git_tag: web-v4.11.0
39+
name: actix-web
40+
- git_repo: https://github.com/hyperium/hyper
41+
git_tag: v1.6.0
42+
name: hyper
43+
- git_repo: https://github.com/clap-rs/clap
44+
git_tag: v4.5.38
45+
name: clap

0 commit comments

Comments
 (0)