Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to run custom build command for esp-idf-sys v0.34.1 #297

Closed
Wenrh2004 opened this issue Apr 9, 2024 · 1 comment
Closed

failed to run custom build command for esp-idf-sys v0.34.1 #297

Wenrh2004 opened this issue Apr 9, 2024 · 1 comment

Comments

@Wenrh2004
Copy link

   Compiling compiler_builtins v0.1.103
   Compiling core v0.0.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.150
   Compiling proc-macro2 v1.0.79
   Compiling memchr v2.5.0
   Compiling unicode-ident v1.0.12
   Compiling std v0.0.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/std)
   Compiling libc v0.2.153
   Compiling memchr v2.7.2
   Compiling cfg-if v1.0.0
   Compiling serde v1.0.197
   Compiling aho-corasick v1.1.3
   Compiling crossbeam-utils v0.8.19
   Compiling regex-syntax v0.8.3
   Compiling quote v1.0.35
   Compiling syn v2.0.58
   Compiling regex-automata v0.4.6
   Compiling rustix v0.38.32
   Compiling bitflags v1.3.2
   Compiling glob v0.3.1
   Compiling syn v1.0.109
   Compiling clang-sys v1.7.0
   Compiling errno v0.3.8
   Compiling bitflags v2.5.0
   Compiling log v0.4.21
   Compiling rustversion v1.0.15
   Compiling rustc-std-workspace-core v1.99.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc)
   Compiling unwind v0.0.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/unwind)
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.23
   Compiling serde_derive v1.0.197
   Compiling crossbeam-epoch v0.9.18
   Compiling rustc-std-workspace-alloc v1.99.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling gimli v0.28.0
   Compiling hashbrown v0.14.2
   Compiling miniz_oxide v0.7.1
   Compiling object v0.32.0
   Compiling std_detect v0.1.5 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling panic_unwind v0.0.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_unwind)
   Compiling panic_abort v0.0.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_abort)
   Compiling bstr v1.9.1
   Compiling same-file v1.0.6
   Compiling serde_json v1.0.115
   Compiling minimal-lexical v0.2.1
   Compiling thiserror v1.0.58
   Compiling addr2line v0.21.0
   Compiling nom v7.1.3
   Compiling walkdir v2.5.0
   Compiling globset v0.4.14
   Compiling crossbeam-deque v0.8.5
   Compiling thiserror-impl v1.0.58
   Compiling nix v0.26.4
   Compiling libloading v0.8.3
   Compiling cvt v0.1.2
   Compiling heck v0.4.1
   Compiling bindgen v0.63.0
   Compiling either v1.10.0
   Compiling ryu v1.0.17
   Compiling lazy_static v1.4.0
   Compiling itoa v1.0.11
   Compiling anyhow v1.0.81
   Compiling home v0.5.9
   Compiling which v4.4.2
   Compiling fs_at v0.1.10
   Compiling cexpr v0.6.0
   Compiling ignore v0.4.22
   Compiling regex v1.10.4
   Compiling strum_macros v0.24.3
   Compiling proc_macro v0.0.0 (/Users/wenruohan/.rustup/toolchains/nightly-2023-11-14-aarch64-apple-darwin/lib/rustlib/src/rust/library/proc_macro)
   Compiling shlex v1.3.0
   Compiling fastrand v2.0.2
   Compiling rustc-hash v1.1.0
   Compiling cc v1.0.92
   Compiling normpath v1.2.0
   Compiling lazycell v1.3.0
   Compiling peeking_take_while v0.1.2
   Compiling remove_dir_all v0.8.2
   Compiling cmake v0.1.50
   Compiling tempfile v3.10.1
   Compiling globwalk v0.8.1
   Compiling filetime v0.2.23
   Compiling semver v1.0.22
   Compiling camino v1.1.6
   Compiling cargo-platform v0.1.8
   Compiling envy v0.4.2
   Compiling ident_case v1.0.1
   Compiling fnv v1.0.7
   Compiling autocfg v1.2.0
   Compiling num-traits v0.2.18
   Compiling darling_core v0.20.8
   Compiling strum v0.24.1
   Compiling byteorder v1.5.0
   Compiling nb v1.1.0
   Compiling embedded-io-async v0.6.1
   Compiling heapless v0.8.0
   Compiling core-foundation-sys v0.8.6
   Compiling iana-time-zone v0.1.60
   Compiling cargo_metadata v0.18.1
   Compiling embuild v0.31.4
   Compiling darling_macro v0.20.8
   Compiling hash32 v0.3.1
   Compiling darling v0.20.8
   Compiling embedded-io v0.6.1
   Compiling stable_deref_trait v1.2.0
   Compiling embassy-time-driver v0.1.0
   Compiling unicode-xid v0.2.4
   Compiling const_format_proc_macros v0.2.32
   Compiling chrono v0.4.37
   Compiling pin-project-lite v0.2.14
   Compiling pin-utils v0.1.0
   Compiling futures-core v0.3.30
   Compiling embedded-hal v1.0.0
   Compiling futures-task v0.3.30
   Compiling once_cell v1.19.0
   Compiling embassy-sync v0.5.0
   Compiling version_check v0.9.4
   Compiling enumset_derive v0.8.1
   Compiling embedded-hal-async v1.0.0
   Compiling uncased v0.9.10
   Compiling build-time v0.1.3
   Compiling esp-idf-sys v0.34.1
   Compiling esp-idf-hal v0.43.1
   Compiling enumset v1.1.3
   Compiling esp-idf-svc v0.48.1
   Compiling futures-util v0.3.30
   Compiling const_format v0.2.32
   Compiling nb v0.1.3
   Compiling void v1.0.2
   Compiling critical-section v1.1.2
   Compiling num_enum_derive v0.7.2
   Compiling litrs v0.4.1
   Compiling embedded-hal v0.2.7
   Compiling document-features v0.2.8
   Compiling embedded-hal-nb v1.0.0
   Compiling embedded-can v0.4.1
   Compiling no-std-net v0.5.0
   Compiling num_enum v0.7.2
   Compiling atomic-waker v1.1.2
   Compiling esp32-demo v0.1.0 (/Users/wenruohan/esp32-demo)
   Compiling embassy-futures v0.1.1
   Compiling embedded-svc v0.27.1
error: failed to run custom build command for `esp-idf-sys v0.34.1`

Caused by:
  process didn't exit successfully: `/Users/wenruohan/esp32-demo/target/debug/build/esp-idf-sys-df1307c4e5939b31/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ESP_IDF_TOOLS_INSTALL_DIR
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG
  cargo:rerun-if-env-changed=ESP_IDF_SDKCONFIG_DEFAULTS
  cargo:rerun-if-env-changed=MCU
  cargo:rerun-if-env-changed=ESP_IDF_SYS_ROOT_CRATE
  cargo:rerun-if-env-changed=ESP_IDF_VERSION
  cargo:rerun-if-env-changed=ESP_IDF_REPOSITORY
  cargo:rerun-if-env-changed=ESP_IDF_CMAKE_GENERATOR
  cargo:rerun-if-env-changed=IDF_PATH
  cargo:rerun-if-env-changed=EXTRA-COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENTS
  cargo:rerun-if-env-changed=ESP_IDF_COMPONENT_MANAGER
  OPENOCD_SCRIPTS=/Users/wenruohan/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts
  ESP_ROM_ELF_DIR=/Users/wenruohan/.espressif/tools/esp-rom-elfs/20230320/
  IDF_PYTHON_ENV_PATH=/Users/wenruohan/.espressif/python_env/idf5.2_py3.11_env
  ESP_IDF_VERSION=5.2
  PATH=/Users/wenruohan/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/wenruohan/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/wenruohan/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/Users/wenruohan/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/wenruohan/.espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/wenruohan/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/wenruohan/.espressif/tools/ninja/1.11.1/:/Users/wenruohan/.espressif/python_env/idf5.2_py3.11_env/bin:/Users/wenruohan/.espressif/esp-idf/v5.2.1/tools:$PATH
  IDF_DEACTIVATE_FILE_PATH=/var/folders/5l/_q66nzlj16s74jjw4jm_sdcr0000gn/T/tmpo9ewbzw9idf_71760
  Current system platform: macos-arm64
  Installing tools: riscv32-esp-elf, cmake, ninja
  Skipping [email protected]_20230928 (already installed)
  Skipping [email protected] (already installed)
  Skipping [email protected] (already installed)
  OPENOCD_SCRIPTS=/Users/wenruohan/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts
  ESP_ROM_ELF_DIR=/Users/wenruohan/.espressif/tools/esp-rom-elfs/20230320/
  IDF_PYTHON_ENV_PATH=/Users/wenruohan/.espressif/python_env/idf5.2_py3.11_env
  ESP_IDF_VERSION=5.2
  PATH=/Users/wenruohan/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/wenruohan/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/wenruohan/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/Users/wenruohan/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/wenruohan/.espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/wenruohan/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/wenruohan/.espressif/tools/ninja/1.11.1/:/Users/wenruohan/.espressif/python_env/idf5.2_py3.11_env/bin:/Users/wenruohan/.espressif/esp-idf/v5.2.1/tools:$PATH
  IDF_DEACTIVATE_FILE_PATH=/var/folders/5l/_q66nzlj16s74jjw4jm_sdcr0000gn/T/tmpl0xhyt20idf_71760
  cargo:rerun-if-changed=/Users/wenruohan/esp32-demo/sdkconfig.defaults
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_PREFIX_PATH_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_riscv32imc_zicsr_zifencei-esp-espidf = None
  CMAKE_riscv32imc_zicsr_zifencei_esp_espidf = None
  TARGET_CMAKE = None
  CMAKE = None
  running: cd "/Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/Users/wenruohan/.espressif/esp-idf/v5.2.1" IDF_TARGET="esp32c3" IDF_TOOLS_PATH="/Users/wenruohan/.espressif" PATH="/Users/wenruohan/.espressif/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin:/Users/wenruohan/.espressif/tools/riscv32-esp-elf-gdb/12.1_20231023/riscv32-esp-elf-gdb/bin:/Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/Users/wenruohan/.espressif/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:/Users/wenruohan/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:/Users/wenruohan/.espressif/tools/ninja/1.11.1/:/Users/wenruohan/.espressif/esp-idf/v5.2.1/tools:/Users/wenruohan/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/Users/wenruohan/.espressif/python_env/idf5.2_py3.11_env/bin:/Users/wenruohan/.espressif/tools/cmake/3.24.0/CMake.app/Contents/bin:/Users/wenruohan/Library/pnpm:/Users/wenruohan/.console-ninja/.bin:/opt/homebrew/anaconda3/bin:/Users/wenruohan/bin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Library/TeX/texbin:/Users/wenruohan/.cargo/bin:/Users/wenruohan/Library/Application Support/JetBrains/Toolbox/scripts:/Users/wenruohan/.orbstack/bin:/Users/wenruohan/sdk/go1.21.5/bin:/Users/wenruohan/go/bin" PROJECT_DIR="/Users/wenruohan/esp32-demo" SDKCONFIG_DEFAULTS="/Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out/gen-sdkconfig.defaults;/Users/wenruohan/esp32-demo/sdkconfig.defaults" "cmake" "/Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out" "-G" "Ninja" "-DCMAKE_TOOLCHAIN_FILE=/Users/wenruohan/.espressif/esp-idf/v5.2.1/tools/cmake/toolchain-esp32c3.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/Users/wenruohan/.espressif/python_env/idf5.2_py3.11_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out" "-DCMAKE_C_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf" "-DCMAKE_CXX_FLAGS= -march=rv32imc_zicsr_zifencei -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf" "-DCMAKE_ASM_FLAGS=  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf"
  -- Found Git: /opt/homebrew/bin/git (found version "2.43.0")
  -- The C compiler identification is GNU 13.2.0
  -- The CXX compiler identification is GNU 13.2.0
  -- The ASM compiler identification is GNU
  -- Found assembler: /Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc
  -- Check for working C compiler: /Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc - broken
  -- Configuring incomplete, errors occurred!
  See also "/Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out/build/CMakeFiles/CMakeOutput.log".
  See also "/Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  Build configuration: BuildConfig {
      esp_idf_tools_install_dir: Some(
          Global,
      ),
      esp_idf_sdkconfig: None,
      esp_idf_sdkconfig_defaults: None,
      mcu: Some(
          "esp32c3",
      ),
      native: NativeConfig {
          esp_idf_version: Some(
              Tag(
                  "v5.2.1",
              ),
          ),
          esp_idf_repository: None,
          esp_idf_cmake_generator: None,
          idf_path: None,
          extra_components: [],
          esp_idf_components: None,
          esp_idf_component_manager: None,
      },
      esp_idf_sys_root_crate: None,
  }
  Using managed esp-idf repository: RemoteSdk { repo_url: None, git_ref: Tag("v5.2.1") }
  Using esp-idf v5.2.1 at '/Users/wenruohan/.espressif/esp-idf/v5.2.1'
  CMake Error at /Users/wenruohan/.espressif/tools/cmake/3.24.0/CMake.app/Contents/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out/build/CMakeFiles/CMakeTmp

      Run Build Command(s):/Users/wenruohan/.espressif/tools/ninja/1.11.1/ninja cmTC_cc7ce && [1/2] Building C object CMakeFiles/cmTC_cc7ce.dir/testCCompiler.c.obj
      FAILED: CMakeFiles/cmTC_cc7ce.dir/testCCompiler.c.obj
      /Users/wenruohan/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc   -march=rv32imc_zicsr_zifencei  -ffunction-sections -fdata-sections --target=riscv32imc_zicsr_zifencei-esp-espidf -o CMakeFiles/cmTC_cc7ce.dir/testCCompiler.c.obj -c /Users/wenruohan/esp32-demo/target/riscv32imc-esp-espidf/debug/build/esp-idf-sys-33e429dfc052fdca/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      riscv32-esp-elf-gcc: error: unrecognized command-line option '--target=riscv32imc_zicsr_zifencei-esp-espidf'
      ninja: build stopped: subcommand failed.





    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    /Users/wenruohan/.espressif/esp-idf/v5.2.1/tools/cmake/project.cmake:506 (__project)
    CMakeLists.txt:28 (project)


  thread 'main' panicked at /Users/wenruohan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  command did not execute successfully, got: exit status: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Here is my config.toml
image

@Vollbrecht
Copy link
Collaborator

duplicate of #287
current workaround add CRATE_CC_NO_DEFAULTS=1 inside your Cargo.toml [env] section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants