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

bzip2: modernize more #13703

Closed
wants to merge 1 commit into from
Closed

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Oct 23, 2022

Specify library name and version: lib/1.0

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.

- simplify CMakeLists
- test custom variables of FindBZip2 in test package
- protect deletion of fPIC option
- use export_conandata_patches
- use can_run in test package
@conan-center-bot

This comment has been minimized.

@ghost
Copy link

ghost commented Oct 23, 2022

I detected other pull requests that are modifying bzip2/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 23, 2022
4 tasks
@SpaceIm SpaceIm closed this Oct 23, 2022
@SpaceIm SpaceIm reopened this Oct 23, 2022
jwillikers added a commit to jwillikers/conan-center-index that referenced this pull request Oct 23, 2022
@jwillikers
Copy link
Contributor

@SpaceIm I've incorporated your changes into my existing PR #13667.

@conan-center-bot
Copy link
Collaborator

All green in build 4 (187bb6d067795032da3a2ed66a51a748d532d0eb):

  • bzip2/1.0.8@:
    All packages built successfully! (All logs)

  • bzip2/1.0.6@:
    All packages built successfully! (All logs)

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.

Please do not add a version check -- this wont be needed in the next beta

I'd appreciate if you can remove it from your other PRs too

bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.env_info.PATH.append(bin_path)
if Version(conan_version).major < 2:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if Version(conan_version).major < 2:

Copy link
Contributor

Choose a reason for hiding this comment

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

@jwillikers @toge Since you are also helping to opening/reviewing PRs -- please mark sure this is not being used ❤️

Copy link
Contributor Author

@SpaceIm SpaceIm Oct 24, 2022

Choose a reason for hiding this comment

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

Why? It's a better way than tones of TODO to track conan v1 stuff which are unused in conan v2 client. Code is better than comments.

Copy link
Member

Choose a reason for hiding this comment

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

Conan 2.0 is still beta, which means, not totally stable. It will accept env_info soon, so it should work for both versions. Also, adding an if adds more complexity, okay a recipe is small, but still, a new condition for something that should work is too much.

Copy link
Contributor

Choose a reason for hiding this comment

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

@uilianries can we avoid conditional code to check for v1/v2 from the recipe code? IMO, it should be possible to write recipe compatible with both v1 and v2 simultaneously, using only some common sub-set of v1/v2 features. if it's problematic, may v2 provide some dummy/stub objects to make migration process easier?

Copy link
Member

Choose a reason for hiding this comment

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

@SSE4 Yes, it's possible to avoid conditional code. We have added new issues for Conan v2, keeping compatibility, or at least some stub. env_info is one case, which will be supported on beta-5, but without any practical effect, only to keep Conan v1 working with v2.

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

Choose a reason for hiding this comment

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

#13754

Removing it . Thanks for pointing it out

@SpaceIm SpaceIm marked this pull request as draft October 24, 2022 17:12
@SpaceIm
Copy link
Contributor Author

SpaceIm commented Oct 24, 2022

duplicate of #13667

@SpaceIm SpaceIm closed this Oct 24, 2022
conan-center-bot pushed a commit that referenced this pull request Oct 24, 2022
* bzip2: Conan V2 improvments

Use export patches method.
Safely delete fPIC option.
Use Python F-Strings.

* Remove redundant package name from topics

* Modernize the CMakeLists.txt file

* Fix spacing

* Use can_run in test package

* Incorporate changes from #13703

* More fixes

* Remove use of conan_version

* Update recipes/bzip2/all/test_package/CMakeLists.txt

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
@SpaceIm SpaceIm deleted the bzip2-modernize-more branch October 24, 2022 23:20
Cogitri pushed a commit to dampsoft/conan-center-index that referenced this pull request Nov 2, 2022
* bzip2: Conan V2 improvments

Use export patches method.
Safely delete fPIC option.
Use Python F-Strings.

* Remove redundant package name from topics

* Modernize the CMakeLists.txt file

* Fix spacing

* Use can_run in test package

* Incorporate changes from conan-io#13703

* More fixes

* Remove use of conan_version

* Update recipes/bzip2/all/test_package/CMakeLists.txt

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
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