Skip to content
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

last commit breaks building the Python bindings #77

Closed
sharkcz opened this issue Jan 30, 2023 · 2 comments
Closed

last commit breaks building the Python bindings #77

sharkcz opened this issue Jan 30, 2023 · 2 comments

Comments

@sharkcz
Copy link
Contributor

sharkcz commented Jan 30, 2023

Seems the last commit a41509b breaks building the Python bindings.

...
make[1]: Entering directory '/var/lib/jenkins/workspace/dtc/label/x86_64'
set -e; echo '	CHK version_gen.h'; mkdir -p ./; 	(echo "#define DTC_VERSION \"DTC 1.6.1-ga41509be\""; ) < Makefile > version_gen.h.tmp; if [ -r version_gen.h ] && cmp -s version_gen.h version_gen.h.tmp; then rm -f version_gen.h.tmp; else echo '	UPD version_gen.h'; mv -f version_gen.h.tmp version_gen.h; fi;
	CHK version_gen.h
python3 ./setup.py  build_ext --build-lib=pylibfdt
running build_ext
building '_libfdt' extension
swigging /var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt.i to /var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c
swig -python -I/var/lib/jenkins/workspace/dtc/label/x86_64/./libfdt -o /var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c /var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt.i
creating build
creating build/temp.linux-x86_64-3.10
creating build/temp.linux-x86_64-3.10/var
creating build/temp.linux-x86_64-3.10/var/lib
creating build/temp.linux-x86_64-3.10/var/lib/jenkins
creating build/temp.linux-x86_64-3.10/var/lib/jenkins/workspace
creating build/temp.linux-x86_64-3.10/var/lib/jenkins/workspace/dtc
creating build/temp.linux-x86_64-3.10/var/lib/jenkins/workspace/dtc/label
creating build/temp.linux-x86_64-3.10/var/lib/jenkins/workspace/dtc/label/x86_64
creating build/temp.linux-x86_64-3.10/var/lib/jenkins/workspace/dtc/label/x86_64/pylibfdt
gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPY_SSIZE_T_CLEAN -I/var/lib/jenkins/workspace/dtc/label/x86_64/./libfdt -I/usr/include/python3.10 -c /var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c -o build/temp.linux-x86_64-3.10/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.o
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_node_header_name_set’:
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4038:7: warning: the comparison will always evaluate as ‘true’ for the address of ‘name’ will never be NULL [-Waddress]
 4038 |   if (arg1->name) free((char*)arg1->name);
      |       ^~~~
In file included from /var/lib/jenkins/workspace/dtc/label/x86_64/./libfdt/libfdt.h:10,
                 from /var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:2722:
/var/lib/jenkins/workspace/dtc/label/x86_64/./libfdt/fdt.h:38:14: note: ‘name’ declared here
   38 |         char name[];
      |              ^~~~
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4041:18: error: cast specifies array type
 4041 |     arg1->name = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
      |                  ^
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4041:16: error: invalid use of flexible array member
 4041 |     arg1->name = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
      |                ^
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4043:16: error: invalid use of flexible array member
 4043 |     arg1->name = 0;
      |                ^
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_property_data_set’:
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4301:7: warning: the comparison will always evaluate as ‘true’ for the address of ‘data’ will never be NULL [-Waddress]
 4301 |   if (arg1->data) free((char*)arg1->data);
      |       ^~~~
/var/lib/jenkins/workspace/dtc/label/x86_64/./libfdt/fdt.h:45:14: note: ‘data’ declared here
   45 |         char data[];
      |              ^~~~
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4304:18: error: cast specifies array type
 4304 |     arg1->data = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
      |                  ^
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4304:16: error: invalid use of flexible array member
 4304 |     arg1->data = (char [])(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
      |                ^
/var/lib/jenkins/workspace/dtc/label/x86_64/./pylibfdt/libfdt_wrap.c:4306:16: error: invalid use of flexible array member
 4306 |     arg1->data = 0;
      |                ^
error: command '/usr/bin/gcc' failed with exit code 1
make[1]: *** [pylibfdt/Makefile.pylibfdt:20: pylibfdt/_libfdt.so] Error 1
make[1]: Leaving directory '/var/lib/jenkins/workspace/dtc/label/x86_64'
make: *** [Makefile:172: maybe_pylibfdt] Error 2
Build step 'Execute shell' marked build as failure
Finished: FAILURE

This is on Fedora 36 on x86_64, but fails on all arches.

@dgibson
Copy link
Owner

dgibson commented Feb 2, 2023

Someone else also reported this, and a fix has been applied (commit abbd523).

This is on Fedora 36 on x86_64, but fails on all arches.

Huh. That's interesting. The reason I didn't notice this breakage before applying is that build of pylibfdt has been broken for me for some time. It's not broken for everyone, so it's something specific to my build environment - which is Fedora 37, and I'm pretty sure it was also broken when I was on Fedora 36. So now I'm even more at a loss as to why it's broken for me.

@dgibson dgibson closed this as completed Feb 2, 2023
@sharkcz
Copy link
Contributor Author

sharkcz commented Feb 6, 2023

for the record, all looks good again after commit a41509b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants