-
Notifications
You must be signed in to change notification settings - Fork 13.5k
clang does not support long paths #46966
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
Comments
Also note that using LONG_DIR='\?\D:\1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234\12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' as path did not change anything, the inconsistency is still there. |
#54559 notes a similar issue in |
I think this issue may be fixed as of Clang 14.0.6. Here is a standalone script: #!/usr/bin/env bash
DIR="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
LONG_DIR="$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR/$DIR"
mkdir -p "$LONG_DIR"
echo "int main(){}" > "$LONG_DIR/main.cpp"
clang++.exe --version
clang++.exe "$LONG_DIR/main.cpp" -o "$LONG_DIR/main.exe" && echo "Long path used successfully" If I use Clang 13.0.0, then this fails:
If I use Clang 14.0.6, however, then this succeeds:
|
Yes, this works for me also. https://reviews.llvm.org/D75372 looks like the fix, but that predates this issue so maybe it was https://reviews.llvm.org/D111880. Closing. |
Extended Description
Hello, clang is inconsistent on how ti handles long paths.
I'm using the cygwin environment for simplicity, but it has nothing to do with cygwin, as it is only used for calling clang and creating feils/directories.
LONG_DIR="D:/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234/12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
mkdir -p "$LONG_DIR"
echo "int main(){}" > "$LONG_DIR/main.cpp"
'/cygdrive/c/Program Files/LLVM/bin/clang++.exe' "$LONG_DIR/main.cpp" -o "$LONG_DIR/main.exe"
LINK : fatal error LNK1104: cannot open file 'D:\1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234\12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\123456789012345678901234567890123456789012345
67890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\main.exe'
While following works without issues
LONG_DIR="D:/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234/12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890/12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
mkdir -p "$LONG_DIR"
echo "int main(){}" > "$LONG_DIR/main.cpp"
'/cygdrive/c/Program Files/LLVM/bin/clang++.exe' "$LONG_DIR/main.cpp"
Thus it seems that clang has issues writing, not reading, files in long paths.
If case it is relevant, I've enabled "LongPathsEnabled" on my machine (Windows 10 Version 1909).
The text was updated successfully, but these errors were encountered: