-
Notifications
You must be signed in to change notification settings - Fork 78
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
Cocotb clashes with cocotb installed in venv #80
Comments
I've done some further investigation into this. Naturally, when I create a venv with my system python, that venv will use the system python too which seems to cause conflicts. I still want a venv because I would like to install some additional dependencies per project, so I figured I could create a venv using the python version that oss-cad-suite provides, i.e.
However, that seems to fail half way through the creation process. Running that raw command gives
|
And another update: Not being able to create venvs with the cad suite seems to be because However, I attempted to fix this by following the symlink as But that updates |
Ok, I think I have figured out a fix that works for me. I don't know if it is worth upstreaming it since I don't really know what i'm doing, my use case might be strange etc. But I figure it is worth posting this for others who run into similar issues Python seems to determine venvs partially based on where the python executable being run is, before resolving symlinks so that needs to be set correctly. oss-cad-suite on the other hand relies on the executable location to be where the cad suite is installed, not following symlinks. Modifying #!/usr/bin/env bash
release_bindir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
release_bindir_abs="$(readlink -f "$release_bindir")"
release_topdir_abs="$(readlink -f "$release_bindir/..")"
export PATH="$release_bindir_abs:$PATH"
export PYTHONEXECUTABLE="${BASH_SOURCE[0]}"
# export PYTHONEXECUTABLE="$release_topdir_abs/bin/tabbypy3"
# export PYTHONHOME="$release_topdir_abs"
export PYTHONNOUSERSITE=1
export SSL_CERT_FILE="$release_topdir_abs"/etc/cacert.pem
exec "$release_topdir_abs"/lib/ld-linux-x86-64.so.2 --inhibit-cache --inhibit-rpath "" --library-path "$release_topdir_abs"/lib "$release_topdir_abs"/libexec/python3.8 "$@" Seems to resolve my issues, namely, oss-cad-sutie works to the point where cocotb works, both with and without virtual environments To use it in a venv, you can make a new venv with |
As discussed in discord, this workflow breaks with the ubuntu bump, so libpthread will need to be added to the bundle |
File is added now in release, and I have rebuilt releases, so please do try if it fixes complete flow now. |
Thanks for the quick fix! It does seem to work. Unfortunately, now i'm running into some problems which I think are due to cocotb being bumped to 2.0-dev. It feels fixable by installing cocotb from pip, but I can't seem to get that to work |
I'm not sure this is a supported use case, it seems like having oss-cad-suite in path at the same time as having a venv-installed cocotb version results in a glibc linker error on arch linux
Steps to reproduce
Create a cocotb "project" as follows
test_my_design.py
my_design.sv
Makefile
Then create a venv, activate it, and install cocotb with
pip
Running
make
now results inNot cativating the venv, or not having oss-cad suite in PATH results in the expected output
This is on an up to date Arch system with the latest oss-cad-suite
The text was updated successfully, but these errors were encountered: