-
Notifications
You must be signed in to change notification settings - Fork 993
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
Deprecate 'cppflags' in favor of 'cxxflags' in class CppInfo #4611
Conversation
b7d4585
to
fad1d9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, the only thing if we are going to remove it in Conan 2.0, we might want to raise an Exception, so defining it is not silently dismissed.
I think the approach proposed is right and the Please make sure to update the docs! |
I would like to use the approach recommended by the """
TODO: Need to solve the circular dependency when importing `conans.__version__` in build_info.py
@deprecation.fail_if_not_remove
def test_deprecation_v2(self):
cpp_info = CppInfo("roothpath")
self.assertListEqual(cpp_info.cppflags, [])
"""
def test_deprecation_v2(self):
cpp_info = CppInfo("roothpath")
import warnings
from conans import __version__
from packaging import version
if version.parse(__version__) >= version.parse("2.0"):
with warnings.catch_warnings(record=True) as caught_warnings:
warnings.simplefilter("always")
self.assertListEqual(cpp_info.cppflags, [])
if caught_warnings:
self.fail("CppInfo::cppflags must be removed in Conan 2.0") Other option is to move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not worried about raising an error in Conan 2.0, we will manage. Please add the docs to merge it.
The idea is to implement a test that fails in Conan v2.0 (so it will remember us that we have to delete that deprecated functionality), but the code will keep working the same... ... on my way to docs! |
Docs are ready! |
Deprecated since 1.13.0 conan-io/conan#4611 conan-io/docs#1091
Changelog: Fix: Deprecate 'cppflags' in favor of 'cxxflags' in class CppInfo
Docs: conan-io/docs#1091
closes #4337
In order to remove all the usages of the deprecated member in our codebase, I find one problem: the files written by the generators...
For example, the
conanbuildinfo.txt
file now contains[cppflags_Hello] FLAG
and the expected (for Conan v2.0) should be:
[cxxflags_Hello] FLAG
During the transition, we can output something like the following one, to keep compatibility:
So, our reader should be able to deal with the first option and the last one until Conan V2 (checking that both sections contain the same information). This is easy for the
txt
generator, but it might require some more testing for other generators.Maybe we can merge this PR jsut with the deprecation notice as the issue states, and then we can open a different PR to fix all the usages of this deprecated code. WDYT?