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

tests/cmake/yaml/ is creating a bogus file in the source tree #79052

Open
aescolar opened this issue Sep 26, 2024 · 0 comments · May be fixed by #79062
Open

tests/cmake/yaml/ is creating a bogus file in the source tree #79052

aescolar opened this issue Sep 26, 2024 · 0 comments · May be fixed by #79062
Assignees
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug Regression Something, which was working, does not anymore

Comments

@aescolar
Copy link
Member

aescolar commented Sep 26, 2024

Describe the bug
Running the test tests/cmake/yaml/ creates a bogus file, with the extra bonus that its name is full of special characters:
tests/cmake/yaml/cmake:\n test:\n set:\n key-int: 42\n
The exact name properly escaping it is:
tests/cmake/yaml/'cmake:'$'\n'' test:'$'\n'' set:'$'\n'' key-int: 42'$'\n'
(yes, that is the file name)

To Reproduce
Steps to reproduce the behavior:

  1. mkdir build; cd build
  2. cmake -GNinja -DBOARD=native_sim ../tests/cmake/yaml/
  3. you can now admire your new file

Note: You can remove the file from ZEPHYR_BASE with
rm tests/cmake/yaml/'cmake:'$'\n'' test:'$'\n'' set:'$'\n'' key-int: 42'$'\n'

Expected behavior
No files created in the tree

Impact
An untracked file in the git tree, and confused developers

Logs and console output
N/A

Environment (please complete the following information):

  • OS: Linux, Ubuntu 24.04
  • Toolchain (e.g Zephyr SDK, ...): cmake 3.28.3
  • Commit SHA or Version used: main as of now da6b607

Additional context
Test introduced in 3382e28
The file is created during test_fail_missing_filename()

@aescolar aescolar added bug The issue is a bug, or the PR is fixing a bug area: Build System labels Sep 26, 2024
@aescolar aescolar added the Regression Something, which was working, does not anymore label Sep 26, 2024
tejlmand added a commit to tejlmand/zephyr that referenced this issue Sep 26, 2024
Fixes: zephyrproject-rtos#79052

The yaml CMake tests overwrites `message()` in order to verify correct
error handling. This was original done in a function and then using
a return call when an expected error has been raised.
Using a function() means the `return()` only returns the `message()`
and thus wrongly continue processing rest of the yaml file.

Change `message()` to macro so the return call correctly returns from
the calling yaml functions.

Signed-off-by: Torsten Rasmussen <[email protected]>
@tejlmand tejlmand linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug Regression Something, which was working, does not anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants