Open jaydenkim opened 2 years ago
File name too long
Please clone vcpkg in a shorter path such as d:\ and try again.
@jaydenkim, does this still be a problem for you?
We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info.
File name too long
Please clone vcpkg in a shorter path such as d:\ and try again.
I am facing the same issue on a ci agent, changing to a shorter path is not possible as it is determined by the ci server. Is there any other way to work around this issue?
@hyt589 ./vcpkg install ... --x-buildtrees-root=<SHORTER_PATH>
@hyt589
./vcpkg install ... --x-buildtrees-root=<SHORTER_PATH>
Thanks for the quick reply! Our project is set up in manifest mode because we need to pin some dependency versions, and as I understand it running vcpkg install
is not possible in this mode.
@hyt589
./vcpkg install ... --x-buildtrees-root=<SHORTER_PATH>
Thanks for the quick reply! Our project is set up in manifest mode because we need to pin some dependency versions, and as I understand it running
vcpkg install
is not possible in this mode.
cmake.exe ... -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=<SHORTER_PATH>"
@hyt589
./vcpkg install ... --x-buildtrees-root=<SHORTER_PATH>
Thanks for the quick reply! Our project is set up in manifest mode because we need to pin some dependency versions, and as I understand it running
vcpkg install
is not possible in this mode.
cmake.exe ... -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=<SHORTER_PATH>"
I tried that, and it successfully changed the buildtree root path, but it seems the installation path is still too long. I also tried adding --x-install-root
to VCPKG_INSTALL_OPTIONS
, but it seems vcpkg doesn't accept more than 1 options?
I tried that, and it successfully changed the buildtree root path, but it seems the installation path is still too long.
So the best way is unlock the path length limit on Windows using Windows register.
I also tried adding
--x-install-root
toVCPKG_INSTALL_OPTIONS
, but it seems vcpkg doesn't accept more than 1 options?
VCPKG_INSTALL_OPTIONS, so I don't think that this option can't pass multiple options.
So the best way is unlock the path length limit on Windows using Windows register.
I tried the registry with no luck, for some reason it just won't allow long paths.
VCPKG_INSTALL_OPTIONS, so I don't think that this option can't pass multiple options.
The issue was I already defined VCPKG_INSTALLED_DIR
in cmake, which caused vcpkg to complain --x-install-root
was defined twice. I solved the issue by overriding VCPKG_INSTALLED_DIR
.
Thanks for your help.
I'm hitting this same issue. Although the symptom is that the path is too long, the root cause of such a long path is that the root path is repeated in the install path for this package.
You can see this in the OP's error log if you look closely at the path mkdir
tries to create:
mkdir: cannot create directory '/C/Users/xxx/Documents/projectx/external/PreBuildProj/vcpkg/packages/icu_x64-windows/C/Users/xxx/Documents/projectx/external/PreBuildProj': File exists
The ln
calls first cd
into this repeated directory and try to link, and that's when it fails. I think the fix here is to stop this path repetition from happening. Other packages do not seem to have this behavior and install to my x-packages-root
directory as I'd expect.
Is this intentional behavior, or is there something I should be doing to prevent this?
Here you can see that in my install directory, the installed icu
package includes the entire root path again as a subdirectory. I'd expect this folder to not exist and for the files it contains to just live inside the parent folder.
I'm hitting this same issue. Although the symptom is that the path is too long, the root cause of such a long path is that the root path is repeated in the install path for this package.
You can see this in the OP's error log if you look closely at the path
mkdir
tries to create:mkdir: cannot create directory '/C/Users/xxx/Documents/projectx/external/PreBuildProj/vcpkg/packages/icu_x64-windows/C/Users/xxx/Documents/projectx/external/PreBuildProj': File exists
The
ln
calls firstcd
into this repeated directory and try to link, and that's when it fails. I think the fix here is to stop this path repetition from happening. Other packages do not seem to have this behavior and install to myx-packages-root
directory as I'd expect.Is this intentional behavior, or is there something I should be doing to prevent this?
Here you can see that in my install directory, the installed
icu
package includes the entire root path again as a subdirectory. I'd expect this folder to not exist and for the files it contains to just live inside the parent folder.
Does your OS account contain empty space ?
Does your OS account contain empty space ?
No
>whoami
cengler-m16\cengl
The path also doesn't include spaces and isn't using my user folders, except to invoke vcpkg which I'm storing in %TEMP%
.
If it helps my invocation looks like:
:: Runs in manifest mode to install `msdfgen`
%TEMP%\vcpkg-Win64\vcpkg.exe install ^
--overlay-ports=.\overlay-ports ^
--overlay-triplets=.\overlay-triplets ^
--x-manifest-root=.\Win64\x64-windows-static-md-v142 ^
--x-packages-root=.\Win64\x64-windows-static-md-v142 ^
--triplet=x64-windows-static-md-v142
My manifest looks like this:
{
"name": "msdf",
"version-string": "1.0.0",
"dependencies": [
"msdfgen"
]
}
My overlay-ports
directory is currently empty, but I do have some overlay-triplets
. The x64-windows-static-md-v142
one looks like this:
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v142)
set(VCPKG_BUILD_TYPE release)
I'm using tag 2023.08.09
when I clone vcpkg.
Edit: If I do this instead, it doesn't duplicate the path in the install location:
pushd %TEMP%\vcpkg-Win64
:: Runs in classic mode to install `msdfgen`
vcpkg.exe install msdfgen ^
--overlay-ports=C:\xxx\overlay-ports ^
--overlay-triplets=C:\xxx\overlay-triplets ^
--triplet=x64-windows-static-md-v142
popd
Right now as a workaround I'm trying to write a script that installs in the %TEMP% vcpkg folder directly using the above and then copying the resulting libraries into my project.
@Cheney-W Please investigate this.
Please change the issue title to:
[icu] Build error (windows): File name too long
Host Environment
To Reproduce Steps to reproduce the behavior:
./vcpkg install xxxx
Failure logs