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

gcc: model exported libraries, better mirrors, more specific license #21193

Closed
wants to merge 26 commits into from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Nov 17, 2023

Continues the changes from #15128 to model the installed runtime libraries correctly. The compilers cannot be used reliably unless self.requires("gcc/") with self.cpp_info.requires.append("gcc::gfortran") is used in addition to self.tool_requires("gcc/").

Set the package_type to library for the runtime libraries to be usable as self.requires(). See conan-io/conan#15306 for more context.

The current URLs for the sources were extremely slow - 10 minutes to download 140 MB. Replaced the .tar.gz with tar.xz for 80 MB instead of 140 MB size and picked the fastest 2 mirrors out of 25 tested. Download takes less than 10 seconds now.

Made the license ID more specific by including the exception for runtimes:
https://spdx.org/licenses/GCC-exception-3.1.html
https://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html

Requires #21153 for Conan 2.0 pipeline to pass.

samuel-emrys and others added 13 commits January 29, 2023 11:01
* Add legacy env_info environment variable definitions for conan v1
  compatibility
* Define cpp_info.libdirs and cpp_info.libs to enable linkage against gnu libraries
* Populate tools.build:compiler_executables with exported compilers using conf_info
* Add model for libraries that ship with gcc to enable
  individual libraries to be linked against and included
  in the right order in command line arguments
* Remove automatic library discovery
* Remove conf propagation of tools.build:compiler_executables as this
  conflicts with profiles when used
* Removed the conf_info definition for compiler executables as this
  breaks builds when the profile doesn't match the gcc version. This
  change has been deferred to a separate PR.
* Add description of all libraries to package_info
* Add static libraries to package model. This is an initial
  representation limited by a lack of knowledge about the interdependent
  relationships between these libraries.
* Add comments describing future triplet functionality and the imports
  that will be required
Rebasing on the changes made for conan 2.0 compatibility changed the
path to liblto_plugin.so from
<package_folder>/bin/libexec/gcc/<triplet>/<version> to
<package_folder/libexec/gcc/<triplet>/<version>
80 MB instead of 140 MB.

Also switched to a better URL from the same domain that downloads in 1 minute rather than 10.
Picked two fastest ones out of 25 tested.
Copy link
Contributor

🤖 Beep Boop! This pull request is making changes to 'recipes/gcc//'.

👋 @samuel-emrys you might be interested. 😉

@ghost
Copy link

ghost commented Nov 17, 2023

I detected other pull requests that are modifying gcc/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.

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

# Conflicts:
#	recipes/gcc/all/conanfile.py
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@samuel-emrys
Copy link
Contributor

The changes you've pulled in from my PR in #15128 exceed the scope of what you've defined for this PR. Given that there seems to be some reluctance to adopt the internal library model for the gcc recipe, my suggestion would be to remove these changes from this PR if you want it to be accepted.

@valgur valgur changed the title gcc: bump deps, use better mirrors, more specific license gcc: model exported libraries, better mirrors, more specific license Jan 10, 2024
@valgur
Copy link
Contributor Author

valgur commented Jan 10, 2024

The changes you've pulled in from my PR in #15128 exceed the scope of what you've defined for this PR. Given that there seems to be some reluctance to adopt the internal library model for the gcc recipe, my suggestion would be to remove these changes from this PR if you want it to be accepted.

@samuel-emrys Yes, I actually care more about that change than the other minor ones, really.

gfortran is not really usable via a self.tool_requires("gcc/") unless self.requires("gcc/") with self.cpp_info.requires.append("gcc::gfortran") is also used. I've tried multiple approaches with self.cpp_info.system_libs and what not, and this is the only one that really works.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 8 (f72ab0b9cee06e569070afdf27923c719de4c8dd):

  • gcc/13.2.0:
    Error running command conan info gcc/13.2.0@#fa44be06c21a11c5a498218c294b8527 --json {jsonName} -pr {profileName}:

    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=5
    os=Linux
    
    ...
    WARN: mpc/1.3.1: requirement mpfr/4.2.0 overridden by gcc/13.2.0 to mpfr/4.2.1 
    ERROR: Failed requirement 'isl/0.25' from 'gcc/13.2.0'
    ERROR: Unable to find 'isl/0.25' in remotes
    
  • gcc/11.4.0:
    Didn't run or was cancelled before finishing

  • gcc/12.3.0:
    Didn't run or was cancelled before finishing

  • gcc/10.5.0:
    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 v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

See details:

Failure in build 8 (f72ab0b9cee06e569070afdf27923c719de4c8dd):

  • gcc/13.2.0:
    Error running command conan graph info --requires gcc/13.2.0@#fa44be06c21a11c5a498218c294b8527 -f json -pr:h /home/conan/w/prod-v2/bsr/71378/defce/profile_linux_11_libstdcpp11_17_gcc_release_64..txt -pr:b /home/conan/w/prod-v2/bsr/71378/defce/profile_linux_11_libstdcpp11_17_gcc_release_64..txt:

    ======== Computing dependency graph ========
    ERROR: gcc/13.2.0: Package type is 'library', but no 'shared' option declared
    
  • gcc/12.3.0:
    Didn't run or was cancelled before finishing

  • gcc/11.4.0:
    Didn't run or was cancelled before finishing

  • gcc/10.5.0:
    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.

@jcar87
Copy link
Contributor

jcar87 commented Apr 30, 2024

Closing this, as per the reasons already expressed here: #15099 (comment)

Currently we don't have a package type that can correctly and comprehensively model libraries within a toolchain. In most circumstances, libraries within a toolchain like GCC don't need to be modelled: the compiler knows where to look for those libraries, and a "relocatable" gcc would know, as a fallback, where to look for libraries, or would already implicitly link them (e.g. like glibc, libstdc++, etc).

It is true that the gcc recipe in Conan center is unmaintained - at the moment we are not prioritising this because the vast majority of our users use a GCC provided by their system or SDK. If there are specific use cases that could be satisfied by an improved recipe, please open an issue where this can be discussed and other users can articulate their needs, and we will consider this in the future.

@jcar87 jcar87 closed this Apr 30, 2024
@valgur
Copy link
Contributor Author

valgur commented Apr 30, 2024

@jcar87 Thanks for looking into it. I agree with all of your points.

My real motivation in this PR was to get some kind of Fortran support going on CCI, which is required for quite a few numerical libraries. A full GCC toolchain with C/C++ support is more of a liability in that case anyway as it will interfere with the compiler configured in the profile. That's why I opened #23334. I invite you to take a closer look at it if you get a chance.

@jcar87
Copy link
Contributor

jcar87 commented Apr 30, 2024

Hi @valgur - could you please open an issue to discuss fortran, including which recipes would benefit for it, and on which platforms, and what would be the benefits to the wider user base? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants