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

twister: problem with build specific samples on Windows OS #41929

Closed
gopiotr opened this issue Jan 18, 2022 · 0 comments · Fixed by #41930
Closed

twister: problem with build specific samples on Windows OS #41929

gopiotr opened this issue Jan 18, 2022 · 0 comments · Fixed by #41930
Assignees
Labels
area: Twister Twister bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@gopiotr
Copy link
Collaborator

gopiotr commented Jan 18, 2022

Describe the bug
During building samples or tests by Twister on Windows OS some of them cannot be build due to the fact, that path of directories created for build place is too long. This problem is connected with path limit on Windows OS, which can be remove (since Windows 10) but it seems that still some programs like CMake has problem with such limit. This problem do not occur, when those samples and tests are built by west tool (path of build directory is shorter).

To Reproduce
Steps to reproduce the behavior:

  1. Run Twister on Windows by following command:
python scripts\twister --outdir C:\tb --ninja -p nrf5340dk_nrf5340_cpuapp -T samples/subsys/portability/cmsis_rtos_v1/timer_synchronization
  1. Observe build failure (CMake cannot find necessary files in C:\tb\nrf5340dk_nrf5340_cpuapp\samples\subsys\portability\cmsis_rtos_v1\timer_synchronization\sample.portability.cmsis_rtos_v1.timer_synchronization build directory).
  2. Problem do not exist, when name of testscenario in sample.yaml file is changed artificially to x.y.z. This cause, that path of build directory is shorter: C:\tb\nrf5340dk_nrf5340_cpuapp\samples\subsys\portability\cmsis_rtos_v1\timer_synchronization\x.y.z.
  3. Problem also do not exist when this sample is built by west by command (in this case build directory path is also shorter: C:\zephyrproject\zephyr\build)
west build -p always -b nrf5340dk_nrf5340_cpuapp samples/subsys/portability/cmsis_rtos_v1/timer_synchronization
  1. The same problem can be observed for example on following samples or tests when they are built on nrf5340dk_nrf5340_cpuapp_ns, nrf5340dk_nrf5340_cpuapp or nrf5340dk_nrf5340_cpunet:
sample/test path testscenario name
samples/subsys/portability/cmsis_rtos_v1/timer_synchronization sample.portability.cmsis_rtos_v1.timer_synchronization
samples/subsys/portability/cmsis_rtos_v2/timer_synchronization sample.portability.cmsis_rtos_v2.timer_synchronization
samples/subsys/portability/cmsis_rtos_v1/philosophers sample.portability.cmsis_rtos_v1.philosopher.semaphores
samples/subsys/portability/cmsis_rtos_v2/philosophers sample.portability.cmsis_rtos_v2.philosopher.semaphores
samples/net/sockets/dumb_http_server sample.net.sockets.dumb_http_server.netusb_zeroconf
tests/lib/newlib/thread_safety libraries.libc.newlib_nano.thread_safety.userspace.stress
samples/boards/nrf/mesh/onoff_level_lighting_vnd_app ​ sample.bluetooth.mesh.onoff_level_lighting_vnd.mcumgr
tests/drivers/clock_control/nrf_lf_clock_start all 8 testscenarios

Expected behavior
The path length of sample or test or testscenario name should not impact on build result.

Impact
Twister cannot be used to build all samples or tests on Windows OS

Environment (please complete the following information):

  • OS: Windows 10
  • Toolchain: GNU Arm Embedded
  • CMake: version 3.21.3
  • Commit SHA: c025abd

Additional context
I already have proposition for fix this bug and I will create PR soon

@gopiotr gopiotr added the bug The issue is a bug, or the PR is fixing a bug label Jan 18, 2022
@gopiotr gopiotr added the area: Twister Twister label Jan 18, 2022
@nashif nashif self-assigned this Jan 18, 2022
@nashif nashif assigned gopiotr and unassigned nashif Jan 20, 2022
@nashif nashif added the priority: low Low impact/importance bug label Jan 24, 2022
gopiotr added a commit to gopiotr/zephyr that referenced this issue Feb 7, 2022
Add possibility to create shorter build paths when --short-build-path
option is enabled. This can help during run Twister on Windows OS and
building programs by CMake which has a problem when paths with building
files are too long. The solution based on symbolic links which help to
connect "traditional" long paths with shorther one like:
"twister_links/test_0".

Fixes zephyrproject-rtos#41929

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
gopiotr added a commit to gopiotr/zephyr that referenced this issue Feb 17, 2022
Add possibility to create shorter build paths when --short-build-path
option is enabled. This can help during run Twister on Windows OS and
building programs by CMake which has a problem when paths with building
files are too long. The solution based on symbolic links which help to
connect "traditional" long paths with shorter one like:
"twister_links/test_0".

Fixes zephyrproject-rtos#41929

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
nashif pushed a commit that referenced this issue Feb 22, 2022
Add possibility to create shorter build paths when --short-build-path
option is enabled. This can help during run Twister on Windows OS and
building programs by CMake which has a problem when paths with building
files are too long. The solution based on symbolic links which help to
connect "traditional" long paths with shorter one like:
"twister_links/test_0".

Fixes #41929

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
andrea-pallini pushed a commit to andrea-pallini/zephyr that referenced this issue Feb 23, 2022
Add possibility to create shorter build paths when --short-build-path
option is enabled. This can help during run Twister on Windows OS and
building programs by CMake which has a problem when paths with building
files are too long. The solution based on symbolic links which help to
connect "traditional" long paths with shorter one like:
"twister_links/test_0".

Fixes zephyrproject-rtos#41929

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Twister Twister bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants