You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When trying to follow the documentation after fresh install, the make build_unix within poetry shell environment, fails with an error.
Firmware version and revision
Current (latest commit is f8be07b) main branch.
Desktop/smartphone setup (please complete the following information):
OS: macOS Sonoma 14.4.1 (23E224)
clang --version:
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
--- stderr
thread 'main' panicked at /Users/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.29/src/fallback.rs:702:9:
"_mp_obj_fun_builtin_fixed_t_union_(unnamed_at___/__/vendor/micropython/py/obj_h_981_5)" is not a valid Ident
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
scons: *** [build/unix/build/unix/rust/aarch64-apple-darwin/release/libtrezor_lib.a] Error 101
make: *** [build_unix] Error 2
Additional context
The problem is described here, however it suggests problem is in Clang version 16 and above. But I am encountering this error with clang 15.
However, there is a workaround in updating the bindgen crate to version 0.62.0 and above (current version os 0.69.4):
Updating the bindgen to version 0.62.0 in core/embed/rust/Cargo.toml
As 0.62.0 and above changes the API of bindgen::EnumVariation it is needed to add is_global variable when creating default enum style in core/embed/rust/build.rs line 37:
Describe the bug
When trying to follow the documentation after fresh install, the
make build_unix
withinpoetry shell
environment, fails with an error.Firmware version and revision
Current (latest commit is
f8be07b
)main
branch.Desktop/smartphone setup (please complete the following information):
macOS Sonoma 14.4.1 (23E224)
clang --version
:To Reproduce
Steps to reproduce the behavior:
git clone --recurse-submodules https://github.com/trezor/trezor-firmware.git
cd trezor-firmware
poetry install
brew install scons sdl2 sdl2_image pkg-config llvm
rustup default nightly && rustup update
cd core
poetry shell
make build_unix
Expected behavior
Build is successful.
Screenshots
Additional context
The problem is described here, however it suggests problem is in Clang version 16 and above. But I am encountering this error with
clang 15
.However, there is a workaround in updating the
bindgen
crate to version0.62.0
and above (current version os0.69.4
):0.62.0
incore/embed/rust/Cargo.toml
bindgen::EnumVariation
it is needed to addis_global
variable when creating default enum style incore/embed/rust/build.rs
line37
:With the workaround applied, build is done and I am able to run the
emu.py
. Also all tests passed locally.After investigating this problem I suggest to update the version of
bindgen
to at leastv0.62.0
and do the necessary changes in the code.If someone gives me a green light, I can prepare the PR for this.
The text was updated successfully, but these errors were encountered: