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

MPFR: partial Conan 2.0 Compatibility #14687

Merged
merged 42 commits into from
Apr 5, 2023

Conversation

System-Arch
Copy link
Contributor

Specify library name and version: mpfr/4.1.0

Migrated recipe to Conan 2.0. Resolves #14666. Note that these changes are untested on Windows with Conan 2.0 because some of the required dependencies don't build with 20 yet


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

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@Hopobcn Hopobcn mentioned this pull request Jan 19, 2023
4 tasks
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit ecf6011
mpfr/4.1.0
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libmpfr.dylib, libmpfr.6.dylib
mpfr/4.0.2
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libmpfr.dylib, libmpfr.6.dylib

@conan-center-bot

This comment has been minimized.

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.

After some length discussion...

Because this code path is not tested but CI, it's very likely to break in subsequent PRs - it has a higher risk of negatively impacting the larger consumers base (to the benefits of only a few). It adds a burden to the reviewers and maintainers to make future changes. We, are willing to accept some extra effort for individual contributors as long as it prevents pain on the larger community.


Our recommendation for user who need to build from Git source with CCI recipes is to git archive the commit then and pull those in with a entry in conandata.yml such that the normal workflow is preserved.

@@ -20,155 +26,174 @@ class MpfrConan(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
"exact_int": ["mpir", "gmp",]
"exact_int": ["mpir", "gmp",],
"autogen": [True, False],
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this option and the extra dependencies 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @prince-chrismc,

Thanks for your feedback. Certainly, I will do as you request (and we will maintain a private fork of the recipe to meet our needs), but I wanted to clarify a couple of points:

  1. These changes work even without using Git source. They simply enable the regeneration of the configure script and Makefiles from their .ac and .in templates. AutotoolsToolchain even has a method for this: Autotools::autoreconf().
  2. It is unclear to me how the "git archive" approach would work unless one first runs autoreconf manually before archiving the resulting build area. The benefit of the pending change is that it leverages Conan to automatically ensure one has a self-consistent version of the autotools (autoconf, automake, libtool, etc.) needed to actually be able to run autoreconf to create configure and Makefiles from Git source. In jettisoning this code, CCI is loosing that information and tooling.
  3. I think this use case points out an opportunity for a Conan enhancement, which is the ability to add tags to patches in the conandata.yml file. Such a feature would permit selective application of patches on an as needed basis. For example, apply_conandata_patches applies Windows-specific patches regardless of what platform it is running on. Had such a feature existed, I would have used it to selectively apply the autogen patches.
    Thanks

Comment on lines 143 to 145
# Only apply this patch when building from Git source to prevent Makefile from
# invoking autoconf due to to changed .ac or .m4 file
patch(self, patch_file=os.path.join(self.export_sources_folder, "patches", f'{self.version}-0001-configure.ac-fixes.patch'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this logic and the subsequent autogen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed, but please see message above about how an enhancement to apply_conandata_patches would have made this cleaner.

@conan-center-bot

This comment has been minimized.

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

Looking really good, just a comment about test_v1_package

recipes/mpfr/all/test_v1_package/CMakeLists.txt Outdated Show resolved Hide resolved
Co-authored-by: Uilian Ries <uilianries@gmail.com>
@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.

LGTM

@SpaceIm
Copy link
Contributor

SpaceIm commented Mar 24, 2023

It's doesn't pass v2 pipeline for the moment, while claiming to be v2 compatible.

@prince-chrismc prince-chrismc self-requested a review April 5, 2023 20:53
@prince-chrismc prince-chrismc changed the title MPFR Conan 2.0 Compatibility MPFR: partial Conan 2.0 Compatibility Apr 5, 2023
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.

This has a lot of good work so I will give it a tick, we can polish the 2.0 to pass in the next PR :)

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 44 (1a61172d261a1daffd18290efd7f4bce965cf4d8):

  • mpfr/4.1.0@:
    All packages built successfully! (All logs)

  • mpfr/4.0.2@:
    All packages built successfully! (All logs)


Conan v2 pipeline (informative, not required for merge) ❌

Note: Conan v2 builds are informative and they are not required for the PR to be merged.

The v2 pipeline failed. Please, review the errors and note this will be required for pull requests to be merged in the near future.

See details:

Failure in build 47 (1a61172d261a1daffd18290efd7f4bce965cf4d8):

  • mpfr/4.1.0@:
    CI failed to create some packages (All logs)

    Logs for packageID 120b68957e77b6ca66ea506daddd9511347758da:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.cppstd=gnu17
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=True
    
    [...]
    -------- Installing package mpfr/4.1.0 (2 of 2) --------
    mpfr/4.1.0: Building from source
    mpfr/4.1.0: Package mpfr/4.1.0:120b68957e77b6ca66ea506daddd9511347758da
    mpfr/4.1.0: Copying sources to build folder
    mpfr/4.1.0: Building your package in /home/conan/w/prod-v2/BuildSingleReference/p/t/mpfr72e98faa33b91/b
    mpfr/4.1.0: Calling generate()
    mpfr/4.1.0: Generators folder: /home/conan/w/prod-v2/BuildSingleReference/p/t/mpfr72e98faa33b91/b/build-release/conan
    mpfr/4.1.0: Generating aggregated env files
    mpfr/4.1.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
    mpfr/4.1.0: Calling build()
    mpfr/4.1.0: Apply patch (portability): Windows header DLL
    mpfr/4.1.0: Calling:
     > "/home/conan/w/prod-v2/BuildSingleReference/p/t/mpfr72e98faa33b91/b/src/configure" --enable-shared --disable-static --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --enable-thread-safe --with-gmp=/home/conan/w/prod-v2/BuildSingleReference/p/gmp4efe3e83e00c3/p 
    mpfr/4.1.0: RUN: "/home/conan/w/prod-v2/BuildSingleReference/p/t/mpfr72e98faa33b91/b/src/configure" --enable-shared --disable-static --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --enable-thread-safe --with-gmp=/home/conan/w/prod-v2/BuildSingleReference/p/gmp4efe3e83e00c3/p 
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... no
    checking for mawk... mawk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking whether to enable maintainer-specific portions of Makefiles... yes
    checking build system type... x86_64-pc-linux-gnu
    checking host system type... x86_64-pc-linux-gnu
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking whether configure options are compatible... yes
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... configure: error: in `/home/conan/w/prod-v2/BuildSingleReference/p/t/mpfr72e98faa33b91/b/build-release':
    configure: error: cannot run C compiled programs.
    If you meant to cross compile, use `--host'.
    See `config.log' for more details
    
    mpfr/4.1.0: ERROR: 
    Package '120b68957e77b6ca66ea506daddd9511347758da' build failed
    mpfr/4.1.0: WARN: Build folder /home/conan/w/prod-v2/BuildSingleReference/p/t/mpfr72e98faa33b91/b/build-release
    *********************************************************
    Recipe 'mpfr/4.1.0' cannot build its binary
    It is possible that this recipe is not Conan 2.0 ready
    If the recipe comes from ConanCenter check: https://conan.io/cci-v2.html
    If it is your recipe, check if it is updated to 2.0
    *********************************************************
    
    ERROR: mpfr/4.1.0: Error in build() method, line 148
    	autotools.configure() # Need to generate Makefile to extract variables for CMake below
    	ConanException: Error 1 while executing
    
  • mpfr/4.0.2@:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@conan-center-bot conan-center-bot merged commit 618424d into conan-io:master Apr 5, 2023
pezy pushed a commit to pezy/conan-center-index that referenced this pull request Apr 7, 2023
* MPFR Conan 2.0 Compatibility

* Fixed lint errors

* Missed one

* Fixed lint error in test_package

* Cleaned up patch records for older release

* Added patch descriptions

* Tweaked how win_bash is set

* Added more patch metadata

* Bump required_conan_version

* Account for path differences with Conan 2.0

* Make work on Windows (but requires VS 2022)

* Use NMake to work around MSBuild bug

* Differentiate MSVC from Windows

* Re-ordered apply_conandata_patches

* Add call to fix_apple_shared_install_name

* Deleted blank line to unstick CI

* Remove blank line to spur CI

* Removed redundant setting of --enable-shared and --enable-static

* Use test_package.c from ../test_project

* Use ../test_package/test_package.c

* Apply suggestion from code review

* Tweak previous change

* Added find_package to v1 CMakeLists.txt

* Try making conan_basic_setup(TARGETS) work

* Add cmake_find_package_multi generator per template

* Put back add_subdirectory

* Another try at making v1 work with TARGETS

* Removed extra blank link

* Try setting CMAKE_RUNTIME_OUTPUT_DIRECTORY instead of add_subdirectory

* Try using CMAKE_CURRENT_SOURCE_DIR

* Leverage CONAN_PKG::mpfr from conan_basic_setup(TARGETS)

* Restore use of PROJECT_NAME

* Apply suggestions from code review

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

* Various cleanup changes

* Added autogen option to shield autoconf workflow

* Fixed lint error

* Removed autogen support

* Fixed lint warnings

* Bumped required_conan_version

* Bumped required_conan_version

* Update recipes/mpfr/all/test_v1_package/CMakeLists.txt

Co-authored-by: Uilian Ries <uilianries@gmail.com>

---------

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
Co-authored-by: Rubén Rincón Blanco <rubenrb@jfrog.com>
Co-authored-by: Uilian Ries <uilianries@gmail.com>
MartinDelille pushed a commit to MartinDelille/conan-center-index that referenced this pull request Apr 12, 2023
* MPFR Conan 2.0 Compatibility

* Fixed lint errors

* Missed one

* Fixed lint error in test_package

* Cleaned up patch records for older release

* Added patch descriptions

* Tweaked how win_bash is set

* Added more patch metadata

* Bump required_conan_version

* Account for path differences with Conan 2.0

* Make work on Windows (but requires VS 2022)

* Use NMake to work around MSBuild bug

* Differentiate MSVC from Windows

* Re-ordered apply_conandata_patches

* Add call to fix_apple_shared_install_name

* Deleted blank line to unstick CI

* Remove blank line to spur CI

* Removed redundant setting of --enable-shared and --enable-static

* Use test_package.c from ../test_project

* Use ../test_package/test_package.c

* Apply suggestion from code review

* Tweak previous change

* Added find_package to v1 CMakeLists.txt

* Try making conan_basic_setup(TARGETS) work

* Add cmake_find_package_multi generator per template

* Put back add_subdirectory

* Another try at making v1 work with TARGETS

* Removed extra blank link

* Try setting CMAKE_RUNTIME_OUTPUT_DIRECTORY instead of add_subdirectory

* Try using CMAKE_CURRENT_SOURCE_DIR

* Leverage CONAN_PKG::mpfr from conan_basic_setup(TARGETS)

* Restore use of PROJECT_NAME

* Apply suggestions from code review

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

* Various cleanup changes

* Added autogen option to shield autoconf workflow

* Fixed lint error

* Removed autogen support

* Fixed lint warnings

* Bumped required_conan_version

* Bumped required_conan_version

* Update recipes/mpfr/all/test_v1_package/CMakeLists.txt

Co-authored-by: Uilian Ries <uilianries@gmail.com>

---------

Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
Co-authored-by: Rubén Rincón Blanco <rubenrb@jfrog.com>
Co-authored-by: Uilian Ries <uilianries@gmail.com>
ericLemanissier added a commit to ericLemanissier/conan-center-index that referenced this pull request Nov 23, 2023
they were introduced in conan-io#14687 but never applied

also, use more compact archives

identified by conan-io#21146
and https://ericlemanissier.github.io/conan-center-lint-conandata/
@ericLemanissier ericLemanissier mentioned this pull request Nov 23, 2023
3 tasks
conan-center-bot pushed a commit that referenced this pull request Nov 27, 2023
they were introduced in #14687 but never applied

also, use more compact archives

identified by #21146
and https://ericlemanissier.github.io/conan-center-lint-conandata/
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.

[package] mpfr/4.1.0 lacks support for Conan 2.0
10 participants