-
Notifications
You must be signed in to change notification settings - Fork 124
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
Error: Too long output directory #252
Comments
On windows please try to put your projects in root project like C:\your-project to make the path as short as possible or use WSL as it has not such a problem. This is a windows specific problem we cant influence. |
In my case,
To use WSL2, remember, that WSL2 don't have access to your USB device. Under linux, install all ESP32 tools (see https://esp-rs.github.io/book/).
Where esp32-std-blink-led is you ELF binary after compile found in your Rust project It works for me. |
I think this workaround should be enabled by default if it isn't fatal. Note that the recommended workaround doesn't work, so the documentation should be updated to reflect this approach instead: https://esp-rs.github.io/book/misc/troubleshooting.html#long-path-names |
What workaround should be enabled by default if it isn't fatal? If you mean And I'm not enabling it by default no matter what, as we were flooded by "I have a weird build failure on Windows" errors before. As for the trick described in the ESP book, I don't know why it is there, given that - last time I checked - it does NOT work for (Emphasis mine.) Otherwise, thanks to you and the rest of the folks trying to help! Unfortunately I'm not very optimistic we can improve the "too long Windows path" issue handling beyond what we have and what we suggest. |
UPDATE: For the "subst" trick - I've posted a question in the Matrix chat as I'm not sure who was ever successfully using that. But other than that, not sure what else to do here. Closing :) |
I just successfully used that trick. What error did you @ivmarkov get when trying it out? Did you have windows long path support set up correctly? |
|
Does it mean that it is definitively impossible to use Rust for espressif on windows ? Sorry but I'm quite angry. |
It is possible. "Shorten your project path down to no more than 10 characters (or use WSL2 and its native Linux filesystem). Note that tricks like Windows subst do NOT work!"
Espressif is currently investing (as in hired, full time developers) in the baremetal crates, not the ones which are based on top of ESP-IDF. Either because they consider the baremetal solutions more important, or because they think the ESP-IDF crates are in the meantime relatively mature, or both. Speculating here a bit, but that's the status quo. Therefore, the effort put into
Not sure for that suggestion. Might or might not work. If we go this route, we have to put not just build artefacts, but also the ESP IDF git repo itself in something like Another solution would be to make sure that ALL tools involved in building the You also need to realize, that the "please use a short project path" restriction is coming from ESP IDF itself. It is just that the cargo build system is making it worse (as in the project path needs to be even shorter).
Espressif's ESP IDF is unique in its class in that it provides you a Rust STD environment. On an MCU. Therefore, I think this "short project path" constraint on pure Windows (it does not exist with WSL2's native file system) is a small price to pay for that. Surely annoying, but tolerable. But then - IMO. Perhaps if you or other folks find this really inconvenient, you can work towards a solution? |
Well, you can always give your hands on trying to create a workaround for this. I originally wrote this compilation infrastructure on Windows, where we ran into command-line length limitations (see #7 (comment) and espressif/esp-idf#7864), which was fixed by using response files and preventing the linker to expand the response files while running the jobs. Then, someone ran into Windows file path limitations (see #23). Which seems to be caused by gcc no supporting long paths on Windows (see my comment #23 (comment)). There may be other tools that we're using that also don't support this (e.g. I seem to remember there were some issues with git and too long paths as well). The original workarounds I posted are:
Where point one seems not to work. But maybe point 2 could? The issue is also with the system headers (e.g. for newlib) which reside in the I've been pretty inactive, and am also not building stuff with esp-idf-sys, so I've not looked into workarounds further. But again if anyone wants improvements in this regard, you'd (or anyone) have to it yourself. |
Regarding the gcc side of the problem there is this tracked bug. According to one of the comments the fix was simply to add a manifest to enable long path support on windows. It seems nobody has pursued this further. |
It's better to use WSL2 as recommended and please refer this to bind the usb ports to the hosted linux distro -- things works like a charm :) |
You are preaching to the wrong choir. I never said it does not work or that WSL2 is not a good workaround. If you would like to help, a paragraph to the README of esp-idf-template dedicated to Windows+WSL2, including some instructions what to install so that |
Happy to help, will definitely do so over this weekend @ivmarkov. |
create a project by
cargo generate esp-rs/esp-idf-template cargo
and then, run
cargo build
error: failed to run custom build command for
esp-idf-sys v0.33.3
Caused by:
process didn't exit successfully:
E:\rust\esp32-std-project\target\debug\build\esp-idf-sys-7beb8c60ac8a9a8b\build-script-build
(exit code: 1)--- stderr
Error: Too long output directory:
\\?\E:\rust\esp32-std-project\target\xtensa-esp32-espidf\debug\build\esp-idf-sys-168dae4d88221cf9\out
. Shorten your project path down to no more than 10 characters (or use WSL2 and its native Linux filesystem). Note that tricks like Windowssubst
do NOT work!warning: build failed, waiting for other jobs to finish...
Tasks
The text was updated successfully, but these errors were encountered: