| 0f1ec070 | 08-Aug-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
python: mkvenv: introduce TOML-like representation of dependencies
We would like to place all Python dependencies in the same file, so that we can add more information without having long and comple
python: mkvenv: introduce TOML-like representation of dependencies
We would like to place all Python dependencies in the same file, so that we can add more information without having long and complex command lines. The plan is to have a TOML file with one entry per package, for example
[avocado] avocado-framework = { accepted = "(>=88.1, <93.0)", installed = "88.1", canary = "avocado" }
Each TOML section will thus be a dictionary of dictionaries. Modify mkvenv.py's workhorse function, _do_ensure, to already operate on such a data structure. The "ensure" subcommand is modified to separate the depspec into a name and a version part, and use the result (plus the --diagnose argument) to build a dictionary for each command line argument.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| c76e7652 | 17-May-2023 |
John Snow <jsnow@redhat.com> |
Revert "python/qmp/protocol: add open_with_socket()"
This reverts commit a3cfea92e2030926e00a2519d299384ea648e36e.
(It's being rolled back in favor of a different API, which brings the in-tree and
Revert "python/qmp/protocol: add open_with_socket()"
This reverts commit a3cfea92e2030926e00a2519d299384ea648e36e.
(It's being rolled back in favor of a different API, which brings the in-tree and out-of-tree versions of qemu.qmp back in sync.)
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20230517163406.2593480-6-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 5bbc5936 | 17-May-2023 |
John Snow <jsnow@redhat.com> |
python/qmp/legacy: remove open_with_socket() calls
Favor using connect() when passing a socket instead of open_with_socket(). Simultaneously, update constructor calls to use the combined address arg
python/qmp/legacy: remove open_with_socket() calls
Favor using connect() when passing a socket instead of open_with_socket(). Simultaneously, update constructor calls to use the combined address argument for QEMUMonitorProtocol().
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20230517163406.2593480-5-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| 7f5f3ae7 | 17-May-2023 |
John Snow <jsnow@redhat.com> |
python/machine: use connect-based interface for existing sockets
Instead of using accept() with sockets (which uses open_with_socket()), use calls to connect() to utilize existing sockets instead. A
python/machine: use connect-based interface for existing sockets
Instead of using accept() with sockets (which uses open_with_socket()), use calls to connect() to utilize existing sockets instead. A benefit of this is more robust error handling already present within the connect() call that isn't present in open_with_socket().
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20230517163406.2593480-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| b8d4ca18 | 17-May-2023 |
John Snow <jsnow@redhat.com> |
python/qmp/legacy: allow using sockets for connect()
Instead of asserting that we have an address, allow the use of sockets instead of addresses during a call to connect().
Signed-off-by: John Snow
python/qmp/legacy: allow using sockets for connect()
Instead of asserting that we have an address, allow the use of sockets instead of addresses during a call to connect().
Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20230517163406.2593480-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
show more ...
|
| d37c21b5 | 19-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
mkvenv: pass first missing package to diagnose()
If sphinx is present but the theme is not, mkvenv will print an inaccurate diagnostic:
ERROR: Could not find a version that satisfies the requiremen
mkvenv: pass first missing package to diagnose()
If sphinx is present but the theme is not, mkvenv will print an inaccurate diagnostic:
ERROR: Could not find a version that satisfies the requirement sphinx-rtd-theme>=0.5.0 (from versions: none) ERROR: No matching distribution found for sphinx-rtd-theme>=0.5.0
'sphinx>=1.6.0' not found: • Python package 'sphinx' version '5.3.0' was found, but isn't suitable. • mkvenv was configured to operate offline and did not check PyPI.
Instead, ignore the packages that were found to be present, and report an error based on the first absent package.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 3b087f79 | 23-Dec-2021 |
Paolo Bonzini <pbonzini@redhat.com> |
meson: require 0.63.0
This version allows cleanups in modinfo collection, but they only work with Ninja 1.9.x and 1.8.x is still supported. It also supports the equivalent of QEMU's --static option
meson: require 0.63.0
This version allows cleanups in modinfo collection, but they only work with Ninja 1.9.x and 1.8.x is still supported. It also supports the equivalent of QEMU's --static option to configure.
The wheel file is bumped to 0.63.3, the last release in the 0.63 branch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 7b4b98c4 | 16-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
python: bump some of the dependencies
The version of pyflakes that is listed in python/tests/minreqs.txt breaks on Python 3.8 with the following message:
AttributeError: 'FlakesChecker' object ha
python: bump some of the dependencies
The version of pyflakes that is listed in python/tests/minreqs.txt breaks on Python 3.8 with the following message:
AttributeError: 'FlakesChecker' object has no attribute 'CONSTANT'
Now that we do not support EOL'd Python versions anymore, we can update to newer, fixed versions. It is a good time to do so, before Python packages start dropping support for Python 3.7 as well!
The new mypy is also a bit smarter about which packages are actually being used, so remove the now-unnecessary sections from setup.cfg.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-27-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 02312f1a | 10-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
mkvenv: mark command as required
This is only available in Python 3.7+.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.73
mkvenv: mark command as required
This is only available in Python 3.7+.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-26-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 5591b745 | 10-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
Python: Drop support for Python 3.6
Python 3.6 was EOL 2021-12-31. Newer versions of upstream libraries have begun dropping support for this version and it is becoming more cumbersome to support. Av
Python: Drop support for Python 3.6
Python 3.6 was EOL 2021-12-31. Newer versions of upstream libraries have begun dropping support for this version and it is becoming more cumbersome to support. Avocado-framework and qemu.qmp each have their own reasons for wanting to drop Python 3.6, but won't until QEMU does.
Versions of Python available in our supported build platforms as of today, with optional versions available in parentheses:
openSUSE Leap 15.4: 3.6.15 (3.9.10, 3.10.2) CentOS Stream 8: 3.6.8 (3.8.13, 3.9.16) CentOS Stream 9: 3.9.13 Fedora 36: 3.10 Fedora 37: 3.11 Debian 11: 3.9.2 Alpine 3.14, 3.15: 3.9.16 Alpine 3.16, 3.17: 3.10.10 Ubuntu 20.04 LTS: 3.8.10 Ubuntu 22.04 LTS: 3.10.4 NetBSD 9.3: 3.9.13* FreeBSD 12.4: 3.9.16 FreeBSD 13.1: 3.9.16 OpenBSD 7.2: 3.9.16
Note: Our VM tests install 3.9 explicitly for FreeBSD and 3.10 for NetBSD; the default for "python" or "python3" in FreeBSD is 3.9.16. NetBSD does not appear to have a default meta-package, but offers several options, the lowest of which is 3.7.15. "python39" appears to be a pre-requisite to one of the other packages we request in tests/vm/netbsd. pip, ensurepip and other Python essentials are currently only available for Python 3.10 for NetBSD.
CentOS and OpenSUSE support parallel installation of multiple Python interpreters, and binaries in /usr/bin will always use Python 3.6. However, the newly introduced support for virtual environments ensures that all build steps that execute QEMU Python code use a single interpreter.
Since it is safe to under our supported platform policy, bump our minimum supported version of Python to 3.7.
Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20230511035435.734312-24-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| e80bdbf2 | 10-May-2023 |
John Snow <jsnow@redhat.com> |
python/wheels: add vendored meson package
In preference to vendoring meson source, vendor a built distributable ("bdist" in python parlance). This has some benefits:
(1) We can get rid of a git sub
python/wheels: add vendored meson package
In preference to vendoring meson source, vendor a built distributable ("bdist" in python parlance). This has some benefits:
(1) We can get rid of a git submodule, (2) Installing built meson into a venv doesn't require any extra dependencies (the python "wheel" package, chiefly.) (3) We don't treat meson any differently than we would any other python package (we install it, end of story, done.) (4) All future tarball *and* developer checkouts will function offline; No git or PyPI connection needed to fetch meson.
Note that because mkvenv prefers vendored packages to PyPI, as mkvenv is currently written we will never consult PyPI for meson. (Do keep in mind that your distribution's meson will be preferred above the vendored version, though.)
``` jsnow@scv ~/s/q/python (python-configure-venv)> python3 scripts/vendor.py pip download --dest /home/jsnow/src/qemu/python/wheels --require-hashes -r /tmp/tmpvo5qav7i Collecting meson==0.61.5 Using cached meson-0.61.5-py3-none-any.whl (862 kB) Saved ./wheels/meson-0.61.5-py3-none-any.whl Successfully downloaded meson ```
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-17-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 2274817f | 10-May-2023 |
John Snow <jsnow@redhat.com> |
python: add vendor.py utility
This is a teeny-tiny script that just downloads any packages we want to vendor from PyPI and stores them in qemu.git/python/wheels/. If I'm hit by a meteor, it'll be ea
python: add vendor.py utility
This is a teeny-tiny script that just downloads any packages we want to vendor from PyPI and stores them in qemu.git/python/wheels/. If I'm hit by a meteor, it'll be easy to replicate what I have done in order to udpate the vendored source.
We don't really care which python runs it; it exists as a meta-utility with no external dependencies and we won't package or install it. It will be monitored by the linters/type checkers, though; so it's guaranteed safe on python 3.6+.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-15-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| c8049626 | 16-May-2023 |
John Snow <jsnow@redhat.com> |
mkvenv: work around broken pip installations on Debian 10
This is a workaround intended for Debian 10, where the debian-patched pip does not function correctly if accessed from within a virtual envi
mkvenv: work around broken pip installations on Debian 10
This is a workaround intended for Debian 10, where the debian-patched pip does not function correctly if accessed from within a virtual environment.
We don't support Debian 10 as a build platform any longer, though we do still utilize it for our build-tricore-softmmu CI test. It's also possible that this bug might appear on other derivative platforms and this workaround may prove useful.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-11-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 68ea6d17 | 16-May-2023 |
John Snow <jsnow@redhat.com> |
mkvenv: use pip's vendored distlib as a fallback
distlib is usually not installed on Linux distribution, but it is vendored into pip. Because the virtual environment has pip via ensurepip, we can p
mkvenv: use pip's vendored distlib as a fallback
distlib is usually not installed on Linux distribution, but it is vendored into pip. Because the virtual environment has pip via ensurepip, we can piggy-back on pip's vendored version. This could break if they move our cheese in the future, but the fix would be simply to require distlib.
If it is debundled, as it is on msys, it is simply available directly.
Signed-off-by: John Snow <jsnow@redhat.com> [Move to toplevel. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 92834894 | 16-May-2023 |
John Snow <jsnow@redhat.com> |
mkvenv: add console script entry point generation
When creating a virtual environment that inherits system packages, script entry points (like "meson", "sphinx-build", etc) are not re-generated with
mkvenv: add console script entry point generation
When creating a virtual environment that inherits system packages, script entry points (like "meson", "sphinx-build", etc) are not re-generated with the correct shebang. When you are *inside* of the venv, this is not a problem, but if you are *outside* of it, you will not have a script that engages the virtual environment appropriately.
Add a mechanism that generates new entry points for pre-existing packages so that we can use these scripts to run "meson", "sphinx-build", "pip", unambiguously inside the venv.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-9-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| 4695a22e | 10-May-2023 |
John Snow <jsnow@redhat.com> |
mkvenv: add --diagnose option to explain "ensure" failures
This is a routine that is designed to print some usable info for human beings back out to the terminal if/when "mkvenv ensure" fails to loc
mkvenv: add --diagnose option to explain "ensure" failures
This is a routine that is designed to print some usable info for human beings back out to the terminal if/when "mkvenv ensure" fails to locate or install a package during configure time, such as meson or sphinx.
Since we are requiring that "meson" and "sphinx" are installed to the same Python environment as QEMU is configured to build with, this can produce some surprising failures when things are mismatched. This method is here to try and ease that sting by offering some actionable diagnosis.
Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-8-jsnow@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
| c5538eed | 10-May-2023 |
John Snow <jsnow@redhat.com> |
mkvenv: add ensure subcommand
This command is to be used to add various packages (or ensure they're already present) into the configure-provided venv in a modular fashion.
Examples:
mkvenv ensure
mkvenv: add ensure subcommand
This command is to be used to add various packages (or ensure they're already present) into the configure-provided venv in a modular fashion.
Examples:
mkvenv ensure --online --dir "${source_dir}/python/wheels/" "meson>=0.61.5" mkvenv ensure --online "sphinx>=1.6.0" mkvenv ensure "qemu.qmp==0.0.2"
It's designed to look for packages in three places, in order:
(1) In system packages, if the version installed is already good enough. This way your distribution-provided meson, sphinx, etc are always used as first preference.
(2) In a vendored packages directory. Here I am suggesting qemu.git/python/wheels/ as that directory. This is intended to serve as a replacement for vendoring the meson source for QEMU tarballs. It is also highly likely to be extremely useful for packaging the "qemu.qmp" package in source distributions for platforms that do not yet package qemu.qmp separately.
(3) Online, via PyPI, ***only when "--online" is passed***. This is only ever used as a fallback if the first two sources do not have an appropriate package that meets the requirement. The ability to build QEMU and run tests *completely offline* is not impinged.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-Id: <20230511035435.734312-7-jsnow@redhat.com> [Use distlib to lookup distributions. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|