OneKeyHQ / OneKeyHQ/firmware-pro

Emulator build error

Open
#315 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
32
Forks
20
PR merge metrics
No merged PRs in 30d

Description

$ nix-shell
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'trezor-firmware-env'
         whose name attribute is located at /nix/store/k6wgqyawq9sfb3n5c3969lzk6x230a5j-source/pkgs/stdenv/generic/make-derivation.nix:302:7

       … while evaluating attribute 'buildInputs' of derivation 'trezor-firmware-env'
         at /nix/store/k6wgqyawq9sfb3n5c3969lzk6x230a5j-source/pkgs/stdenv/generic/make-derivation.nix:345:7:
          344|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          345|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |       ^
          346|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: path '/home/user/firmware-pro/pyright' does not exist

OK, replace in shell.nix:

pyright = nixpkgs.callPackage ./pyright {};

with

pyright = nixpkgs.pyright;

Next:

$ poetry run make build_unix
embed/extmod/modtrezorconfig/modtrezorconfig.c:74:2: error: #error "Emulator not support SE_THD89"
   74 | #error "Emulator not support SE_THD89"
      |  ^~~~~
In file included from embed/extmod/modtrezorcrypto/modtrezorcrypto.c:59:
embed/extmod/modtrezorcrypto/modtrezorcrypto-schnorr-bch.h:23:10: fatal error: se_thd89.h: No such file or directory
   23 | #include "se_thd89.h"
      |          ^~~~~~~~~~~~
compilation terminated.
In file included from embed/extmod/modtrezorio/modtrezorio.c:44:
embed/extmod/modtrezorio/modtrezorio-poll.h:26:10: fatal error: fpsensor_platform.h: No such file or directory
   26 | #include "fpsensor_platform.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from embed/extmod/modtrezorui/display.c:137:
embed/extmod/modtrezorui/mipi_lcd.h:6:10: fatal error: sdram.h: No such file or directory
    6 | #include "sdram.h"
      |          ^~~~~~~~~
compilation terminated.
embed/extmod/modtrezorutils/modtrezorutils.c:25:10: fatal error: bc_bytewords.h: No such file or directory
   25 | #include "bc_bytewords.h"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with shell.nix and run nix-shell, then reproduce the failures with poetry run make build_unix. Inspect the emulator build configuration and the listed C includes in embed/extmod; done means the emulator build completes without the missing-header and SE_THD89 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, shell
Domain
build-system, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.