Closed noahbliss closed 1 year ago
Do you mind expanding the commands that you used? So I can try to reproduce the issue. From the logs I suppose that you are trying to build esp-idf-template
for esp32s3.
Hey @SergioGasquez I don't have all of the exact commands, but what you assume I did is more or less on-the-money.
System context:
M1 Mac
colima with docker tools installed via brew.
custom docker invocation script, uses a shared volume with the esp-idf-template
(for std) as you mentioned.
Nothing else really special. I start the container, cd to the directory, run cargo build
, it chugs along fine for a while compiling other crates, chews on esp-idf-sys
for a while then spits this error.
The exact same git repo/code running on x64 Linux compiles with no issues.
Just did a small test on my M1 mac with docker and had no issue, here is what I did:
$ docker pull espressif/idf-rust:esp32s3_latest
$ docker run -it --rm -u esp espressif/idf-rust:esp32s3_latest
docker$ cargo install cargo-generate
docker$ USER=esp cargo generate esp-rs/esp-idf-template cargo --name test -d mcu=esp32s3 -d advanced=false
docker$ cd test
docker$ cargo build
....
Finished dev [optimized + debuginfo] target(s) in 2m 57s
@SergioGasquez thanks for testing this. I'll repeat your steps, if I also have no issues, then I suspect this may be stemming from the volume mount and will investigate that deeper. Thanks!
Is there a way to change the path where the .cargo and .embuild directories are created?
Hmmm it thickens.
I attempted to effectively "move" .embuild into the container fs by running
export ESP_IDF_TOOLS_INSTALL_DIR=global
prior to running cargo build
.
It seems that this does install the IDF tools to the container's home directory, but later in the build process, I still receive an error which points to a path inside the workspace directory which now no longer exists rather than to the file which is present in the ~ directory. Any thoughts?
This is the snippet including the error now:
[esp-idf-sys 0.33.3] CMAKE_xtensa_esp32s3_espidf = None
[esp-idf-sys 0.33.3] TARGET_CMAKE = None
[esp-idf-sys 0.33.3] CMAKE = None
[esp-idf-sys 0.33.3] running: cd "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/home/esp/.espressif/esp-idf/v5.1.1" IDF_TARGET="esp32s3" IDF_TOOLS_PATH="/home/esp/.espressif" PATH="/home/esp/.espressif/tools/cmake/3.24.0/bin:/home/esp/.espressif/python_env/idf5.1_py3.11_env/bin:/home/esp/.espressif/esp-idf/v5.1.1/tools:/home/esp/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/home/esp/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/home/esp/.rustup/toolchains/esp/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/esp/.cargo/bin" PROJECT_DIR="/mnt/code" SDKCONFIG_DEFAULTS="/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/gen-sdkconfig.defaults;/mnt/code/sdkconfig.defaults" "cmake" "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out" "-G" "Unix Makefiles" "-DCMAKE_TOOLCHAIN_FILE=/home/esp/.espressif/esp-idf/v5.1.1/tools/cmake/toolchain-esp32s3.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/home/esp/.espressif/python_env/idf5.1_py3.11_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out" "-DCMAKE_C_FLAGS= -mlongcalls -ffunction-sections -fdata-sections" "-DCMAKE_CXX_FLAGS= -mlongcalls -ffunction-sections -fdata-sections" "-DCMAKE_ASM_FLAGS= -mlongcalls -ffunction-sections -fdata-sections"
[esp-idf-sys 0.33.3] CMake Error at build/CMakeFiles/3.24.0/CMakeSystem.cmake:6 (include):
[esp-idf-sys 0.33.3] include could not find requested file:
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3] /mnt/code/.embuild/espressif/esp-idf/v5.1.1/tools/cmake/toolchain-esp32s3.cmake
[esp-idf-sys 0.33.3] Call Stack (most recent call first):
[esp-idf-sys 0.33.3] /home/esp/.espressif/esp-idf/v5.1.1/tools/cmake/project.cmake:448 (__project)
[esp-idf-sys 0.33.3] CMakeLists.txt:28 (project)
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3] -- The C compiler identification is GNU 12.2.0
[esp-idf-sys 0.33.3] -- The CXX compiler identification is GNU 12.2.0
[esp-idf-sys 0.33.3] -- The ASM compiler identification is GNU
[esp-idf-sys 0.33.3] -- Found assembler: /usr/bin/cc
[esp-idf-sys 0.33.3] -- Detecting C compiler ABI info
[esp-idf-sys 0.33.3] CMake Error at /mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build/CMakeFiles/3.24.0/CMakeSystem.cmake:6 (include):
[esp-idf-sys 0.33.3] include could not find requested file:
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3] /mnt/code/.embuild/espressif/esp-idf/v5.1.1/tools/cmake/toolchain-esp32s3.cmake
[esp-idf-sys 0.33.3] Call Stack (most recent call first):
[esp-idf-sys 0.33.3] /mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build/CMakeFiles/CMakeTmp/CMakeLists.txt:4 (project)
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3] CMake Error at /home/esp/.espressif/tools/cmake/3.24.0/share/cmake-3.24/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
[esp-idf-sys 0.33.3] Failed to configure test project build system.
[esp-idf-sys 0.33.3] Call Stack (most recent call first):
[esp-idf-sys 0.33.3] /home/esp/.espressif/tools/cmake/3.24.0/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
[esp-idf-sys 0.33.3] /home/esp/.espressif/esp-idf/v5.1.1/tools/cmake/project.cmake:448 (__project)
[esp-idf-sys 0.33.3] CMakeLists.txt:28 (project)
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3] -- Configuring incomplete, errors occurred!
[esp-idf-sys 0.33.3] See also "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build/CMakeFiles/CMakeOutput.log".
[esp-idf-sys 0.33.3] See also "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build/CMakeFiles/CMakeError.log".
[esp-idf-sys 0.33.3] thread 'main' panicked at /home/esp/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3] command did not execute successfully, got: exit status: 1
[esp-idf-sys 0.33.3]
[esp-idf-sys 0.33.3] build script failed, must exit now
[esp-idf-sys 0.33.3] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `esp-idf-sys v0.33.3`
Caused by:
process didn't exit successfully: `/mnt/code/target/debug/build/esp-idf-sys-7a89f24be9931daf/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
IDF_PYTHON_ENV_PATH=/home/esp/.espressif/python_env/idf5.1_py3.11_env
ESP_IDF_VERSION=5.1
PATH=/home/esp/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/home/esp/.espressif/tools/cmake/3.24.0/bin:/home/esp/.espressif/python_env/idf5.1_py3.11_env/bin:/home/esp/.espressif/esp-idf/v5.1.1/tools:$PATH
IDF_DEACTIVATE_FILE_PATH=/tmp/tmpwpuwvttyidf_1101
Current system platform: linux-arm64
Skipping xtensa-esp32s3-elf@esp-12.2.0_20230208 (already installed)
Skipping cmake@3.24.0 (already installed)
IDF_PYTHON_ENV_PATH=/home/esp/.espressif/python_env/idf5.1_py3.11_env
ESP_IDF_VERSION=5.1
PATH=/home/esp/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/home/esp/.espressif/tools/cmake/3.24.0/bin:/home/esp/.espressif/python_env/idf5.1_py3.11_env/bin:/home/esp/.espressif/esp-idf/v5.1.1/tools:$PATH
IDF_DEACTIVATE_FILE_PATH=/tmp/tmpnv149go7idf_1101
cargo:rerun-if-changed=/mnt/code/sdkconfig.defaults
CMAKE_PREFIX_PATH_xtensa-esp32s3-espidf = None
CMAKE_PREFIX_PATH_xtensa_esp32s3_espidf = None
TARGET_CMAKE_PREFIX_PATH = None
CMAKE_PREFIX_PATH = None
CMAKE_xtensa-esp32s3-espidf = None
CMAKE_xtensa_esp32s3_espidf = None
TARGET_CMAKE = None
CMAKE = None
running: cd "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build" && CMAKE_PREFIX_PATH="" EXTRA_COMPONENT_DIRS="" IDF_COMPONENT_MANAGER="1" IDF_PATH="/home/esp/.espressif/esp-idf/v5.1.1" IDF_TARGET="esp32s3" IDF_TOOLS_PATH="/home/esp/.espressif" PATH="/home/esp/.espressif/tools/cmake/3.24.0/bin:/home/esp/.espressif/python_env/idf5.1_py3.11_env/bin:/home/esp/.espressif/esp-idf/v5.1.1/tools:/home/esp/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin:/home/esp/.rustup/toolchains/esp/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:/home/esp/.rustup/toolchains/esp/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/esp/.cargo/bin" PROJECT_DIR="/mnt/code" SDKCONFIG_DEFAULTS="/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/gen-sdkconfig.defaults;/mnt/code/sdkconfig.defaults" "cmake" "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out" "-G" "Unix Makefiles" "-DCMAKE_TOOLCHAIN_FILE=/home/esp/.espressif/esp-idf/v5.1.1/tools/cmake/toolchain-esp32s3.cmake" "-DCMAKE_BUILD_TYPE=" "-DPYTHON=/home/esp/.espressif/python_env/idf5.1_py3.11_env/bin/python" "-DCMAKE_INSTALL_PREFIX=/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out" "-DCMAKE_C_FLAGS= -mlongcalls -ffunction-sections -fdata-sections" "-DCMAKE_CXX_FLAGS= -mlongcalls -ffunction-sections -fdata-sections" "-DCMAKE_ASM_FLAGS= -mlongcalls -ffunction-sections -fdata-sections"
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Detecting C compiler ABI info
-- Configuring incomplete, errors occurred!
See also "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/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(
"esp32s3",
),
native: NativeConfig {
esp_idf_version: Some(
Tag(
"v5.1.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.1.1") }
Using esp-idf v5.1.1 at '/home/esp/.espressif/esp-idf/v5.1.1'
CMake Error at build/CMakeFiles/3.24.0/CMakeSystem.cmake:6 (include):
include could not find requested file:
/mnt/code/.embuild/espressif/esp-idf/v5.1.1/tools/cmake/toolchain-esp32s3.cmake
Call Stack (most recent call first):
/home/esp/.espressif/esp-idf/v5.1.1/tools/cmake/project.cmake:448 (__project)
CMakeLists.txt:28 (project)
CMake Error at /mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build/CMakeFiles/3.24.0/CMakeSystem.cmake:6 (include):
include could not find requested file:
/mnt/code/.embuild/espressif/esp-idf/v5.1.1/tools/cmake/toolchain-esp32s3.cmake
Call Stack (most recent call first):
/mnt/code/target/xtensa-esp32s3-espidf/debug/build/esp-idf-sys-67c3ebe566277a4d/out/build/CMakeFiles/CMakeTmp/CMakeLists.txt:4 (project)
CMake Error at /home/esp/.espressif/tools/cmake/3.24.0/share/cmake-3.24/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
Failed to configure test project build system.
Call Stack (most recent call first):
/home/esp/.espressif/tools/cmake/3.24.0/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
/home/esp/.espressif/esp-idf/v5.1.1/tools/cmake/project.cmake:448 (__project)
CMakeLists.txt:28 (project)
thread 'main' panicked at /home/esp/.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
esp@678ab5bdf6f9:/mnt/code$
Update: Issue appears to be resolved.
I found this issue comment (https://github.com/abiosoft/colima/issues/362#issuecomment-1564068063) which hinted that telling colima to use mac vz instead of qemu would help. I switched and now the build is completing and with far fewer errors. I did not switch to virtiofs as the comment suggests.
Thanks all, I'll close this now.
Hey all. I have an M1 Mac running a template build directory. When using the latest (the only version I have tried) version of the docker on dockerhub, the initial
cargo build
fails with the following error. Any ideas? Any details I need to provide in addition?Thanks!