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

ZCS-13984 : Changes for RHEL9 #267

Merged
merged 4 commits into from
May 2, 2024
Merged

ZCS-13984 : Changes for RHEL9 #267

merged 4 commits into from
May 2, 2024

Conversation

umagmrit
Copy link
Contributor

@umagmrit umagmrit commented Dec 7, 2023

For zimbra-imapd, zimbra-spell, zimbra-store packages getting below error.

/usr/lib/rpm/redhat/brp-ldconfig: line 5: RPM_BUILD_ROOT: unbound variable
/usr/lib/rpm/redhat/brp-mangle-shebangs: line 4: RPM_BUILD_ROOT: unbound variable

RPM_BUILD_ROOT is not defined.

/usr/lib/rpm/redhat/brp-ldconfig and /usr/lib/rpm/redhat/brp-mangle-shebangs are changed in the RHEL9.
To fix this issue from build side, we need to define RPM_BUILD_ROOT.

Copy link

@ghen2 ghen2 left a comment

Choose a reason for hiding this comment

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

An alternative solution is to self-sign the same PGP key with SHA-256, this way existing signatures remain valid, and you can continue to use the same key for all supported OS versions.

eg. Elastic search did this: elastic/elasticsearch#85876 (comment), from https://github.com/chrisberkhout/sha1-key-fix/tree/master

@ghen2
Copy link

ghen2 commented Feb 16, 2024

Wouldn't it be better to install p7zip on all platforms, not only on RHEL 9?
(it's not just a pax/cpio replacement, it can handle a lot more compression types for amavisd)

@adriangibanelbtactic
Copy link
Contributor

I have tried to build 10.0.7 on Rocky Linux 9 thanks to this Dockerfile: https://github.com/maldua/zimbra-foss-builder/blob/07637be07ca826a22f6b132438536191a0dd8448/Dockerfile-manual-rhel-9 which should be equivalent to your latest Centos 9 Docker file: https://github.com/Zimbra/zm-base-os/blob/9c99638d067436c0d65768fbc46ead375b968aa6/Dockerfile-devcore-centos-9.

I can confirm on my side that these two issues are present at 10.0.6 tag (as a consequence of this pull request not being merged yet):

  • rpmconf/Build/get_plat_tag.sh needs to be updated to detect Rocky Linux release 9 as RHEL9_64. Otherwise I am supposed to be adding --build-os RHEL9_64 to the build.pl command so that it works properly.
  • The build stops at zimbra-store package build:
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.NY5btr
/usr/lib/rpm/redhat/brp-ldconfig: line 5: RPM_BUILD_ROOT: unbound variable
error: Bad exit status from /var/tmp/rpm-tmp.NY5btr (%install)
    Bad exit status from /var/tmp/rpm-tmp.NY5btr (%install)

.

If you have a regular user with docker permissions and the proper Github keys and want to give it a try so that it stops at the RPM_BUILD_ROOT: unbound variable error here there is the complete list of commands:

mkdir ~/maldua-rhel-9
cd ~/maldua-rhel-9
git clone https://github.com/maldua/zimbra-foss-builder
cd zimbra-foss-builder
git checkout 07637be07ca826a22f6b132438536191a0dd8448

docker build \
  --build-arg ZIMBRA_BUILDER_UID=$(id -u) \
  --build-arg ZIMBRA_BUILDER_GID=$(id -g) \
  --tag zimbra-manual-rhel-9-builder . \
  -f Dockerfile-manual-rhel-9

docker run \
  -it \
  --env ZIMBRA_BUILDER_UID=$(id -u) \
  --env ZIMBRA_BUILDER_GID=$(id -g) \
  -v ~/.ssh:/home/build/.ssh:ro \
  -v $(pwd)/BUILDS:/home/build/installer-build/BUILDS:rw \
  zimbra-manual-rhel-9-builder:latest

cd installer-build
git clone --depth 1 --branch 10.0.6 [email protected]:Zimbra/zm-build.git
cd zm-build

# We add: --build-os RHEL9_64 because Rocky Linux 9 is not autodetected

ENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=10.0.7,10.0.6,10.0.5,10.0.4,10.0.2,10.0.1,10.0.0-GA,10.0.0 --build-release-no=10.0.7 --build-type=FOSS --build-release=LIBERTY --build-release-candidate=GA_10.0.7_maldua --build-thirdparty-server=files.zimbra.com --no-interactive --build-os RHEL9_64

Note: Later on I will try to build with this pull request applied and I will give you feedback.

@silentsakky
Copy link
Member

Sure please provide your feedback after using this PR.
as we are still working on adding RHEL 9 support and work is not completed so there might be issues and because of that we haven't merged the PR.

@adriangibanelbtactic
Copy link
Contributor

mkdir ~/maldua-rhel-9-pull-267
cd ~/maldua-rhel-9-pull-267
git clone https://github.com/maldua/zimbra-foss-builder
cd zimbra-foss-builder
git checkout 07637be07ca826a22f6b132438536191a0dd8448

docker build \
  --build-arg ZIMBRA_BUILDER_UID=$(id -u) \
  --build-arg ZIMBRA_BUILDER_GID=$(id -g) \
  --tag zimbra-manual-rhel-9-builder . \
  -f Dockerfile-manual-rhel-9

docker run \
  -it \
  --env ZIMBRA_BUILDER_UID=$(id -u) \
  --env ZIMBRA_BUILDER_GID=$(id -g) \
  -v ~/.ssh:/home/build/.ssh:ro \
  -v $(pwd)/BUILDS:/home/build/installer-build/BUILDS:rw \
  zimbra-manual-rhel-9-builder:latest

cd installer-build
git clone --branch 10.0.6 [email protected]:Zimbra/zm-build.git
cd zm-build
git fetch origin ZCS-13984
git checkout ZCS-13984
git checkout 10.0.6
git config --global user.email "[email protected]"
git config --global user.name "Inside Docker"
git merge ZCS-13984 --no-edit

# git log # Additional Develop branch commits have been added. Latest of those 4 commits do not seem to be a concern.

ENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=10.0.7,10.0.6,10.0.5,10.0.4,10.0.2,10.0.1,10.0.0-GA,10.0.0 --build-release-no=10.0.7 --build-type=FOSS --build-release=LIBERTY --build-release-candidate=GA_10.0.7_maldua --build-thirdparty-server=files.zimbra.com --no-interactive

This fails with:

cp: cannot stat '/home/build/installer-build/.staging/RHEL9_64-LIBERTY-1007-20240329081503-FOSS-1000/zm-core-utils/src/bin/zmlicensectl': No such file or directory 

.

Trying to merge this pull request seemed to work quite nice because most all of the packages have been build. However in the end zmlicensectl is not found and the whole build fails. I have just checked the git log command again (just after the merge) and there are too many old commits from develop branch which should not be there in the first place so that might explain it.

Note: Next test it's with manual cherry-picks of this pull request specific commits for 10.0.6 tag. I will make an specific branch if needed.

@umagmrit
Copy link
Contributor Author

@adriangibanelbtactic
try with zm-build -> ZCS-13984_10.0.0 , zm-core-utils -> ZCS-13984_10.0.0

--git-default-tag=10.0.7,10.0.6,10.0.5,10.0.4,10.0.3,10.0.2,10.0.1,10.0.0-GA --git-overrides zm-core-utils.branch=ZCS-13984_10.0.0

@adriangibanelbtactic
Copy link
Contributor

Applying just the 4 commits of this pull request to 10.0.6 tag seemed to work in order to build the tgz without any problem.
I haven't tried to install or use the tgz though.

Associated instructions below:

mkdir ~/maldua-rhel-9-cherry-267
cd ~/maldua-rhel-9-cherry-267
git clone https://github.com/maldua/zimbra-foss-builder
cd zimbra-foss-builder
git checkout 07637be07ca826a22f6b132438536191a0dd8448

docker build \
  --build-arg ZIMBRA_BUILDER_UID=$(id -u) \
  --build-arg ZIMBRA_BUILDER_GID=$(id -g) \
  --tag zimbra-manual-rhel-9-builder . \
  -f Dockerfile-manual-rhel-9

docker run \
  -it \
  --env ZIMBRA_BUILDER_UID=$(id -u) \
  --env ZIMBRA_BUILDER_GID=$(id -g) \
  -v ~/.ssh:/home/build/.ssh:ro \
  -v $(pwd)/BUILDS:/home/build/installer-build/BUILDS:rw \
  zimbra-manual-rhel-9-builder:latest

cd installer-build
git clone --branch 10.0.6 [email protected]:Zimbra/zm-build.git
cd zm-build

git config --global user.email "[email protected]"
git config --global user.name "Inside Docker"
git cherry-pick 25ce6db5bd3ffe1a6ee7e86ba967daf580510a96
git cherry-pick 5651c44b238f7e26eb998fc5b5541769a0c6375d
git cherry-pick 6611588eab0437bec8957bc352453e5fe5a5f96b
git cherry-pick 6be839d05c912f733400b3e7e0f037432d8699b0

ENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=10.0.7,10.0.6,10.0.5,10.0.4,10.0.2,10.0.1,10.0.0-GA,10.0.0 --build-release-no=10.0.7 --build-type=FOSS --build-release=LIBERTY --build-release-candidate=GA_10.0.7_maldua --build-thirdparty-server=files.zimbra.com --no-interactive

@adriangibanelbtactic
Copy link
Contributor

@adriangibanelbtactic try with zm-build -> ZCS-13984_10.0.0 , zm-core-utils -> ZCS-13984_10.0.0

--git-default-tag=10.0.7,10.0.6,10.0.5,10.0.4,10.0.3,10.0.2,10.0.1,10.0.0-GA --git-overrides zm-core-utils.branch=ZCS-13984_10.0.0

  • ZCS-13984_10.0.0 branch/tag from zm-build seems to be equivalent to my 4 commits cherry-pick.
  • ZCS-13984_10.0.0 branch/tag from zm-core-utils seems to be fix some syslog issues that one would have had found when installing the tgz.

I will give it a go and confirm you that, at least the build, works as expected and a tgz is returned.

@adriangibanelbtactic
Copy link
Contributor

@adriangibanelbtactic try with zm-build -> ZCS-13984_10.0.0 , zm-core-utils -> ZCS-13984_10.0.0

--git-default-tag=10.0.7,10.0.6,10.0.5,10.0.4,10.0.3,10.0.2,10.0.1,10.0.0-GA --git-overrides zm-core-utils.branch=ZCS-13984_10.0.0

Your suggestions seemed to work in order to build the tgz without any problem.
I haven't tried to install or use the tgz though.

Associated instructions below:

mkdir ~/maldua-rhel-9-uma-267
cd ~/maldua-rhel-9-uma-267
git clone https://github.com/maldua/zimbra-foss-builder
cd zimbra-foss-builder
git checkout 07637be07ca826a22f6b132438536191a0dd8448

docker build \
  --build-arg ZIMBRA_BUILDER_UID=$(id -u) \
  --build-arg ZIMBRA_BUILDER_GID=$(id -g) \
  --tag zimbra-manual-rhel-9-builder . \
  -f Dockerfile-manual-rhel-9

docker run \
  -it \
  --env ZIMBRA_BUILDER_UID=$(id -u) \
  --env ZIMBRA_BUILDER_GID=$(id -g) \
  -v ~/.ssh:/home/build/.ssh:ro \
  -v $(pwd)/BUILDS:/home/build/installer-build/BUILDS:rw \
  zimbra-manual-rhel-9-builder:latest

cd installer-build
git clone --depth 1 --branch ZCS-13984_10.0.0 [email protected]:Zimbra/zm-build.git
cd zm-build

ENV_CACHE_CLEAR_FLAG=true ./build.pl --ant-options -DskipTests=true --git-default-tag=10.0.7,10.0.6,10.0.5,10.0.4,10.0.2,10.0.1,10.0.0-GA,10.0.0 --build-release-no=10.0.7 --build-type=FOSS --build-release=LIBERTY --build-release-candidate=GA_10.0.7_maldua --build-thirdparty-server=files.zimbra.com --no-interactive --git-overrides zm-core-utils.branch=ZCS-13984_10.0.0

@umagmrit
Copy link
Contributor Author

@adriangibanelbtactic Third-party packages not yet available to install this build. We are working on it Zimbra/packages#198 .

@adriangibanelbtactic
Copy link
Contributor

@adriangibanelbtactic Third-party packages not yet available to install this build. We are working on it Zimbra/packages#198 .

Added an specific note about Third-party packages not being available (and thus there is no point on testing the build yet) attached to the build I've made out of your suggestions.

Thank you for the clarification.

Note to myself: I'm not sure why I started testing RHEL builds based on RHEL9. I somehow managed to think that Zimbra 10 NE already supported RHEL9 but that's not the case at all (right now at 2024 03 30). Probably centos-9 being the latest available Dockerfile in zm-base-os pointed me onto that direction.

@umagmrit umagmrit deleted the ZCS-13984 branch May 2, 2024 07:35
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