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

refine Folly recipe #13621

Merged
merged 6 commits into from
Oct 24, 2022
Merged

refine Folly recipe #13621

merged 6 commits into from
Oct 24, 2022

Conversation

kexianda
Copy link
Contributor

folly

refine folly recipe

1. add sse42 option
some libraries depends on folly, but with simd enabled. It will causes
compiling error if folly has no such option.

2. folly project exports cmake file with components, such as folly::follybenchmark.
To keep consistent with folly's project, add components info

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

@CLAassistant
Copy link

CLAassistant commented Oct 20, 2022

CLA assistant check
All committers have signed the CLA.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

1. add sse42 option
projects with simd enabled can not not be linked with folly since sse is not
enabled currently.

2. Keep consistent with folly's cmake files.
folly itself export components such as follybenchmark
the cmake script uses target_link_libraries(xxlib Folly::follybenchmark)
works if using manually install folly. but will fail if uses conan's
recipe.
@ghost
Copy link

ghost commented Oct 20, 2022

I detected other pull requests that are modifying folly/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@ghost ghost mentioned this pull request Oct 20, 2022
4 tasks
@@ -144,6 +150,9 @@ def source(self):
def _configure_cmake(self):
cmake = CMake(self)
if can_run(self):
if self.options.with_sse4_2:
Copy link
Member

Choose a reason for hiding this comment

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

Since when is it available? Is it backward compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sse4.2 support was in folly long long ago (>7 years)
I will set option default to False to be backward compatible.

}
default_options = {
"shared": False,
"fPIC": True,
"with_sse4_2" : True
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"with_sse4_2" : True
"use_sse4_2" : True

with is not a good prefix, as it's not a dependency. Prefer use instead: https://github.com/conan-io/conan-center-index/blob/master/docs/packaging_policy.md#recommended-feature-options-names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. fixed.

self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"]
self.cpp_info.components["folly_test_util"].requires = ["libfolly"]

if Version(self.version) >= "2020.08.10.00" and self.settings.os == "Linux":
Copy link
Member

Choose a reason for hiding this comment

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

Bad indentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not bad indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is OK to adjust the indentation..

@conan-center-bot

This comment has been minimized.

@@ -144,6 +151,9 @@ def source(self):
def _configure_cmake(self):
cmake = CMake(self)
if can_run(self):
if self.options.use_sse4_2 and str(self.settings.arch) in ['x86', 'x86_64']:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self.options.use_sse4_2 and str(self.settings.arch) in ['x86', 'x86_64']:
if self.options.get_safe("use_sse4_2"):

Let's say we are using ARM arch here. The option use_sse4_2 will not be available and will break conan create command. Checking the arch should be done in validate() method, like:

def validate(self):
    if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']:
        raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. fixed.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@kexianda
Copy link
Contributor Author

@uilianries
"continuous-integration/jenkins/pr-merge — This commit cannot be built" [Details]
I've built it sucessfully on my linux desktop. I want to know how it failed, I clicked the 'Details', but got "403 Forbidden"
How to get detailed error information? Thanks in advance.

@conan-center-bot

This comment has been minimized.

@uilianries
Copy link
Member

@kexianda The CI result says: #13621 (comment)

Please, remove the line /test_v1_package/conanfile.py:# pylint: skip-file

@conan-center-bot

This comment has been minimized.

jwillikers
jwillikers previously approved these changes Oct 22, 2022
@@ -103,7 +110,7 @@ def validate(self):
raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format(
self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version))

if self.version < "2022.01.31.00" and self.settings.os != "Linux":
if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux":
raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00")

if self.settings.os == "Macos" and self.settings.arch != "x86_64":
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this finally be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can this finally be updated?
thanks. fixed now

Copy link
Contributor

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

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

The new targets are not exported by the project (usually when it changes over versions we just do latest) but some more work is needed if you want this available in older versions

@@ -254,3 +268,30 @@ def package_info(self):
self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly"
self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly")
self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly")

if Version(self.version) >= "2019.10.21.00":
self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I clearly did not drink enough coffee.

Perfect thank you for pointign that out!

@conan-center-bot
Copy link
Collaborator

All green in build 10 (4fa53b8f7e18e780c761f31ca13f0eeac86a71ca):

  • folly/2022.01.31.00@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py", line 6, in <module>
        from conans import CMake, tools
    ImportError: cannot import name 'CMake' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • folly/2020.08.10.00@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py", line 6, in <module>
        from conans import CMake, tools
    ImportError: cannot import name 'CMake' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • folly/2019.10.21.00@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-13621/recipes/folly/all/conanfile.py", line 6, in <module>
        from conans import CMake, tools
    ImportError: cannot import name 'CMake' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    

@conan-center-bot conan-center-bot merged commit f6e9704 into conan-io:master Oct 24, 2022
@kexianda kexianda deleted the folly branch October 26, 2022 03:31
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.

6 participants