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

build step for 'chip_gn' failed No such file or directory (CON-1419) #1157

Open
North3rnL1ght opened this issue Nov 17, 2024 · 7 comments
Open

Comments

@North3rnL1ght
Copy link

Describe the bug
I downloaded and installed ESP-IDF and ESP-Matter for apple/swift-matter-examples. I used the installation tutorial they provided. But for some reason I can't build the example for the smart-light. I even tried the examples provided inside the esp-matter folder but I always recive the following error during Build.

[702/1257] Performing build step for 'chip_gn'
FAILED: esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-build esp-idf/chip/lib/libCHIP.a /Users/account/esp-matter/examples/light/build/esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-build /Users/account/esp-matter/examples/light/build/esp-idf/chip/lib/libCHIP.a 
cd "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip" && ninja esp32
/bin/sh: line 0: cd: /Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip: No such file or directory 

Environment

  • ESP-Matter Commit Id: 7b9d69a (grafted, HEAD -> release/v1.2, origin/release/v1.2)

  • ESP-IDF Commit Id: a322e6bdad4b6675d4597fb2722eea2851ba88cb (grafted, HEAD, tag: v5.2.1)

  • SoC (eg: ESP32 or ESP32-C3): ESP32-C6

  • Host Machine OS: MacOS 15.1 (24B83)

  • Host Machine Python version: 3.9.6

Any additional details
The Problem is that the build.ninja trys to execute the following command:

#############################################
# Custom command for esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-build

build esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-build esp-idf/chip/lib/libCHIP.a | ${cmake_ninja_workdir}esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-build ${cmake_ninja_workdir}esp-idf/chip/lib/libCHIP.a: CUSTOM_COMMAND esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-configure || esp-idf/chip/args_gn
  COMMAND = cd "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip" && ninja esp32
  DESC = Performing build step for 'chip_gn'
  restat = 1

Which results in "No such file or directory". When I manually edit the build.ninja file and remove the first PATH "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;" the build executes successfully. I don't know where it takes the first path from. Even tried reinstalling esp-matter and esp-idf but it didn't made any changes.

@github-actions github-actions bot changed the title build step for 'chip_gn' failed No such file or directory build step for 'chip_gn' failed No such file or directory (CON-1419) Nov 17, 2024
@xbrunosousa
Copy link

xbrunosousa commented Nov 18, 2024

I have the same problem here with esp-matter and swift-matter-examples,
and editing the command (replacing ; with " && cd ") resolved it.

Thanks! Let's wait for a fix.

@shubhamdp
Copy link
Contributor

@North3rnL1ght thanks for the detailed debugging, will see how this can be fixed.

On my mac, I am unable to reproduce this. I only see one path in build.ninja, not sure how that extra path added.
I'm using following gn, ninja, cmake, versions, can you please share your's.

$  esp-matter git:(7b9d69a) gn --version
2123 (5d8727f3fbf4)
$  esp-matter git:(7b9d69a) cmake --version
cmake version 3.30.0
$  esp-matter git:(7b9d69a) ninja --version
1.12.1

@North3rnL1ght
Copy link
Author

@shubhamdp I found this extra path inside the list of component path output on set-target for esp32c6.

Copied only some until the components/chip folder path occours!

-- Component paths: /Users/account/esp-matter/examples/common/app_bridge /Users/account/esp-matter/examples/common/app_reset /Users/account/esp-idf/components/app_trace /Users/account/esp-idf/components/app_update /Users/account/esp-idf/components/bootloader /Users/account/esp-idf/components/bootloader_support /Users/account/esp-idf/components/bt /Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip

The only different version is in cmake:

gn --version
2123 (5d8727f3fbf4)
cmake --version
cmake version 3.31.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
ninja --version
1.12.1

@nicolas-christe
Copy link

I have the same issue, fixed by rolling back cmake from 3.31.0 to 3.30.5.

shubhamdp added a commit to shubhamdp/connectedhomeip that referenced this issue Nov 22, 2024
remove the WORKING_DIRECTORY from chip_gn target

For cmake v3.31.x, custom command generated for chip_gn-build in
build.ninja concats the $WORKING_DIRECTORY and $BUILD_DIR paths and
it mess up the chip_gn step when building example.
    COMMAND = cd "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip" && ninja esp32

For cmake version prior to v3.31, it do not prepend the
$WORKING_DIRECTORY path.
    COMMAND = cd /Users/account/esp-matter/examples/light/build/esp-idf/chip && ninja esp32

This could be becuase of Kitware/CMake@f5f8030

related issue - espressif/esp-matter#1157
@shubhamdp
Copy link
Contributor

@nicolas-christe thanks for the tip. Please check if project-chip/connectedhomeip#36606 can fix the problem with cmake v3.31.x. You can apply the PR by running following command in esp-matter.

curl https://patch-diff.githubusercontent.com/raw/project-chip/connectedhomeip/pull/36606.patch | git -C connectedhomeip/connectedhomeip am

@nicolas-christe
Copy link

Thanks @shubhamdp, I confirm that the patch works for me with both cmake 3.30.5 and 3.31.0.

@North3rnL1ght
Copy link
Author

@shubhamdp thank you very much. Patch works for me as well on cmake 3.31.0 👍

mergify bot pushed a commit to project-chip/connectedhomeip that referenced this issue Nov 22, 2024
remove the WORKING_DIRECTORY from chip_gn target

For cmake v3.31.x, custom command generated for chip_gn-build in
build.ninja concats the $WORKING_DIRECTORY and $BUILD_DIR paths and
it mess up the chip_gn step when building example.
    COMMAND = cd "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip" && ninja esp32

For cmake version prior to v3.31, it do not prepend the
$WORKING_DIRECTORY path.
    COMMAND = cd /Users/account/esp-matter/examples/light/build/esp-idf/chip && ninja esp32

This could be becuase of Kitware/CMake@f5f8030

related issue - espressif/esp-matter#1157
shubhamdp added a commit to shubhamdp/connectedhomeip that referenced this issue Nov 25, 2024
…ip#36606)

remove the WORKING_DIRECTORY from chip_gn target

For cmake v3.31.x, custom command generated for chip_gn-build in
build.ninja concats the $WORKING_DIRECTORY and $BUILD_DIR paths and
it mess up the chip_gn step when building example.
    COMMAND = cd "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip" && ninja esp32

For cmake version prior to v3.31, it do not prepend the
$WORKING_DIRECTORY path.
    COMMAND = cd /Users/account/esp-matter/examples/light/build/esp-idf/chip && ninja esp32

This could be becuase of Kitware/CMake@f5f8030

related issue - espressif/esp-matter#1157
shgutte pushed a commit to shgutte/connectedhomeip that referenced this issue Nov 25, 2024
…ip#36606)

remove the WORKING_DIRECTORY from chip_gn target

For cmake v3.31.x, custom command generated for chip_gn-build in
build.ninja concats the $WORKING_DIRECTORY and $BUILD_DIR paths and
it mess up the chip_gn step when building example.
    COMMAND = cd "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip" && ninja esp32

For cmake version prior to v3.31, it do not prepend the
$WORKING_DIRECTORY path.
    COMMAND = cd /Users/account/esp-matter/examples/light/build/esp-idf/chip && ninja esp32

This could be becuase of Kitware/CMake@f5f8030

related issue - espressif/esp-matter#1157
andy31415 pushed a commit to project-chip/connectedhomeip that referenced this issue Nov 25, 2024
…36631)

remove the WORKING_DIRECTORY from chip_gn target

For cmake v3.31.x, custom command generated for chip_gn-build in
build.ninja concats the $WORKING_DIRECTORY and $BUILD_DIR paths and
it mess up the chip_gn step when building example.
    COMMAND = cd "/Users/account/esp-matter/connectedhomeip/connectedhomeip/config/esp32/components/chip;/Users/account/esp-matter/examples/light/build/esp-idf/chip" && ninja esp32

For cmake version prior to v3.31, it do not prepend the
$WORKING_DIRECTORY path.
    COMMAND = cd /Users/account/esp-matter/examples/light/build/esp-idf/chip && ninja esp32

This could be becuase of Kitware/CMake@f5f8030

related issue - espressif/esp-matter#1157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants