about summary refs log tree commit diff homepage
path: root/scripts/build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build')
-rwxr-xr-xscripts/build/build-ci-container.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/build/build-ci-container.py b/scripts/build/build-ci-container.py
index c9264674..3f478b54 100755
--- a/scripts/build/build-ci-container.py
+++ b/scripts/build/build-ci-container.py
@@ -3,6 +3,7 @@
 import yaml
 import subprocess
 import os
+import sys
 
 (abs_path, _) = os.path.split(os.path.abspath(__file__))
 
@@ -10,7 +11,6 @@ with open(os.path.join(abs_path,"../../.github/workflows/build.yaml"), 'r') as s
     try:
         ci_config = yaml.safe_load(stream)
         global_env = ci_config['env']
-        print(ci_config['jobs']['Linux']['strategy']['matrix']['include'])
         for job in ci_config['jobs']['Linux']['strategy']['matrix']['include']:
             if job['name'] in ["Docker", "macOS"]:
                 print("Skip: {}".format(job['name']))
@@ -21,11 +21,12 @@ with open(os.path.join(abs_path,"../../.github/workflows/build.yaml"), 'r') as s
             build_env = os.environ.copy()
 
             # Copy current global build configurations
-            build_vars = dict(global_env)
+            for k,v in global_env.items():
+              build_env[k] = str(v)
 
             # Override with job specific values
             for k,v in job['env'].items():
-                build_vars[k] = v
+                build_env[k] = str(v)
 
             cmd = [os.path.join(abs_path, 'build.sh'),
                   'klee', # build KLEE and all its dependencies
@@ -35,8 +36,6 @@ with open(os.path.join(abs_path,"../../.github/workflows/build.yaml"), 'r') as s
                   '--create-final-image', # assume KLEE is the final image
                   ]
 
-            env_str = ["{}={}".format(k,v) for k,v in build_vars.items()]
-            print("{} {}".format(" ".join(env_str)," ".join(cmd)) )
 
             process = subprocess.Popen(cmd, # Assume KLEE is the final image
                             stdout=subprocess.PIPE,
@@ -47,11 +46,13 @@ with open(os.path.join(abs_path,"../../.github/workflows/build.yaml"), 'r') as s
                 output = process.stdout.readline()
                 print(output.strip())
                 return_code = process.poll()
-                if return_code is not None:
-                    print('Building image failed: {}'.format(return_code))
-                    for output in process.stdout.readlines():
-                        print(output.strip())
+                if return_code != None:
                     break
+            if return_code != 0:
+                print('Building image failed: {}'.format(return_code))
+                for output in process.stdout.readlines():
+                    print(output.strip())
+                sys.exit(1)
 
     except yaml.YAMLError as exc:
         print(exc)
\ No newline at end of file