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

RHEL 7 support. #56

Open
dumol opened this issue May 27, 2024 · 3 comments
Open

RHEL 7 support. #56

dumol opened this issue May 27, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@dumol
Copy link
Contributor

dumol commented May 27, 2024

We can't build on RHEL 7 because of contamination with libs that are not installed on other distros, such as Ubuntu.

However, Amazon Linux 1 (2018.03) has the same glibc version as RHEL7: 2.17. More so, lately you can install gcc 7.x on Amazon 1, same version we use on Amazon Linux 2.

Starting diff for building on an AMI 2018.03 container:

diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml
index 22fc7be..27491cb 100644
--- a/.github/workflows/docker.yaml
+++ b/.github/workflows/docker.yaml
@@ -25,8 +25,8 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        # Alpine 3.12 has musl 1.1.24, Amazon 2 has glibc 2.26.
-        container: [ 'alpine:3.12', 'amazonlinux:2' ]
+        # Alpine 3.12 has musl 1.1.24, Amazon 1 has glibc 2.17.
+        container: [ 'alpine:3.12', 'amazonlinux:1' ]
     timeout-minutes: 60
     steps:

@@ -44,7 +44,7 @@ jobs:
       if: startsWith(matrix.container, 'amazonlinux')
       run: |
         yum -y upgrade
-        yum -y install git-core gcc make m4 patch tar unzip perl perl-Test-Simple perl-IPC-Cmd xz gcc-c++ dejagnu
+        yum -y install git-core gcc72 make m4 patch tar unzip perl perl-Test-Simple perl-IPC-Cmd xz gcc72-c++ dejagnu diffutils

     - name: Ubuntu setup
       if: startsWith(matrix.container, 'ubuntu')
@@ -86,7 +86,7 @@ jobs:

     # If one of the above steps fails, fire up tmate for remote debugging.
     # Not all platforms are supported by tmate.
-    # Currently not supported: Alpine, Amazon 2, CentOS 5 (no glibc or too old).
+    # Currently not supported: Alpine, Amazon 1, CentOS 5 (no glibc or too old).
     - name: Tmate debug on failure
       if: ${{ !cancelled() && runner.debug }}
       uses: chevah/action-tmate@v3
diff --git a/pkg_checks.sh b/pkg_checks.sh
index 80d2168..4d122d5 100644
--- a/pkg_checks.sh
+++ b/pkg_checks.sh
@@ -62,7 +62,7 @@ case "$OS" in
             CHECK_CMD=(dpkg --status)
             PACKAGES="$DEB_PKGS"
         elif [ -x /usr/bin/rpm ]; then
-            # Assumes Amazon Linux 2.
+            # Assumes Amazon Linux 1/2.
             CHECK_CMD=(rpm --query)
             PACKAGES="$RPM_PKGS"
         else
diff --git a/pythia.sh b/pythia.sh
index efe880c..332d2a0 100755
--- a/pythia.sh
+++ b/pythia.sh
@@ -642,11 +642,11 @@ check_glibc_version(){
     local supported_glibc2_version

     # Supported minimum minor glibc 2.X versions for various arches.
-    # For x64, we build on Amazon 2 with glibc 2.26.
-    # For arm64, we also build on Amazon 2 with glibc 2.26 lately.
+    # For x64, we build on Amazon 1 with glibc 2.17.
+    # For arm64, we build on Amazon 2 with glibc 2.26.
     # If we get back to building against different libc versions per arch,
     # beware we haven't normalized arch names yet.
-    supported_glibc2_version=26
+    supported_glibc2_version=17

     echo "No specific runtime for the current distribution / version / arch."
     echo "Minimum glibc version for this arch: 2.$supported_glibc2_version."
diff --git a/src/chevah-python-tests/test_python_binary_dist.py b/src/chevah-python-tests/test_python_binary_dist.py
index f72e82e..6733717 100644
--- a/src/chevah-python-tests/test_python_binary_dist.py
+++ b/src/chevah-python-tests/test_python_binary_dist.py
@@ -34,7 +34,7 @@ def get_allowed_deps():
         elif 'linux' in CHEVAH_OS:
             # Deps without paths for generic glibc Linux builds.
             # Only glibc 2.x libs are allowed.
-            # Tested on Amazon 2 & Ubuntu 16.04/18.04 with glibc 2.26/2.23/2.27.
+            # Tested on Amazon 1/2 & Ubuntu 16.04/18.04 w/ glibc 2.17/26/23/27.
             allowed_deps=[
                 'libc.so.6',
                 'libcrypt.so.1',
diff --git a/src/libffi/chevahbs b/src/libffi/chevahbs
index cfd9e5b..12b9ffb 100755
--- a/src/libffi/chevahbs
+++ b/src/libffi/chevahbs
@@ -32,10 +32,13 @@ chevahbs_compile() {

 # This requires DejaGnu to actually do the tests.
 chevahbs_try() {
-    # Tests fail on Amazon 2: https://github.com/libffi/libffi/issues/785.
+    # Tests fail on Amazon 1/2: https://github.com/libffi/libffi/issues/785.
     if [ "$OS" = "linux" ]; then
         if [ -f /etc/os-release ]; then
-            if grep -q ^'PRETTY_NAME="Amazon Linux 2"'$ /etc/os-release; then
+            if grep -q "Amazon Linux AMI 2018.03" /etc/os-release; then
+                (>&2 echo -e "\tSkipping libffi tests on Amazon Linux 1.")
+                return
+            elif grep -q ^'PRETTY_NAME="Amazon Linux 2"'$ /etc/os-release; then
                 (>&2 echo -e "\tSkipping libffi tests on Amazon Linux 2.")
                 return
             fi
@dumol dumol added the enhancement New feature or request label May 27, 2024
@dumol dumol self-assigned this May 27, 2024
@adiroiban
Copy link
Member

Thanks.
For now RHEL7 is a lower priority.

I bigger priority is perparing for Python 3.13, not that it's in beta.

There are some changes in Python 3.13...and we will also need to upgrade Twisted...

It would help to have the 3.13 sooner and start fixing the issues

It might take 3 months to have a public release with Python 3.13

@dumol
Copy link
Contributor Author

dumol commented Oct 7, 2024

Another possibility is building with zig cc as described at https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html.

@adiroiban
Copy link
Member

thanks. for now, this remains low priority

but it's good to know there are options

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

No branches or pull requests

2 participants