From 5d29eb1060566662452d111568e5eeda5b50cd74 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 Aug 2025 10:51:35 -0700 Subject: [PATCH 01/18] Fix Azure Pipeline PyPI package builds by including VERSION.txt in source distribution (#7808) * Initial plan * Fix Azure Pipeline PyPI package builds by including VERSION.txt in source distribution Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- src/api/python/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index 6b400c7d4..c993ac54f 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -114,7 +114,7 @@ def _clean_native_build(): def _z3_version(): post = os.getenv('Z3_VERSION_SUFFIX', '') if RELEASE_DIR is None: - fn = os.path.join(SRC_DIR_REPO, 'VERSION.txt') + fn = os.path.join(SRC_DIR, 'VERSION.txt') if os.path.exists(fn): with open(fn) as f: for line in f: @@ -247,6 +247,7 @@ def _copy_sources(): # shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), ROOT_DIR) shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), SRC_DIR_LOCAL) + shutil.copy(os.path.join(SRC_DIR_REPO, 'VERSION.txt'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'z3.pc.cmake.in'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'CMakeLists.txt'), SRC_DIR_LOCAL) shutil.copytree(os.path.join(SRC_DIR_REPO, 'cmake'), os.path.join(SRC_DIR_LOCAL, 'cmake')) From 64419ad85be164491355d0adbd20492eed4125b0 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 Aug 2025 11:15:21 -0700 Subject: [PATCH 02/18] Update nightly.yaml to match release.yml NuGet tool installer changes (#7810) * Initial plan * Update nightly.yaml to match release.yml NuGet tool installer changes Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- scripts/nightly.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/nightly.yaml b/scripts/nightly.yaml index 5323f8bc0..63c259397 100644 --- a/scripts/nightly.yaml +++ b/scripts/nightly.yaml @@ -254,9 +254,9 @@ stages: inputs: artifact: 'MacArm64' path: $(Agent.TempDirectory)\package - - task: NuGetToolInstaller@0 + - task: NuGetToolInstaller@1 inputs: - versionSpec: 5.x + versionSpec: 6.x checkLatest: false - task: PythonScript@0 displayName: 'Python: assemble files' @@ -302,9 +302,9 @@ stages: inputs: artifact: 'WindowsBuild-x86' path: $(Agent.TempDirectory)\package - - task: NuGetToolInstaller@0 + - task: NuGetToolInstaller@1 inputs: - versionSpec: 5.x + versionSpec: 6.x checkLatest: false - task: PythonScript@0 displayName: 'Python: assemble files' From 4792068517c3f98c0ed01a8badc8ac3b4a4420d8 Mon Sep 17 00:00:00 2001 From: Solal Pirelli Date: Sat, 23 Aug 2025 20:15:51 +0200 Subject: [PATCH 03/18] Attempt at adding the README to the NuGet package (#7807) * Attempt at adding README to NuGet package * Forgot to enable publishing --- scripts/mk_nuget_task.py | 3 ++- scripts/release.yml | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/mk_nuget_task.py b/scripts/mk_nuget_task.py index b85ec4c8e..d854adad4 100644 --- a/scripts/mk_nuget_task.py +++ b/scripts/mk_nuget_task.py @@ -103,7 +103,7 @@ def mk_targets(source_root): def mk_icon(source_root): mk_dir("out/content") shutil.copy(f"{source_root}/resources/icon.jpg", "out/content/icon.jpg") -# shutil.copy(f"{source_root}/src/api/dotnet/README.md", "out/content/README.md") + shutil.copy(f"{source_root}/src/api/dotnet/README.md", "out/content/README.md") @@ -124,6 +124,7 @@ Linux Dependencies: © Microsoft Corporation. All rights reserved. smt constraint solver theorem prover content/icon.jpg + content/README.md https://github.com/Z3Prover/z3 MIT diff --git a/scripts/release.yml b/scripts/release.yml index 2a6cd363d..5973c46f5 100644 --- a/scripts/release.yml +++ b/scripts/release.yml @@ -261,9 +261,9 @@ stages: artifact: 'MacArm64' path: $(Agent.TempDirectory)\package - - task: NuGetToolInstaller@0 + - task: NuGetToolInstaller@1 inputs: - versionSpec: 5.x + versionSpec: 6.x checkLatest: false - task: PythonScript@0 displayName: 'Python: assemble files' @@ -305,9 +305,9 @@ stages: inputs: artifact: 'WindowsBuild-x86' path: $(Agent.TempDirectory)\package - - task: NuGetToolInstaller@0 + - task: NuGetToolInstaller@1 inputs: - versionSpec: 5.x + versionSpec: 6.x checkLatest: false - task: PythonScript@0 displayName: 'Python: assemble files' @@ -471,7 +471,7 @@ stages: - job: NuGetPublish - condition: eq(1,0) + condition: eq(1,1) displayName: "Publish to NuGet.org" steps: - task: DownloadPipelineArtifact@2 @@ -479,9 +479,9 @@ stages: inputs: artifact: 'NuGetPackage' path: $(Agent.TempDirectory) - - task: NuGetToolInstaller@0 + - task: NuGetToolInstaller@1 inputs: - versionSpec: 5.x + versionSpec: 6.x checkLatest: false - task: NuGetCommand@2 inputs: From 12e74783b6f92e1410fdc57ebeaceef5a18ac07d Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 23 Aug 2025 11:40:53 -0700 Subject: [PATCH 04/18] add resources Signed-off-by: Nikolaj Bjorner --- scripts/nightly.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/nightly.yaml b/scripts/nightly.yaml index 63c259397..50652ae56 100644 --- a/scripts/nightly.yaml +++ b/scripts/nightly.yaml @@ -8,6 +8,13 @@ variables: NightlyVersion: $(AssemblyVersion)-$(Build.buildId) # TODO: Auto-read from VERSION.txt when Azure DevOps supports it better +resources: + repositories: + - repository: z3 + type: github + name: Z3Prover/z3 + endpoint: Z3Prover + stages: - stage: Build jobs: From 7e6e96f6aae5b65e15da8604cb7215a4aaec94b2 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 23 Aug 2025 11:44:55 -0700 Subject: [PATCH 05/18] remove resources directive again Signed-off-by: Nikolaj Bjorner --- scripts/nightly.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/nightly.yaml b/scripts/nightly.yaml index 50652ae56..63c259397 100644 --- a/scripts/nightly.yaml +++ b/scripts/nightly.yaml @@ -8,13 +8,6 @@ variables: NightlyVersion: $(AssemblyVersion)-$(Build.buildId) # TODO: Auto-read from VERSION.txt when Azure DevOps supports it better -resources: - repositories: - - repository: z3 - type: github - name: Z3Prover/z3 - endpoint: Z3Prover - stages: - stage: Build jobs: From ba068d751c08d0ae229eeaa34d289ec9922e4a92 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 Aug 2025 14:23:49 -0700 Subject: [PATCH 06/18] Document how to use system-installed Z3 with CMake projects (#7809) * Initial plan * Add documentation for using system-installed Z3 with CMake Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- README-CMake.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README-CMake.md b/README-CMake.md index e182a7f94..bf06116fc 100644 --- a/README-CMake.md +++ b/README-CMake.md @@ -119,6 +119,30 @@ target_link_libraries(yourTarget libz3) ``` Note that this is `libz3` not `z3` (`libz3` refers to the library target from `src/CMakeLists.txt`). +#### Using system-installed Z3 + +If you have Z3 installed on your system (e.g., via package manager or by building and installing Z3 yourself), you can use CMake's `find_package` to locate it: + +```cmake +find_package(Z3 REQUIRED CONFIG) +``` + +Once found, you can use the Z3 include directories and libraries: + +```cmake +# For C projects +target_include_directories(yourTarget PRIVATE ${Z3_C_INCLUDE_DIRS}) +target_link_libraries(yourTarget PRIVATE ${Z3_LIBRARIES}) + +# For C++ projects +target_include_directories(yourTarget PRIVATE ${Z3_CXX_INCLUDE_DIRS}) +target_link_libraries(yourTarget PRIVATE ${Z3_LIBRARIES}) +``` + +The `find_package(Z3 CONFIG)` approach uses Z3's provided `Z3Config.cmake` file, which is installed to a standard location (typically `/lib/cmake/z3/`). If CMake cannot automatically find Z3, you can help it by setting `-DZ3_DIR=` where `` is the directory containing the `Z3Config.cmake` file. + +**Note**: This approach requires that Z3 was built and installed using CMake. Z3 installations from the Python build system may not provide the necessary CMake configuration files. + ### Ninja From 8d395d63aef4a1f1eda85838b6ce3a96e84501ec Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 Aug 2025 14:24:20 -0700 Subject: [PATCH 07/18] Fix Julia bindings linker errors on Windows MSVC (#7794) * Initial plan * Fix Julia bindings linker errors on Windows MSVC Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Complete Julia bindings fix validation and testing Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Fix Julia bindings linker errors on Windows MSVC Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- src/api/julia/CMakeLists.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/api/julia/CMakeLists.txt b/src/api/julia/CMakeLists.txt index fe27caa95..952b33fb5 100644 --- a/src/api/julia/CMakeLists.txt +++ b/src/api/julia/CMakeLists.txt @@ -1,5 +1,32 @@ find_package(JlCxx REQUIRED) +# Check for Windows MSVC + MinGW library compatibility issues +if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Get the JlCxx library path to check its format + get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_LOCATION) + if(NOT JLCXX_LIB_PATH) + get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_LOCATION_RELEASE) + endif() + if(NOT JLCXX_LIB_PATH) + get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_IMPLIB) + endif() + if(NOT JLCXX_LIB_PATH) + get_target_property(JLCXX_LIB_PATH JlCxx::cxxwrap_julia IMPORTED_IMPLIB_RELEASE) + endif() + + if(JLCXX_LIB_PATH AND JLCXX_LIB_PATH MATCHES "\\.dll\\.a$") + message(FATAL_ERROR + "Julia bindings build error: Incompatible CxxWrap library format detected.\n" + "The found libcxxwrap_julia library (${JLCXX_LIB_PATH}) is a MinGW import library (.dll.a), " + "but Z3 is being built with MSVC which requires .lib format.\n\n" + "Solutions:\n" + "1. Use MinGW/GCC instead of MSVC to build Z3\n" + "2. Install a MSVC-compatible version of CxxWrap\n" + "3. Disable Julia bindings with -DZ3_BUILD_JULIA_BINDINGS=OFF\n\n" + "For more information, see: https://github.com/JuliaInterop/CxxWrap.jl#compiling-the-c-code") + endif() +endif() + add_library(z3jl SHARED z3jl.cpp) target_link_libraries(z3jl PRIVATE JlCxx::cxxwrap_julia libz3) target_include_directories(z3jl PRIVATE From 21e63dba8d839d942915d2929a143506fe2973c3 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 23 Aug 2025 14:41:28 -0700 Subject: [PATCH 08/18] add print for version file Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index c993ac54f..e23868c9a 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -115,6 +115,7 @@ def _z3_version(): post = os.getenv('Z3_VERSION_SUFFIX', '') if RELEASE_DIR is None: fn = os.path.join(SRC_DIR, 'VERSION.txt') + print("loading version file", fn) if os.path.exists(fn): with open(fn) as f: for line in f: From 3b036369f9ca0581f79f8aa2e199499f563a5278 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 23 Aug 2025 16:37:06 -0700 Subject: [PATCH 09/18] add more logging to setup.py Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index e23868c9a..795240f04 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -113,6 +113,7 @@ def _clean_native_build(): def _z3_version(): post = os.getenv('Z3_VERSION_SUFFIX', '') + print("z3_version", "release dir", RELEASE_DIR) if RELEASE_DIR is None: fn = os.path.join(SRC_DIR, 'VERSION.txt') print("loading version file", fn) From 778b9a57c32e8f22ea423d0ab33a3af212ba969b Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 23 Aug 2025 18:13:18 -0700 Subject: [PATCH 10/18] try diferennt dirs Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index 795240f04..ce464ec03 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -113,16 +113,17 @@ def _clean_native_build(): def _z3_version(): post = os.getenv('Z3_VERSION_SUFFIX', '') - print("z3_version", "release dir", RELEASE_DIR) + print("z3_version", "release dir", RELEASE_DIR) if RELEASE_DIR is None: - fn = os.path.join(SRC_DIR, 'VERSION.txt') - print("loading version file", fn) - if os.path.exists(fn): - with open(fn) as f: - for line in f: - n = re.match(r"(.*)\.(.*)\.(.*)\.(.*)", line) - if not n is None: - return n.group(1) + '.' + n.group(2) + '.' + n.group(3) + '.' + n.group(4) + post + fns = [os.path.join(SRC_DIR, 'VERSION.txt'), os.path.join(ROOT_DIR, 'VERSION.txt')] + for fn in fns: + print("loading version file", fn) + if os.path.exists(fn): + with open(fn) as f: + for line in f: + n = re.match(r"(.*)\.(.*)\.(.*)\.(.*)", line) + if not n is None: + return n.group(1) + '.' + n.group(2) + '.' + n.group(3) + '.' + n.group(4) + post return "?.?.?.?" else: version = RELEASE_METADATA[0] From 1987b3dde17e87608de86189d826d2b0f2ee394c Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 23 Aug 2025 18:20:32 -0700 Subject: [PATCH 11/18] try src_dir_repo Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index ce464ec03..418b238f1 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -115,7 +115,8 @@ def _z3_version(): post = os.getenv('Z3_VERSION_SUFFIX', '') print("z3_version", "release dir", RELEASE_DIR) if RELEASE_DIR is None: - fns = [os.path.join(SRC_DIR, 'VERSION.txt'), os.path.join(ROOT_DIR, 'VERSION.txt')] + dirs = [SRC_DIR, ROOT_DIR, SRC_DIR_REPO] + fns = [os.path.join(d, 'VERSION.txt') for d in dirs] for fn in fns: print("loading version file", fn) if os.path.exists(fn): From 438b41acbfa63ed98b9a83ea09baa038e2421023 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sat, 23 Aug 2025 18:27:26 -0700 Subject: [PATCH 12/18] try other dir Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index 418b238f1..d4cc7215f 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -65,7 +65,7 @@ else: BUILD_ARCH = RELEASE_METADATA[1] if len(RELEASE_METADATA) == 4: BUILD_OS_VERSION = RELEASE_METADATA[3].split(".") - else: + else:v BUILD_OS_VERSION = None # determine where destinations are @@ -115,7 +115,7 @@ def _z3_version(): post = os.getenv('Z3_VERSION_SUFFIX', '') print("z3_version", "release dir", RELEASE_DIR) if RELEASE_DIR is None: - dirs = [SRC_DIR, ROOT_DIR, SRC_DIR_REPO] + dirs = [SRC_DIR, ROOT_DIR, SRC_DIR_REPO, SRC_DIR_LOCAL, os.path.join(ROOT_DIR, '..', '..')] fns = [os.path.join(d, 'VERSION.txt') for d in dirs] for fn in fns: print("loading version file", fn) From 867bc6aee6c289bc3365f930e58e7609a857892c Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 24 Aug 2025 14:36:23 -0700 Subject: [PATCH 13/18] remove extra characters Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index d4cc7215f..089cd65af 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -65,7 +65,7 @@ else: BUILD_ARCH = RELEASE_METADATA[1] if len(RELEASE_METADATA) == 4: BUILD_OS_VERSION = RELEASE_METADATA[3].split(".") - else:v + else: BUILD_OS_VERSION = None # determine where destinations are From be22111df5282423c4fe87ecafb837801829b7ee Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 24 Aug 2025 14:49:56 -0700 Subject: [PATCH 14/18] more output Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index 089cd65af..8db621da9 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -118,7 +118,7 @@ def _z3_version(): dirs = [SRC_DIR, ROOT_DIR, SRC_DIR_REPO, SRC_DIR_LOCAL, os.path.join(ROOT_DIR, '..', '..')] fns = [os.path.join(d, 'VERSION.txt') for d in dirs] for fn in fns: - print("loading version file", fn) + print("loading version file", fn, "exists", os.path.exists(fn)) if os.path.exists(fn): with open(fn) as f: for line in f: From 116e1eca8bb45a758fae8c8f0b388813033933e7 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 24 Aug 2025 15:02:50 -0700 Subject: [PATCH 15/18] print dirs Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index 8db621da9..d18b96e0c 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -116,6 +116,9 @@ def _z3_version(): print("z3_version", "release dir", RELEASE_DIR) if RELEASE_DIR is None: dirs = [SRC_DIR, ROOT_DIR, SRC_DIR_REPO, SRC_DIR_LOCAL, os.path.join(ROOT_DIR, '..', '..')] + for d in dirs: + if os.path.exists(d): + print(d, ": ", os.listdir(d)) fns = [os.path.join(d, 'VERSION.txt') for d in dirs] for fn in fns: print("loading version file", fn, "exists", os.path.exists(fn)) From 287464567b8ee39548d6babc271c2a7b8dfcddfb Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 24 Aug 2025 15:10:49 -0700 Subject: [PATCH 16/18] copy VERSION from SRC_DIR Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index d18b96e0c..bdc3cc38b 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -254,7 +254,7 @@ def _copy_sources(): # shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), ROOT_DIR) shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), SRC_DIR_LOCAL) - shutil.copy(os.path.join(SRC_DIR_REPO, 'VERSION.txt'), SRC_DIR_LOCAL) + shutil.copy(os.path.join(SRC_DIR, 'VERSION.txt'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'z3.pc.cmake.in'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'CMakeLists.txt'), SRC_DIR_LOCAL) shutil.copytree(os.path.join(SRC_DIR_REPO, 'cmake'), os.path.join(SRC_DIR_LOCAL, 'cmake')) From 300e0ae69edd7b6668e4c22273cbdf98ca0968f4 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 16:36:05 -0700 Subject: [PATCH 17/18] Move VERSION.txt to scripts directory and update all references (#7811) * Initial plan * Move VERSION.txt to scripts/ and update all references Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- CMakeLists.txt | 2 +- MODULE.bazel | 2 +- VERSION.txt => scripts/VERSION.txt | 0 scripts/mk_project.py | 2 +- scripts/nightly.yaml | 4 ++-- scripts/release.yml | 2 +- scripts/update_version.py | 2 +- src/api/python/setup.py | 4 +++- 8 files changed, 10 insertions(+), 8 deletions(-) rename VERSION.txt => scripts/VERSION.txt (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1cfa8ee3..603e86ee1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.16) set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_compiler_flags_overrides.cmake") # Read version from VERSION.txt file -file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" Z3_VERSION_FROM_FILE) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/scripts/VERSION.txt" Z3_VERSION_FROM_FILE) string(STRIP "${Z3_VERSION_FROM_FILE}" Z3_VERSION_FROM_FILE) project(Z3 VERSION ${Z3_VERSION_FROM_FILE} LANGUAGES CXX) diff --git a/MODULE.bazel b/MODULE.bazel index c368221da..48848d27e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "z3", - version = "4.16.0", # TODO: Read from VERSION.txt - currently manual sync required + version = "4.15.4", # TODO: Read from VERSION.txt - currently manual sync required bazel_compatibility = [">=7.0.0"], ) diff --git a/VERSION.txt b/scripts/VERSION.txt similarity index 100% rename from VERSION.txt rename to scripts/VERSION.txt diff --git a/scripts/mk_project.py b/scripts/mk_project.py index da73e2daf..7b4d444ea 100644 --- a/scripts/mk_project.py +++ b/scripts/mk_project.py @@ -9,7 +9,7 @@ from mk_util import * def init_version(): # Read version from VERSION.txt file - version_file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'VERSION.txt') + version_file_path = os.path.join(os.path.dirname(__file__), 'VERSION.txt') try: with open(version_file_path, 'r') as f: version_str = f.read().strip() diff --git a/scripts/nightly.yaml b/scripts/nightly.yaml index 63c259397..d051cb0ee 100644 --- a/scripts/nightly.yaml +++ b/scripts/nightly.yaml @@ -1,8 +1,8 @@ variables: # Version components read from VERSION.txt (updated manually when VERSION.txt changes) Major: '4' - Minor: '16' - Patch: '0' + Minor: '15' + Patch: '4' ReleaseVersion: $(Major).$(Minor).$(Patch) AssemblyVersion: $(Major).$(Minor).$(Patch).$(Build.BuildId) NightlyVersion: $(AssemblyVersion)-$(Build.buildId) diff --git a/scripts/release.yml b/scripts/release.yml index 5973c46f5..b26539c35 100644 --- a/scripts/release.yml +++ b/scripts/release.yml @@ -6,7 +6,7 @@ trigger: none variables: - ReleaseVersion: '4.16.0' # TODO: Auto-read from VERSION.txt when Azure DevOps supports it better + ReleaseVersion: '4.15.4' # TODO: Auto-read from VERSION.txt when Azure DevOps supports it better stages: diff --git a/scripts/update_version.py b/scripts/update_version.py index fcc3c5576..f33b20655 100755 --- a/scripts/update_version.py +++ b/scripts/update_version.py @@ -16,7 +16,7 @@ import sys def read_version(): """Read version from VERSION.txt file.""" script_dir = os.path.dirname(os.path.abspath(__file__)) - version_file = os.path.join(os.path.dirname(script_dir), 'VERSION.txt') + version_file = os.path.join(script_dir, 'VERSION.txt') try: with open(version_file, 'r') as f: diff --git a/src/api/python/setup.py b/src/api/python/setup.py index bdc3cc38b..75b2298ac 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -120,6 +120,8 @@ def _z3_version(): if os.path.exists(d): print(d, ": ", os.listdir(d)) fns = [os.path.join(d, 'VERSION.txt') for d in dirs] + # Also try the scripts directory + fns.extend([os.path.join(d, 'scripts', 'VERSION.txt') for d in dirs]) for fn in fns: print("loading version file", fn, "exists", os.path.exists(fn)) if os.path.exists(fn): @@ -254,7 +256,7 @@ def _copy_sources(): # shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), ROOT_DIR) shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), SRC_DIR_LOCAL) - shutil.copy(os.path.join(SRC_DIR, 'VERSION.txt'), SRC_DIR_LOCAL) + shutil.copy(os.path.join(SRC_DIR, 'scripts', 'VERSION.txt'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'z3.pc.cmake.in'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'CMakeLists.txt'), SRC_DIR_LOCAL) shutil.copytree(os.path.join(SRC_DIR_REPO, 'cmake'), os.path.join(SRC_DIR_LOCAL, 'cmake')) From 12563c6963465b78b80ce263b9063d0e6d89a84b Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 24 Aug 2025 16:38:15 -0700 Subject: [PATCH 18/18] clean up a little of the handling of VERSION.txt Signed-off-by: Nikolaj Bjorner --- src/api/python/setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/api/python/setup.py b/src/api/python/setup.py index 75b2298ac..39ae7df72 100644 --- a/src/api/python/setup.py +++ b/src/api/python/setup.py @@ -119,9 +119,7 @@ def _z3_version(): for d in dirs: if os.path.exists(d): print(d, ": ", os.listdir(d)) - fns = [os.path.join(d, 'VERSION.txt') for d in dirs] - # Also try the scripts directory - fns.extend([os.path.join(d, 'scripts', 'VERSION.txt') for d in dirs]) + fns = [os.path.join(d, 'scripts', 'VERSION.txt') for d in dirs] for fn in fns: print("loading version file", fn, "exists", os.path.exists(fn)) if os.path.exists(fn): @@ -256,7 +254,6 @@ def _copy_sources(): # shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), ROOT_DIR) shutil.copy(os.path.join(SRC_DIR_REPO, 'LICENSE.txt'), SRC_DIR_LOCAL) - shutil.copy(os.path.join(SRC_DIR, 'scripts', 'VERSION.txt'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'z3.pc.cmake.in'), SRC_DIR_LOCAL) shutil.copy(os.path.join(SRC_DIR_REPO, 'CMakeLists.txt'), SRC_DIR_LOCAL) shutil.copytree(os.path.join(SRC_DIR_REPO, 'cmake'), os.path.join(SRC_DIR_LOCAL, 'cmake'))