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

ios-cmake: migrate to Conan v2, improve test_package #21532

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Dec 1, 2023

No description provided.

@conan-center-bot

This comment has been minimized.

@valgur valgur force-pushed the migrate/ios-cmake branch from 6174a8e to cdb0111 Compare December 3, 2023 21:53
@conan-center-bot

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Dec 3, 2023

Hooks produced the following warnings for commit cdb0111
ios-cmake/3.1.2@#579c560cc6c3cdaf7f6fabc8f2d9c11e
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] The *.cmake files have to be placed in a folder declared as `cpp_info.builddirs`. Currently folders declared: {'/Users/jenkins/w/prod-v1/bsr/65799/edfea/.conan/data/ios-cmake/3.1.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/'}
post_package_info(): WARN: [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] Found files: ./lib/cmake/ios-cmake/ios.toolchain.cmake

@conan-center-bot

This comment has been minimized.

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments, otherwise I like how this looks :)

"WATCHOSCOMBINED", "SIMULATOR_WATCHOS",
"MAC", "MAC_ARM64", "MAC_CATALYST", "MAC_CATALYST_ARM64"]
"toolchain_target": [
"auto",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use the fact that we're migrating this to Conan 2 to remove the auto value altogether so we don't need to check for it later? wdyt @valgur?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that would work. The logic in config_options() sets the default value to an appropriate one based on self.settings.os and falls back to auto if it cannot be determined. The self._default_toolchain_target property does not cover several Apple OS-s, notably Macos.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh so then the idea is that if it's not able to be guessed, we fail later in the validate if it's still set to auto? My only concern is that then running conan create ... -o="&:toolchain_target=auto" will always fail, the CLI value is overriding the decision in config_options

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see - I've pushed a minor change to let users pass auto and have it be still auto-guessed, let me know if it works for you :)

Copy link
Contributor Author

@valgur valgur Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm... self.options always report their default value in configure(), even if the user overrides them. But only if packge_type = "build-scripts" for some reason.

Second, it always fails with:

ConanException: Incorrect attempt to modify option 'toolchain_target' from 'auto' to 'xyz'

It would be great if the Conan client got rid of that artificial limitation. :/

The VTK PR (#10776) actually manages to work around that limitation through some black magic, basically doing:

def configure(self):
    overrides = {}
    if self.options.toolchain_target == "auto":
        overrides["toolchain_target"] = self._default_toolchain_target
    self.options.update(self.options.possible_values, dict(self.options.items(), **overrides))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build-scripts package type is super-buggy or simply inconsistent with the options handling overall, for some reason. The user-supplied option values are simply ignored and not even validated to be one of the allowed values.

Copy link
Contributor Author

@valgur valgur Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh... the options actually work, but only if I use -o:b toolchain_target=.... This could maybe be documented better.

recipes/ios-cmake/all/conanfile.py Outdated Show resolved Hide resolved
@AbrilRBS AbrilRBS self-assigned this Jul 15, 2024
@conan-center-bot

This comment has been minimized.

AbrilRBS
AbrilRBS previously approved these changes Jul 16, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 5 (f7cb71c3919a2bbf1c5685a2d84044abeaf8cb19):

  • ios-cmake/3.1.2:
    CI failed to create some packages (All logs)

    Logs for packageID 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9:
    [settings]
    arch=armv8
    build_type=Release
    compiler=apple-clang
    compiler.libcxx=libc++
    compiler.version=13.0
    os=Macos
    
    [...]
    Installing package: ios-cmake/3.1.2
    Requirements
        ios-cmake/3.1.2 from local cache - Cache
    Packages
        ios-cmake/3.1.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Build
    
    Installing (downloading, building) binaries...
    [HOOK - conan-center.py] pre_source(): [IMMUTABLE SOURCES (KB-H010)] OK
    ios-cmake/3.1.2: Configuring sources in /Users/jenkins/workspace/prod-v1/bsr/71216/bcead/.conan/data/ios-cmake/3.1.2/_/_/source/src
    ios-cmake/3.1.2: 
    ios-cmake/3.1.2: Unzipping 196.4KB, this can take a while
    ios-cmake/3.1.2: 
    [HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK
    [HOOK - conan-center.py] post_source(): [CPPSTD MANAGEMENT (KB-H022)] OK
    [HOOK - conan-center.py] post_source(): [SHORT_PATHS USAGE (KB-H066)] OK
    ios-cmake/3.1.2: Copying sources to build folder
    ios-cmake/3.1.2: Building your package in /Users/jenkins/workspace/prod-v1/bsr/71216/bcead/.conan/data/ios-cmake/3.1.2/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
    ios-cmake/3.1.2: Generator txt created conanbuildinfo.txt
    ios-cmake/3.1.2: Aggregating env generators
    [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found
    [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK
    ios-cmake/3.1.2: Calling build()
    ios-cmake/3.1.2: Package '5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9' built
    ios-cmake/3.1.2: Build folder /Users/jenkins/workspace/prod-v1/bsr/71216/bcead/.conan/data/ios-cmake/3.1.2/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/build-release
    ios-cmake/3.1.2: Generated conaninfo.txt
    ios-cmake/3.1.2: Generated conanbuildinfo.txt
    ios-cmake/3.1.2: Generating the package
    ios-cmake/3.1.2: Package folder /Users/jenkins/workspace/prod-v1/bsr/71216/bcead/.conan/data/ios-cmake/3.1.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
    ios-cmake/3.1.2: Calling package()
    ios-cmake/3.1.2: Copied 1 file: cmake-wrapper
    ios-cmake/3.1.2: Copied 1 '.cmake' file: ios.toolchain.cmake
    ios-cmake/3.1.2: Copied 1 '.md' file: LICENSE.md
    [HOOK - conan-center.py] post_package(): [PACKAGE LICENSE (KB-H012)] OK
    [HOOK - conan-center.py] post_package(): [DEFAULT PACKAGE LAYOUT (KB-H013)] OK
    [HOOK - conan-center.py] post_package(): [SHARED ARTIFACTS (KB-H015)] OK
    [HOOK - conan-center.py] post_package(): [STATIC ARTIFACTS (KB-H074)] OK
    [HOOK - conan-center.py] post_package(): [EITHER STATIC OR SHARED OF EACH LIB (KB-H076)] OK
    [HOOK - conan-center.py] post_package(): [PC-FILES (KB-H020)] OK
    [HOOK - conan-center.py] post_package(): [CMAKE-MODULES-CONFIG-FILES (KB-H016)] OK
    [HOOK - conan-center.py] post_package(): [PDB FILES NOT ALLOWED (KB-H017)] OK
    [HOOK - conan-center.py] post_package(): [LIBTOOL FILES PRESENCE (KB-H018)] OK
    [HOOK - conan-center.py] post_package(): [MS RUNTIME FILES (KB-H021)] OK
    [HOOK - conan-center.py] post_package(): [SHORT_PATHS USAGE (KB-H066)] OK
    [HOOK - conan-center.py] post_package(): [MISSING SYSTEM LIBS (KB-H043)] OK
    [HOOK - conan-center.py] post_package(): [APPLE RELOCATABLE SHARED LIBS (KB-H077)] OK
    WARN: *** Conan 1 is legacy and on a deprecation path ***
    WARN: *** Please upgrade to Conan 2 ***
    [HOOK - conan-center.py] post_package(): ERROR: [MATCHING CONFIGURATION (KB-H014)] Package for Header Only does not contain artifacts with these extensions: ['h', 'h++', 'hh', 'hxx', 'hpp', 'cuh'] (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H014-MATCHING-CONFIGURATION) 
    [HOOK - conan-center.py] post_package(): ERROR: [MATCHING CONFIGURATION (KB-H014)] Packaged artifacts does not match the settings used: os=Macos, compiler=apple-clang (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H014-MATCHING-CONFIGURATION) 
    ERROR: [HOOK - conan-center.py] post_package(): Some checks failed running the hook, check the output
    
  • ios-cmake/4.0.0:
    Didn't run or was cancelled before finishing

  • ios-cmake/4.1.1:
    Didn't run or was cancelled before finishing

  • ios-cmake/4.2.0:
    Didn't run or was cancelled before finishing

  • ios-cmake/4.4.1:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

Failure in build 5 (f7cb71c3919a2bbf1c5685a2d84044abeaf8cb19):

  • ios-cmake/3.1.2:
    Didn't run or was cancelled before finishing

  • ios-cmake/4.0.0:
    CI failed to create some packages (All logs)

    Logs for packageID da39a3ee5e6b4b0d3255bfef95601890afd80709:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=apple-clang
    compiler.cppstd=17
    compiler.libcxx=libc++
    compiler.version=13
    os=Macos
    
    [...]
    compiler.cppstd=17
    compiler.libcxx=libc++
    compiler.version=13
    os=Macos
    [conf]
    tools.apple:sdk_path=/Applications/conan/xcode/13.0/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
    tools.system.package_manager:mode=install
    tools.system.package_manager:sudo=True
    
    
    ======== Computing dependency graph ========
    Graph root
        cli
    Requirements
        ios-cmake/4.0.0#ea49206298cb524202d83ea0e900c304 - Cache
    
    ======== Computing necessary packages ========
    ios-cmake/4.0.0: Forced build from source
    Requirements
        ios-cmake/4.0.0#ea49206298cb524202d83ea0e900c304:da39a3ee5e6b4b0d3255bfef95601890afd80709 - Build
    
    ======== Installing packages ========
    ios-cmake/4.0.0: Calling source() in /Users/jenkins/workspace/prod-v2/bsr/64235/fcfed/p/ios-cc5e9d469a9f4a/s/src
    ios-cmake/4.0.0: WARN: File https://github.com/leetal/ios-cmake/archive/4.0.0.zip not found in https://c3i.jfrog.io/artifactory/conan-center-backup-sources/
    ios-cmake/4.0.0: Unzipping 176.2KB, this can take a while
    
    
    -------- Installing package ios-cmake/4.0.0 (1 of 1) --------
    ios-cmake/4.0.0: Building from source
    ios-cmake/4.0.0: Package ios-cmake/4.0.0:da39a3ee5e6b4b0d3255bfef95601890afd80709
    ios-cmake/4.0.0: Copying sources to build folder
    ios-cmake/4.0.0: Building your package in /Users/jenkins/workspace/prod-v2/bsr/64235/fcfed/p/b/ios-c68228e034f4d6/b
    ios-cmake/4.0.0: Generating aggregated env files
    ios-cmake/4.0.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
    ios-cmake/4.0.0: Calling build()
    ios-cmake/4.0.0: Package 'da39a3ee5e6b4b0d3255bfef95601890afd80709' built
    ios-cmake/4.0.0: Build folder /Users/jenkins/workspace/prod-v2/bsr/64235/fcfed/p/b/ios-c68228e034f4d6/b/build-release
    ios-cmake/4.0.0: Generating the package
    ios-cmake/4.0.0: Packaging in folder /Users/jenkins/workspace/prod-v2/bsr/64235/fcfed/p/b/ios-c68228e034f4d6/p
    ios-cmake/4.0.0: Calling package()
    ios-cmake/4.0.0: package(): Packaged 1 file: cmake-wrapper
    ios-cmake/4.0.0: package(): Packaged 1 '.md' file: LICENSE.md
    ios-cmake/4.0.0: package(): Packaged 1 '.cmake' file: ios.toolchain.cmake
    ios-cmake/4.0.0: Created package revision 1624825ebece0377760fcdc65ed02dd6
    ios-cmake/4.0.0: Package 'da39a3ee5e6b4b0d3255bfef95601890afd80709' created
    ios-cmake/4.0.0: Full package reference: ios-cmake/4.0.0#ea49206298cb524202d83ea0e900c304:da39a3ee5e6b4b0d3255bfef95601890afd80709#1624825ebece0377760fcdc65ed02dd6
    ios-cmake/4.0.0: Package folder /Users/jenkins/workspace/prod-v2/bsr/64235/fcfed/p/b/ios-c68228e034f4d6/p
    ERROR: ios-cmake/4.0.0: Error in package_info() method, line 134
    	if not settings.os:
    	AttributeError: 'NoneType' object has no attribute 'os'
    
  • ios-cmake/4.1.1:
    Didn't run or was cancelled before finishing

  • ios-cmake/4.4.1:
    Didn't run or was cancelled before finishing

  • ios-cmake/4.2.0:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@AbrilRBS AbrilRBS removed their assignment Dec 3, 2024
@amerry
Copy link
Contributor

amerry commented Dec 10, 2024

@valgur are you still intending to work on this PR? This is package is a sticking point for my work's internal Conan 2 migration, so we can probably pick it up if you don't have time (although it doesn't look like it needs much work to drive it forwards? Maybe just rebasing to set off another CI run?).

@valgur
Copy link
Contributor Author

valgur commented Dec 10, 2024

I'd be happy to help, but honestly, it's probably more likely to be merged if you open a new PR based off this one. I am no longer able to trigger the PRs without the team since to the newly-imposed limit on the number of allowed open PRs, and new PRs tend to get more immediate attention as well, it seems.

@valgur valgur marked this pull request as draft January 9, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants