openwrt / routing

OpenWrt Routing Packages
334 stars 378 forks source link

cjdns: does not compile with gcc 13 #970

Closed PolynomialDivision closed 1 year ago

PolynomialDivision commented 1 year ago

cjnds does not compile with gcc-13.

Maintainer: @wfleurant Environment: mt7622

Error Output:

install -d -m0755 /home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/tmp
(cd /home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1 && CROSS="true" CC="aarch64-openwrt-linux-musl-gcc" AR="aarch64-openwrt-linux-musl-gcc-ar" RANLIB="aarch64-openwrt-linux-musl-gcc-ranlib" CFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1=cjdns-cjdns-v21.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -U_FORTIFY_SOURCE -Wno-error=array-bounds -Wno-error=stringop-overflow -Wno-error=stringop-overread" LDFLAGS="-L/home/nick/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/usr/lib -L/home/nick/openwrt/staging_dir/toolchain-aarch64_cortex-a53_gcc-12.3.0_musl/lib -znow -zrelro" SYSTEM="linux" TARGET_ARCH=""aarch64"" SSP_SUPPORT="y" GYP_ADDITIONAL_ARGS="-f make-linux" CJDNS_BUILD_TMPDIR="/home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/tmp" CJDNS_RELEASE_VERSION= exec ./do)
timeout is 600000
Loaded state file
rebuildIfChanges changed, rebuilding everything
Initialize 11ms
testing python python2
error starting python Error: spawn python2 ENOENT
testing python python2.7
error starting python Error: spawn python2.7 ENOENT
testing python python3.7
error starting python Error: spawn python3.7 ENOENT
testing python python3.8
error starting python Error: spawn python3.8 ENOENT
testing python python3.9
error starting python Error: spawn python3.9 ENOENT
testing python python3
sys.version_info(major=3, minor=10, micro=7, releaselevel='final', serial=0)

Build Libuv
Total build time: 102ms.
/home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/node_build/CjdnsTest.js:40
                    if (err) { throw err; }
                               ^

Error: ENOENT: no such file or directory, scandir './node_linux/nodejs/node/lib/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules'
    at Error (native)
make[2]: *** [Makefile:149: /home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/.built] Error 1
make[2]: Leaving directory '/home/nick/openwrt/feeds/routing/cjdns'
time: package/feeds/routing/cjdns/compile#0.27#0.07#0.28
    ERROR: package/feeds/routing/cjdns failed to build.
make[1]: *** [package/Makefile:120: package/feeds/routing/cjdns/compile] Error 1
make[1]: Leaving directory '/home/nick/openwrt'
make: *** [/home/nick/openwrt/include/toplevel.mk:231: package/cjdns/compile] Error 2
[nick@nicksbuildingvm openwrt]$ Traceback (most recent call last):
  File "/home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/build_linux/dependencies/libuv/./gyp_uv.py", line 14, in <module>
    import gyp
  File "/home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/build_linux/dependencies/libuv/build/gyp/pylib/gyp/__init__.py", line 10, in <module>
    import gyp.input
  File "/home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/build_linux/dependencies/libuv/build/gyp/pylib/gyp/input.py", line 8, in <module>
    import gyp.common
  File "/home/nick/openwrt/build_dir/target-aarch64_cortex-a53_musl/cjdns-cjdns-v21.1/build_linux/dependencies/libuv/build/gyp/pylib/gyp/common.py", line 497, in <module>
    class OrderedSet(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'
wfleurant commented 1 year ago

I think we need the patch from
https://github.com/cjdelisle/cjdns/pull/1246/commits/20122611a5a3983dd4c67146f430533f1c61346e

can you test this patch on the builder with python 3.10? cat /dev/shm/openwrt/feeds/routing/cjdns/patches/040-gyp-python_310.patch

...

--- a/node_build/dependencies/libuv/build/gyp/pylib/gyp/common.py
+++ b/node_build/dependencies/libuv/build/gyp/pylib/gyp/common.py
@@ -4,7 +4,11 @@

 from __future__ import with_statement

-import collections
+try:
+  # Python 3.10
+  from six.moves import collections_abc as collections
+except ImportError:
+  import collections
 import errno
 import filecmp
 import os.path

then retry

make V=99 -j10 packages/cjdns/{clean,compile}
...
Applying ./patches/040-gyp-python_310.patch using plaintext: 
patching file node_build/dependencies/libuv/build/gyp/pylib/gyp/common.py
...