Open yasuo-ozu opened 1 year ago
Not sure if this would be interesting to you or not, but have you considered also supporting vcpkg
(especially for Windows)?
Most Linux distributions and macOS homebrew offer precompiled z3 libraries so there is no need to fallback to building manually.
@waywardmonkeys I'm sorry that I don't know about vcpkg
. What do you mean by "supporting vcpkg"?
In my understanding, the precompiled z3 requires msvc's C++ runtime such as msvcp140.dll
, msvcp140_1.dll
, msvcp140_2.dll
, ...
This PR assumes the precondition that C++ runtime is already installed on the Windows system. I think the following lines in .github/workflows/rust.yml
is enough for now.
choco install vcredist2017
echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
@wtdcode
no need to fallback to building manually
I don't think so. Considering Rust projects which depends on z3-sys
with static-link-z3
flag, users who we cannot offer precompiled binary for, should have to do followings:
static-link-z3
flag manually with overriding z3-sys
dependenciy in Cargo.toml
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html
This is not smart way, so I think the fallback is better.
@wtdcode
no need to fallback to building manually
I don't think so. Considering Rust projects which depends on
z3-sys
withstatic-link-z3
flag, users who we cannot offer precompiled binary for, should have to do followings:
- Install z3 package with their package manager (sometimes difficult as if they are not super user)
- Disable
static-link-z3
flag manually with overridingz3-sys
dependenciy inCargo.toml
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html
This is not smart way, so I think the fallback is better.
Oh I misunderstood your statements and didn’t check the code. You are correct on this.
But further I suggest using pkg-config like my PR to avoid so many hardcoded paths.
I suggest using pkg-config like my PR to avoid so many hardcoded paths
I agree. (It can be implemented with new PR.)
@waywardmonkeys any updates?
I am hoping to get back to this this week. Support for vcpkg
has landed which helps on Windows. I would like to do some other cleanups to the build and then look at this.
Replace #193 Includes #207
This PR adds feature flag
static-link-z3
andforce-build-z3
to change building behavior ofz3-sys
.static-link-z3
force-build-z3
force-build-z3
Precompiled binary support
For environments with no precompiled binary support, automatically fallback to
force-build-z3
linux-x86_64
macOS-x86_64
macOS-aarch64
-- no ci testwindows-x86_64-msvc
windows-x86-msvc
-- no ci testBuild time