Skip to content
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

[qt5-webengine] Build error on x86-windows #39351

Closed
3UR opened this issue Jun 18, 2024 · 17 comments
Closed

[qt5-webengine] Build error on x86-windows #39351

3UR opened this issue Jun 18, 2024 · 17 comments
Assignees
Labels
category:question This issue is a question

Comments

@3UR
Copy link

3UR commented Jun 18, 2024

Package: qt5-webengine:[email protected]#3

Host Environment

  • Host: x64-windows
  • Compiler: MSVC 19.41.33923.0
  • vcpkg-tool version: 2024-04-23-d6945642ee5c3076addd1a42c331bbf4cfc97457
    vcpkg-readonly: true
    vcpkg-scripts version: da4b78d

To Reproduce

vcpkg install

Failure logs

CMake Warning at scripts/cmake/vcpkg_buildpath_length_warning.cmake:4 (message):
  qt5-webengine's buildsystem uses very long paths and may fail on your
  system.

  We recommend moving vcpkg to a short path such as 'C:\src\vcpkg' or using
  the subst command.
Call Stack (most recent call first):
  C:/Users/User/AppData/Local/vcpkg/registries/git-trees/58ef6b79a9cfe23e3a196d3a38970c5c48b1a15b/portfile.cmake:4 (vcpkg_buildpath_length_warning)
  scripts/ports.cmake:175 (include)


CMake Warning at C:/Users/User/AppData/Local/vcpkg/registries/git-trees/58ef6b79a9cfe23e3a196d3a38970c5c48b1a15b/portfile.cmake:5 (message):
  The qt5-webengine source was will be extracted to
  X:/REDACTED/REDACTED/vcpkg_installed/x86-windows/vcpkg/blds/qt5-webengine
  , which has more then 35 characters in length.
Call Stack (most recent call first):
  scripts/ports.cmake:175 (include)


CMake Error at C:/Users/User/AppData/Local/vcpkg/registries/git-trees/58ef6b79a9cfe23e3a196d3a38970c5c48b1a15b/portfile.cmake:6 (message):
  terminating due to
  X:/REDACTED/REDACTED/vcpkg_installed/x86-windows/vcpkg/blds/qt5-webengine
  being too long.
Call Stack (most recent call first):
  scripts/ports.cmake:175 (include)



Additional context

vcpkg.json
{
  "dependencies": [
    "qt5",
    "qt5-webengine"
  ]
}

@3UR
Copy link
Author

3UR commented Jun 18, 2024

Is there any way to resolve this? I would rather not change my directories I assume there is some way to disable the length limit

@3UR
Copy link
Author

3UR commented Jun 18, 2024

image
I have tried registry (Yes I did restart, and I sadly still am getting this issue)

@WangWeiLin-MV WangWeiLin-MV added the category:question This issue is a question label Jun 18, 2024
@dg0yt
Copy link
Contributor

dg0yt commented Jun 18, 2024

@3UR The check exists because there is no other simple way.

@3UR
Copy link
Author

3UR commented Jun 18, 2024

@3UR The check exists because there is no other simple way.

Would there be any way around it if I have LongPathsEnabled enabled in registry?

@WangWeiLin-MV
Copy link
Contributor

The installation path of vcpkg is too long. You can create a new vcpkg directory in the drive root directory, and then clone the code for compilation.

Or build with specify the option, for example, vcpkg install qt-webengine --x-buildtrees-root C:\v\bld

If attempting long path support, see #32684 (comment)

@dg0yt
Copy link
Contributor

dg0yt commented Jun 18, 2024

Would there be any way around it if I have LongPathsEnabled enabled in registry?

Well, you "only" have to make all tools capable of using long paths.

Or build with specify the option, for example, vcpkg install qt-webengine --x-buildtrees-root C:\v\bld

This issue is about qt5-webengine (Qt 5).
qt-webengine (Qt 6) might or might not benefit from the update of ninja, #39260.
But all webengine ports are non-trivial and troublesome.

@3UR
Copy link
Author

3UR commented Jun 18, 2024

I manually went and edited the portfile.cmake and everything seems fine now

Would any issues really happen now though as LongPathsEnabled is True? I assume everything should be able to handle long paths fine now

if(buildtrees_path_length GREATER 35 AND CMAKE_HOST_WIN32)
    execute_process(
        COMMAND powershell -Command "Get-ItemPropertyValue -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSystem' -Name 'LongPathsEnabled'"
        OUTPUT_VARIABLE LONG_PATHS_ENABLED
        OUTPUT_STRIP_TRAILING_WHITESPACE
    )

    if (LONG_PATHS_ENABLED STREQUAL "0")
        vcpkg_buildpath_length_warning(35)
        message(WARNING "The ${PORT} source was will be extracted to ${CURRENT_BUILDTREES_DIR} , which has more then 35 characters in length.")
        message(FATAL_ERROR "terminating due to ${CURRENT_BUILDTREES_DIR} being too long.")
    endif()
endif()

@dg0yt
Copy link
Contributor

dg0yt commented Jun 18, 2024

If the build succeeds, then it should be good.
(When the build fails, it isn't obvious from the "file not found" errors that path length is the trigger.)

@3UR
Copy link
Author

3UR commented Jun 18, 2024

Ok I see now there is more to then just having LongPathsEnabled I guess I will have to change the directory for vcpkg

How would I do so? @WangWeiLin-MV @dg0yt I installed vcpkg through Visual Studio 2022 using vcpkg integrate install in the developer powershell

@3UR
Copy link
Author

3UR commented Jun 18, 2024

I have been considering maybe I will just use CEF or something instead of WebEngine because I currently am upgrading to QT 5 and I don't want to use QT Webkit anymore and it seems WebEngine is a pain

@WangWeiLin-MV
Copy link
Contributor

@3UR In manifest mode, just try vcpkg install --x-buildtrees-root C:\v\bld with the C:\v\bld is any short path.

@3UR
Copy link
Author

3UR commented Jun 18, 2024

Thanks!

@3UR
Copy link
Author

3UR commented Jun 18, 2024

@WangWeiLin-MV Another question, do you know if I can also change the directory where Vcpkg downloads stuff (C:/Users/User/AppData/Local/vcpkg/downloads) or can I clear the files in this directory safely?

@3UR
Copy link
Author

3UR commented Jun 18, 2024

Sorry for lots of questions still new to using Vcpkg 😅

@WangWeiLin-MV
Copy link
Contributor

change the directory where Vcpkg downloads

Yes. By command line option --downloads-root=<path> or environment variable VCPKG_DOWNLOADS

or can I clear the files in this directory safely?

Yes. The vcpkg/download directory is just a local cache of downloaded files. And the vcpkg/download/tools directory may have some decompression tools. After deleting these, vcpkg will re-extract these when any port needed.

I'm thrilled I could assist you.

@3UR
Copy link
Author

3UR commented Jun 18, 2024

change the directory where Vcpkg downloads

Yes. By command line option --downloads-root= or environment variable VCPKG_DOWNLOADS

or can I clear the files in this directory safely?

Yes. The vcpkg/download directory is just a local cache of downloaded files. And the vcpkg/download/tools directory may have some decompression tools. After deleting these, vcpkg will re-extract these when any port needed.

I'm thrilled I could assist you.

Okay thanks I will close this now as it solved my issue :)

@3UR 3UR closed this as completed Jun 18, 2024
@dg0yt
Copy link
Contributor

dg0yt commented Jun 18, 2024

@3UR In manifest mode, just try vcpkg install --x-buildtrees-root C:\v\bld with the C:\v\bld is any short path.

With build system integration, don't call vcpkg install at the command line. It won't know the build system's binary dir and target.
Use VCPKG_INSTALL_OPTIONS with CMake integration:
https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/cmake-integration#vcpkg_install_options
Use VcpkgAdditionalInstallOptions with msbuild integration:
https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/msbuild-integration#vcpkg-additional-install-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants