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

Migrate from deprecated distutils.sysconfig in scripts #5729

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

XVilka
Copy link
Contributor

@XVilka XVilka commented Dec 22, 2021

Python module distutils.sysconfig was deprecated via PEP-632 since Python 3.10 and will be removed in 3.12. The recommended alternative to use the sysconfig module. Instead of get_python_lib() the recommended alternative is get_path('purelib').

Tested with Python 3.10 on Fedora 35 x86_64

@XVilka
Copy link
Contributor Author

XVilka commented Dec 22, 2021

Only MacOS with OCaml bindings build fails, not sure why - I don't have a MacOS system:

Starting: CmdLine
==============================================================================
Task         : Command line
Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version      : 2.182.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
==============================================================================
Generating script.
========================== Starting Command Output ===========================
/bin/bash --noprofile --norc /Users/runner/work/_temp/9dd6c435-b27a-4dc7-b380-b8e712bc8c9a.sh
ocamlfind ocamlopt -package zarith  -linkall -shared -o api/ml/z3ml.cmxs -I . -I api/ml api/ml/z3ml.cmxa
install_name_tool -id $(ocamlfind printconf path)/stublibs/libz3.dylib libz3.dylib
install_name_tool -change libz3.dylib $(ocamlfind printconf path)/stublibs/libz3.dylib api/ml/dllz3ml.so
Z3 was successfully built.
Z3Py scripts can already be executed in the 'build/python' directory.
Z3Py scripts stored in arbitrary directories can be executed if the 'build/python' directory is added to the PYTHONPATH environment variable and the 'build' directory is added to the DYLD_LIBRARY_PATH environment variable.
Use the following command to install Z3 at prefix /Library/Frameworks/Python.framework/Versions/2.7.
    sudo make install
ocamlfind ocamlc -o  ml_example_shared.byte -thread -package z3 -linkpkg  ../examples/ml/ml_example.ml
ocamlfind ocamlc -custom -o  ml_example_shared_custom.byte -thread -package z3 -linkpkg  ../examples/ml/ml_example.ml
ocamlfind ocamlopt -o  ml_example_shared -thread -package z3 -linkpkg  ../examples/ml/ml_example.ml
File "../examples/ml/ml_example.ml", line 1:
Error: The file ../examples/ml/ml_example.cmo is not a bytecode object file
make: *** [ml_example_shared_custom.byte] Error 2
make: *** Waiting for unfinished jobs....
ld: warning: directory not found for option '-L/opt/local/lib'
##[error]Bash exited with code '2'.
Finishing: CmdLine

But the error looks exactly like the one on master branch: https://dev.azure.com/Z3Public/Z3/_build/results?buildId=2799&view=logs&j=60487b59-e8f4-5a1c-7805-8cc27f5a1dc1&t=88468735-7057-5663-2ef3-5b1d70f9f872

@NikolajBjorner
Copy link
Contributor

build failure is orthogonal to your change.

@NikolajBjorner NikolajBjorner merged commit f11fcec into Z3Prover:master Dec 22, 2021
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.

2 participants