User Story
As a new contributor setting up an x86-64 Windows MSVC build,
I want the build command in CONTRIBUTING.md to work as written,
so that I can get a working openshell CLI without having to read the crate
manifests to figure out which parts of the setup instructions apply to me.
Problem Statement
The Windows MSVC build example in CONTRIBUTING.md fails immediately. The
command is:
$env:LIBCLANG_PATH='C:\Program Files\Microsoft Visual Studio\2022\<Edition>\VC\Tools\Llvm\x64\bin'
cargo build -p openshell-cli --target x86_64-pc-windows-msvc --features bundled-z3
Cargo rejects it before compiling anything:
error: the package 'openshell-cli' does not contain this feature: bundled-z3
help: packages with the missing feature: openshell-prover, openshell-server
crates/openshell-cli/Cargo.toml has no [features] section. bundled-z3 is
declared on openshell-prover and forwarded by openshell-server.
The surrounding section is what makes this more than a typo. It is titled
"Z3 installation", states "For x86-64 Windows MSVC builds, use one of these Z3
paths", and then gives openshell-cli as the worked example. But
openshell-cli has no dependency on Z3 at all. cargo tree -p openshell-cli --target x86_64-pc-windows-msvc -e normal,build returns 803 entries, none of
which are z3, z3-sys, or openshell-prover. Neither Z3 path described in
that section is needed to build the CLI, and neither Z3_LIBRARY_PATH_OVERRIDE
nor LIBCLANG_PATH is required for it either.
The two other bundled-z3 invocations in the repository are consistent with the
manifests: CONTRIBUTING.md uses -p openshell-prover for the non-Windows
bundled-Z3 example, and tasks/ci.toml uses -p openshell-server. The Windows
example is the only one naming a package that does not have the feature.
Impact / Why This Matters
This sits on the first-run path for Windows contributors, where a reader has the
least context to tell a documentation error from their own setup mistake.
The failure mode is misleading in a specific way. The section spends most of its
length on Z3 prerequisites (system package vs. bundled build, two environment
variables, an LLVM path for bindgen), so a contributor whose build command
fails has an obvious and wrong hypothesis waiting for them: that their Z3 or
LLVM setup is incomplete. The natural next step is to install Z3, set
Z3_LIBRARY_PATH_OVERRIDE and Z3_SYS_Z3_HEADER, or hunt for libclang.dll.
None of that changes the error, because the error is raised during feature
resolution, before any of those inputs are consulted. Time spent there is spent
against a dependency the CLI does not have.
Working around it requires reading crates/openshell-cli/Cargo.toml and
crates/openshell-prover/Cargo.toml to discover that the feature belongs to a
different crate, and then inferring that the entire Z3 section is irrelevant to
the CLI. That is a reasonable thing for a contributor to work out eventually,
but it is not discoverable from the error message, and the document gives no
signal that the example is wrong rather than incomplete.
Dropping --features bundled-z3 makes the documented command succeed, so the
cost is bounded, but only once you know that is the fix.
Acceptance Criteria
Reproduction Steps
No Z3, LLVM, or gateway setup is required. The command fails during feature
resolution:
-
Clone the repository on x86-64 Windows with the MSVC toolchain and the
pinned Rust version from rust-toolchain.toml (1.95.0).
-
Run the command exactly as printed in CONTRIBUTING.md:
cargo build -p openshell-cli --target x86_64-pc-windows-msvc --features bundled-z3
-
Observe the failure (exit code 101):
error: the package 'openshell-cli' does not contain this feature: bundled-z3
help: packages with the missing feature: openshell-prover, openshell-server
-
Confirm the CLI does not depend on Z3:
cargo tree -p openshell-cli --target x86_64-pc-windows-msvc -e normal,build
No z3, z3-sys, or openshell-prover entry appears.
-
Drop --features bundled-z3 and observe that the same invocation resolves
and compiles, with no Z3 or LIBCLANG_PATH setup present:
cargo check -p openshell-cli --target x86_64-pc-windows-msvc
Exits 0.
Environment
- OpenShell:
main at c27a3a3c
- OS: Windows 11, x86-64
- Toolchain: Rust 1.95.0 MSVC (pinned by
rust-toolchain.toml)
- Affected file:
CONTRIBUTING.md, "Z3 installation" section
- Not deployment-specific; reproduces on a clean checkout with no gateway,
Docker, or Z3 installed
User Story
As a new contributor setting up an x86-64 Windows MSVC build,
I want the build command in
CONTRIBUTING.mdto work as written,so that I can get a working
openshellCLI without having to read the cratemanifests to figure out which parts of the setup instructions apply to me.
Problem Statement
The Windows MSVC build example in
CONTRIBUTING.mdfails immediately. Thecommand is:
Cargo rejects it before compiling anything:
crates/openshell-cli/Cargo.tomlhas no[features]section.bundled-z3isdeclared on
openshell-proverand forwarded byopenshell-server.The surrounding section is what makes this more than a typo. It is titled
"Z3 installation", states "For x86-64 Windows MSVC builds, use one of these Z3
paths", and then gives
openshell-clias the worked example. Butopenshell-clihas no dependency on Z3 at all.cargo tree -p openshell-cli --target x86_64-pc-windows-msvc -e normal,buildreturns 803 entries, none ofwhich are
z3,z3-sys, oropenshell-prover. Neither Z3 path described inthat section is needed to build the CLI, and neither
Z3_LIBRARY_PATH_OVERRIDEnor
LIBCLANG_PATHis required for it either.The two other
bundled-z3invocations in the repository are consistent with themanifests:
CONTRIBUTING.mduses-p openshell-proverfor the non-Windowsbundled-Z3 example, and
tasks/ci.tomluses-p openshell-server. The Windowsexample is the only one naming a package that does not have the feature.
Impact / Why This Matters
This sits on the first-run path for Windows contributors, where a reader has the
least context to tell a documentation error from their own setup mistake.
The failure mode is misleading in a specific way. The section spends most of its
length on Z3 prerequisites (system package vs. bundled build, two environment
variables, an LLVM path for
bindgen), so a contributor whose build commandfails has an obvious and wrong hypothesis waiting for them: that their Z3 or
LLVM setup is incomplete. The natural next step is to install Z3, set
Z3_LIBRARY_PATH_OVERRIDEandZ3_SYS_Z3_HEADER, or hunt forlibclang.dll.None of that changes the error, because the error is raised during feature
resolution, before any of those inputs are consulted. Time spent there is spent
against a dependency the CLI does not have.
Working around it requires reading
crates/openshell-cli/Cargo.tomlandcrates/openshell-prover/Cargo.tomlto discover that the feature belongs to adifferent crate, and then inferring that the entire Z3 section is irrelevant to
the CLI. That is a reasonable thing for a contributor to work out eventually,
but it is not discoverable from the error message, and the document gives no
signal that the example is wrong rather than incomplete.
Dropping
--features bundled-z3makes the documented command succeed, so thecost is bounded, but only once you know that is the fix.
Acceptance Criteria
cargocommand in the Windows MSVC section ofCONTRIBUTING.mdruns successfully as written on a clean x86-64 Windows MSVC checkout.
contributor building only the CLI can tell that the Z3 prerequisites and
the
LIBCLANG_PATH/Z3_LIBRARY_PATH_OVERRIDE/Z3_SYS_Z3_HEADERvariables do not apply to them.
feature or variable it is demonstrating.
Reproduction Steps
No Z3, LLVM, or gateway setup is required. The command fails during feature
resolution:
Clone the repository on x86-64 Windows with the MSVC toolchain and the
pinned Rust version from
rust-toolchain.toml(1.95.0).Run the command exactly as printed in
CONTRIBUTING.md:Observe the failure (exit code 101):
Confirm the CLI does not depend on Z3:
No
z3,z3-sys, oropenshell-proverentry appears.Drop
--features bundled-z3and observe that the same invocation resolvesand compiles, with no Z3 or
LIBCLANG_PATHsetup present:Exits 0.
Environment
mainatc27a3a3crust-toolchain.toml)CONTRIBUTING.md, "Z3 installation" sectionDocker, or Z3 installed