-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Fix idf_as_lib example (IDFGH-14655) #15401
base: master
Are you sure you want to change the base?
Conversation
👋 Hello Dazza0, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Hello @Dazza0 ,
What makes you believe the permissions are incorrect? When symlinks are checked out into the working directory by git, they will have $ git ls-tree HEAD .
100644 blob 53a0188134242bc8972b3dbc9f659d9ccd7fdba4 CMakeLists.txt
100644 blob 0cc5619a9ff85aaac6d064fa2f938cf7cd71b946 README.md
120000 blob c07a74de4fb4ebbad5a9b84a5a7b68e4f489a6e0 build-esp32.sh
120000 blob c07a74de4fb4ebbad5a9b84a5a7b68e4f489a6e0 build-esp32c2.sh
120000 blob c07a74de4fb4ebbad5a9b84a5a7b68e4f489a6e0 build-esp32c3.sh
120000 blob c07a74de4fb4ebbad5a9b84a5a7b68e4f489a6e0 build-esp32c6.sh
120000 blob c07a74de4fb4ebbad5a9b84a5a7b68e4f489a6e0 build-esp32h2.sh
100644 blob 9a18dc76db01b2cdc16aa7dc7638be16a1ce176b build-esp32p4.sh
120000 blob c07a74de4fb4ebbad5a9b84a5a7b68e4f489a6e0 build-esp32s2.sh
120000 blob c07a74de4fb4ebbad5a9b84a5a7b68e4f489a6e0 build-esp32s3.sh
100755 blob 9a18dc76db01b2cdc16aa7dc7638be16a1ce176b build.sh
100644 blob 379147fc5e2f1f03613b39bfdc081e9376280c70 main.c
100755 blob 3d9e0bfba5e5d5a76511ed3e3d6efc77a68bf6e2 run-esp32.sh
120000 blob cde8585ed41a85676c5b731a0dec1ebccbfca15b run-esp32c2.sh
120000 blob cde8585ed41a85676c5b731a0dec1ebccbfca15b run-esp32c3.sh
120000 blob cde8585ed41a85676c5b731a0dec1ebccbfca15b run-esp32c6.sh
120000 blob cde8585ed41a85676c5b731a0dec1ebccbfca15b run-esp32h2.sh
100644 blob 3d9e0bfba5e5d5a76511ed3e3d6efc77a68bf6e2 run-esp32p4.sh
120000 blob cde8585ed41a85676c5b731a0dec1ebccbfca15b run-esp32s2.sh
120000 blob cde8585ed41a85676c5b731a0dec1ebccbfca15b run-esp32s3.sh
100755 blob f7747ac0285770f56cbff59e43665143af1999ed run.sh
040000 tree c50e046662674434f403ceea2c60f187aa170fd9 stubs Are all the script-related changes stemming from this issue? I believe converting the
I believe this issue arises from converting the symlinks into regular files. When
Again, I believe this is needed just because the symlinks are changed to regular files. The base scripts, e.g., I might be overlooking something, but the sole issue I notice with the scripts and permissions seems to be related to the Thank you very much |
The build-esp32p4.sh and run-esp32p4.sh scripts are not symbolic links to the base scripts, leading to a "permission denied" error. This commit changes their types to symbolic links, in line with the other targets.
Example linux build of the example demonstrates "esp32" and "spi_flash" stub libraries (roughly analogous to "esp_system" and "spi_flash" components). This commit moves the "flash_ops.c" file to the "spi_flash" stub library as it is a flash related funciton. Also renamed the header to "esp_flash.h" (in order to match current header name in IDF). This is a prerequisite to fixing the linux build of this example.
The Linux build was broken after IDF flash API was updated without updating the Linux stub library in the example. This commit updates the spi_flash stub library such that: - The API now matches same API as IDF's spi_flash component - Links the stub_esp32 library to pull in basic types and defines
154f9e8
to
3b28818
Compare
@fhrbata Thanks for the quick review Regarding the symbolic links, I think you're correct. The existing symbolic link implementation works fine when I tried it on a different machine. The issue was probably on my end (maybe something to do with |
Hello @Dazza0 , thank you very much for updating the PR and this fix. LGTM! |
sha=3b28818ba4f1c0ace850ddd893cf28bcf71f2407 |
Description
The current
idf_as_lib
example doesn't work out of the box for target and Linux builds. This PR fixes the following issues with the example:git ls-files -s
shows*.sh
files have a file mode of120000
(non-executable symbolic link). Replaced with file mode100755
build-esp32.sh
) need to call base scripts (e.g.,build.sh
) as source, otherwise the current argument parsing doesn't work.esp_flash_get_size()
). However the Linuxstub_spi_flash
library still uses the legacy API (i.e.,spi_flash_get_chip_size()
). Updatedstub_spi_flash
to provideesp_flash_get_size()
.On a related note, the example would probably be more clear if did away with the build and run bash scripts, and just required uses to call the underlying
cmake .. -GNinja
command directly. This workflow is more inline with the intended use case of this example (i.e., integrating IDF into an existing CMake project). Likewise, doing away with the linux stubs and providing an example of how to integrate the IDF Linux simulator into an existing CMake project would be more clear. However, these points can be addressed in a separate PR (if at all).Related
Testing
./build-esp32.sh
andrun-esp32.sh
to test example for a real target./build.sh
andrun.sh
to test example for Linux simulator targetChecklist
Before submitting a Pull Request, please ensure the following: