Closed waywardmonkeys closed 10 months ago
FYI @TheVeryDarkness @hermanventer @Pat-Lafon @yasuo-ozu @wtdcode
This lays the ground for starting to use pkg-config
to find the system-provided build (#248) and downloading pre-built Z3 binaries (#249).
How about uploading the z3 built by vcpkg? It's statically linked. Then we can download it.
@TheVeryDarkness The Rust binary ABI isn't stable, so it would be specific to a particular version or set of versions of Rust. But getting #249 in place with downloading the Z3 binary might be good for what you want?
@TheVeryDarkness The Rust binary ABI isn't stable, so it would be specific to a particular version or set of versions of Rust. But getting #249 in place with downloading the Z3 binary might be good for what you want?
A question I've met with the binary downloaded from z3 release is that it seems to be dynamically linked. In rust, it's not recommended, and in my test cases, doctests might fail, as dynamic library may not be found, And distributing our program with a .dylib or a .dll may be a little annoying.
As far as I know, vcpkg is building z3 as a cpp project, therefore it's following cpp ABI. Maybe let me have a try. I'm already testing uploading and downloading our built z3.
Thanks for your answer.
Ah, just the libz3.a
... not the z3-sys
or z3
crate outputs ...
Ah, just the
libz3.a
... not thez3-sys
orz3
crate outputs ...
Yep. Sorry, I didn't make it clear.
Anyway, we can provide a lot of options.
Is it possible to add a compile-time warning from build.rs if it is built with the static-link-z3
flag?
@TheVeryDarkness The Rust binary ABI isn't stable, so it would be specific to a particular version or set of versions of Rust. But getting #249 in place with downloading the Z3 binary might be good for what you want?
I think #249 is good enough if users are just using z3 for their own usage. Is there anything preventing it from being in place?
Days ago, I opened an issue in z3 repository, asking whether they can build a statically-linked one, but got a refusal.
Is it possible to add a compile-time warning from build.rs if it is built with the
static-link-z3
flag?
Maybe a println!
or eprintln!
?
Warning added:
$ cargo build --features static-link-z3
Compiling z3-sys v0.8.1 (... z3-sys)
warning: The 'static-link-z3' feature is deprecated. Please use the 'bundled' feature.
Compiling z3 v0.12.1 (... z3)
Finished dev [unoptimized + debuginfo] target(s) in 1m 37s
This renames the
static-link-z3
build feature tobundled
but leaves a bit around for now to maintain compatibility.It also improves the README's discussion a little bit to mention
vcpkg
.