-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
[linux] Driver component no longer builds (IDFGH-9375) #10749
Comments
Hi @higaski As mentioned here,
to you project CMake file, which would allow you to link the driver (mock) component. If you describe what you are trying to achieve by linking the |
I just need the driver headers to not brick a x86 build, that's all. I've previously been using a combination of the following two lines: list(APPEND EXTRA_COMPONENT_DIRS tests $ENV{IDF_PATH}/tools/mocks/driver) and idf_component_register(
...
REQUIRES
driver
...
) But that stopped working during the last couple of weeks. It produces the following CMake error [0/1] Re-running CMake...-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target linux
-- building DRIVER MOCKS (only SPI, I2C and GPIO driver)
-- Project sdkconfig file /home/vinci/Develop/VSCode/hello_world_linux_compatible/sdkconfig
-- building DRIVER MOCKS (only SPI, I2C and GPIO driver)
CMake Error at /home/vinci/esp/esp-idf/tools/cmake/component.cmake:313 (message):
Include directory
'/home/vinci/esp/esp-idf/components/driver/include/driver' is not a
directory.
Call Stack (most recent call first):
/home/vinci/esp/esp-idf/tools/cmake/component.cmake:481 (__component_add_include_dirs)
/home/vinci/esp/esp-idf/tools/cmake/component.cmake:558 (idf_component_register)
/home/vinci/esp/esp-idf/tools/mocks/driver/CMakeLists.txt:15 (idf_component_mock)
-- Configuring incomplete, errors occurred!
See also "/home/vinci/Develop/VSCode/hello_world_linux_compatible/build/CMakeFiles/CMakeOutput.log".
FAILED: build.ninja Probably the folder structure of the component has changed but no one thought to adjust the mock? The driver mock components CMake sets an include_dirs variable like this set(include_dirs
"${original_driver_dir}/include"
"${original_driver_dir}/include/driver"
"${CMAKE_CURRENT_SOURCE_DIR}/../hal/include"
"${CMAKE_CURRENT_SOURCE_DIR}/../esp_hw_support/include") But the "/include/driver" folder doesn't seem to exist at the current master? |
You are right, someone recently reorganized the driver and broke this. We'll take a look at it. Meanwhile, another option when building for the linux target is to make requirements dynamic depending on the target, e.g. something like:
Of course, this may require some changes to your component as well if you are including/calling any of the driver functions. |
|
Works for me with Make sure to run |
AFAIK there is no esp_mm mock? |
Still works for me as well. Can you provide a bit more details what you are doing? E.g. which hello world example? Linux or the normal one? Any modifications other than what you mentioned? |
Answers checklist.
IDF version.
v5.1-dev-3296-g76433e4cb2
Operating System used.
Linux
How did you build your project?
Command line with CMake
If you are using Windows, please specify command line type.
None
What is the expected behavior?
The driver component no longer builds when setting
linux
as target.What is the actual behavior?
CMake produces an error when trying to build the project
Steps to reproduce.
idf_component_register(SRCS "hello_world_main.c" INCLUDE_DIRS "" REQUIRES driver)
Build or installation Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: