Re: scripts/ os.symlink: OSError: [Errno 36] File name too long

Carles Cufi

Hi Abhishek,


I think this can be solved in multiple ways, just by taking a quick look at the script.

It is even handled differently on Windows, where symlinks are not supported.


Could you open a GitHub enhancement issue with the contents of the email and then we can discuss the solution there?

scripts/ was added by Torsten (I have added him on copy) so I think he’d be the right person to assign the issue to.






From: devel@... <devel@...> On Behalf Of Abhishek Shah via
Sent: 18 April 2020 21:01
To: devel@...
Subject: [Zephyr-devel] scripts/ os.symlink: OSError: [Errno 36] File name too long


Hi -


I am facing an issue where os.symlink call in v2.2) results in below error:

"scripts/", line 56, in main

os.symlink(directory, symlink)
OSError: [Errno 36] File name too long


Here is the example of one of the symlink getting created on one of the systems:

directory path:

'/tmp/yocto_builds/ 20133855_ genericx86-64/poky/build/tmp/work/


It's symlink created by

 '/tmp/yocto_builds/ 20133855_ genericx86-64/poky/build/tmp/work/


Above symlink is evidently too long.


I can think of 2 ways to reduce symlink length:

1. Symlink creation should use relative path instead of absolute path.

As symlink is in zephyr build directory and original directory is in build directory;

a relation needs to be established in between zephyr source directory and build directory.


2. The final symlink name should not use entire PATH in the name, rather just start from "include_*"

For example: Instead of this:


Name could be just:


This should reduce symlink length almost by half.




Join to automatically receive all group messages.