Skip to content

Conversation

@bk2204
Copy link
Member

@bk2204 bk2204 commented Oct 19, 2022

RHEL 9 recently came out. Let's use Rocky Linux 9 to build packages for RHEL and RHEL-equivalent versions so that users have packages to work with.

Each step has its own commit and description.

Fixes #5107

For CentOS, we've traditionally included the el7 component, so let's
include the same component for Rocky 8.  While we're at it, let's be
honest about what we're shipping and say Rocky Linux and not CentOS,
since CentOS 8 is dead.
The version of RPM in Rocky Linux 9 no longer allows string comparisons
with barewords.  Quote the arguments properly to make sure that the
comparison works on Rocky Linux 9.
If we're building for a RHEL 9 equivalent, use the same patterns as for
RHEL 8 equivalents, since those seem to work and build properly.
Since CentOS is now no longer a plain rebuild of RHEL, use Rocky Linux
as the RHEL 9 equivalent.  Add entries in all the required files for
this to build properly.
@bk2204 bk2204 marked this pull request as ready for review October 19, 2022 19:20
@bk2204 bk2204 requested a review from a team as a code owner October 19, 2022 19:20
@bk2204 bk2204 merged commit f4cd44b into git-lfs:main Oct 20, 2022
@bk2204 bk2204 deleted the rocky-9 branch October 20, 2022 13:06
chrisd8088 added a commit to chrisd8088/git-lfs that referenced this pull request Dec 28, 2022
In commit c2d25ee of PR git-lfs#511 we added
support for building RPM packages for 32-bit platforms by updating the
docker/centos_script.bsh script which was present at that time to
call rpmbuild with a --target=i686 argument.

Since commit 56ffe42 of PR git-lfs#555 both
that script and the rpm/build_rpms.bsh script contained the same logic
to parse the OS name and version in order to set a short suffix for
the RPM filenames.

However, the docker/centos_script.bsh script was subsequently moved into
the git-lfs/build-dockers repository, where it has not been updated to
match the rpm/build_rpms.bsh script, such as when parsing of the OS major
version was added in commit e939409 of
PR git-lfs#5054, which allows us to properly parse the version number on
CentOS/Rocky Linux 8 and above, or when parsing of the Rocky Linux OS
name was added in commit 723be34 of
PR git-lfs#5144.

The result is that at present we build 32-bit RPMs for CentOS 8 and
Rocky Linux 9 (el8 and el9, respectively) without the platform short
name suffix in their filenames, e.g., git-lfs-3.3.0-1.i686.rpm and
git-lfs-3.3.0-1.i686.rpm, and then upload them to Packagecloud with
those names.

To resolve this problem and avoid later regressions between the two
sets of parsing logic, we move the rpmbuild command for 32-bit packages
into our rpm/build_rpms.bsh script, which ensures they will be built
with the same context as our 64-bit packages.

To do this we introduce an rpmbuild command with the --target=i686
argument into rpm/build_rpms.bsh, which allows us to also remove
the rpmbuild command from the centos_script.bsh script in the
git-lfs/build-dockers repository in PR git-lfs/build-dockers#54.
chrisd8088 added a commit to chrisd8088/build-dockers that referenced this pull request Dec 28, 2022
In commit git-lfs/git-lfs@c2d25ee of
PR git-lfs/git-lfs#511 we added support for building RPM packages for
32-bit platforms by updating the docker/centos_script.bsh script which
was present at that time to call rpmbuild with a --target=i686 argument.

Since commit git-lfs/git-lfs@56ffe42 of
PR git-lfs/git-lfs#555 both that script and the rpm/build_rpms.bsh script
in the primary Git LFS project's repository contained the same logic to
parse the OS name and version in order to set a short suffix for the RPM
filenames.

However, the docker/centos_script.bsh script was subsequently moved
into this repository, where it has not been updated to match the
rpm/build_rpms.bsh script in the primary project repository, such
as when parsing of the OS major version was added in commit
git-lfs/git-lfs@e939409 of PR
git-lfs/git-lfs#5054, which allows us to properly parse the version
number on CentOS/Rocky Linux 8 and above, or when parsing of the
Rocky Linux OS name was added in commit
git-lfs/git-lfs@723be34 of PR
git-lfs/git-lfs#5144.

The result is that at present we build 32-bit RPMs for CentOS 8 and
Rocky Linux 9 (el8 and el9, respectively) without the platform short
name suffix in their filenames, e.g., git-lfs-3.3.0-1.i686.rpm and
git-lfs-3.3.0-1.i686.rpm, and then upload them to Packagecloud with
those names.

To resolve this problem and avoid later regressions between the two
sets of parsing logic, we add an rpmbuild command with the --target=i686
argument for 32-bit packages to the rpm/build_rpms.bsh script in the
primary Git LFS project repository in commit
git-lfs/git-lfs@7830f04 of PR
git-lfs/git-lfs#5241, which ensures they will be built with the same
context as our 64-bit packages.

We can therefore also remove the rpmbuild command with the --target=i686
argument from the centos_script.bsh script in this repository, along
with the setup code which attempted to parse the OS version and name
from either /etc/os-release or /etc/redhat-release, as these values
are only used to set the RPM_DIST variable passed to rpmbuild, and
the initialization code for that variable can be removed as well.
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.

Add RHEL 9-compatible packages

2 participants