-
Notifications
You must be signed in to change notification settings - Fork 994
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
Feature: update conan new to latest guidelines #8106
Conversation
Signed-off-by: SSE4 <tomskside@gmail.com>
10c8264
to
6d46b12
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.
Could you update test_cmake
template? By default it is not allowed by hook KB-H048
:
[HOOK - conan-center.py] pre_export(): ERROR: [CMAKE VERSION REQUIRED (KB-H048)] The test_package/CMakeLists.txt requires CMake 3.1 at least. Update to 'cmake_minimum_required(VERSION 3.1)'. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H048)
np, updated |
/cc @ericLemanissier @Croydon @madebr @uilianries @SpaceIm @prince-chrismc |
Signed-off-by: SSE4 <tomskside@gmail.com>
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.
A few suggestions because of comments that are common
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC |
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 am fairly certain this is also expected during review
def config_options(self): | |
if self.settings.os == "Windows": | |
del self.options.fPIC | |
def config_options(self): | |
if self.settings.os == "Windows": | |
del self.options.fPIC | |
def configure(self): | |
if self.options.shared: | |
del self.options.fPIC |
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.
Not completely sure, many recipes do not implement it yet. I would say wait until this is discussed a bit more, seems that some Conan built-in helpers would be better.
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.
agree
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
this code has 361 occurrences on CCI
def configure(self):
if self.options.shared:
del self.options.fPIC
this one is only 264.
so, probably, it might be too early to enforce that, as it's not an established practice on CCI.
earlier we also had proposal for so called shared_library_package_id
to be used in recipes, I don't remember what was a conclusion.
we need to talk about these two IMO before we start to recommend them.
@@ -145,6 +153,9 @@ def source(self): | |||
|
|||
def package(self): | |||
self.copy("*.h", "include") | |||
|
|||
def package_id(self): | |||
self.info.header_only() |
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 understand this is more explicit than just a recipe without settings, but we are adding more code here that is unneeded. If this is a pattern followed in CCI for example, then I am ok with it. Maybe we should consider it for conan 2.0 (enforce settings always?)
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 guess it might be error prone without explicit, e.g. if you add some settings and options to the recipe after running conan new
, it's easy to forget about this method.
same if you decide to add more requirements, as header_only
now contains:
self.requires.clear()
I believe the same package id is expected to be generated regardless of requires, which is not the case in the current template.
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.
LGTM
update several minor things in
conan new
command:fPIC
option handlingaddhomepage
attributeheader_only
topackage_id
cmake_minimum_required(VERSION 3.1)
this makes it easier to create package skeletons - fewer things need to be edited
Changelog: Feature: Update
conan new
to latest guidelines.Docs: omit
#tags: slow