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

Add asn1c/0.9.28 #12015

Merged
merged 7 commits into from
Aug 12, 2022
Merged

Add asn1c/0.9.28 #12015

merged 7 commits into from
Aug 12, 2022

Conversation

theirix
Copy link
Contributor

@theirix theirix commented Aug 2, 2022

Specify library name and version: asn1c/0.9.28

This is also a good place to share with all of us why you are submitting this PR (specially if it is a new addition to ConanCenter): is it a dependency of other libraries you want to package? Are you the author of the library? Thanks!


  • 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.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

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

Conan Center Index is moving toward to Conan 2.0

Some linters are checking if new PRs are minimally compatible with Conan 2.0. As some methods will be removed in the future, the linter asks to update them.

Comment on lines 1 to 2
from conans import ConanFile, AutoToolsBuildEnvironment, tools
from conans.errors import ConanInvalidConfiguration
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
from conans import ConanFile, AutoToolsBuildEnvironment, tools
from conans.errors import ConanInvalidConfiguration
from conan import ConanFile
from conan.tools.files import get, rmdir, chdir
from conans import AutoToolsBuildEnvironment, tools
from conan.errors import ConanInvalidConfiguration

from conans.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.33.0"
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
required_conan_version = ">=1.33.0"
required_conan_version = ">=1.47.0"

del self.info.settings.compiler

def source(self):
tools.get(**self.conan_data["sources"][self.version],
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
tools.get(**self.conan_data["sources"][self.version],
get(self, **self.conan_data["sources"][self.version],

return self._autotools

def build(self):
with tools.chdir(self._source_subfolder):
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 tools.chdir(self._source_subfolder):
with chdir(self, self._source_subfolder):

Comment on lines 68 to 69
tools.rmdir(os.path.join(self.package_folder, "res", "doc"))
tools.rmdir(os.path.join(self.package_folder, "res", "man"))
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
tools.rmdir(os.path.join(self.package_folder, "res", "doc"))
tools.rmdir(os.path.join(self.package_folder, "res", "man"))
rmdir(self, os.path.join(self.package_folder, "res", "doc"))
rmdir(self, os.path.join(self.package_folder, "res", "man"))

@@ -0,0 +1,22 @@
from conans import ConanFile, CMake, tools
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
from conans import ConanFile, CMake, tools
from conans import CMake
from conan import ConanFile
from conan.tools.build import cross_building

cmake.build()

def test(self):
if not tools.cross_building(self):
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 not tools.cross_building(self):
if not cross_building(self):

@theirix
Copy link
Contributor Author

theirix commented Aug 3, 2022

@uilianries , thanks for suggestions! What a coincidence, I have already prepared almost the same changes :-)

Anyway I was confused by a few problems.

  1. How to replace a very popular os_info? I do not see equivalents for tools.os_info and others in conan package.

  2. Is it right that for 2.0-ready recipes we have not have any conans imports? Docs stated that. If so, should we place feature requests to the Conan?

  3. Conan-center's pylint-based v2 linter is amazing. How can I run it locally?

@uilianries
Copy link
Member

uilianries commented Aug 3, 2022

@theirix

How to replace a very popular os_info? I do not see equivalents for tools.os_info and others in conan package.

It's still not available (ported). I suggest you opening an issue to Conan client, because they are removing many things and if you explain your case, there is a chance of porting it.

Is it right that for 2.0-ready recipes we have not have any conans imports? Docs stated that. If so, should we place feature requests to the Conan?

True, some of them are being migrated. For instance, check_min_cppstd requires Conan 1.50, which is not running on Conan Center yet. Placing a new feature request to keep tools which you judge as important is the best move, as more people can have same situation.

Conan-center's pylint-based v2 linter is amazing. How can I run it locally?

Excellent question! Indeed, it deserves a documentation. In short term, you need to copy the linter folder locally (which you already have with your git clone to conan-center-index), then you need to run those steps listed on Github Actions: https://github.com/conan-io/conan-center-index/blob/master/.github/workflows/linter-conan-v2.yml#L82. Of course, don't forget to install pylint first.

For instance:

$ pylint --rcfile=linter/pylintrc_recipe recipes/boost/all/conanfile.py

@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
Copy link
Collaborator

All green in build 6 (b37c9ab2393d67a6bda38c62757a6cf60532fa73):

  • asn1c/0.9.28@:
    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-12015/recipes/asn1c/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12015/recipes/asn1c/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-12015/recipes/asn1c/all/conanfile.py", line 1, in <module>
        from conans import AutoToolsBuildEnvironment, tools
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    

@conan-center-bot conan-center-bot merged commit 5cd5d97 into conan-io:master Aug 12, 2022
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.

None yet

4 participants