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

check for patches not referenced in conandata.yml #536

Closed
wants to merge 3 commits into from

Conversation

ericLemanissier
Copy link
Contributor

@ericLemanissier
Copy link
Contributor Author

ericLemanissier commented Apr 24, 2024

I tried all recipes in CCI with

#!/bin/bash
conan config set hooks.conan-center
export CONAN_HOOK_ERROR_LEVEL=40
last_package_folder=""
find . -mindepth 1 -maxdepth 1 -type d  -printf '%f\n' | while read -r package; do
    yq '.versions | to_entries[] | "\(.key) \(.value.folder)"' "$package/config.yml" -r | while IFS= read -r line; do
        IFS=' ' read -r version folder <<< "$line"
        if [ "$package/$folder" != "$last_package_folder" ]; then
            last_package_folder="$package/$folder"
            conan export $package/$folder "$package/$version@"
        fi
    done
done

 
 
 

Results:

[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/2.13.0-0001-fix-fallthrough.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES)
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/1.1.1.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/fix-cmake-source-dir-and-targets.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/pstring.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/strlen.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/002-fix-event-destruct.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/1.3/0002-gzguts-xcode12-compile-fix.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/0021-typedef-clockid.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/0.48.0-0001-fix-cmake.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/0.51.0-0001-fix-cmake.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/0.52.0-0001-fix-cmake.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/0001-ign-tools-1.0.0-cmake-fixes.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/0002-ign-tools-1.2.0-cmake-fixes.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES)
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/fix-install-6.0.0.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/fix-mingw-msvc2015-export-assert-fail-6.1.0.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/0003-fix-diligent-core-include-paths.diff (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/support-SPV_KHR_fragment_shading_rate.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch files is not referenced in conandata.yml: patches/20230104-0001-remove-mac-deploy.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES)

 
 
 

Hooks errors not related to this change

(it looks like conan-io/conan-center-index#20516 (comment) does not work any more):

[HOOK - conan-center.py] pre_export(): ERROR: [REQUIREMENT OVERRIDE PARAMETER (KB-H075)] self.requires('package/version', override=True) is forbidden, do not force override parameter. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H075-REQUIREMENT-OVERRIDE-PARAMETER) 
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] The versions {'878.200.35-opt'} are in 'patches' but not in 'sources'. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES) 

@uilianries
Copy link
Member

Nice! I see it as a good improvement, but I would prefer fixing all recipes first, because it's classified as error. Otherwise, any non-related PR would be broken.

@ericLemanissier

This comment was marked as outdated.

@ericLemanissier
Copy link
Contributor Author

ericLemanissier commented Apr 24, 2024

@uilianries done, I integrated the information in my message above

hooks/conan-center.py Outdated Show resolved Hide resolved
@ericLemanissier
Copy link
Contributor Author

As you wanted, all the patches are now grouped on the same line instead of one line per patch.
Here are two examples of logs generated:

[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch file(s) are/is not referenced in conandata.yml: patches/2.13.0-0001-fix-fallthrough.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES)
[HOOK - conan-center.py] pre_export(): ERROR: [NO DANGLING PATCHES (KB-H078)] Following patch file(s) are/is not referenced in conandata.yml: patches/1.1.1.patch, patches/fix-cmake-source-dir-and-targets.patch, patches/pstring.patch, patches/strlen.patch (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H078-NO-DANGLING-PATCHES)

I don't think it's more readable, but as you want

@ericLemanissier
Copy link
Contributor Author

@uilianries all the fixes have been merged. The only offenders remaining are either deprecated, or not compatible with conan 2.

Copy link
Contributor

@jcar87 jcar87 left a comment

Choose a reason for hiding this comment

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

Pending discussion with the team.
(likely to be merged, this is a good change, thanks @ericLemanissier )

@ericLemanissier
Copy link
Contributor Author

@jcar87 What's the opinion of the team regarding this change ?

@ericLemanissier
Copy link
Contributor Author

@jcar87 @uilianries can we please have an update on the status of this PR ?

@ericLemanissier
Copy link
Contributor Author

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

Successfully merging this pull request may close these issues.

4 participants