-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
executable file
·40 lines (28 loc) · 1.1 KB
/
build.py
File metadata and controls
executable file
·40 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3
import os
import shutil
import subprocess
from pathlib import Path
OSS_FUZZ_PROJ_DIR = Path(os.getenv("OSS_CRS_PROJ_PATH", "/OSS_CRS_PROJ_PATH"))
CRS_PROJ_DIR = Path("/out/crs/proj")
OSS_SRC_DIR = Path(os.getenv("SRC", "/src"))
CRS_SRC_DIR = Path("/out/crs/src")
def run_ossfuzz_build():
env = os.environ.copy()
subprocess.run(["/usr/local/bin/compile"], env=env, check=True)
def prepare_crs_src():
if CRS_SRC_DIR.exists():
shutil.rmtree(CRS_SRC_DIR)
shutil.copytree(OSS_FUZZ_PROJ_DIR, CRS_PROJ_DIR, symlinks=True)
shutil.copytree(OSS_SRC_DIR, CRS_SRC_DIR, symlinks=True)
def submit_build_outputs():
"""Submit build outputs to oss-crs framework via libCRS."""
subprocess.run(["libCRS", "submit-build-output", "/out", "build"], check=True)
subprocess.run(["libCRS", "submit-build-output", str(CRS_PROJ_DIR), "crs/proj"], check=True)
subprocess.run(["libCRS", "submit-build-output", str(CRS_SRC_DIR), "crs/src"], check=True)
def main():
run_ossfuzz_build()
prepare_crs_src()
submit_build_outputs()
if __name__ == "__main__":
main()