Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

[bug report] rust: "no function or associated item named new found for struct Utf8Chunks in the current scope" #30

Open
DavidBuchanan314 opened this issue Jul 4, 2024 · 4 comments

Comments

@DavidBuchanan314
Copy link

Building on aarch64 Fedora 39.

$ cmake --build build -j $(nproc)
[1/18] cd /home/david/re/r1/magiskboot_build/src/Magisk/native/src/boot && /usr/bin/cmake -E...david/re/r1/magiskboot_build/build/./cargo/build --release -- -Cdefault-linker-libraries=yes
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling zeroize v1.7.0
   Compiling libc v0.2.153
   Compiling typenum v1.17.0
   Compiling cfg-if v1.0.0
   Compiling const-oid v0.10.0-pre.2
   Compiling subtle v2.5.0
   Compiling libm v0.2.8
   Compiling autocfg v1.2.0
   Compiling base64ct v1.6.0
   Compiling flagset v0.4.5
   Compiling unicode-width v0.1.11
   Compiling termcolor v1.4.1
   Compiling serde v1.0.197
   Compiling memchr v2.7.2
   Compiling num-traits v0.2.18
   Compiling pem-rfc7468 v1.0.0-pre.0
   Compiling base16ct v0.2.0
   Compiling cxx-gen v0.7.115 (/home/david/re/r1/magiskboot_build/src/Magisk/native/src/external/cxx-rs/gen/lib)
   Compiling aho-corasick v1.1.3
   Compiling quote v1.0.35
   Compiling getrandom v0.2.12
   Compiling syn v2.0.58
   Compiling rand_core v0.6.4
   Compiling cpufeatures v0.2.12
   Compiling codespan-reporting v0.11.1
   Compiling regex-syntax v0.8.3
   Compiling ff v0.13.0
   Compiling quick-error v1.2.3
   Compiling hybrid-array v0.2.0-rc.8
   Compiling group v0.13.0
   Compiling humantime v1.3.0
   Compiling textwrap v0.11.0
   Compiling cxxbridge-flags v1.0.115 (/home/david/re/r1/magiskboot_build/src/Magisk/native/src/external/cxx-rs/flags)
   Compiling atty v0.2.14
   Compiling cxxbridge-macro v1.0.115 (/home/david/re/r1/magiskboot_build/src/Magisk/native/src/external/cxx-rs/macro)
   Compiling ppv-lite86 v0.2.17
   Compiling bitflags v1.3.2
   Compiling ansi_term v0.12.1
   Compiling log v0.4.21
   Compiling strsim v0.8.0
   Compiling cc v1.0.90
   Compiling crypto-common v0.2.0-pre.5
   Compiling minimal-lexical v0.2.1
   Compiling vec_map v0.8.2
   Compiling rand_chacha v0.3.1
   Compiling clap v2.34.0
   Compiling unicode-xid v0.2.4
   Compiling thiserror v1.0.58
   Compiling crypto-bigint v0.6.0-pre.12
   Compiling nom v7.1.3
   Compiling num-integer v0.1.46
   Compiling spin v0.5.2
   Compiling block-buffer v0.11.0-pre.5
   Compiling digest v0.11.0-pre.8
   Compiling regex-automata v0.4.6
   Compiling cxx v1.0.115 (/home/david/re/r1/magiskboot_build/src/Magisk/native/src/external/cxx-rs)
   Compiling byteorder v1.5.0
   Compiling num-bigint-dig v0.8.4
   Compiling hmac v0.13.0-pre.3
   Compiling signature v2.3.0-pre.3
   Compiling sha2 v0.11.0-pre.3
   Compiling num-iter v0.1.44
   Compiling hkdf v0.13.0-pre.3
   Compiling rfc6979 v0.5.0-pre.3
   Compiling lazy_static v1.4.0
   Compiling const_format_proc_macros v0.2.32
   Compiling rand v0.8.5
   Compiling smallvec v1.13.2
   Compiling libc v0.0.0 (/home/david/re/r1/magiskboot_build/src/libc-compat/rs)
   Compiling primefield v0.14.0-pre (https://github.com/RustCrypto/elliptic-curves.git?rev=5d1c252c2defb5808f55329f3e2955ca72d7f8b5#5d1c252c)
   Compiling quick-protobuf v0.8.1 (https://github.com/tafia/quick-protobuf.git?rev=2f37d5a65504de7d716b5b28fd82219501a901a9#2f37d5a6)
   Compiling sha1 v0.11.0-pre.3
   Compiling const_format v0.2.32
   Compiling fdt v0.1.5
   Compiling regex v1.10.4
   Compiling size v0.4.1
   Compiling env_logger v0.7.1
   Compiling der_derive v0.8.0-pre.0
   Compiling serde_derive v1.0.197
   Compiling bytemuck_derive v1.6.0
   Compiling base v0.0.0 (/home/david/re/r1/magiskboot_build/src/Magisk/native/src/base)
   Compiling thiserror-impl v1.0.58
   Compiling pb-rs v0.10.0 (https://github.com/tafia/quick-protobuf.git?rev=2f37d5a65504de7d716b5b28fd82219501a901a9#2f37d5a6)
   Compiling num-derive v0.4.2
   Compiling der v0.8.0-pre.0
   Compiling bytemuck v1.15.0
   Compiling magiskboot v0.0.0 (/home/david/re/r1/magiskboot_build/src/Magisk/native/src/boot)
   Compiling spki v0.8.0-pre.0
   Compiling pkcs8 v0.11.0-pre.0
   Compiling x509-cert v0.3.0-pre (https://github.com/RustCrypto/formats.git?rev=809df65b20d61e88afb7f514b5cfdd3d1958a40f#809df65b)
   Compiling sec1 v0.8.0-pre.1
   Compiling pkcs1 v0.8.0-pre.0
   Compiling elliptic-curve v0.14.0-pre.5
   Compiling rsa v0.10.0-pre.1
   Compiling ecdsa v0.17.0-pre.5
   Compiling primeorder v0.14.0-pre.0 (https://github.com/RustCrypto/elliptic-curves.git?rev=5d1c252c2defb5808f55329f3e2955ca72d7f8b5#5d1c252c)
   Compiling p256 v0.14.0-pre.0 (https://github.com/RustCrypto/elliptic-curves.git?rev=5d1c252c2defb5808f55329f3e2955ca72d7f8b5#5d1c252c)
   Compiling p384 v0.14.0-pre (https://github.com/RustCrypto/elliptic-curves.git?rev=5d1c252c2defb5808f55329f3e2955ca72d7f8b5#5d1c252c)
   Compiling p521 v0.14.0-pre (https://github.com/RustCrypto/elliptic-curves.git?rev=5d1c252c2defb5808f55329f3e2955ca72d7f8b5#5d1c252c)
   Compiling argh_shared v0.1.12 (https://github.com/google/argh.git?rev=1c632b046d084e7bde86b82dfc969b30b4647c8c#1c632b04)
   Compiling argh_derive v0.1.12 (https://github.com/google/argh.git?rev=1c632b046d084e7bde86b82dfc969b30b4647c8c#1c632b04)
   Compiling argh v0.1.12 (https://github.com/google/argh.git?rev=1c632b046d084e7bde86b82dfc969b30b4647c8c#1c632b04)
warning: the feature `utf8_chunks` has been stable since 1.79.0 and no longer requires an attribute to enable
 --> base/lib.rs:4:12
  |
4 | #![feature(utf8_chunks)]
  |            ^^^^^^^^^^^
  |
  = note: `#[warn(stable_features)]` on by default

error[E0599]: no function or associated item named `new` found for struct `Utf8Chunks` in the current scope
  --> base/cstr.rs:58:30
   |
58 |     let chunks = Utf8Chunks::new(s);
   |                              ^^^ function or associated item not found in `Utf8Chunks<'_>`
   |
help: there is a method `ne` with a similar name
   |
58 |     let chunks = Utf8Chunks::ne(s);
   |                              ~~

For more information about this error, try `rustc --explain E0599`.
warning: `base` (lib) generated 1 warning
error: could not compile `base` (lib) due to 1 previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
[3/18] Preparing C header flags.h
FAILED: CMakeFiles/_cargo-build_magiskboot /home/david/re/r1/magiskboot_build/build/CMakeFiles/_cargo-build_magiskboot 
@DavidBuchanan314 DavidBuchanan314 added the unconfirmed Unconfirmed bug report, be patient... label Jul 4, 2024
@DavidBuchanan314
Copy link
Author

I suspect my rust toolchain is too new (I'm on 1.79.0). Which version is recommended?

@DavidBuchanan314
Copy link
Author

Successful workaround: I downgraded to 1.78.0 using rustup

@ghost
Copy link

ghost commented Jul 14, 2024

@ghost
Copy link

ghost commented Jul 14, 2024

the official magisk is now using ONDK r27.2 (which is based on rust 1.79.0) to compile, so by simply updating the magisk source this should be fixed automatically

currently i dont know when ill do it

@ghost ghost removed the unconfirmed Unconfirmed bug report, be patient... label Jul 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant