zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.08k stars 6.2k forks source link

LZ4 compression sample should explain how to install optional lz4 module #71970

Open afeinman-snap opened 2 months ago

afeinman-snap commented 2 months ago

Describe the bug Building lz4 sample seems broken after v3.4.0 regardless of platform Build complains of missing lz4.h

/home/user/zephyrproject/zephyr/samples/compression/lz4/src/main.c:11:10: fatal error: lz4.h: No such file or directory
   11 | #include "lz4.h"
      |          ^~~~~~~
compilation terminated.

Git bisect point to the commit f30f08a3ce75ae7d7384a7608b7e3dcef804661a where submodules were made optional

To Reproduce Steps to reproduce the behavior:

  1. cd ~/zephyrproject/zephyr/samples/compression/lz4
  2. west build -b qemu_x86 --pristine
  3. See error

Additionally the cmake phase prints:

warning: LZ4 (defined at modules/lz4/Kconfig:7) was assigned the value 'y' but got the value 'n'.
Check these unsatisfied dependencies: 0 (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LZ4 and/or look up LZ4 in the

This warning is pretty much useless. What is dependency 0? How to deal with it? In menuconfig interface it is impossible to enable LZ4 option either

Expected behavior If the optional module needs to be somehow enabled, a message should be displayed in kconfig phase (probably by config script)

Impact So far I could not find a way to build this sample in v3.5.0+. Nothing that I could see in the documentation either.

Logs and console output If applicable, add console logs or other types of debug information e.g Wireshark capture or Logic analyzer capture (upload in zip archive). copy-and-paste text and put a code fence (```) before and after, to help explain the issue. (if unable to obtain text log, add a screenshot)

Environment (please complete the following information):

github-actions[bot] commented 2 months ago

Hi @afeinman-snap! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

kartben commented 2 months ago

LZ4 is indeed an optional module now, you need to do the following to enable it:

west config manifest.project-filter -- +lz4
west update

Would you be able to please send a PR to update the README along the same lines as e.g. https://docs.zephyrproject.org/latest/samples/modules/tflite-micro/hello_world/README.html#building-and-running ?

afeinman-snap commented 2 months ago

Would you be able to please send a PR to update the README

Yes, will do. Thank you for the hint

Yaxit commented 1 month ago

This method of installing the optional module did not work for me. After I rerun west update the module is not pulled and I still cannot run the example. I could instead download the module by passing the project filter as an argument to west update Regardless, even if the module is downloaded, I still get the Kconfig error and the module is not added to the build. Am I missing some steps?