-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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: init at 1.2.0 #71288
cocotb: init at 1.2.0 #71288
Conversation
Thanks for packaging this! You'll need to add yourself to The following changes get the tests running and passing: diff --git a/pkgs/development/python-modules/cocotb/default.nix b/pkgs/development/python-modules/cocotb/default.nix
index 2da667b77c6..2728da9a3aa 100644
--- a/pkgs/development/python-modules/cocotb/default.nix
+++ b/pkgs/development/python-modules/cocotb/default.nix
@@ -1,19 +1,38 @@
-{ stdenv, buildPythonPackage, fetchPypi, setuptools }:
+{ stdenv, buildPythonPackage, fetchFromGitHub, setuptools, swig, verilog }:
buildPythonPackage rec {
pname = "cocotb";
version = "1.2.0";
- src = fetchPypi {
- inherit pname version;
- sha256 = "0855gs1wi7k9fwk832czri21wr83gzp0lp2jkaxccyjgbr1d8a8z";
+ src = fetchFromGitHub {
+ owner = pname;
+ repo = pname;
+ rev = "v${version}";
+ sha256 = "091q63jcm87xggqgqi44lw2vjxhl1v4yl0mv2c76hgavb29w4w5y";
};
propagatedBuildInputs = [
setuptools
];
- doCheck = false;
+ postPatch = ''
+ patchShebangs bin/*.py
+
+ # POSIX portability (TODO: upstream this)
+ for f in \
+ cocotb/share/makefiles/Makefile.* \
+ cocotb/share/makefiles/simulators/Makefile.*
+ do
+ substituteInPlace $f --replace 'shell which' 'shell command -v'
+ done
+ '';
+
+ checkInputs = [ swig verilog ];
+
+ installCheckPhase = ''
+ export PATH=$out/bin:$PATH
+ make test
+ '';
meta = {
description = "Coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python"; |
@emilazy changes made. Thanks for getting the tests working! |
I submitted the Makefile changes upstream as cocotb/cocotb#1153. |
please squash all the cocotb related commits into one
|
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.
nix-review
passes on NixOS
diff LGTM
executable seems to work
https://github.com/NixOS/nixpkgs/pull/71288
3 package were build:
python27Packages.cocotb python37Packages.cocotb python38Packages.cocotb
[nix-shell:/home/jon/.cache/nix-review/pr-71288-1]$ nix path-info -Sh ./results/python37Packages.cocotb
/nix/store/58fll0a5dwag12is7sbjhgz5wlzfh94h-python3.7-cocotb-1.2.0 98.1M
@GrahamcOfBorg build python27Packages.cocotb python37Packages.cocotb python38Packages.cocotb |
It seems that cocotb support darwin https://cocotb.readthedocs.io/en/latest/quickstart.html#macos-packages , it doesn't look like it's able to resolve gcc correctly, not sure if you all want to pursue mac support, or just mark this linux only |
I don't know much about osx but happy to take a look if you think it's best to get that working too. |
@marsam can you take a look at the failure logs for darwin, it essentially is saying:
I was under the impression that clang is aliased to gcc in most darwin environments. |
Looks like upstream has a makefile with gcc harcoded. It works with the following: diff --git i/pkgs/development/python-modules/cocotb/default.nix w/pkgs/development/python-modules/cocotb/default.nix
index 228ac7904ec..e10ecd8e840 100644
--- i/pkgs/development/python-modules/cocotb/default.nix
+++ w/pkgs/development/python-modules/cocotb/default.nix
@@ -24,6 +24,9 @@ buildPythonPackage rec {
cocotb/share/makefiles/simulators/Makefile.*
do
substituteInPlace $f --replace 'shell which' 'shell command -v'
+ # replace hardcoded gcc. Remove once https://github.com/cocotb/cocotb/pull/1137 gets merged
+ substituteInPlace $f --replace 'gcc' '$(CC)'
+ substituteInPlace $f --replace 'g++' '$(CXX)'
done
''; |
There is an open PR for cocotb to fix this and maybe more related problems: cocotb/cocotb#1137 |
Thanks for your patience. I added the fix for darwin, I hope you don't mind. |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @