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

Build IOS error on MacOS sequoia Version 15.2 #5897

Open
mansivincent opened this issue Dec 16, 2024 · 22 comments
Open

Build IOS error on MacOS sequoia Version 15.2 #5897

mansivincent opened this issue Dec 16, 2024 · 22 comments

Comments

@mansivincent
Copy link

mansivincent commented Dec 16, 2024

Hello everyone,
I'm trying to build an IOS environment with the following command:

cmake -S . -B build-arm64-ios
-DVCPKG_TARGET_TRIPLET=arm64-ios
-DWITH_VCPKG=ON
-DVCPKG_BUILD_TYPE=release
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_OSX_SYSROOT=iphoneos
-DCMAKE_OSX_ARCHITECTURES=arm64
-DCMAKE_SYSTEM_PROCESSOR=aarch64
-GXcode
However I get this error:

The following build commands failed:
PhaseScriptExecution Generate\ vcpkg-populate-prefix/src/vcpkg-populate-stamp/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/vcpkg-populate-download
/qfield_project/QField/build-arm64-ios/_deps/vcpkg-subbuild/build/vcpkg-populate.build/Debug/vcpkg-populate.build/Script-7ED1C045FE7F1AA40556E615.sh (in target 'vcpkg-populate' from project 'vcpkg-populate')
(1 failure)

CMake Error at /usr/local/share/cmake/Modules/FetchContent.cmake:1918 (message):
Build step for vcpkg failed: 65
Call Stack (most recent call first):
/usr/local/share/cmake/Modules/FetchContent.cmake:1609 (__FetchContent_populateSubbuild)
/usr/local/share/cmake/Modules/FetchContent.cmake:2145:EVAL:2 (__FetchContent_doPopulation)
/usr/local/share/cmake/Modules/FetchContent.cmake:2145 (cmake_language)
/usr/local/share/cmake/Modules/FetchContent.cmake:2384 (__FetchContent_Populate)
cmake/VcpkgToolchain.cmake:34 (FetchContent_MakeAvailable)
CMakeLists.txt:26 (include)

after some modifications suggested by users in other issues, i still can't configure my build
the command line I placed came from this pull request: https://github.com/opengisch/QField/pull/5016/files

@nirvn
Copy link
Member

nirvn commented Dec 16, 2024

This looks like an issue that was fixed on master yesterday. Can you make sure you pull all changes up to this very moment?

@mansivincent
Copy link
Author

mansivincent commented Dec 16, 2024

thank you for your reply
I have redone a new fork following your reply, the building has begun but I have this error which occurs afterwards:
warning: Embedding vcpkg-configuration in a manifest file is an EXPERIMENTAL feature.
Detecting compiler hash for triplet x64-osx...
Compiler found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
Detecting compiler hash for triplet arm64-ios...
Compiler found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
[.......]
error: building qtbase:x64-osx failed with: BUILD_FAILED
See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Elapsed time to handle qtbase:x64-osx: 1.3 min
Please ensure you're using the latest port files with git pull and vcpkg update.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+qtbase
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[qtbase]+Build+error+on+x64-osx&body=Copy+issue+body+from+qfield_project%2FQField%2Fbuild-arm64-ios%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md

-- Running vcpkg install - failed
CMake Error at build-arm64-ios/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:904 (message):
vcpkg install failed. See logs for more information:
qfield_project/QField/build-arm64-ios/vcpkg-manifest-install.log
Call Stack (most recent call first):
/usr/local/share/cmake/Modules/CMakeDetermineSystem.cmake:146 (include)
CMakeLists.txt:30 (project)

@nirvn
Copy link
Member

nirvn commented Dec 17, 2024

@mansivincent , there should be a message that points you to a log file that contains more information.

E.g., this was a build error with QtQuick3D some time ago:

Building qtquick3d[core,default-features]:x64-android@6.8.1...
/home/runner/work/QField/QField/vcpkg/triplets/x64-android.cmake: info: loaded overlay triplet from here
/home/runner/work/QField/QField/vcpkg/ports/qtquick3d: info: installing overlay port from here
-- Using cached qtquick3d-everywhere-src-6.8.1.tar.xz.
-- Cleaning sources at /home/runner/builddir/_deps/vcpkg-src/buildtrees/qtquick3d/src/here-src-6-e2374e959f.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/runner/builddir/_deps/vcpkg-src/downloads/qtquick3d-everywhere-src-6.8.1.tar.xz
-- Applying patch 0001-devendor-meshoptimizer.patch
-- Using source at /home/runner/builddir/_deps/vcpkg-src/buildtrees/qtquick3d/src/here-src-6-e2374e959f.clean
-- Found external ninja('1.12.1').
-- Configuring x64-android
-- Building x64-android-rel
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: /usr/local/bin/cmake --build . --config Release --target install -- -v -j5
    Working Directory: /home/runner/builddir/_deps/vcpkg-src/buildtrees/qtquick3d/x64-android-rel
    See logs for more information:
      /home/runner/builddir/_deps/vcpkg-src/buildtrees/qtquick3d/install-x64-android-rel-out.log

The install-x64-android-rel-out.log file is what gives us the most information as to what's wrong in this scenario.

@mansivincent
Copy link
Author

mansivincent commented Dec 17, 2024

@nirvn thanks for your reply, I've just found a log file called QField/build-arm64-ios/_deps/vcpkg-src/buildtrees/qtbase/config-x64-osx-out.log. From what I understand, it can't find Qt6::Bootstrap, if that's the error, how can I fix it, do I have to install it manually?

-- Configuring done (59.1s)
CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "moc" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/moc/CMakeLists.txt:9 (qt_internal_add_tool)


CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "tracepointgen" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/tracepointgen/CMakeLists.txt:9 (qt_internal_add_tool)


CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "tracegen" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/tracegen/CMakeLists.txt:9 (qt_internal_add_tool)


CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "cmake_automoc_parser" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/cmake_automoc_parser/CMakeLists.txt:9 (qt_internal_add_tool)


-- Generating done (3.4s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_DISABLE_FIND_PACKAGE_GLESv3
    CMAKE_DISABLE_FIND_PACKAGE_PPS
    CMAKE_DISABLE_FIND_PACKAGE_WrapResolve
    CMAKE_DISABLE_FIND_PACKAGE_X11
    CMAKE_DISABLE_FIND_PACKAGE_XCB
    CMAKE_DISABLE_FIND_PACKAGE_XKB
    CMAKE_DISABLE_FIND_PACKAGE_XKB_COMMON_X11
    CMAKE_DISABLE_FIND_PACKAGE_XRender
    CMAKE_DISABLE_FIND_PACKAGE_ZSTD
    CMAKE_INSTALL_BINDIR
    FEATURE_xcb_native_painting
    FEATURE_xrender
    FETCHCONTENT_FULLY_DISCONNECTED
    HOST_PERL
    INPUT_xkbcommon
    VCPKG_PLATFORM_TOOLSET
    VCPKG_SET_CHARSET_FLAG
    _VCPKG_ROOT_DIR


CMake Generate step failed.  Build files cannot be regenerated correctly.
ninja: build stopped: subcommand failed.

@nirvn
Copy link
Member

nirvn commented Dec 17, 2024

Ah, add a -D VCPKG_HOST_TRIPLET="arm64-osx" to your cmake command.

@mansivincent
Copy link
Author

ok i launch it let's see :)

@mansivincent
Copy link
Author

well, i guess your reply help me to fix my first error but I have a new error, looking in the log files QField/build-arm64-ios/_deps/vcpkg-src/buildtrees/fontconfig/config-arm64-ios-rel-out.log and QField/build-arm64-ios/_deps/vcpkg-src/buildtrees/fontconfig/config-arm64-ios-rel-r.log I have two different information about the error.
here are the respective errors in these two files :

ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment.

-------------------
OSError: [Errno 86] Bad CPU type in executable: '/Users/vincentmansi/Desktop/Stage_Montcocol/qfield_project/QField/build-arm64-ios/vcpkg_installed/arm64-osx/tools/gperf/gperf'

@nirvn
Copy link
Member

nirvn commented Dec 17, 2024

Oh sorry, your host is not ARM. I think your command would be :

-D VCPKG_HOST_TRIPLET="x64-osx"

@mansivincent
Copy link
Author

mansivincent commented Dec 17, 2024

Oh sorry, your host is not ARM. I think your command would be :

-D VCPKG_HOST_TRIPLET="x64-osx"

i want to setup a arm ios to work with new IPAD but i am working on macos intel9

@nirvn
Copy link
Member

nirvn commented Dec 17, 2024

@mansivincent , yeah that's not a problem, you just need to make sure your VCPKG_HOST_TRIPLET matches the computer architecture you're using to build.

@mansivincent
Copy link
Author

mansivincent commented Dec 17, 2024

so in my case i need amd because my computer isnt an arm mac ?

@mansivincent
Copy link
Author

mansivincent commented Dec 17, 2024

@nirvn I tried this new command :

cmake -S . -B build-arm64-ios \
        -DVCPKG_TARGET_TRIPLET=arm64-ios \
        -DWITH_VCPKG=ON \
        -DVCPKG_BUILD_TYPE=release \
        -DCMAKE_SYSTEM_NAME=iOS \
        -DCMAKE_OSX_SYSROOT=iphoneos \
        -DCMAKE_OSX_ARCHITECTURES=arm64 \
        -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
        -GXcode -D VCPKG_HOST_TRIPLET="x64-osx"

I encounter my old error :

 -- Configuring done (64.8s)
CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "moc" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/moc/CMakeLists.txt:9 (qt_internal_add_tool)


CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "tracepointgen" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/tracepointgen/CMakeLists.txt:9 (qt_internal_add_tool)


CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "tracegen" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/tracegen/CMakeLists.txt:9 (qt_internal_add_tool)


CMake Error at cmake/QtTargetHelpers.cmake:186 (target_link_libraries):
  Target "cmake_automoc_parser" links to:

    Qt6::Bootstrap

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  cmake/QtExecutableHelpers.cmake:129 (qt_internal_extend_target)
  cmake/QtToolHelpers.cmake:131 (qt_internal_add_executable)
  src/tools/cmake_automoc_parser/CMakeLists.txt:9 (qt_internal_add_tool)


-- Generating done (4.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_DISABLE_FIND_PACKAGE_GLESv3
    CMAKE_DISABLE_FIND_PACKAGE_PPS
    CMAKE_DISABLE_FIND_PACKAGE_WrapResolve
    CMAKE_DISABLE_FIND_PACKAGE_X11
    CMAKE_DISABLE_FIND_PACKAGE_XCB
    CMAKE_DISABLE_FIND_PACKAGE_XKB
    CMAKE_DISABLE_FIND_PACKAGE_XKB_COMMON_X11
    CMAKE_DISABLE_FIND_PACKAGE_XRender
    CMAKE_DISABLE_FIND_PACKAGE_ZSTD
    CMAKE_INSTALL_BINDIR
    FEATURE_xcb_native_painting
    FEATURE_xrender
    FETCHCONTENT_FULLY_DISCONNECTED
    HOST_PERL
    INPUT_xkbcommon
    VCPKG_PLATFORM_TOOLSET
    VCPKG_SET_CHARSET_FLAG
    _VCPKG_ROOT_DIR


CMake Generate step failed.  Build files cannot be regenerated correctly.
ninja: build stopped: subcommand failed.

@m-kuhn
Copy link
Member

m-kuhn commented Dec 20, 2024

Qt does not yet support macos 15 cleanly, see microsoft/vcpkg#41435 for a workaround.
As the error there is different, I am not sure this is related

@mansivincent
Copy link
Author

thanks you @m-kuhn, i will see microsoft/vcpkg#41435, maybe i will found how to fix it

@woutergd
Copy link
Contributor

I have the build already running on MacOS 15, but with an ARM version (M1). It indeed requires the VCPKG_HOST_TRIPLET-parameter to get the build fully running. Made a PR to add it in the docs as it took me a day to find out a couple of weeks ago, PR is here: #5909

@mansivincent
Copy link
Author

mansivincent commented Dec 23, 2024

thanks all for your reply, after taking your comments into account, I made a new pull request and ran the command as said before with VCPKG_HOST_TRIPLET=x64-osx:

 cmake -S . -B build-arm64-ios \
        -DVCPKG_HOST_TRIPLET=x64-osx \
        -DVCPKG_TARGET_TRIPLET=arm64-ios \
        -DWITH_VCPKG=ON \
        -DVCPKG_BUILD_TYPE=release \
        -DCMAKE_SYSTEM_NAME=iOS \
        -DCMAKE_OSX_SYSROOT=iphoneos \
        -DCMAKE_OSX_ARCHITECTURES=arm64 \
        -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
        -GXcode

but near the end I made this error in the log file :
QField/build-arm64-ios/_deps/vcpkg-src/buildtrees/qgis/install-x64-osx-rel-out.log:

ninja: build stopped: subcommand failed. 

QField/build-arm64-ios/vcpkg-manifest-install.log

error: building qgis:x64-osx failed with: BUILD_FAILED

if someone can tell me what did i made wrong to fix it :)

@m-kuhn
Copy link
Member

m-kuhn commented Dec 24, 2024

Is there a "See logs for more information" section in your output?

@mansivincent
Copy link
Author

i have only this :

CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
Command failed: /usr/local/bin/cmake --build . --config Release --target install -- -v -j17
Working Directory: qfield_project/QField/build-arm64-ios/_deps/vcpkg-src/buildtrees/qgis/x64-osx-rel
See logs for more information:
qfield_project/QField/build-arm64-ios/_deps/vcpkg-src/buildtrees/qgis/install-x64-osx-rel-out.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_build_cmake.cmake:78 (vcpkg_execute_build_process)
scripts/cmake/vcpkg_install_cmake.cmake:18 (vcpkg_build_cmake)
/qfield_project/QField/vcpkg/ports/qgis/portfile.cmake:188 (vcpkg_install_cmake)
scripts/ports.cmake:196 (include)

error: building qgis:x64-osx failed with: BUILD_FAILED
See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Elapsed time to handle qgis:x64-osx: 22 min
Please ensure you're using the latest port files with git pull and vcpkg update.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+qgis
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?title=[qgis]+Build+error+on+x64-osx&body=Copy+issue+body+from+%2FUsers%2Fvincentmansi%2FDesktop%2FStage_Montcocol%2Fqfield_project%2FQField%2Fbuild-arm64-ios%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md

-- Running vcpkg install - failed
CMake Error at build-arm64-ios/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:904 (message):
vcpkg install failed. See logs for more information:
/Users/vincentmansi/Desktop/Stage_Montcocol/qfield_project/QField/build-arm64-ios/vcpkg-manifest-install.log
Call Stack (most recent call first):
/usr/local/share/cmake/Modules/CMakeDetermineSystem.cmake:146 (include)
CMakeLists.txt:30 (project)

@woutergd
Copy link
Contributor

@mansivincent it mentions in the log you provided two different log files for this build error, did you check those? Checking the error it seems that it is failing on a build of QGIS, so I would start with that log file. Path that is listed is (see the last line just above the call stack): _qfield_project/QField/build-arm64-ios/deps/vcpkg-src/buildtrees/qgis/install-x64-osx-rel-out.log

In my experience these log files provide a more detailed explanation of the error that helps to find the root cause of the build failure.

@mansivincent
Copy link
Author

i already see this log file i have only this error in this one :

ninja: build stopped: subcommand failed.

@woutergd
Copy link
Contributor

@mansivincent not very helpful message itself, but it states that a subcommand failed, so you need to seek to the log about that. Only advice I can give is to check all related log files, and if you find errors run them through google to find if there are maybe any known issues with it. It is the same process what I did when running it over here with MacOS 15, but as that was Silicon based it is not fully comparable.

@mansivincent
Copy link
Author

mansivincent commented Dec 24, 2024

thx for you reply i will try to fix it and come back if i succes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants