Skip to content

Commit

Permalink
fix CI meson.build subproject script
Browse files Browse the repository at this point in the history
  • Loading branch information
giridharprasath committed Sep 21, 2024
1 parent 9c7c243 commit 169a671
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
13 changes: 5 additions & 8 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ py3_exe = import('python').find_installation()
check_meson_subproject_py = files('sys/check_meson_subproject.py')
subproject_clean_error_msg = 'Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories.'

r = run_command(py3_exe, check_meson_subproject_py, 'z3', check: false)
r = run_command(py3_exe, check_meson_subproject_py, ['z3', meson.source_root()], check: true)
if r.returncode() == 1
error(subproject_clean_error_msg)
endif

'''
# handle z3 library
sys_z3_opt = get_option('use_sys_z3')
z3_dep = disabler()
Expand All @@ -24,15 +25,11 @@ if sys_z3_opt.enabled() or sys_z3_opt.auto()
z3_dep = cc.find_library('z3', required: sys_z3_opt)
endif
endif
if (sys_z3_opt.auto() and not z3_dep.found()) or sys_z3_opt.disabled()
'''
#if (sys_z3_opt.auto() and not z3_dep.found()) or sys_z3_opt.disabled()
z3_proj = subproject('z3', default_options: ['default_library=static'])
z3_dep = z3_proj.get_variable('z3_dep')
endif

r = run_command(py3_exe, check_meson_subproject_py, 'z3', check: false)
if r.returncode() == 1
error(subproject_clean_error_msg)
endif
#endif

rz_solver_deps = [
rz_core_dep,
Expand Down
8 changes: 7 additions & 1 deletion sys/check_meson_subproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sys

subproject = sys.argv[1]
meson_root = os.environ["MESON_SOURCE_ROOT"]
meson_root = sys.argv[2] if len(sys.argv) > 2 else ''

subproject_filename = os.path.join(meson_root, "subprojects", subproject + ".wrap")

Expand Down Expand Up @@ -66,9 +66,15 @@
subproject_p_f = subproject_f.replace(
patch_subproject_dir, subproject_dir
)

if not os.path.isfile(subproject_f):
sys.exit(2)

if not os.path.isfile(subproject_p_f):
with open(subproject_f, 'rb') as fsrc:
with open(subproject_p_f, 'wb') as fdst:
fdst.write(fsrc.read())

if not filecmp.cmp(subproject_p_f, subproject_f):
sys.exit(3)

Expand Down

0 comments on commit 169a671

Please sign in to comment.