mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
Merge remote-tracking branch 'origin/master' into poly
This commit is contained in:
commit
183e911a79
260 changed files with 4131 additions and 3248 deletions
99
scripts/build-win-signed-cmake.yml
Normal file
99
scripts/build-win-signed-cmake.yml
Normal file
|
@ -0,0 +1,99 @@
|
|||
parameters:
|
||||
ReleaseVersion: ''
|
||||
BuildArchitecture: ''
|
||||
VCArchitecture: ''
|
||||
|
||||
jobs:
|
||||
- job: WindowsBuild${{parameters.BuildArchitecture}}
|
||||
displayName: "Windows build (${{parameters.BuildArchitecture}})"
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
steps:
|
||||
- powershell: write-host $(System.TeamProjectId)
|
||||
displayName: 'System.TeamProjectId'
|
||||
- powershell: write-host $(System.DefinitionId)
|
||||
displayName: 'System.DefinitionId'
|
||||
- powershell: write-host $(Build.BuildId)
|
||||
displayName: 'Build.BuildId'
|
||||
- task: CmdLine@2
|
||||
displayName: Build
|
||||
inputs:
|
||||
script:
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{parameters.VCArchitecture}} &
|
||||
python scripts\mk_win_dist_cmake.py
|
||||
--${{parameters.BuildArchitecture}}-only
|
||||
--assembly-version=${{parameters.ReleaseVersion}}
|
||||
--dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Collect Symbols'
|
||||
inputs:
|
||||
sourceFolder: build-dist/${{parameters.BuildArchitecture}}/
|
||||
contents: '*.pdb'
|
||||
targetFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
# Publish symbol archive to match nuget package
|
||||
# Index your source code and publish symbols to a file share or Azure Artifacts symbol server
|
||||
- task: PublishSymbols@2
|
||||
inputs:
|
||||
symbolsFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
searchPattern: '**/*.pdb'
|
||||
indexSources: false # Github sources not supported
|
||||
publishSymbols: true
|
||||
symbolServerType: TeamServices
|
||||
detailedLog: true
|
||||
- task: EsrpCodeSigning@2
|
||||
displayName: Sign
|
||||
inputs:
|
||||
ConnectedServiceName: 'z3-esrp-signing-2'
|
||||
FolderPath: 'build-dist/${{parameters.BuildArchitecture}}/dist/z3-${{parameters.ReleaseVersion}}-${{parameters.BuildArchitecture}}-win/bin'
|
||||
Pattern: 'Microsoft.Z3.dll,libz3.dll,libz3java.dll,z3.exe'
|
||||
signConfigType: 'inlineSignParams'
|
||||
inlineOperation: |
|
||||
[
|
||||
{
|
||||
"keyCode": "CP-230012",
|
||||
"operationSetCode": "SigntoolSign",
|
||||
"parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd sha256"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"toolName": "signtool.exe",
|
||||
"toolVersion": "6.2.9304.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: '60'
|
||||
MaxConcurrency: '50'
|
||||
MaxRetryAttempts: '5'
|
||||
- task: DeleteFiles@1
|
||||
displayName: Cleanup
|
||||
inputs:
|
||||
SourceFolder: 'build-dist/${{parameters.BuildArchitecture}}/dist/z3-${{parameters.ReleaseVersion}}-${{parameters.BuildArchitecture}}-win/bin'
|
||||
Contents: 'CodeSignSummary*'
|
||||
- task: ArchiveFiles@2
|
||||
displayName: Zip
|
||||
inputs:
|
||||
rootFolderOrFile: 'build-dist/${{parameters.BuildArchitecture}}/dist/z3-${{parameters.ReleaseVersion}}-${{parameters.BuildArchitecture}}-win'
|
||||
includeRootFolder: true
|
||||
archiveType: 'zip'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/z3-${{parameters.ReleaseVersion}}-${{parameters.BuildArchitecture}}-win.zip'
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: '$(Build.ArtifactStagingDirectory)/z3-${{parameters.ReleaseVersion}}-${{parameters.BuildArchitecture}}-win.zip'
|
||||
artifactName: 'WindowsBuild-${{parameters.BuildArchitecture}}'
|
|
@ -21,9 +21,10 @@ def mk_dir(d):
|
|||
if not os.path.exists(d):
|
||||
os.makedirs(d)
|
||||
|
||||
os_info = { 'ubuntu-latest' : ('so', 'linux-x64'),
|
||||
'ubuntu-18' : ('so', 'linux-x64'),
|
||||
'ubuntu-20' : ('so', 'linux-x64'),
|
||||
os_info = { 'x64-ubuntu-latest' : ('so', 'linux-x64'),
|
||||
'x64-ubuntu-18' : ('so', 'linux-x64'),
|
||||
'x64-ubuntu-20' : ('so', 'linux-x64'),
|
||||
'x64-ubuntu-22' : ('so', 'linux-x64'),
|
||||
'x64-glibc-2.35' : ('so', 'linux-x64'),
|
||||
'x64-win' : ('dll', 'win-x64'),
|
||||
'x86-win' : ('dll', 'win-x86'),
|
||||
|
@ -78,8 +79,15 @@ def unpack(packages, symbols, arch):
|
|||
if symbols:
|
||||
files += ["Microsoft.Z3.pdb", "Microsoft.Z3.xml"]
|
||||
for b in files:
|
||||
zip_ref.extract(f"{package_dir}/bin/{b}", f"{tmp}")
|
||||
replace(f"{tmp}/{package_dir}/bin/{b}", f"out/lib/netstandard2.0/{b}")
|
||||
file = f"{package_dir}/bin/{b}"
|
||||
if os.path.exists(file):
|
||||
zip_ref.extract(file, f"{tmp}")
|
||||
replace(f"{tmp}/{package_dir}/bin/{b}", f"out/lib/netstandard2.0/{b}")
|
||||
file = os.path.join(file,"netstandard2.0")
|
||||
if os.path.exists(file):
|
||||
zip_ref.extract(file, f"{tmp}")
|
||||
replace(f"{tmp}/{package_dir}/bin/netstandard2.0/{b}", f"out/lib/netstandard2.0/{b}")
|
||||
|
||||
|
||||
def mk_targets(source_root):
|
||||
mk_dir("out/build")
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
from mk_util import *
|
||||
|
||||
def init_version():
|
||||
set_version(4, 12, 5, 0) # express a default build version or pick up ci build version
|
||||
set_version(4, 12, 6, 0) # express a default build version or pick up ci build version
|
||||
|
||||
# Z3 Project definition
|
||||
def init_project_def():
|
||||
|
@ -40,6 +40,7 @@ def init_project_def():
|
|||
add_lib('model', ['macros'])
|
||||
add_lib('converters', ['model'], 'ast/converters')
|
||||
add_lib('simplifiers', ['euf', 'normal_forms', 'bit_blaster', 'converters', 'substitution'], 'ast/simplifiers')
|
||||
add_lib('ast_sls', ['ast','normal_forms','converters'], 'ast/sls')
|
||||
add_lib('tactic', ['simplifiers'])
|
||||
add_lib('mbp', ['model', 'simplex'], 'qe/mbp')
|
||||
add_lib('qe_lite', ['tactic', 'mbp'], 'qe/lite')
|
||||
|
@ -65,7 +66,7 @@ def init_project_def():
|
|||
add_lib('bv_tactics', ['tactic', 'bit_blaster', 'core_tactics'], 'tactic/bv')
|
||||
add_lib('fuzzing', ['ast'], 'test/fuzzing')
|
||||
add_lib('smt_tactic', ['smt'], 'smt/tactic')
|
||||
add_lib('sls_tactic', ['tactic', 'normal_forms', 'core_tactics', 'bv_tactics'], 'tactic/sls')
|
||||
add_lib('sls_tactic', ['tactic', 'normal_forms', 'core_tactics', 'bv_tactics', 'ast_sls'], 'tactic/sls')
|
||||
add_lib('qe', ['smt', 'mbp', 'qe_lite', 'nlsat', 'tactic', 'nlsat_tactic'], 'qe')
|
||||
add_lib('sat_solver', ['solver', 'core_tactics', 'aig_tactic', 'bv_tactics', 'arith_tactics', 'sat_tactic'], 'sat/sat_solver')
|
||||
add_lib('fd_solver', ['core_tactics', 'arith_tactics', 'sat_solver', 'smt'], 'tactic/fd_solver')
|
||||
|
|
268
scripts/mk_unix_dist_cmake.py
Normal file
268
scripts/mk_unix_dist_cmake.py
Normal file
|
@ -0,0 +1,268 @@
|
|||
############################################
|
||||
# Copyright (c) 2013 Microsoft Corporation
|
||||
#
|
||||
# Scripts for automatically generating
|
||||
# Linux/OSX/BSD distribution zip files.
|
||||
#
|
||||
# Author: Leonardo de Moura (leonardo)
|
||||
############################################
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import zipfile
|
||||
import re
|
||||
import getopt
|
||||
import sys
|
||||
import shutil
|
||||
from mk_exception import *
|
||||
from fnmatch import fnmatch
|
||||
|
||||
def getenv(name, default):
|
||||
try:
|
||||
return os.environ[name].strip(' "\'')
|
||||
except:
|
||||
return default
|
||||
|
||||
BUILD_DIR = 'build-dist'
|
||||
DIST_DIR = 'dist'
|
||||
VERBOSE = True
|
||||
FORCE_MK = False
|
||||
ASSEMBLY_VERSION = None
|
||||
DOTNET_CORE_ENABLED = True
|
||||
DOTNET_KEY_FILE = None
|
||||
JAVA_ENABLED = True
|
||||
JULIA_ENABLED = False
|
||||
GIT_HASH = False
|
||||
PYTHON_ENABLED = True
|
||||
ARM64 = False
|
||||
MAKEJOBS = getenv("MAKEJOBS", "24")
|
||||
|
||||
def set_verbose(flag):
|
||||
global VERBOSE
|
||||
VERBOSE = flag
|
||||
|
||||
def is_verbose():
|
||||
return VERBOSE
|
||||
|
||||
def mk_dir(d):
|
||||
if not os.path.exists(d):
|
||||
if is_verbose():
|
||||
print("Make directory", d)
|
||||
os.makedirs(d)
|
||||
|
||||
def get_z3_name():
|
||||
version = "4"
|
||||
if ASSEMBLY_VERSION:
|
||||
version = ASSEMBLY_VERSION
|
||||
print("Assembly version:", version)
|
||||
if GIT_HASH:
|
||||
return 'z3-%s.%s' % (version, get_git_hash())
|
||||
else:
|
||||
return 'z3-%s' % (version)
|
||||
|
||||
def get_build_dir():
|
||||
return BUILD_DIR
|
||||
|
||||
def get_build_dist():
|
||||
return os.path.join(get_build_dir(), DIST_DIR)
|
||||
|
||||
def get_build_dist_path():
|
||||
return os.path.join(get_build_dist(), get_z3_name())
|
||||
|
||||
def set_build_dir(path):
|
||||
global BUILD_DIR
|
||||
BUILD_DIR = os.path.expanduser(os.path.normpath(path))
|
||||
mk_dir(BUILD_DIR)
|
||||
|
||||
def display_help():
|
||||
print("mk_unix_dist_cmake.py: Z3 Unix distribution generator\n")
|
||||
print("This script generates the zip files containing executables, shared objects, header files for Unix.")
|
||||
print("It must be executed from the Z3 root directory.")
|
||||
print("\nOptions:")
|
||||
print(" -h, --help display this message.")
|
||||
print(" -s, --silent do not print verbose messages.")
|
||||
print(" -b <subdir>, --build=<subdir> subdirectory where Z3 will be built (default: build-dist).")
|
||||
print(" -f, --force force script to regenerate Makefiles.")
|
||||
print(" --version=<version> release version.")
|
||||
print(" --assembly-version assembly version for dll")
|
||||
print(" --nodotnet do not include .NET bindings in the binary distribution files.")
|
||||
print(" --dotnet-key=<file> strongname sign the .NET assembly with the private key in <file>.")
|
||||
print(" --nojava do not include Java bindings in the binary distribution files.")
|
||||
print(" --nopython do not include Python bindings in the binary distribution files.")
|
||||
print(" --julia build Julia bindings.")
|
||||
print(" --githash include git hash in the Zip file.")
|
||||
print(" --arm64 build for ARM64 architecture.")
|
||||
exit(0)
|
||||
|
||||
# Parse configuration option for mk_make script
|
||||
def parse_options():
|
||||
global FORCE_MK, JAVA_ENABLED, JULIA_ENABLED, GIT_HASH, DOTNET_CORE_ENABLED, DOTNET_KEY_FILE, ASSEMBLY_VERSION, PYTHON_ENABLED, ARM64
|
||||
path = BUILD_DIR
|
||||
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=',
|
||||
'help',
|
||||
'silent',
|
||||
'force',
|
||||
'nojava',
|
||||
'nodotnet',
|
||||
'dotnet-key=',
|
||||
'assembly-version=',
|
||||
'githash',
|
||||
'nopython',
|
||||
'julia',
|
||||
'arm64'
|
||||
])
|
||||
for opt, arg in options:
|
||||
if opt in ('-b', '--build'):
|
||||
if arg == 'src':
|
||||
raise MKException('The src directory should not be used to host the Makefile')
|
||||
path = arg
|
||||
elif opt in ('-s', '--silent'):
|
||||
set_verbose(False)
|
||||
elif opt in ('-h', '--help'):
|
||||
display_help()
|
||||
elif opt in ('-f', '--force'):
|
||||
FORCE_MK = True
|
||||
elif opt == '--nodotnet':
|
||||
DOTNET_CORE_ENABLED = False
|
||||
elif opt == '--assembly-version':
|
||||
ASSEMBLY_VERSION = arg
|
||||
elif opt == '--nopython':
|
||||
PYTHON_ENABLED = False
|
||||
elif opt == '--dotnet-key':
|
||||
DOTNET_KEY_FILE = arg
|
||||
elif opt == '--nojava':
|
||||
JAVA_ENABLED = False
|
||||
elif opt == '--julia':
|
||||
JULIA_ENABLED = True
|
||||
elif opt == '--githash':
|
||||
GIT_HASH = True
|
||||
elif opt == '--arm64':
|
||||
ARM64 = True
|
||||
else:
|
||||
raise MKException("Invalid command line option '%s'" % opt)
|
||||
set_build_dir(path)
|
||||
|
||||
def check_output(cmd):
|
||||
out = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
|
||||
if out != None:
|
||||
enc = sys.getdefaultencoding()
|
||||
if enc != None: return out.decode(enc).rstrip('\r\n')
|
||||
else: return out.rstrip('\r\n')
|
||||
else:
|
||||
return ""
|
||||
|
||||
def get_git_hash():
|
||||
try:
|
||||
branch = check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
|
||||
r = check_output(['git', 'show-ref', '--abbrev=12', 'refs/heads/%s' % branch])
|
||||
except:
|
||||
raise MKException("Failed to retrieve git hash")
|
||||
ls = r.split(' ')
|
||||
if len(ls) != 2:
|
||||
raise MKException("Unexpected git output " + r)
|
||||
return ls[0]
|
||||
|
||||
# Create a build directory using CMake
|
||||
def mk_build_dir():
|
||||
build_path = get_build_dir()
|
||||
if not os.path.exists(build_path) or FORCE_MK:
|
||||
mk_dir(build_path)
|
||||
cmds = []
|
||||
cmds.append(f"cd {build_path}")
|
||||
cmd = []
|
||||
cmd.append("cmake -S .")
|
||||
if DOTNET_CORE_ENABLED:
|
||||
cmd.append(' -DZ3_BUILD_DOTNET_BINDINGS=ON')
|
||||
if JAVA_ENABLED:
|
||||
cmd.append(' -DZ3_BUILD_JAVA_BINDINGS=ON')
|
||||
cmd.append(' -DZ3_INSTALL_JAVA_BINDINGS=ON')
|
||||
cmd.append(' -DZ3_JAVA_JAR_INSTALLDIR=java')
|
||||
cmd.append(' -DZ3_JAVA_JNI_LIB_INSTALLDIR=bin/java')
|
||||
if PYTHON_ENABLED:
|
||||
cmd.append(' -DZ3_BUILD_PYTHON_BINDINGS=ON')
|
||||
cmd.append(' -DZ3_INSTALL_PYTHON_BINDINGS=ON')
|
||||
cmd.append(' -DCMAKE_INSTALL_PYTHON_PKG_DIR=bin/python')
|
||||
if JULIA_ENABLED:
|
||||
cmd.append(' -DZ3_BUILD_JULIA_BINDINGS=ON')
|
||||
cmd.append(' -DZ3_INSTALL_JULIA_BINDINGS=ON')
|
||||
if GIT_HASH:
|
||||
git_hash = get_git_hash()
|
||||
cmd.append(' -DGIT_HASH=' + git_hash)
|
||||
cmd.append(' -DZ3_USE_LIB_GMP=OFF')
|
||||
cmd.append(' -DZ3_BUILD_LIBZ3_SHARED=ON')
|
||||
cmd.append(' -DCMAKE_BUILD_TYPE=RelWithDebInfo')
|
||||
cmd.append(' -DCMAKE_INSTALL_PREFIX=' + get_build_dist_path())
|
||||
cmd.append(' -G "Ninja"')
|
||||
cmd.append(' ..\n')
|
||||
cmds.append("".join(cmd))
|
||||
print("CMAKE commands:", cmds)
|
||||
sys.stdout.flush()
|
||||
if exec_cmds(cmds) != 0:
|
||||
raise MKException("failed to run commands")
|
||||
|
||||
def exec_cmds(cmds):
|
||||
cmd_file = 'z3_tmp.sh'
|
||||
f = open(cmd_file, 'w')
|
||||
for cmd in cmds:
|
||||
f.write(cmd)
|
||||
f.write('\n')
|
||||
f.close()
|
||||
res = 0
|
||||
try:
|
||||
res = subprocess.call(['sh', cmd_file])
|
||||
except:
|
||||
res = 1
|
||||
try:
|
||||
os.remove(cmd_file)
|
||||
except:
|
||||
pass
|
||||
return res
|
||||
|
||||
def build_z3():
|
||||
if is_verbose():
|
||||
print("build z3")
|
||||
build_dir = get_build_dir()
|
||||
cmds = []
|
||||
cmds.append('cd %s' % build_dir)
|
||||
cmds.append('ninja install')
|
||||
if exec_cmds(cmds) != 0:
|
||||
raise MKException("Failed to make z3")
|
||||
|
||||
def mk_zip():
|
||||
build_dist = get_build_dist_path()
|
||||
dist_name = get_z3_name()
|
||||
old = os.getcwd()
|
||||
try:
|
||||
if is_verbose():
|
||||
print("dist path", build_dist)
|
||||
mk_dir(build_dist)
|
||||
zfname = '%s.zip' % dist_name
|
||||
zipout = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
|
||||
os.chdir(get_build_dist())
|
||||
for root, dirs, files in os.walk("."):
|
||||
for f in files:
|
||||
if is_verbose():
|
||||
print("adding ", os.path.join(root, f))
|
||||
zipout.write(os.path.join(root, f))
|
||||
if is_verbose():
|
||||
print("Generated '%s'" % zfname)
|
||||
except:
|
||||
pass
|
||||
os.chdir(old)
|
||||
|
||||
def cp_license():
|
||||
if is_verbose():
|
||||
print("copy licence")
|
||||
path = get_build_dist_path()
|
||||
mk_dir(path)
|
||||
shutil.copy("LICENSE.txt", path)
|
||||
|
||||
# Entry point
|
||||
def main():
|
||||
parse_options()
|
||||
mk_build_dir()
|
||||
build_z3()
|
||||
cp_license()
|
||||
mk_zip()
|
||||
|
||||
main()
|
423
scripts/mk_win_dist_cmake.py
Normal file
423
scripts/mk_win_dist_cmake.py
Normal file
|
@ -0,0 +1,423 @@
|
|||
############################################
|
||||
# Copyright (c) 2012 Microsoft Corporation
|
||||
#
|
||||
# Scripts for automatically generating
|
||||
# Window distribution zip files.
|
||||
#
|
||||
# Author: Leonardo de Moura (leonardo)
|
||||
############################################
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import zipfile
|
||||
import re
|
||||
import getopt
|
||||
import sys
|
||||
import shutil
|
||||
from mk_exception import *
|
||||
from fnmatch import fnmatch
|
||||
|
||||
def getenv(name, default):
|
||||
try:
|
||||
return os.environ[name].strip(' "\'')
|
||||
except:
|
||||
return default
|
||||
|
||||
BUILD_DIR = 'build-dist'
|
||||
DIST_DIR = 'dist'
|
||||
BUILD_X64_DIR = os.path.join(BUILD_DIR, 'x64')
|
||||
BUILD_X86_DIR = os.path.join(BUILD_DIR, 'x86')
|
||||
BUILD_ARM64_DIR = os.path.join(BUILD_DIR, 'arm64')
|
||||
VERBOSE = True
|
||||
FORCE_MK = False
|
||||
ASSEMBLY_VERSION = None
|
||||
DOTNET_CORE_ENABLED = True
|
||||
DOTNET_KEY_FILE = None
|
||||
JAVA_ENABLED = True
|
||||
ZIP_BUILD_OUTPUTS = False
|
||||
GIT_HASH = False
|
||||
PYTHON_ENABLED = True
|
||||
X86ONLY = False
|
||||
X64ONLY = False
|
||||
ARM64ONLY = False
|
||||
ARCHITECTURES = []
|
||||
|
||||
def set_verbose(flag):
|
||||
global VERBOSE
|
||||
VERBOSE = flag
|
||||
|
||||
def is_verbose():
|
||||
return VERBOSE
|
||||
|
||||
def mk_dir(d):
|
||||
if not os.path.exists(d):
|
||||
if is_verbose():
|
||||
print("Make directory", d)
|
||||
os.makedirs(d)
|
||||
|
||||
def get_z3_name(arch):
|
||||
version = "4"
|
||||
if ASSEMBLY_VERSION:
|
||||
version = ASSEMBLY_VERSION
|
||||
print("Assembly version:", version)
|
||||
if GIT_HASH:
|
||||
return 'z3-%s.%s-%s-win' % (version, get_git_hash(), arch)
|
||||
else:
|
||||
return 'z3-%s-%s-win' % (version, arch)
|
||||
|
||||
def get_build_dir(arch):
|
||||
return ARCHITECTURES[arch]
|
||||
|
||||
def get_build_dist(arch):
|
||||
return os.path.join(get_build_dir(arch), DIST_DIR)
|
||||
|
||||
def get_build_dist_path(arch):
|
||||
return os.path.join(get_build_dir(arch), DIST_DIR, get_z3_name(arch))
|
||||
|
||||
def get_bin_dist_path(arch):
|
||||
return os.path.join(get_build_dist_path(arch), "bin")
|
||||
|
||||
def get_lib_dist_path(arch):
|
||||
return os.path.join(get_build_dist_path(arch), "lib")
|
||||
|
||||
def get_java_dist_path(arch):
|
||||
return os.path.join(get_build_dist_path(arch), "java")
|
||||
|
||||
def get_dist_path(arch):
|
||||
return os.path.join(DIST_DIR, arch)
|
||||
|
||||
def set_build_dir(path):
|
||||
global BUILD_DIR, BUILD_X86_DIR, BUILD_X64_DIR, BUILD_ARM64_DIR, ARCHITECTURES
|
||||
BUILD_DIR = os.path.expanduser(os.path.normpath(path))
|
||||
BUILD_X86_DIR = os.path.join(path, 'x86')
|
||||
BUILD_X64_DIR = os.path.join(path, 'x64')
|
||||
BUILD_ARM64_DIR = os.path.join(path, 'arm64') # Set ARM64 build directory
|
||||
ARCHITECTURES = {'x64': BUILD_X64_DIR, 'x86':BUILD_X86_DIR, 'arm64':BUILD_ARM64_DIR}
|
||||
|
||||
def display_help():
|
||||
print("mk_win_dist.py: Z3 Windows distribution generator\n")
|
||||
print("This script generates the zip files containing executables, dlls, header files for Windows.")
|
||||
print("It must be executed from the Z3 root directory.")
|
||||
print("\nOptions:")
|
||||
print(" -h, --help display this message.")
|
||||
print(" -s, --silent do not print verbose messages.")
|
||||
print(" -b <sudir>, --build=<subdir> subdirectory where x86 and x64 Z3 versions will be built (default: build-dist).")
|
||||
print(" -f, --force force script to regenerate Makefiles.")
|
||||
print(" --version=<version> release version.")
|
||||
print(" --assembly-version assembly version for dll")
|
||||
print(" --nodotnet do not include .NET bindings in the binary distribution files.")
|
||||
print(" --dotnet-key=<file> strongname sign the .NET assembly with the private key in <file>.")
|
||||
print(" --nojava do not include Java bindings in the binary distribution files.")
|
||||
print(" --nopython do not include Python bindings in the binary distribution files.")
|
||||
print(" --zip package build outputs in zip file.")
|
||||
print(" --githash include git hash in the Zip file.")
|
||||
print(" --x86-only x86 dist only.")
|
||||
print(" --x64-only x64 dist only.")
|
||||
print(" --arm64-only arm64 dist only.")
|
||||
exit(0)
|
||||
|
||||
# Parse configuration option for mk_make script
|
||||
def parse_options():
|
||||
global FORCE_MK, JAVA_ENABLED, ZIP_BUILD_OUTPUTS, GIT_HASH, DOTNET_CORE_ENABLED, DOTNET_KEY_FILE, ASSEMBLY_VERSION, PYTHON_ENABLED, X86ONLY, X64ONLY, ARM64ONLY
|
||||
path = BUILD_DIR
|
||||
options, remainder = getopt.gnu_getopt(sys.argv[1:], 'b:hsf', ['build=',
|
||||
'help',
|
||||
'silent',
|
||||
'force',
|
||||
'nojava',
|
||||
'nodotnet',
|
||||
'dotnet-key=',
|
||||
'assembly-version=',
|
||||
'zip',
|
||||
'githash',
|
||||
'nopython',
|
||||
'x86-only',
|
||||
'x64-only',
|
||||
'arm64-only'
|
||||
])
|
||||
for opt, arg in options:
|
||||
if opt in ('-b', '--build'):
|
||||
if arg == 'src':
|
||||
raise MKException('The src directory should not be used to host the Makefile')
|
||||
path = arg
|
||||
elif opt in ('-s', '--silent'):
|
||||
set_verbose(False)
|
||||
elif opt in ('-h', '--help'):
|
||||
display_help()
|
||||
elif opt in ('-f', '--force'):
|
||||
FORCE_MK = True
|
||||
elif opt == '--nodotnet':
|
||||
DOTNET_CORE_ENABLED = False
|
||||
elif opt == '--assembly-version':
|
||||
ASSEMBLY_VERSION = arg
|
||||
elif opt == '--nopython':
|
||||
PYTHON_ENABLED = False
|
||||
elif opt == '--dotnet-key':
|
||||
DOTNET_KEY_FILE = arg
|
||||
elif opt == '--nojava':
|
||||
JAVA_ENABLED = False
|
||||
elif opt == '--zip':
|
||||
ZIP_BUILD_OUTPUTS = True
|
||||
elif opt == '--githash':
|
||||
GIT_HASH = True
|
||||
elif opt == '--x86-only' and not X64ONLY:
|
||||
X86ONLY = True
|
||||
elif opt == '--arm64-only' and not X86ONLY and not X64ONLY:
|
||||
ARM64ONLY = True
|
||||
elif opt == '--x64-only' and not X86ONLY:
|
||||
X64ONLY = True
|
||||
else:
|
||||
raise MKException("Invalid command line option '%s'" % opt)
|
||||
set_build_dir(path)
|
||||
|
||||
# Check whether build directory already exists or not
|
||||
def check_build_dir(path):
|
||||
return os.path.exists(path) and os.path.exists(os.path.join(path, 'Makefile'))
|
||||
|
||||
def check_output(cmd):
|
||||
out = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
|
||||
if out != None:
|
||||
enc = sys.getdefaultencoding()
|
||||
if enc != None: return out.decode(enc).rstrip('\r\n')
|
||||
else: return out.rstrip('\r\n')
|
||||
else:
|
||||
return ""
|
||||
|
||||
def get_git_hash():
|
||||
try:
|
||||
branch = check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
|
||||
r = check_output(['git', 'show-ref', '--abbrev=12', 'refs/heads/%s' % branch])
|
||||
except:
|
||||
raise MKException("Failed to retrieve git hash")
|
||||
ls = r.split(' ')
|
||||
if len(ls) != 2:
|
||||
raise MKException("Unexpected git output " + r)
|
||||
return ls[0]
|
||||
|
||||
|
||||
|
||||
# Create a build directory using mk_make.py
|
||||
def mk_build_dir(arch):
|
||||
build_path = get_build_dir(arch)
|
||||
if not check_build_dir(build_path) or FORCE_MK:
|
||||
mk_dir(build_path)
|
||||
vsarch = arch
|
||||
if arch == "arm64":
|
||||
vsarch = "amd64_arm64"
|
||||
|
||||
cmds = []
|
||||
cmds.append(f"cd {build_path}")
|
||||
cmds.append('call "%VCINSTALLDIR%Auxiliary\\build\\vcvarsall.bat" ' + vsarch)
|
||||
cmd = []
|
||||
cmd.append("cmake -S .")
|
||||
if DOTNET_CORE_ENABLED:
|
||||
cmd.append(' -DZ3_BUILD_DOTNET_BINDINGS=ON')
|
||||
# cmd.append(' -DZ3_INSTALL_DOTNET_BINDINGS=ON')
|
||||
if JAVA_ENABLED:
|
||||
cmd.append(' -DZ3_BUILD_JAVA_BINDINGS=ON')
|
||||
cmd.append(' -DZ3_INSTALL_JAVA_BINDINGS=ON')
|
||||
cmd.append(' -DZ3_JAVA_JAR_INSTALLDIR=java')
|
||||
cmd.append(' -DZ3_JAVA_JNI_LIB_INSTALLDIR=bin/java')
|
||||
if PYTHON_ENABLED:
|
||||
cmd.append(' -DZ3_BUILD_PYTHON_BINDINGS=ON')
|
||||
cmd.append(' -DZ3_INSTALL_PYTHON_BINDINGS=ON')
|
||||
cmd.append(' -DCMAKE_INSTALL_PYTHON_PKG_DIR=bin/python')
|
||||
|
||||
if GIT_HASH:
|
||||
git_hash = get_git_hash()
|
||||
cmd.append(' -DGIT_HASH=' + git_hash)
|
||||
cmd.append(' -DZ3_USE_LIB_GMP=OFF')
|
||||
cmd.append(' -DZ3_BUILD_LIBZ3_SHARED=ON')
|
||||
cmd.append(' -DCMAKE_BUILD_TYPE=RelWithDebInfo')
|
||||
cmd.append(' -DCMAKE_INSTALL_PREFIX=' + os.path.join(DIST_DIR, get_z3_name(arch)))
|
||||
cmd.append(' -G "Ninja"')
|
||||
cmd.append(' ../..\n')
|
||||
cmds.append("".join(cmd))
|
||||
print("CMAKE commands:", cmds)
|
||||
sys.stdout.flush()
|
||||
if exec_cmds(cmds) != 0:
|
||||
raise MKException("failed to run commands")
|
||||
|
||||
|
||||
|
||||
# Check if on Visual Studio command prompt
|
||||
def check_vc_cmd_prompt():
|
||||
try:
|
||||
DEVNULL = open(os.devnull, 'wb')
|
||||
subprocess.call(['cl'], stdout=DEVNULL, stderr=DEVNULL)
|
||||
except:
|
||||
raise MKException("You must execute the mk_win_dist.py script on a Visual Studio Command Prompt")
|
||||
|
||||
def exec_cmds(cmds):
|
||||
cmd_file = 'z3_tmp.cmd'
|
||||
f = open(cmd_file, 'w')
|
||||
for cmd in cmds:
|
||||
f.write(cmd)
|
||||
f.write('\n')
|
||||
f.close()
|
||||
res = 0
|
||||
try:
|
||||
res = subprocess.call(cmd_file, shell=True)
|
||||
except:
|
||||
res = 1
|
||||
try:
|
||||
os.erase(cmd_file)
|
||||
except:
|
||||
pass
|
||||
return res
|
||||
|
||||
|
||||
|
||||
def build_z3(arch):
|
||||
if is_verbose():
|
||||
print("build z3")
|
||||
build_dir = get_build_dir(arch)
|
||||
if arch == "arm64":
|
||||
arch = "amd64_arm64"
|
||||
cmds = []
|
||||
cmds.append('call "%VCINSTALLDIR%Auxiliary\\build\\vcvarsall.bat" ' + arch)
|
||||
cmds.append('cd %s' % build_dir)
|
||||
cmds.append('ninja install')
|
||||
if exec_cmds(cmds) != 0:
|
||||
raise MKException("Failed to make z3")
|
||||
|
||||
|
||||
|
||||
def mk_zip(arch):
|
||||
if not ZIP_BUILD_OUTPUTS:
|
||||
return
|
||||
build_dist = get_build_dist_path(arch)
|
||||
dist_name = get_z3_name(arch)
|
||||
dist_path = get_dist_path(arch)
|
||||
build_dir = get_build_dir(arch)
|
||||
old = os.getcwd()
|
||||
try:
|
||||
if is_verbose():
|
||||
print("dist path", dist_path)
|
||||
mk_dir(dist_path)
|
||||
zfname = os.path.join(dist_path, '%s.zip' % dist_name)
|
||||
zipout = zipfile.ZipFile(zfname, 'w', zipfile.ZIP_DEFLATED)
|
||||
os.chdir(get_build_dist(arch))
|
||||
for root, dirs, files in os.walk("."):
|
||||
for f in files:
|
||||
if is_verbose():
|
||||
print("adding ", os.path.join(root, f))
|
||||
zipout.write(os.path.join(root, f))
|
||||
if is_verbose():
|
||||
print("Generated '%s'" % zfname)
|
||||
except:
|
||||
pass
|
||||
os.chdir(old)
|
||||
|
||||
|
||||
|
||||
VS_RUNTIME_PATS = [re.compile(r'vcomp.*\.dll'),
|
||||
re.compile(r'msvcp.*\.dll'),
|
||||
re.compile(r'msvcr.*\.dll'),
|
||||
re.compile(r'vcrun.*\.dll')]
|
||||
|
||||
# Copy Visual Studio Runtime libraries
|
||||
def cp_vs_runtime(arch):
|
||||
platform = arch
|
||||
vcdir = os.environ['VCINSTALLDIR']
|
||||
path = '%sredist' % vcdir
|
||||
vs_runtime_files = []
|
||||
print("Walking %s" % path)
|
||||
# Everything changes with every release of VS
|
||||
# Prior versions of VS had DLLs under "redist\x64"
|
||||
# There are now several variants of redistributables
|
||||
# The naming convention defies my understanding so
|
||||
# we use a "check_root" filter to find some hopefully suitable
|
||||
# redistributable.
|
||||
def check_root(root):
|
||||
return platform in root and ("CRT" in root or "MP" in root) and "onecore" not in root and "debug" not in root
|
||||
for root, dirs, files in os.walk(path):
|
||||
for filename in files:
|
||||
if fnmatch(filename, '*.dll') and check_root(root):
|
||||
print("Checking %s %s" % (root, filename))
|
||||
for pat in VS_RUNTIME_PATS:
|
||||
if pat.match(filename):
|
||||
fname = os.path.join(root, filename)
|
||||
if not os.path.isdir(fname):
|
||||
vs_runtime_files.append(fname)
|
||||
if not vs_runtime_files:
|
||||
raise MKException("Did not find any runtime files to include")
|
||||
bin_dist_path = get_bin_dist_path(arch)
|
||||
for f in vs_runtime_files:
|
||||
shutil.copy(f, bin_dist_path)
|
||||
if is_verbose():
|
||||
print("Copied '%s' to '%s'" % (f, bin_dist_path))
|
||||
|
||||
def cp_license(arch):
|
||||
if is_verbose():
|
||||
print("copy licence")
|
||||
path = get_build_dist_path(arch)
|
||||
mk_dir(path)
|
||||
shutil.copy("LICENSE.txt", path)
|
||||
|
||||
def cp_dotnet(arch):
|
||||
if not DOTNET_CORE_ENABLED:
|
||||
return
|
||||
if is_verbose():
|
||||
print("copy dotnet")
|
||||
build_dir = get_build_dir(arch)
|
||||
dist_dir = get_bin_dist_path(arch)
|
||||
shutil.copytree(os.path.join(build_dir, "Microsoft.Z3"),
|
||||
dist_dir,
|
||||
dirs_exist_ok=True)
|
||||
|
||||
def cp_into_bin(arch):
|
||||
if is_verbose():
|
||||
print("copy lib")
|
||||
lib_dir = get_lib_dist_path(arch)
|
||||
bin_dir = get_bin_dist_path(arch)
|
||||
shutil.copyfile(os.path.join(lib_dir, "libz3.lib"),
|
||||
os.path.join(bin_dir, "libz3.lib"))
|
||||
shutil.rmtree(lib_dir)
|
||||
if JAVA_ENABLED:
|
||||
java_dir = get_java_dist_path(arch)
|
||||
shutil.copytree(java_dir,
|
||||
bin_dir,
|
||||
dirs_exist_ok=True)
|
||||
shutil.rmtree(java_dir)
|
||||
|
||||
def cp_pdb(arch):
|
||||
if is_verbose():
|
||||
print("copy pdb")
|
||||
build_dir = get_build_dir(arch)
|
||||
bin_path = get_bin_dist_path(arch)
|
||||
mk_dir(bin_path)
|
||||
for f in os.listdir(build_dir):
|
||||
if f.endswith("libz3.pdb"):
|
||||
shutil.copy(os.path.join(build_dir, f), bin_path)
|
||||
|
||||
def build_for_arch(arch):
|
||||
mk_build_dir(arch)
|
||||
build_z3(arch)
|
||||
cp_license(arch)
|
||||
cp_pdb(arch)
|
||||
cp_dotnet(arch)
|
||||
cp_vs_runtime(arch)
|
||||
cp_into_bin(arch)
|
||||
mk_zip(arch)
|
||||
|
||||
# Entry point
|
||||
def main():
|
||||
if os.name != 'nt':
|
||||
raise MKException("This script is for Windows only")
|
||||
|
||||
parse_options()
|
||||
check_vc_cmd_prompt()
|
||||
|
||||
if X86ONLY:
|
||||
build_for_arch("x86")
|
||||
elif X64ONLY:
|
||||
build_for_arch("x64")
|
||||
elif ARM64ONLY:
|
||||
build_for_arch("arm64")
|
||||
else:
|
||||
for arch in ARCHITECTURES:
|
||||
build_for_arch(arch)
|
||||
|
||||
main()
|
||||
|
|
@ -1,28 +1,44 @@
|
|||
variables:
|
||||
Major: '4'
|
||||
Minor: '12'
|
||||
Patch: '5'
|
||||
Patch: '6'
|
||||
ReleaseVersion: $(Major).$(Minor).$(Patch)
|
||||
AssemblyVersion: $(Major).$(Minor).$(Patch).$(Build.BuildId)
|
||||
NightlyVersion: $(AssemblyVersion)-$(Build.DefinitionName)
|
||||
NightlyVersion: $(AssemblyVersion)-$(Build.buildId)
|
||||
|
||||
stages:
|
||||
- stage: Build
|
||||
jobs:
|
||||
- job: Mac
|
||||
displayName: "Mac Build"
|
||||
- job: MacBuild
|
||||
displayName: "macOS Build"
|
||||
pool:
|
||||
vmImage: "macOS-11"
|
||||
steps:
|
||||
- script: python scripts/mk_unix_dist.py --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: python z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/.
|
||||
- task: PublishPipelineArtifact@1
|
||||
- task: PythonScript@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
artifactName: 'Mac'
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts/mk_unix_dist.py
|
||||
arguments: --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
displayName: 'Clone z3test'
|
||||
- task: PythonScript@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: z3test/scripts/test_benchmarks.py
|
||||
arguments: build-dist/z3 z3test/regressions/smt2
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'macOSBuild'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: MacArm64
|
||||
- job: MacBuildArm64
|
||||
displayName: "Mac ARM64 Build"
|
||||
pool:
|
||||
vmImage: "macOS-11"
|
||||
|
@ -35,32 +51,62 @@ stages:
|
|||
artifactName: 'MacArm64'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: Ubuntu20
|
||||
displayName: "Ubuntu20 build"
|
||||
pool:
|
||||
vmImage: "ubuntu-20.04"
|
||||
steps:
|
||||
- script: python scripts/mk_unix_dist.py --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: python z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/.
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Ubuntu-20.04'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: Ubuntu
|
||||
- job: UbuntuBuild
|
||||
displayName: "Ubuntu build"
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
steps:
|
||||
- script: python scripts/mk_unix_dist.py --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- task: PythonScript@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts/mk_unix_dist.py
|
||||
arguments: --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: python z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/.
|
||||
displayName: 'Clone z3test'
|
||||
- task: PythonScript@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: z3test/scripts/test_benchmarks.py
|
||||
arguments: build-dist/z3 z3test/regressions/smt2
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Ubuntu'
|
||||
artifactName: 'UbuntuBuild'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: UbuntuBuild20
|
||||
displayName: "Ubuntu build 20"
|
||||
pool:
|
||||
vmImage: "ubuntu-20.04"
|
||||
steps:
|
||||
- task: PythonScript@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts/mk_unix_dist.py
|
||||
arguments: --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
displayName: 'Clone z3test'
|
||||
- task: PythonScript@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: z3test/scripts/test_benchmarks.py
|
||||
arguments: build-dist/z3 z3test/regressions/smt2
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'UbuntuBuild20'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: UbuntuArm64
|
||||
|
@ -68,12 +114,9 @@ stages:
|
|||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
steps:
|
||||
- script: sudo apt update
|
||||
- script: sudo apt install gcc-arm-none-eabi -y
|
||||
- script: sudo apt install gcc-arm-linux-gnueabihf -y
|
||||
- script: sudo apt install gcc-aarch64-linux-gnu -y
|
||||
- script: sudo apt install g++-aarch64-linux-gnu -y
|
||||
- script: CXX=aarch64-linux-gnu-g++ CC=aarch64-linux-gnu-gcc python scripts/mk_unix_dist.py --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk --arch=arm64
|
||||
- script: python scripts/mk_unix_dist.py --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk --arch=arm64
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: python z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/.
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
|
@ -115,165 +158,57 @@ stages:
|
|||
inputs:
|
||||
artifactName: 'UbuntuDoc'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: ManyLinuxBuild
|
||||
variables:
|
||||
python: "/opt/python/cp37-cp37m/bin/python"
|
||||
name: ManyLinux
|
||||
|
||||
- job: LinuxBuilds
|
||||
displayName: "ManyLinux build"
|
||||
variables:
|
||||
name: ManyLinux
|
||||
python: "/opt/python/cp37-cp37m/bin/python"
|
||||
pool:
|
||||
vmImage: "ubuntu-latest"
|
||||
container: "quay.io/pypa/manylinux2014_x86_64:latest"
|
||||
steps:
|
||||
- script: $(python) scripts/mk_unix_dist.py --nodotnet --nojava
|
||||
- task: PythonScript@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts/mk_unix_dist.py
|
||||
arguments: --nodotnet --nojava
|
||||
pythonInterpreter: $(python)
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: $(python) z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/
|
||||
displayName: 'Clone z3test'
|
||||
- task: PythonScript@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: z3test/scripts/test_benchmarks.py
|
||||
arguments: build-dist/z3 z3test/regressions/smt2
|
||||
pythonInterpreter: $(python)
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: '$(name)Build'
|
||||
artifactName: 'ManyLinuxBuild'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- template: build-win-signed.yml
|
||||
parameters:
|
||||
ReleaseVersion: $(ReleaseVersion)
|
||||
BuildArchitecture: 'x64'
|
||||
|
||||
# - job: MuslLinuxBuild
|
||||
# condition: eq(0,1)
|
||||
# variables:
|
||||
# python: "/opt/python/cp310-cp310/bin/python"
|
||||
# name: MuslLinux
|
||||
# displayName: "MuslLinux build"
|
||||
# pool:
|
||||
# vmImage: "ubuntu-latest"
|
||||
# container: "quay.io/pypa/musllinux_1_1_x86_64:latest"
|
||||
# steps:
|
||||
# - script: $(python) scripts/mk_unix_dist.py --nodotnet --nojava
|
||||
# - script: git clone https://github.com/z3prover/z3test z3test
|
||||
# - script: $(python) z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
# - script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/
|
||||
# - task: PublishPipelineArtifact@0
|
||||
# inputs:
|
||||
# artifactName: '$(name)Build'
|
||||
# targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: Windows32
|
||||
displayName: "Windows 32-bit build"
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
steps:
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script:
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86 &
|
||||
python scripts\mk_win_dist.py
|
||||
--assembly-version=$(AssemblyVersion)
|
||||
--x86-only
|
||||
--dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
--zip
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: 'Windows32'
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Collect Symbols'
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '**/*.pdb'
|
||||
targetFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
# Publish symbol archive to match nuget package
|
||||
# Index your source code and publish symbols to a file share or Azure Artifacts symbol server
|
||||
- task: PublishSymbols@2
|
||||
inputs:
|
||||
symbolsFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
searchPattern: '**/*.pdb'
|
||||
indexSources: false # Github not supported
|
||||
publishSymbols: true
|
||||
symbolServerType: TeamServices
|
||||
detailedLog: true
|
||||
|
||||
- job: Windows64
|
||||
displayName: "Windows 64-bit build"
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
steps:
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script:
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 &
|
||||
python scripts\mk_win_dist.py
|
||||
--assembly-version=$(AssemblyVersion)
|
||||
--x64-only
|
||||
--dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
--zip
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: 'Windows64'
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Collect Symbols'
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '**/*.pdb'
|
||||
targetFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
# Publish symbol archive to match nuget package
|
||||
# Index your source code and publish symbols to a file share or Azure Artifacts symbol server
|
||||
- task: PublishSymbols@2
|
||||
inputs:
|
||||
symbolsFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
searchPattern: '**/*.pdb'
|
||||
indexSources: false # Github not supported
|
||||
publishSymbols: true
|
||||
symbolServerType: TeamServices
|
||||
detailedLog: true
|
||||
|
||||
- job: "WindowsArm64"
|
||||
displayName: "WindowsArm64"
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
variables:
|
||||
arch: "amd64_arm64"
|
||||
bindings: "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||
steps:
|
||||
- script: md build
|
||||
- script: |
|
||||
cd build
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" $(arch)
|
||||
cmake $(bindings) -G "NMake Makefiles" ../
|
||||
nmake
|
||||
cd ..
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: build
|
||||
contents: '*z3*.*'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: 'WindowsArm64'
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Collect Symbols'
|
||||
inputs:
|
||||
sourceFolder: build
|
||||
contents: '**/*.pdb'
|
||||
targetFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
# Publish symbol archive to match nuget package
|
||||
# Index your source code and publish symbols to a file share or Azure Artifacts symbol server
|
||||
- task: PublishSymbols@2
|
||||
inputs:
|
||||
symbolsFolder: '$(Build.ArtifactStagingDirectory)/symbols'
|
||||
searchPattern: '**/*.pdb'
|
||||
indexSources: false # Github not supported
|
||||
publishSymbols: true
|
||||
symbolServerType: TeamServices
|
||||
detailedLog: true
|
||||
- template: build-win-signed.yml
|
||||
parameters:
|
||||
ReleaseVersion: $(ReleaseVersion)
|
||||
BuildArchitecture: 'x86'
|
||||
|
||||
- template: build-win-signed-cmake.yml
|
||||
parameters:
|
||||
ReleaseVersion: $(ReleaseVersion)
|
||||
BuildArchitecture: 'arm64'
|
||||
VCArchitecture: 'amd64_arm64'
|
||||
|
||||
- stage: Package
|
||||
jobs:
|
||||
|
@ -291,27 +226,22 @@ stages:
|
|||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win64 Build'
|
||||
inputs:
|
||||
artifact: 'Windows64'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Ubuntu Build'
|
||||
inputs:
|
||||
artifact: 'Ubuntu'
|
||||
artifact: 'WindowsBuild-x64'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Ubuntu 20.04 Build'
|
||||
inputs:
|
||||
artifact: 'Ubuntu-20.04'
|
||||
artifact: 'UbuntuBuild20'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Ubuntu ARM64 Build'
|
||||
inputs:
|
||||
artifact: 'UbuntuArm64'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download macOS Build'
|
||||
inputs:
|
||||
artifact: 'Mac'
|
||||
artifact: 'macOsBuild'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download macOS Arm64 Build'
|
||||
|
@ -420,7 +350,7 @@ stages:
|
|||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win32 Build'
|
||||
inputs:
|
||||
artifact: 'Windows32'
|
||||
artifact: 'WindowsBuild-x86'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: NuGetToolInstaller@0
|
||||
inputs:
|
||||
|
@ -519,24 +449,19 @@ stages:
|
|||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifactName: 'Windows32'
|
||||
artifactName: 'WindowsBuild-x86'
|
||||
targetPath: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifactName: 'Windows64'
|
||||
artifactName: 'WindowsBuild-x64'
|
||||
targetPath: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifactName: 'ManyLinuxBuild'
|
||||
targetPath: $(Agent.TempDirectory)
|
||||
# - task: DownloadPipelineArtifact@2
|
||||
# displayName: 'Download MuslLinux Build'
|
||||
# inputs:
|
||||
# artifact: 'MuslLinuxBuild'
|
||||
# path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifactName: 'Mac'
|
||||
artifactName: 'macOsBuild'
|
||||
targetPath: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
|
@ -574,22 +499,22 @@ stages:
|
|||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download windows32"
|
||||
inputs:
|
||||
artifactName: 'Windows32'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download windowsArm64"
|
||||
inputs:
|
||||
artifactName: 'WindowsArm64'
|
||||
artifactName: 'WindowsBuild-x86'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download windows64"
|
||||
inputs:
|
||||
artifactName: 'Windows64'
|
||||
artifactName: 'WindowsBuild-x64'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download windowsARM64"
|
||||
inputs:
|
||||
artifactName: 'WindowsBuild-arm64'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download Mac"
|
||||
inputs:
|
||||
artifactName: 'Mac'
|
||||
artifactName: 'macOsBuild'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download MacArm64"
|
||||
|
@ -601,15 +526,10 @@ stages:
|
|||
inputs:
|
||||
artifactName: 'UbuntuArm64'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download Ubuntu"
|
||||
inputs:
|
||||
artifactName: 'Ubuntu'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download Ubuntu-20.04"
|
||||
inputs:
|
||||
artifactName: 'Ubuntu-20.04'
|
||||
artifactName: 'UbuntuBuild20'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download Doc"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
trigger: none
|
||||
|
||||
variables:
|
||||
ReleaseVersion: '4.12.5'
|
||||
ReleaseVersion: '4.12.6'
|
||||
|
||||
stages:
|
||||
|
||||
|
@ -209,6 +209,12 @@ stages:
|
|||
ReleaseVersion: $(ReleaseVersion)
|
||||
BuildArchitecture: 'x86'
|
||||
|
||||
- template: build-win-signed-cmake.yml
|
||||
parameters:
|
||||
ReleaseVersion: $(ReleaseVersion)
|
||||
BuildArchitecture: 'arm64'
|
||||
VCArchitecture: 'amd64_arm64'
|
||||
|
||||
|
||||
# Creates Z3 packages in various formats
|
||||
- stage: Package
|
||||
|
@ -525,16 +531,21 @@ stages:
|
|||
inputs:
|
||||
artifact: 'WindowsBuild-x86'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download Python"
|
||||
inputs:
|
||||
artifactName: 'PythonPackage'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win64 Build'
|
||||
inputs:
|
||||
artifact: 'WindowsBuild-x64'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Arm64 Build'
|
||||
inputs:
|
||||
artifact: 'WindowsBuild-arm64'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: "Download Python"
|
||||
inputs:
|
||||
artifactName: 'PythonPackage'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download NuGet64 Package'
|
||||
inputs:
|
||||
|
|
|
@ -641,8 +641,8 @@ def mk_java(java_src, java_dir, package_name):
|
|||
public static native void propagateRegisterEq(Object o, long ctx, long solver);
|
||||
public static native void propagateRegisterDecide(Object o, long ctx, long solver);
|
||||
public static native void propagateRegisterFinal(Object o, long ctx, long solver);
|
||||
public static native void propagateConflict(Object o, long ctx, long solver, long javainfo, int num_fixed, long[] fixed, long num_eqs, long[] eq_lhs, long[] eq_rhs, long conseq);
|
||||
public static native void propagateAdd(Object o, long ctx, long solver, long javainfo, long e);
|
||||
public static native boolean propagateConsequence(Object o, long ctx, long solver, long javainfo, int num_fixed, long[] fixed, long num_eqs, long[] eq_lhs, long[] eq_rhs, long conseq);
|
||||
public static native boolean propagateNextSplit(Object o, long ctx, long solver, long javainfo, long e, long idx, int phase);
|
||||
public static native void propagateDestroy(Object o, long ctx, long solver, long javainfo);
|
||||
|
||||
|
@ -698,6 +698,8 @@ def mk_java(java_src, java_dir, package_name):
|
|||
protected abstract void createdWrapper(long le);
|
||||
|
||||
protected abstract void fixedWrapper(long lvar, long lvalue);
|
||||
|
||||
protected abstract void decideWrapper(long lvar, int bit, boolean is_pos);
|
||||
}
|
||||
""")
|
||||
java_native.write('\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue