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

[conan-center] Accept self.info.clear() as header-only #442

Merged
merged 1 commit into from
Aug 4, 2022

Conversation

uilianries
Copy link
Member

According to the migration guide, the self.info.clear() should be used to identify header-only recipes.

Documentation https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#the-package-id-method

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@danimtb
Copy link
Member

danimtb commented Aug 4, 2022

Moreover, we should add a migration check to the linter to use self.info.clear() instead of self.info.header_only()

@uilianries
Copy link
Member Author

@danimtb Yes, but still, this change id needed anyway, otherwise, conan-center hook complains about self.info.clear() usage.

@danimtb
Copy link
Member

danimtb commented Aug 4, 2022

@uilianries do you have an example of that? did it happen already?

@uilianries
Copy link
Member Author

@danimtb Yes: conan-io/conan-center-index#11981 (comment)

I needed to revert to self.info.header_only because Hooks didn't recognized my recipe as header-only and complained that was missing artifacts.

@uilianries uilianries requested a review from SSE4 August 4, 2022 11:42
@danimtb danimtb merged commit 09b758a into conan-io:master Aug 4, 2022
@jgsogo
Copy link
Contributor

jgsogo commented Aug 5, 2022

So self.info.header_only() is something that should never be used? The linter can just remove it from info object and syntax will complain

@uilianries
Copy link
Member Author

So self.info.header_only() is something that should never be used? The linter can just remove it from info object and syntax will complain

As soon as we run Conan 1.50 on CCI, we can apply that rule with the linter.

@jgsogo
Copy link
Contributor

jgsogo commented Aug 5, 2022

We are already running 1.50.1, so it's something we can already add.

I see in Conan codebase:

class ConanInfo(object):
    ...

    # FIXME: Rename this to "clear" in 2.0
    def header_only(self):
        self.settings.clear()
        self.options.clear()
        self.requires.clear()

    clear = header_only

@uilianries
Copy link
Member Author

We are already running 1.50.1, so it's something we can already add.

Yes, just in case you need to revert ... 😏

Anyway, I'm using self.info.clear() here and Conan Center, including linter, accepted.

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.

3 participants