Skip to content

French accent unsupported in filepath #98511

@paulmialane

Description

@paulmialane

Describe the bug

Summary:
When an é is present in the file path, the build of a module fails, and CMake returns the following error:

CMake Error at /home/paulm/zephyr/zephyr/cmake/modules/extensions.cmake:465 (add_library):
  The target name
  "..__..__..__..__tmp__dir_with_é__dummy__dummy_module__zephyr" is reserved
  or not valid for certain CMake features, such as generator expressions, and
  may result in undefined behavior.
Call Stack (most recent call first):
  /home/paulm/zephyr/zephyr/cmake/modules/extensions.cmake:434 (zephyr_library_named)
  dummy_module/zephyr/CMakeLists.txt:6 (zephyr_library)


CMake Error at /home/paulm/zephyr/zephyr/cmake/modules/extensions.cmake:536 (target_sources):
  Cannot specify sources for target
  "..__..__..__..__tmp__dir_with_é__dummy__dummy_module__zephyr" which is
  not built by this project.
Call Stack (most recent call first):
  dummy_module/zephyr/CMakeLists.txt:7 (zephyr_library_sources)

Regression

  • This is a regression.

Steps to reproduce

Reproducer:

  1. Create a project in /tmp/dir_with_é/dummy
  2. Create a module dummy_module
  3. Try to build

File tree from /tmp/dir_with_é/dummy:
.
├── CMakeLists.txt
├── dummy_module
│   └── zephyr
│   ├── CMakeLists.txt
│   ├── dummy.c
│   ├── dummy.h
│   ├── Kconfig
│   └── module.yml
├── prj.conf
└── src
└── main.c

Relevant log output

$ west build -b disco_l475_iot1
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /tmp/dir_with_é/dummy
-- CMake version: 4.1.2
-- Found Python3: /home/paulm/zephyr/venv/bin/python3 (found suitable version "3.13.7", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /home/paulm/.cache/zephyr
-- Zephyr version: 4.2.99 (/home/paulm/zephyr/zephyr)
-- Found west (found suitable version "1.5.0", minimum required is "0.14.0")
-- Board: disco_l475_iot1, qualifiers: stm32l475xx
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.4 (/home/paulm/zephyr-sdk-0.17.4)
-- Found toolchain: zephyr 0.17.4 (/home/paulm/zephyr-sdk-0.17.4)
-- Found Dtc: /home/paulm/zephyr-sdk-0.17.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
-- Found BOARD.dts: /home/paulm/zephyr/zephyr/boards/st/disco_l475_iot1/disco_l475_iot1.dts
-- Generated zephyr.dts: /tmp/dir_with_é/dummy/build/zephyr/zephyr.dts
-- Generated pickled edt: /tmp/dir_with_é/dummy/build/zephyr/edt.pickle
-- Generated devicetree_generated.h: /tmp/dir_with_é/dummy/build/zephyr/include/generated/zephyr/devicetree_generated.h
Parsing /home/paulm/zephyr/zephyr/Kconfig
Loaded configuration '/home/paulm/zephyr/zephyr/boards/st/disco_l475_iot1/disco_l475_iot1_defconfig'
Merged configuration '/tmp/dir_with_é/dummy/prj.conf'
Configuration saved to '/tmp/dir_with_é/dummy/build/zephyr/.config'
Kconfig header saved to '/tmp/dir_with_é/dummy/build/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/paulm/zephyr-sdk-0.17.4/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/paulm/zephyr-sdk-0.17.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Using ccache: /usr/bin/ccache
CMake Error at /home/paulm/zephyr/zephyr/cmake/modules/extensions.cmake:465 (add_library):
  The target name
  "..__..__..__..__tmp__dir_with_é__dummy__dummy_module__zephyr" is reserved
  or not valid for certain CMake features, such as generator expressions, and
  may result in undefined behavior.
Call Stack (most recent call first):
  /home/paulm/zephyr/zephyr/cmake/modules/extensions.cmake:434 (zephyr_library_named)
  dummy_module/zephyr/CMakeLists.txt:6 (zephyr_library)


CMake Error at /home/paulm/zephyr/zephyr/cmake/modules/extensions.cmake:536 (target_sources):
  Cannot specify sources for target
  "..__..__..__..__tmp__dir_with_é__dummy__dummy_module__zephyr" which is
  not built by this project.
Call Stack (most recent call first):
  dummy_module/zephyr/CMakeLists.txt:7 (zephyr_library_sources)


-- Found gen_kobject_list: /home/paulm/zephyr/zephyr/scripts/build/gen_kobject_list.py
-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/home/paulm/zephyr/venv/bin/python3 '-B/tmp/dir_with_é/dummy/build' -GNinja -DBOARD=disco_l475_iot1 '-S/tmp/dir_with_é/dummy'

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

System: Arch Linux
CMake version: 4.1.2
West version: v1.5.0
Zephyr version: 4.2.99

Additional Context

I'm no expert in Zephyr, just encountered this bug twice in my life. Once 2 years ago on Ubuntu, and a few days ago on Arch Linux. Only appears when using a home-made module. If you remove the dummy_module, it compiles.

I know it is probably better to avoid accent in paths, but some people might have some in them, and it's pretty frustrating when it doesn't compile because of this.

I don't use CMake outside of Zephyr, so I figured out it would be better to post this here.

Feel free to ask me any more details on my config if needed.

Metadata

Metadata

Assignees

Labels

area: Build SystembugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions