From 6112ea2ec7bf28c738aaba709629defc777596d4 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 5 Feb 2016 14:38:41 +0000 Subject: [PATCH 1/3] Fix typo --- scripts/mk_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 3ca0012e7..6db45d970 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -596,7 +596,7 @@ def display_help(exit_code): else: print(" --parallel=num use cl option /MP with 'num' parallel processes") print(" --pypkgdir= Force a particular Python package directory (default %s)" % PYTHON_PACKAGE_DIR) - print(" -b , --build= subdirectory where Z3 will be built (default: build).") + print(" -b , --build= subdirectory where Z3 will be built (default: build).") print(" --githash=hash include the given hash in the binaries.") print(" -d, --debug compile Z3 in debug mode.") print(" -t, --trace enable tracing in release mode.") From 33f676ef6b7d8b5dfc58607319849cdf101c2457 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 5 Feb 2016 14:39:27 +0000 Subject: [PATCH 2/3] Do not hardcode default build directory name. --- scripts/mk_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 6db45d970..1e940ad13 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -596,7 +596,7 @@ def display_help(exit_code): else: print(" --parallel=num use cl option /MP with 'num' parallel processes") print(" --pypkgdir= Force a particular Python package directory (default %s)" % PYTHON_PACKAGE_DIR) - print(" -b , --build= subdirectory where Z3 will be built (default: build).") + print(" -b , --build= subdirectory where Z3 will be built (default: %s)." % BUILD_DIR) print(" --githash=hash include the given hash in the binaries.") print(" -d, --debug compile Z3 in debug mode.") print(" -t, --trace enable tracing in release mode.") From 508d2e32c8fc228e010e0b02d269c9df1d97f69c Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 5 Feb 2016 14:51:15 +0000 Subject: [PATCH 3/3] Fix a bug in Python build scripts where an extra ending slash in the build directory would cause REV_BUILD_DIR to be set incorrectly and would lead to a broken Makefile being generated. What would happen before: ``` $ python scripts/mk_make.py --build FOO_1 ... REV_BUILD_DIR='..' ``` ``` $ python scripts/mk_make.py --build FOO_1/ ... REV_BUILD_DIR='../..' ``` ^^^^^ that's wrong. It should be REV_BUILD_DIR='..' To fix this the ``reverse_path()`` function has been taught to ignore empty components in ``p.split(os.sep)``. --- scripts/mk_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 1e940ad13..53f891d28 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -742,7 +742,8 @@ def extract_c_includes(fname): # Given a path dir1/subdir2/subdir3 returns ../../.. def reverse_path(p): - l = p.split(os.sep) + # Filter out empty components (e.g. will have one if path ends in a slash) + l = list(filter(lambda x: len(x) > 0, p.split(os.sep))) n = len(l) r = '..' for i in range(1, n):