Skip to content

Rethink Builds #505

@toolCHAINZ

Description

@toolCHAINZ

Some recent discussion #498 has made me start thinking again about how this library is built. The current system (http fetch of the z3 ref and subsequent download) works but is brittle and requires lots of extra build dependencies.

I'm thinking we should instead use something like the following setup:

We add an new crate, z3-src (I've already squatted the name, just in case), inspired by openssl-src, which contains the z3 source tree and the logic needed to build it. z3-sys will then hold the low-level bindings and bindgen glue. It will build as it does now, dynamically linking against the system z3, against a github-sourced binary with gh-release, or against the library produced by z3-src through a new vendored feature flag.

This lets us:

  • remove the z3 submodule
  • remove all "fetch sources from github" logic currently in bundled
  • easily allow users to target different z3 versions by targeting different versions of z3-src
  • separate the currently-entangled concerns of building z3 (now handled by z3-src), running bindgen, and setting up linker paths.

As a separate discussion, per #498, we may want to track z3 versions more closely; in such a case maybe it make sense to track the current dynamic bindgen stuff in version control? Doing so would remove more annoying build dependencies for users.

Any thoughts @Pat-Lafon @lmondada ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions