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
[RDY] pygccxml + castxml + pybindgen #30473
Conversation
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec { | |||
# GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib | |||
# during linking | |||
stdenv.lib.optionalString stdenv.isDarwin '' | |||
export NIX_LDFLAGS+=" -no_dtrace_dof" | |||
export NIX_LDFLgGS+=" -no_dtrace_dof" |
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.
Huh? That's probably not intentional?
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.
I switch between 3 different keyboards a day and sometimes I make mistakes. Will fix
lib/licenses.nix
Outdated
@@ -39,6 +39,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { | |||
url = http://developer.amd.com/amd-license-agreement/; | |||
}; | |||
|
|||
apache2 = spdx { | |||
spdxId = "AL-2.0"; |
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.
According to https://spdx.org/licenses/, that license does not exist.
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.
Didn't know spdxId was an official register so I took a random one. Apache 2 license is registered though https://spdx.org/licenses/Apache-2.0.html. I will fix it
pkgs/top-level/python-packages.nix
Outdated
@@ -1221,7 +1221,7 @@ in { | |||
}; | |||
|
|||
batinfo = buildPythonPackage rec { | |||
version = "0.3"; | |||
version = "-1.3"; |
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.
This is not right; the version must start with a digit.
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.
typically typo mistake too. I will mark the PR as RFC once I make sure everything works. My last commit "Now works" was a shout of joy after sphalerite helped me solve sthg I 'd spent quite some time. thanks for the review
tests fail because of an undesired warning generated by |
|
||
propagatedBuildInputs = [ pkgs.castxml ]; | ||
|
||
doCheck = false; |
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.
can you include a comment with a reason
lib/licenses.nix
Outdated
@@ -39,6 +39,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec { | |||
url = http://developer.amd.com/amd-license-agreement/; | |||
}; | |||
|
|||
apache2 = spdx { |
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.
This is the asl20
@@ -0,0 +1,70 @@ | |||
{ pkgs |
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.
do not pass in pkgs
I am trying to enable pygccxxml tests (previously disabled). So first it generated
so I've tried to add differents packages such as
should I set CXXFLAGS myself or can a package do it for me ? |
bc26ff3
to
17ad38c
Compare
Getting the include path for standard c++ headers is a bit tricky. The following expression might help: $ nix-instantiate --eval --expr 'with (import <nixpkgs>) {}; clang.default_cxx_stdlib_compile'
"-isystem $(echo -n /nix/store/x3wnjni3my5r8d8vpja3qsygvg4bcbgl-gcc-6.4.0/include/c++/*) -isystem $(echo -n /nix/store/x3wnjni3my5r8d8vpja3qsygvg4bcbgl-gcc-6.4.0/include/c++/*)/$(/nix/store/x3wnjni3my5r8d8vpja3qsygvg4bcbgl-gcc-6.4.0/bin/gcc -dumpmachine)" The linking problem with |
I changed the checkPhase to
but the code would still fail to find stdarg.h, I searched the echoed CFLAGS for stdarg.h
and it is there but in a subfolder. The homepage https://github.com/gccxml/pygccxml doesn't list clang compatibility (only python). Maybe I need to add a flag in CFLAG so that stdarg.h appears in the upper folder. Like -std=c++11 ? |
I tried enabling pygccxml tests but it proved kinda hard, environment variables are not useful so one needs to generate a file and the include_paths is checked so that Meanwhile it would be cool if it could be merged without the tests as I need it for my work. PS: Here is what I had in my attempt to enable tests (for my future self or anyone interested in taking over)
|
4 tests are ignored because the regex don't match with custom clang output see: CastXML/CastXML#90
@GrahamcOfBorg build pythonPackages.pybindgen pythonPackages.pygccxml castxml |
Success on x86_64-linux (full log) Attempted: pythonPackages.pybindgen, pythonPackages.pygccxml, castxml Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: pythonPackages.pybindgen, pythonPackages.pygccxml, castxml Partial log (click to expand)
|
@GrahamcOfBorg build python3Packages.pybindgen python3Packages.pygccxml castxml |
Success on x86_64-linux (full log) Attempted: python3Packages.pybindgen, python3Packages.pygccxml, castxml Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: python3Packages.pybindgen, python3Packages.pygccxml, castxml Partial log (click to expand)
|
Python library to play with castxml output, aka your program's clang-produced AST.
Helps generating python bindings to C. Required to generate www.nsnam.org bindings.
I added pybindgen so as to support python bindings in #31346 (they released ns3.28 and fixed some problems in the build so I can finally update that PR). |
Thanks! |
Motivation for this change
I use the simulator www.nsnam.org in my work. I need these libraries in order to generate the python bindings castxml + pygccxml.
Castxml linking stage fails because it can't find -ltinfo. Comments in the repository say it's not available. Not sure what to do.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)