Skip to content

Spurious "No such file or directory" error when library's path contains post-ASCII characters #1239

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

Open
3 tasks done
PKGeorgiev opened this issue Dec 26, 2019 · 0 comments
Open
3 tasks done
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@PKGeorgiev
Copy link

PKGeorgiev commented Dec 26, 2019

Describe the problem

If a library is installed under a path that contains Cyrillic characters, Arduino CLI is unable to discover it.

Compilation of sketches with an #include directive for a header file of a valid library fails with a "No such file or directory" error.

To reproduce

$ arduino-cli version
arduino-cli.exe  Version: git-snapshot Commit: 4b70e023 Date: 2023-01-31T03:19:27Z

$ export ARDUINO_DIRECTORIES_USER="/tmp/arduino-cli-directories/мікроконтролер"

$ arduino-cli lib install Arduino_JSON

[...]

$ mkdir /tmp/FooSketch

$ printf "#include <Arduino_JSON.h>\nvoid setup() {}\nvoid loop() {}" > /tmp/FooSketch/FooSketch.ino

$ arduino-cli compile --fqbn arduino:avr:uno /tmp/FooSketch/FooSketch.ino
C:\Users\per\AppData\Local\Temp\FooSketch\FooSketch.ino:1:10: fatal error: Arduino_JSON.h: No such file or directory
 #include <Arduino_JSON.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.


Used library Version Path
Arduino_JSON 0.2.0   C:\Users\per\AppData\Local\Temp\arduino-cli-directories\мікроконтролер\libraries\Arduino_JSON

Used platform Version Path
arduino:avr   1.8.6   C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Error during build: exit status 1

Expected behavior

Any path supported by the file system is also supported by the library discovery system

Arduino CLI version

Original report

Arduino IDE 1.8.10

Last verified with

a527c7c

Operating system

Windows

Operating system version

  • 10
  • 11

Additional context

The issue is not specific to Cyrillic. For example, it also occurs with a folder named or Κώστας.


The fault only occurs on Windows. I am not able to reproduce it on Ubuntu 22.04 or macOS Ventura machines.


After changing system's locale from English to Bulgarian (win1251) + restart, the compilation succeeded. Unfortunately this is not viable solution, because we have many computers (>150) and changing system locale requires admin privileges.

My suggestion is that the IDE is not using the unicode version of the API when searching for libraries?


This is more likely to occur for those using Microsoft Onedrive because the default location of the sketchbook is:

C:\Users\<username>\OneDrive\<localized "Documents">\Arduino

The <localized "Documents"> in the path above is a placeholder the word "Documents" localized for the user's locale (e.g., 文档 or Документы)

Additional reports

Workaround

Arduino CLI
  1. Configure Arduino CLI to use a directories.user location that does not contain any non-ASCII characters in its path:
    https://arduino.github.io/arduino-cli/latest/configuration/
  2. Move the contents of the folder at the previous directories.user location to the new location.
Arduino IDE
  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Set the path in the "Sketchbook location" preference to a location that does not contain any non-ASCII characters in its path.
  3. Click the "OK" button.
    The "Preferences" dialog will close.
  4. Move the contents of the folder at the previous path of the "Sketchbook location" preference to the new location.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@per1234 per1234 transferred this issue from arduino/Arduino Mar 28, 2021
@per1234 per1234 added topic: code Related to content of the project itself topic: core labels Mar 28, 2021
@fstasi fstasi removed the type: bug label Sep 16, 2021
@rsora rsora added type: imperfection Perceived defect in any part of project topic: core labels Sep 22, 2021
@umbynos umbynos assigned cmaglie and unassigned silvanocerza Oct 12, 2022
@per1234 per1234 changed the title Arduino IDE is ignoring libraries when the path contains Cyrillic chars Library discovery fails when the library's path contains Cyrillic characters Jan 31, 2023
@per1234 per1234 changed the title Library discovery fails when the library's path contains Cyrillic characters "No such file or directory" error when library's path contains Cyrillic characters Jan 31, 2023
@per1234 per1234 changed the title "No such file or directory" error when library's path contains Cyrillic characters "No such file or directory" error when library's path contains post-ASCII characters Sep 14, 2023
@per1234 per1234 changed the title "No such file or directory" error when library's path contains post-ASCII characters Spurious "No such file or directory" error when library's path contains post-ASCII characters Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

7 participants