-
Notifications
You must be signed in to change notification settings - Fork 994
pyosys: tox for non-wheel builds, update instructions #5434
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
base: main
Are you sure you want to change the base?
Conversation
tox for non-wheels builds, update instructionsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ git reset --hard
HEAD is now at 7193598fb pyosys: `tox` for non-wheels builds, update instructions
$ make clean
[...]
$ git diff --stat
kernel/binding.h | 60 -----
kernel/celltypes.h | 556 --------------------------------------------
kernel/consteval.h | 426 ----------------------------------
kernel/cost.h | 99 --------
kernel/log.h | 528 ------------------------------------------
kernel/register.h | 179 ---------------
kernel/rtlil.h | 2447 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
kernel/yosys.h | 103 ---------
libs/sha1/sha1.h | 57 -----
9 files changed, 4455 deletions(-)
(we're discussing this privately, but I want to clarify I don't think this is presently ready to merge)
- add `tox` to list of dependencies: saves builder(s) from manually having to manage a venv for python build dependencies - when building wheels, pip automatically creates the environment with those dependencies, so no need for tox - when running simply `make ENABLE_PYOSYS=1`, this is not the case. people attempting to `pip3 install --upgrade pybind11 cxxheaderparser` to add it to their system packages will be met with a scare message about "breaking system packages" - tox is available from all major package managers all the way back to ubuntu 20.04 and resolves this issue - update installation instructions to drop boost and add tox instead - update ci scripts to use `macos-15[-intel]` (`macos-13` sunset in early december)
|
Rebased on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It builds now; might wait for a JF to get more eyes on this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the JF it was decided that we'd prefer uv over tox for this process.
What are the reasons/motivation for this change?
@Ravenslofty noted that unlike the previous setup, users may have to manually manage a virtual environment to get the new Python build dependencies (pybind11 and cxxheaderparser,) and that is cumbersome.
While pybind11 can in fact be installed via package managers, it tends to be out of date more often than not. cxxheaderparser is not in any package manager that isn't Nix.
I considered just handling the ImportError to instruct the user on creating a venv but that's also just kind of cumbersome.
Explain how this is achieved.
toxto list of dependencies: saves builders from manually having to manage a venv for python build dependenciesmake ENABLE_PYOSYS=1, this is not the case. people attempting topip3 install --upgrade pybind11 cxxheaderparserto add it to their system packages will be met with a scare message about "breaking system packages"PYOSYS_USE_TOX=0suppresses this behaviorNaturally, tox is not required if you're not building Yosys with Python support.
Make sure your change comes with tests. If not possible, share how a reviewer might evaluate it.
On an Ubuntu 22.04 installation (Ubuntu 20.04 also in theory but the Bison on there is out of date so you have to build that on your own),
apt-get install build-essential clang lld bison flex libfl-dev libreadline-dev gawk tcl-dev libffi-dev graphviz xdot pkg-config python3-dev tox zlib1g-devshould be enough to allowmake ENABLE_PYOSYS=1to build successfully without further intervention.I validated that statement as follows:
macos-13is being sunset by EOY, I updated the wheels CI script to usemacos-15andmacos-15-intelbefore I forget about them, and for consistency updated the other CI scripts as well. https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/