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

Install GCC 10.4.0 #351

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Install GCC 10.4.0 #351

merged 1 commit into from
Mar 7, 2023

Conversation

0intro
Copy link
Member

@0intro 0intro commented Feb 8, 2023

This change installs GCC 10.4.0 on the following build images:

  • deb-arm
  • deb-x64
  • rpm-arm64
  • rpm-x64
  • suse-x64

We chose to provide our own GCC version, because the GCC versions available as part of CentOS 6, openSUSE 42.1 and Ubuntu 14.04 weren't recent enough to build OpenSCAP and some of its dependencies.

We chose GCC 10.4.0, because it was the most recent version that could be built using the GCC versions available on our distributions. GCC 11 and upper include libcody, which is written in C++11 and requires a more recent GCC version to be built.

This change is the result of a collaborative work between Sylvain Baubeau, Pierre Guilleminot and David du Colombier.

@0intro 0intro requested review from lebauce and jinroh February 8, 2023 09:59
@0intro 0intro requested a review from a team as a code owner February 8, 2023 09:59
@0intro 0intro force-pushed the ducolombier/gcc-10.4.0 branch 2 times, most recently from 9c24bbf to ddcfd0e Compare February 10, 2023 12:12
@bkabrda
Copy link
Contributor

bkabrda commented Feb 22, 2023

👋 thanks for submitting the PR. Have you talked about this to other teams that maintain pieces of Agent code that get compiled by GCC? From top of my head, this would be agent-metrics-logs (rtloader) and agent-integrations (some Python integrations have C extensions that would get compiled by GCC). It would be good to try to standardize on one GCC version instead of adding more, if possible.

I'm also wondering whether it's practical to put the new GCC version under /opt/gcc-${GCC_VERSION}, because anything using this GCC will have to hardcode the specific GCC_VERSION and if we do even a minor version upgrade we'll have to fix all these places. Maybe it would be sufficient to have a path that would only contain GCC minor version, e.g. /opt/gcc-10?

@0intro 0intro force-pushed the ducolombier/gcc-10.4.0 branch from ddcfd0e to 3801a23 Compare February 22, 2023 09:41
@0intro
Copy link
Member Author

0intro commented Feb 22, 2023

Thanks for your review.

wave thanks for submitting the PR. Have you talked about this to other teams that maintain pieces of Agent code that get compiled by GCC? From top of my head, this would be agent-metrics-logs (rtloader) and agent-integrations (some Python integrations have C extensions that would get compiled by GCC). It would be good to try to standardize on one GCC version instead of adding more, if possible.

We have not talked to the other teams yet. Our goal was to introduce a recent GCC version in the build image, which is required to build some external dependencies (for example, libraries written in C++11). Then, the other teams will be able to use this recent GCC version.

Currently, the build of the Agent is relying on heterogeneous GCC toolchains provided as part of the various Linux distribution we support (RHEL, Ubuntu and SUSE). I think the ultimate goal is that everyone use a single, common, recent GCC toolchain we build ourself, instead of relying on the heterogeneity of the various Linux distribution.

I'm also wondering whether it's practical to put the new GCC version under /opt/gcc-${GCC_VERSION}, because anything using this GCC will have to hardcode the specific GCC_VERSION and if we do even a minor version upgrade we'll have to fix all these places. Maybe it would be sufficient to have a path that would only contain GCC minor version, e.g. /opt/gcc-10?

The GCC_VERSION variable is exported to the environment of the build image, so, when building the Agent, one could refer to the GCC_VERSION available.

It would be possible, for example, to export something like GCC_10_VERSION, or, as you suggested, use a fixed path /opt/gcc-10, but I think it would defeat the goal of having a single, common, modern, recent GCC version.
We defined a GCC_VERSION variable, like it was the case, for example, for CMAKE_VERSION already, but I think, similarly to what you suggested, that we could simply hardcode the path to something like /opt/gcc.

What do you think?

Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

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

Hi 👋 the PR mostly LGTM, but I left couple notes and comments inline to get addressed.

build-gcc.sh Outdated Show resolved Hide resolved
build-gcc.sh Outdated Show resolved Hide resolved
build-gcc.sh Outdated Show resolved Hide resolved
build-gcc.sh Outdated Show resolved Hide resolved
@0intro 0intro force-pushed the ducolombier/gcc-10.4.0 branch 2 times, most recently from 1546067 to 7429a6a Compare February 23, 2023 18:48
Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

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

The change LGTM, so I'm approving.

The two points that I'll leave up to you folks to address going forward are:

  • The rpm-armhf addition of this gcc version when you figure out how to fix the compilation problem there.
  • Talking to other Agent teams to consolidate on this new gcc version and stop using the old ones.

@jinroh jinroh force-pushed the ducolombier/gcc-10.4.0 branch from 7429a6a to c97a131 Compare March 1, 2023 13:52
@jinroh
Copy link
Contributor

jinroh commented Mar 1, 2023

rebased on 48c12a1

@0intro 0intro force-pushed the ducolombier/gcc-10.4.0 branch from c97a131 to af0e7c3 Compare March 6, 2023 10:08
@0intro
Copy link
Member Author

0intro commented Mar 6, 2023

I split the addition of flex on the images where it was missing to a different commit.

This change installs GCC 10.4.0 on the following build images:

 - deb-arm
 - deb-x64
 - rpm-arm64
 - rpm-x64
 - suse-x64

We chose to provide our own GCC version, because the GCC versions
available as part of CentOS 6, openSUSE 42.1 and Ubuntu 14.04
weren't recent enough to build OpenSCAP and some of its dependencies.

We chose GCC 10.4.0, because it was the most recent version that
could be built using the GCC versions available on our distributions.
GCC 11 and upper include libcody, which is written in C++11
and requires a more recent GCC version to be built.

This change is the result of a collaborative work between
Sylvain Baubeau, Pierre Guilleminot and David du Colombier.

Co-authored-by: Sylvain Baubeau <[email protected]>
Co-authored-by: Pierre Guilleminot <[email protected]>
@0intro 0intro force-pushed the ducolombier/gcc-10.4.0 branch from af0e7c3 to 123ae5e Compare March 6, 2023 15:17
@0intro
Copy link
Member Author

0intro commented Mar 6, 2023

Moved the addition of flex to a separate PR (#371).

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