Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename static-link-z3 to bundled. #260

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

waywardmonkeys
Copy link
Contributor

This renames the static-link-z3 build feature to bundled but leaves a bit around for now to maintain compatibility.

It also improves the README's discussion a little bit to mention vcpkg.

This renames the `static-link-z3` build feature to `bundled` but
leaves a bit around for now to maintain compatibility.

It also improves the README's discussion a little bit to mention
`vcpkg`.
@waywardmonkeys
Copy link
Contributor Author

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).

@TheVeryDarkness
Copy link
Contributor

How about uploading the z3 built by vcpkg? It's statically linked. Then we can download it.

@waywardmonkeys
Copy link
Contributor Author

@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
Copy link
Contributor

@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.

@waywardmonkeys
Copy link
Contributor Author

Ah, just the libz3.a ... not the z3-sys or z3 crate outputs ...

@TheVeryDarkness
Copy link
Contributor

Ah, just the libz3.a ... not the z3-sys or z3 crate outputs ...

Yep. Sorry, I didn't make it clear.

@TheVeryDarkness
Copy link
Contributor

Anyway, we can provide a lot of options.

@Pat-Lafon
Copy link
Contributor

Is it possible to add a compile-time warning from build.rs if it is built with the static-link-z3 flag?

@TheVeryDarkness
Copy link
Contributor

@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.

@TheVeryDarkness
Copy link
Contributor

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!?

@waywardmonkeys
Copy link
Contributor Author

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

@waywardmonkeys waywardmonkeys merged commit efdc6ec into master Oct 27, 2023
11 checks passed
@waywardmonkeys waywardmonkeys deleted the rename-bundled-build-feature branch October 27, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants