Skip to content

Commit e232c2e

Browse files
shr-projectkraj
authored andcommitted
cbindgen: upgrade to 0.23.0
* the old version is not compatible with rust-1.60 currently in oe-core and firefox build fails with: 0:01.30 xpcom/base/gk_rust_utils_ffi_generated.h.stub 0:01.69 thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src/bindgen/cargo/cargo.rs:19:16 0:01.69 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace 0:01.69 make[4]: *** [backend.mk:41: .deps/gk_rust_utils_ffi_generated.h.stub] Error 101 0:01.69 make[3]: *** [/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/config/recurse.mk:101: xpcom/base/export] Error 2 0:01.69 make[2]: *** [/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/config/recurse.mk:34: export] Error 2 0:01.69 make[1]: *** [/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/config/rules.mk:413: default] Error 2 and similarly for .deps/ServoStyleConsts.h.stub and .deps/webrender_ffi_generated.h.stub It's actually cbindgen-native call from RunCbindgen.py as in: /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/firefox-build-dir/_virtualenvs/init/bin/python -m mozbuild.action.file_generate /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/layout/style/RunCbindgen.py generate gk_rust_utils_ffi_generated.h .deps/gk_rust_utils_ffi_generated.h.pp .deps/gk_rust_utils_ffi_generated.h.stub /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/xpcom/rust/gkrust_utils but even with RUST_BACKTRACE=full it doesn't show much: /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/recipe-sysroot-native/usr/bin/cbindgen --clean /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/toolkit/library/rust/ --lockfile /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/Cargo.lock --crate gkrust_utils thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src/bindgen/cargo/cargo.rs:19:16 stack backtrace: 0: 0x55b344f0451a - <unknown> 1: 0x55b344f20c0e - <unknown> 2: 0x55b344eea8f0 - <unknown> 3: 0x55b344ef1555 - <unknown> 4: 0x55b344ef128d - <unknown> 5: 0x55b344ef1b73 - <unknown> 6: 0x55b344f049b1 - <unknown> 7: 0x55b344f04644 - <unknown> 8: 0x55b344ef1690 - <unknown> 9: 0x55b344c41522 - <unknown> 10: 0x55b344c41461 - <unknown> 11: 0x55b344d6b211 - <unknown> 12: 0x55b344cd86e6 - <unknown> 13: 0x55b344cfdb91 - <unknown> 14: 0x55b344d6c21d - <unknown> 15: 0x55b344d3f934 - <unknown> 16: 0x55b344d3f1f6 - <unknown> 17: 0x55b344d6aaec - <unknown> 18: 0x55b344d86fe1 - <unknown> 19: 0x55b344d60113 - <unknown> 20: 0x55b344d732c9 - <unknown> 21: 0x55b344ee58a1 - <unknown> 22: 0x55b344d88ca1 - <unknown> 23: 0x7fea107194fb - __libc_start_call_main 24: 0x7fea107195b9 - __libc_start_main@@GLIBC_2.34 25: 0x55b344c41cd1 - <unknown> 26: 0x0 - <unknown> there is another weird error: 0:00.76 Traceback (most recent call last): 0:00.76 File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main 0:00.76 "__main__", fname, loader, pkg_name) 0:00.76 File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code 0:00.76 exec code in run_globals 0:00.76 File "/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/python/mozbuild/mozbuild/action/file_generate.py", line 120, in <module> 0:00.77 sys.exit(main(sys.argv[1:])) 0:00.77 File "/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/python/mozbuild/mozbuild/action/file_generate.py", line 60, in main 0:00.77 ('.py', 'r', imp.PY_SOURCE)) 0:00.77 File "/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/accessible/xpcom/AccEventGen.py", line 29, in <module> 0:00.77 p = xpidl.IDLParser() 0:00.77 File "/OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/xpcom/idl-parser/xpidl/xpidl.py", line 1809, in __init__ 0:00.77 optimize=1) 0:00.77 File "/OE/build/test-oe-build-time/poky/bitbake/lib/ply/yacc.py", line 3064, in yacc 0:00.77 signature = pinfo.signature() 0:00.77 File "/OE/build/test-oe-build-time/poky/bitbake/lib/ply/yacc.py", line 2813, in signature 0:00.77 return sig.digest() 0:00.77 UnboundLocalError: local variable 'sig' referenced before assignment Which is caused by python2 from firefox venv trying to use bitbake's ply and it doesn't like usedforsecurity=False added for fips in: https://git.openembedded.org/bitbake/commit/lib/ply/yacc.py?id=af866dd077867cba0129757bfcc689551445e9d7 $ /OE/build/test-oe-build-time/poky/build/tmp/work/core2-64-poky-linux/firefox/68.9.0esr-r0/firefox-68.9.0/firefox-build-dir/_virtualenvs/init/bin/python Python 2.7.18 (default, May 16 2022, 14:07:21) [GCC 11.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import hashlib >>> sig = hashlib.new('MD5', usedforsecurity=False) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: __hash_new() got an unexpected keyword argument 'usedforsecurity' but that's not fatal (and I still only care about firefox build time, wouldn't use such old version on any device). Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
1 parent 726f2e8 commit e232c2e

File tree

2 files changed

+80
-81
lines changed

2 files changed

+80
-81
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Auto-Generated by cargo-bitbake 0.3.15
2+
#
3+
inherit cargo
4+
5+
# If this is git based prefer versioned ones if they exist
6+
# DEFAULT_PREFERENCE = "-1"
7+
8+
# how to get cbindgen could be as easy as but default to a git checkout:
9+
# SRC_URI += "crate://crates.io/cbindgen/0.23.0"
10+
SRC_URI += "git://github.com/eqrion/cbindgen.git;protocol=https;nobranch=1"
11+
SRCREV = "c732069b2e8b899149a54c26539b843237b85d74"
12+
S = "${WORKDIR}/git"
13+
CARGO_SRC_DIR = ""
14+
15+
BBCLASSEXTEND = "native"
16+
17+
# please note if you have entries that do not begin with crate://
18+
# you must change them to how that package can be fetched
19+
SRC_URI += " \
20+
crate://crates.io/atty/0.2.14 \
21+
crate://crates.io/autocfg/1.1.0 \
22+
crate://crates.io/bitflags/1.3.2 \
23+
crate://crates.io/cfg-if/1.0.0 \
24+
crate://crates.io/clap/3.1.6 \
25+
crate://crates.io/fastrand/1.7.0 \
26+
crate://crates.io/hashbrown/0.11.2 \
27+
crate://crates.io/heck/0.4.0 \
28+
crate://crates.io/hermit-abi/0.1.19 \
29+
crate://crates.io/indexmap/1.8.0 \
30+
crate://crates.io/instant/0.1.12 \
31+
crate://crates.io/itoa/1.0.1 \
32+
crate://crates.io/lazy_static/1.4.0 \
33+
crate://crates.io/libc/0.2.121 \
34+
crate://crates.io/lock_api/0.4.6 \
35+
crate://crates.io/log/0.4.16 \
36+
crate://crates.io/memchr/2.4.1 \
37+
crate://crates.io/os_str_bytes/6.0.0 \
38+
crate://crates.io/parking_lot/0.11.2 \
39+
crate://crates.io/parking_lot_core/0.8.5 \
40+
crate://crates.io/proc-macro2/1.0.36 \
41+
crate://crates.io/quote/1.0.17 \
42+
crate://crates.io/redox_syscall/0.2.12 \
43+
crate://crates.io/remove_dir_all/0.5.3 \
44+
crate://crates.io/ryu/1.0.9 \
45+
crate://crates.io/scopeguard/1.1.0 \
46+
crate://crates.io/serde/1.0.136 \
47+
crate://crates.io/serde_derive/1.0.136 \
48+
crate://crates.io/serde_json/1.0.79 \
49+
crate://crates.io/serial_test/0.5.1 \
50+
crate://crates.io/serial_test_derive/0.5.1 \
51+
crate://crates.io/smallvec/1.8.0 \
52+
crate://crates.io/strsim/0.10.0 \
53+
crate://crates.io/syn/1.0.89 \
54+
crate://crates.io/tempfile/3.3.0 \
55+
crate://crates.io/termcolor/1.1.3 \
56+
crate://crates.io/textwrap/0.15.0 \
57+
crate://crates.io/toml/0.5.8 \
58+
crate://crates.io/unicode-xid/0.2.2 \
59+
crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
60+
crate://crates.io/winapi-util/0.1.5 \
61+
crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
62+
crate://crates.io/winapi/0.3.9 \
63+
"
64+
65+
66+
67+
# FIXME: update generateme with the real MD5 of the license file
68+
LIC_FILES_CHKSUM = " \
69+
file://LICENSE;md5=9741c346eef56131163e13b9db1241b3 \
70+
"
71+
72+
SUMMARY = "A tool for generating C bindings to Rust code."
73+
HOMEPAGE = "https://github.com/eqrion/cbindgen/"
74+
LICENSE = "MPL-2.0"
75+
76+
# includes this file if it exists but does not fail
77+
# this is useful for anything you may want to override from
78+
# what cargo-bitbake generates.
79+
include cbindgen-${PV}.inc
80+
include cbindgen.inc

meta-firefox/recipes-devtools/cbindgen/cbindgen_0.8.7.bb

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)