3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-26 17:02:38 +00:00

Fix NameError: EXECUTABLE_FILE_FALLBACKS undefined on win32/darwin in setup.py (#10219)

`EXECUTABLE_FILE_FALLBACKS` was referenced on all platforms in
`_copy_bins()` but only defined in the `emscripten` and `else` (Linux)
branches — causing a `NameError` crash on Windows and macOS wheel
builds.

## Change

Add `EXECUTABLE_FILE_FALLBACKS = []` to the missing platform branches in
`src/api/python/setup.py`:

```python
if BUILD_PLATFORM in ('sequoia','darwin', 'osx'):
    LIBRARY_FILE = "libz3.dylib"
    EXECUTABLE_FILE = "z3"
    EXECUTABLE_FILE_FALLBACKS = []          # added
elif BUILD_PLATFORM in ('win32', 'cygwin', 'win'):
    LIBRARY_FILE = "libz3.dll"
    EXECUTABLE_FILE = "z3.exe"
    EXECUTABLE_FILE_FALLBACKS = []          # added
elif BUILD_PLATFORM in ('emscripten',):
    ...
    EXECUTABLE_FILE_FALLBACKS = ["z3.js.wasm", "z3"]
else:
    ...
    EXECUTABLE_FILE_FALLBACKS = []
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Nikolaj Bjorner <nikolaj@cs.stanford.edu>
This commit is contained in:
Copilot 2026-07-24 10:44:39 -07:00 committed by GitHub
parent 74b616c2f3
commit c15ef957eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,9 +83,10 @@ BINS_DIR = os.path.join(ROOT_DIR, 'bin')
# determine platform-specific filenames
EXECUTABLE_FILE_FALLBACKS = []
if BUILD_PLATFORM in ('sequoia','darwin', 'osx'):
LIBRARY_FILE = "libz3.dylib"
EXECUTABLE_FILE = "z3"
EXECUTABLE_FILE = "z3"
elif BUILD_PLATFORM in ('win32', 'cygwin', 'win'):
LIBRARY_FILE = "libz3.dll"
EXECUTABLE_FILE = "z3.exe"
@ -98,7 +99,6 @@ elif BUILD_PLATFORM in ('emscripten',):
else:
LIBRARY_FILE = "libz3.so"
EXECUTABLE_FILE = "z3"
EXECUTABLE_FILE_FALLBACKS = []
# check if cmake is available, and pull it in via PyPI if necessary
SETUP_REQUIRES = []