qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.66k stars 3.01k forks source link

Hardcoded path from CI in vcpkg SDK #59231

Open nicogodet opened 1 month ago

nicogodet commented 1 month ago

What is the bug or the crash?

Build fails when it tries to generate SIP files when using the vcpkg SDK

cmake -S . -B build -DSDK_PATH="C:\vcpkg\sdk\vcpkg-export-20241025-031639" -D BUILD_WITH_QT6=ON -D WITH_QTWEBKIT=OFF -D VCPKG_TARGET_TRIPLET=x64-windows-release -DFLEX_EXECUTABLE="C:\Flex_bison\win_flex.exe" -DBISON_EXECUTABLE="C:\Flex_bison\win_bison.exe" -D SIP_BUILD_EXECUTABLE="C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\tools\python3\Scripts\sip-build.exe" -D WITH_DESKTOP=ON -D WITH_3D=ON -D WITH_BINDINGS=ON -D ENABLE_TESTS=OFF
-- Building with SDK -- C:\vcpkg\sdk\vcpkg-export-20241025-031639
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.22631.
-- QGIS version: 3.39.0 Master (33900)
-- Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR)
-- Couldn't find OpenCL: support DISABLED
-- Could not find GRASS 7
-- Could not find GRASS 8
-- Found ZLIB: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/zlib.lib (found suitable version "1.3.1", minimum required is "1")
-- Found Proj: 9.5.0 C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/share/proj
-- Found Geos: 3.13.0 C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/share/geos
-- Found GDAL: 3.9.3 C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/share/gdal
-- Found Spatialindex: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/spatialindex-64.lib
-- Found libzip: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/zip.lib
-- Found Sqlite3: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/sqlite3.lib
-- Found Protobuf: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/bin/libprotobuf.dll
-- Found ZLIB: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/zlib.lib (found version "1.3.1")
-- Found zlib: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/zlib.lib
-- Found exiv2: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/exiv2.lib
-- Qt WebKit support DISABLED.
-- Using embedded laz-perf
-- Found ZSTD: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/zstd.lib
-- Found PDAL: pdalcpp;pdal_util (2.5.3)
-- Found Draco: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/draco.lib (1.5.7)
-- PDF4Qt disabled
-- QtWebEngine support DISABLED.
-- Found Qt version: 6.7.3
-- Found QScintilla2: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/qscintilla2_qt6.lib (2.14.1)
-- Found Qwt: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/qwt.lib (6.3.0)
-- Found QCA: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/qca.lib (2.3.7)
-- Pedantic compiler settings enabled
-- Found Python executable: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/tools/python3/python.exe (version 3.11.10)
-- Python library: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/lib/python311.lib
-- Python site-packages: C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\tools\python3\Lib\site-packages
Added vcpkg bin path to search for dlls. Path added: C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\bin
-- Found SIP version: 6.8.6
-- sip-build executable: C:/vcpkg/sdk/vcpkg-export-20241025-031639/installed/x64-windows-release/tools/python3/Scripts/sip-build.exe
Added vcpkg bin path to search for dlls. Path added: C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\bin
-- Found PyQt6 version: 6.7.1
Added vcpkg bin path to search for dlls. Path added: C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\bin
-- Found QScintilla2 PyQt module: 2.14.1

-- Using PROJ >= 6 srs database.
-- QtGamepad not enabled - disabling bindings for derived classes
-- Configuring done (25.6s)
-- Generating done (15.2s)
-- Build files have been written to: D:/QGIS_src/build
PS D:\QGIS_src> cmake --build build --config RelWithDebInfo -- /p:CL_MPCount=8
Version MSBuild 17.11.9+a69bbaaf5 pour .NET Framework

  1>Automatic MOC for target qgis_core
  qgis_core.vcxproj -> D:\QGIS_src\build\output\bin\RelWithDebInfo\qgis_core.dll
  Automatic MOC for target qgis_native
  qgis_native.vcxproj -> D:\QGIS_src\build\output\bin\RelWithDebInfo\qgis_native.dll
  Automatic MOC for target qgis_gui
  qgis_gui.vcxproj -> D:\QGIS_src\build\output\bin\RelWithDebInfo\qgis_gui.dll
  Automatic MOC for target authmethod_apiheader
  authmethod_apiheader.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_apiheader.dll
  Automatic MOC for target authmethod_awss3
  authmethod_awss3.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_awss3.dll
  Automatic MOC for target authmethod_basic
  authmethod_basic.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_basic.dll
  Automatic MOC for target authmethod_esritoken
  authmethod_esritoken.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_esritoken.dll
  Automatic MOC for target authmethod_identcert
  authmethod_identcert.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_identcert.dll
  Automatic MOC for target authmethod_maptilerhmacsha256
  authmethod_maptilerhmacsha256.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_maptilerhmacsha256.dll
  Automatic MOC for target authmethod_oauth2
  authmethod_oauth2.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_oauth2.dll
  Automatic MOC for target authmethod_pkcs12
  authmethod_pkcs12.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_pkcs12.dll
  Automatic MOC for target authmethod_pkipaths
  authmethod_pkipaths.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\authmethod_pkipaths.dll
  1>Automatic MOC for target qgis_analysis
  qgis_analysis.vcxproj -> D:\QGIS_src\build\output\bin\RelWithDebInfo\qgis_analysis.dll
  Automatic MOC for target plugin_geometrychecker
  plugin_geometrychecker.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\plugin_geometrychecker.dll
  Automatic MOC for target plugin_offlineediting
  plugin_offlineediting.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\plugin_offlineediting.dll
  Automatic MOC for target plugin_topology
  plugin_topology.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\plugin_topology.dll
  Automatic MOC for target provider_arcgisfeatureserver
  provider_arcgisfeatureserver.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_arcgisfeatureserver.dll
  Automatic MOC for target provider_arcgismapserver
  provider_arcgismapserver.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_arcgismapserver.dll
  Automatic MOC for target provider_delimitedtext
  provider_delimitedtext.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_delimitedtext.dll
  Automatic MOC for target provider_gpx
  provider_gpx.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_gpx.dll
  Automatic MOC for target provider_mdal
  provider_mdal.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_mdal.dll
  Automatic MOC for target provider_mssql
  provider_mssql.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_mssql.dll
  Automatic MOC for target provider_pdal
  provider_pdal.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_pdal.dll
  Automatic MOC for target provider_postgres
  provider_postgres.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_postgres.dll
  Automatic MOC for target provider_postgresraster
  provider_postgresraster.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_postgresraster.dll
  Automatic MOC for target provider_spatialite
  provider_spatialite.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_spatialite.dll
  Automatic MOC for target provider_virtuallayer
  provider_virtuallayer.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_virtuallayer.dll
  Automatic MOC for target provider_virtualraster
  provider_virtualraster.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_virtualraster.dll
  Automatic MOC for target provider_wcs
  provider_wcs.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_wcs.dll
  Automatic MOC for target provider_wfs
  provider_wfs.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_wfs.dll
  Automatic MOC for target provider_wms
  provider_wms.vcxproj -> D:\QGIS_src\build\output\plugins\RelWithDebInfo\provider_wms.dll
  Automatic MOC for target qgis_3d
  qgis_3d.vcxproj -> D:\QGIS_src\build\output\bin\RelWithDebInfo\qgis_3d.dll
  Generating 3d/build/_3d_p/sip_3d_ppart0.cpp, 3d/build/_3d_p/sip_3d_ppart1.cpp, 3d/build/_3d_p/sip_3d_ppart2.cpp, 3d/build/_3d_p/sip_3d_ppart3.cpp, 3d/build/_3d_p/s
  ip_3d_ppart4.cpp, 3d/build/_3d_p/sip_3d_ppart5.cpp, 3d/build/_3d_p/sip_3d_ppart6.cpp, 3d/build/_3d_p/sip_3d_ppart7.cpp, 3d/build/_3d_p/sip_3d_ppart8.cpp, 3d/build/
  _3d_p/sip_3d_ppart9.cpp, 3d/build/_3d_p/sip_3d_ppart10.cpp, 3d/build/_3d_p/sip_3d_ppart11.cpp, 3d/build/_3d_p/sip_3d_ppart12.cpp, 3d/build/_3d_p/sip_3d_ppart13.cpp
  , 3d/build/_3d_p/sip_3d_ppart14.cpp, 3d/build/_3d_p/sip_3d_ppart15.cpp, 3d/build/_3d_p/sip_3d_ppart16.cpp, 3d/build/_3d_p/sip_3d_ppart17.cpp, 3d/build/_3d_p/sip_3d
  _ppart18.cpp, 3d/build/_3d_p/sip_3d_ppart19.cpp, 3d/build/_3d_p/sip_3d_ppart20.cpp, 3d/build/_3d_p/sip_3d_ppart21.cpp, 3d/build/_3d_p/sip_3d_ppart22.cpp, 3d/build/
  _3d_p/sip_3d_ppart23.cpp, 3d/build/_3d_p/sip_3d_ppart24.cpp

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: la build personnalisée de 'D:\QG
IS_src\build\python\3d\3d.sip' s'est arrêtée. Code 1. [D:\QGIS_src\build\python\python_module_qgis__3d_p.vcxproj]
  Generating analysis/build/_analysis/sip_analysispart0.cpp, analysis/build/_analysis/sip_analysispart1.cpp, analysis/build/_analysis/sip_analysispart2.cpp, analysis
  /build/_analysis/sip_analysispart3.cpp, analysis/build/_analysis/sip_analysispart4.cpp, analysis/build/_analysis/sip_analysispart5.cpp, analysis/build/_analysis/si
  p_analysispart6.cpp, analysis/build/_analysis/sip_analysispart7.cpp, analysis/build/_analysis/sip_analysispart8.cpp, analysis/build/_analysis/sip_analysispart9.cpp
  , analysis/build/_analysis/sip_analysispart10.cpp, analysis/build/_analysis/sip_analysispart11.cpp, analysis/build/_analysis/sip_analysispart12.cpp, analysis/build
  /_analysis/sip_analysispart13.cpp, analysis/build/_analysis/sip_analysispart14.cpp, analysis/build/_analysis/sip_analysispart15.cpp, analysis/build/_analysis/sip_a
  nalysispart16.cpp, analysis/build/_analysis/sip_analysispart17.cpp, analysis/build/_analysis/sip_analysispart18.cpp, analysis/build/_analysis/sip_analysispart19.cp
  p, analysis/build/_analysis/sip_analysispart20.cpp, analysis/build/_analysis/sip_analysispart21.cpp, analysis/build/_analysis/sip_analysispart22.cpp, analysis/buil
  d/_analysis/sip_analysispart23.cpp, analysis/build/_analysis/sip_analysispart24.cpp

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: la build personnalisée de 'D:\QG
IS_src\build\python\analysis\analysis.sip' s'est arrêtée. Code 1. [D:\QGIS_src\build\python\python_module_qgis__analysis.vcxproj]
  Generating core/build/_core/sip_corepart0.cpp, core/build/_core/sip_corepart1.cpp, core/build/_core/sip_corepart2.cpp, core/build/_core/sip_corepart3.cpp, core/bui
  ld/_core/sip_corepart4.cpp, core/build/_core/sip_corepart5.cpp, core/build/_core/sip_corepart6.cpp, core/build/_core/sip_corepart7.cpp, core/build/_core/sip_corepa
  rt8.cpp, core/build/_core/sip_corepart9.cpp, core/build/_core/sip_corepart10.cpp, core/build/_core/sip_corepart11.cpp, core/build/_core/sip_corepart12.cpp, core/bu
  ild/_core/sip_corepart13.cpp, core/build/_core/sip_corepart14.cpp, core/build/_core/sip_corepart15.cpp, core/build/_core/sip_corepart16.cpp, core/build/_core/sip_c
  orepart17.cpp, core/build/_core/sip_corepart18.cpp, core/build/_core/sip_corepart19.cpp, core/build/_core/sip_corepart20.cpp, core/build/_core/sip_corepart21.cpp,
  core/build/_core/sip_corepart22.cpp, core/build/_core/sip_corepart23.cpp, core/build/_core/sip_corepart24.cpp

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: la build personnalisée de 'D:\QG
IS_src\build\python\core\core.sip' s'est arrêtée. Code 1. [D:\QGIS_src\build\python\python_module_qgis__core.vcxproj]
  Generating gui/build/_gui/sip_guipart0.cpp, gui/build/_gui/sip_guipart1.cpp, gui/build/_gui/sip_guipart2.cpp, gui/build/_gui/sip_guipart3.cpp, gui/build/_gui/sip_g
  uipart4.cpp, gui/build/_gui/sip_guipart5.cpp, gui/build/_gui/sip_guipart6.cpp, gui/build/_gui/sip_guipart7.cpp, gui/build/_gui/sip_guipart8.cpp, gui/build/_gui/sip
  _guipart9.cpp, gui/build/_gui/sip_guipart10.cpp, gui/build/_gui/sip_guipart11.cpp, gui/build/_gui/sip_guipart12.cpp, gui/build/_gui/sip_guipart13.cpp, gui/build/_g
  ui/sip_guipart14.cpp, gui/build/_gui/sip_guipart15.cpp, gui/build/_gui/sip_guipart16.cpp, gui/build/_gui/sip_guipart17.cpp, gui/build/_gui/sip_guipart18.cpp, gui/b
  uild/_gui/sip_guipart19.cpp, gui/build/_gui/sip_guipart20.cpp, gui/build/_gui/sip_guipart21.cpp, gui/build/_gui/sip_guipart22.cpp, gui/build/_gui/sip_guipart23.cpp
  , gui/build/_gui/sip_guipart24.cpp

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: la build personnalisée de 'D:\QG
IS_src\build\python\gui\gui.sip' s'est arrêtée. Code 1. [D:\QGIS_src\build\python\python_module_qgis__gui.vcxproj]
  Automatic MOC for target qgis
  qgis.vcxproj -> D:\QGIS_src\build\output\bin\RelWithDebInfo\qgis.exe

After a little investigation:

Microsoft Windows [version 10.0.22631.4317]
(c) Microsoft Corporation. Tous droits réservés.

C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\tools\python3\Scripts>sip-build.exe
Fatal error in launcher: Unable to create process using '"D:\a\QGIS\QGIS\build\vcpkg_installed\x64-windows-release\tools\python3\python.exe"  "C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\tools\python3\Scripts\sip-build.exe" '

C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\tools\python3\Scripts>

D:\a\QGIS\QGIS\build\vcpkg_installed\x64-windows-release\tools\python3\python.exe is a CI path

Microsoft Windows [version 10.0.22631.4317]
(c) Microsoft Corporation. Tous droits réservés.

C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\tools\python3>more pylupdate6.bat
@D:\a\QGIS\QGIS\build\vcpkg_installed\x64-windows-release\tools\python3\python.exe -m PyQt6.lupdate.pylupdate %1 %2 %3 %4 %5 %6 %7 %8 %9

C:\vcpkg\sdk\vcpkg-export-20241025-031639\installed\x64-windows-release\tools\python3>

It looks like it affects python only

Steps to reproduce the issue

.

Versions

.

Supported QGIS version

New profile

Additional context

No response

nicogodet commented 1 month ago

FYI @m-kuhn

danodom-tcb commented 1 month ago

@nicogodet I am having a similar issues, I think that I just downloaded some python packages to get around some of that as, regardless of how I tried to reference the sdk, nothing worked.

The issue now is that I have a built exe that will not run, but... I can move it to the "install" folder and create an env file and it will run.

m-kuhn commented 1 month ago

@nicogodet I am having a similar issues, I think that I just downloaded some python packages to get around some of that as, regardless of how I tried to reference the sdk, nothing worked.

please don't! This is an issue to be solved within the sdk (and working properly with a full vcpkg build without sdk)

danodom-tcb commented 1 month ago

@nicogodet I am having a similar issues, I think that I just downloaded some python packages to get around some of that as, regardless of how I tried to reference the sdk, nothing worked.

please don't! This is an issue to be solved within the sdk (and working properly with a full vcpkg build without sdk)

I will have have to wipe the current system and restart, but I was following the instructions and there were things missing and errors being thrown and I had to find a way around them.

@m-kuhn , I agree this should be a straightforward repeatable build process and I don't mind helping get through these issues. I know you had me run some other cmake commands to turn some options off (QT6, I think).

danodom-tcb commented 1 month ago

@nicogodet @m-kuhn , question... Do you know anyone that has set up a Windows environment from scratch and following the VCPKG instructions in the Install.md file and successfully built and ran the qgis.exe without any issues?

nicogodet commented 1 month ago

@danodom-tcb Currently, no. I report errors when I encounter one and wait/propose a fix/reasonable workaround if I can

danodom-tcb commented 1 month ago

@danodom-tcb Currently, no. I report errors when I encounter one and wait/propose a fix/reasonable workaround if I can

@nicogodet, What's the primary build environment for QGIS?

I am assuming those currently building on Windows has had the environment set up for a while, so probably some of the issues I ran into were related to not having my system set up in the same manner (python, etc.).

nicogodet commented 1 month ago

OSGeo4W is the main build env for windows (.msi are created this way)

VCPKG based build is fairly new and bugfix seem needed to have a working build outside GH CI.

m-kuhn commented 4 weeks ago

@nicogodet I have added a tiny bit of context to the top message (only affects SDK) and removed windows (it's actually the same for macos, even though easier to handle because one can manually edit the shebang in the sipbuild file there, while on windows it's a .exe)

danodom-tcb commented 4 weeks ago

@nicogodet, What's the primary build environment for QGIS?

I am assuming those currently building on Windows has had the environment set up for a while, so probably some of the issues I ran into were related to not having my system set up in the same manner (python, etc.).

@nicogodet , Newly built out Windows server/Windows 11 system with no development tools on it, so starting from scratch. I've tried on both.

m-kuhn commented 3 weeks ago

Fixed for macos/linux in https://github.com/open-vcpkg/python-registry/pull/70 For windows it's a bit harder since sip-build is a .exe (binary), we could either try to fix this in the python packaging/build backend (didn't manage to ...) or add a wrapper .bat file that calls python with a relative path (similar to what's done in the PR above for macos/linux).