Bug 2232362

Summary: httpd 2.4 module shows wrong PLATFORM string when built for CentOS Stream 8
Product: Red Hat Enterprise Linux 8 Reporter: Adam Saleh <asaleh>
Component: httpd-2.4-moduleAssignee: Luboš Uhliarik <luhliari>
Status: NEW --- QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.9CC: asamalik, jhughes
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Saleh 2023-08-16 13:42:16 UTC
Description of problem:

When installing httpd package and stating the httpd service on CentOS 8 we expect the welcome screen to correctly reflect that it was built for the CentOS platform.

We found down this problem in one of the recent builds[0]

where you can find the incorrect PLATFORM in the build log:
+ sed -i '/^#define PLATFORM/s/Unix/Red Hat Enterprise Linux 8/' os/unix/os.h

This only seems to affect the stream-httpd-2.4-rhel-8.9.0 branch as it uses the env var ${REDHAT_SUPPORT_PRODUCT} that resolves to "Red Hat Enterprise Linux 8" where c9s branch uses ${NAME} that resolves to "CentOS Stream"

[0] https://kojihub.stream.rdu2.redhat.com/koji/buildinfo?buildID=35572
[1] https://kojihub.stream.rdu2.redhat.com/kojifiles/packages/httpd/2.4.37/62.module_el8+597+3986b266/data/logs/x86_64/build.log

Version-Release number of selected component (if applicable):

httpd-2.4.37-62.module_el8+597+3986b266

How reproducible:

You can see the problem when running a scratch-build

Steps to Reproduce:
1. centpkg clone rpms/httpd --branch stream-httpd-2.4-rhel-8.9.0
2. cd httpd
3. centpkg scratch-build

Actual results:

httpd will be built with "sed -i '/^#define PLATFORM/s/Unix/Red Hat Enterprise Linux 8/' os/unix/os.h" applied


Expected results:

httpd will be built with "sed -i '/^#define PLATFORM/s/Unix/CentOS Stream/' os/unix/os.h" applied

Additional info:

Comment 1 Adam Samalik 2023-08-16 14:05:46 UTC
To clarify, I know nothing has changed in this package. This was introduced a few months ago when we switch the c8s workflow.

If I compare this with the c9s package, it uses a different variable from /etc/os-release:

* c8s uses the REDHAT_SUPPORT_PRODUCT variable: https://gitlab.com/redhat/centos-stream/rpms/httpd/-/blob/stream-httpd-2.4-rhel-8.9.0/httpd.spec#L6
* c9s uses the NAME variable: https://gitlab.com/redhat/centos-stream/rpms/httpd/-/blob/c9s/httpd.spec?ref_type=heads#L6

For quick reference, here's what we have in /etc/os-release in c8s (c9s is the same except for the number):

NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"

Would switching c8s to use the NAME variable be an option that works for you? That way we'd have c8s and c9s consistent.

Comment 2 Johnny Hughes 2023-08-16 14:13:04 UTC
I think that would absolutely work.

Comment 3 Luboš Uhliarik 2023-08-17 11:01:32 UTC
We can fix this in RHEL-8.10. I will merge the change[0] into c8s.

[0] https://src.fedoraproject.org/rpms/httpd/c/4916eeea5bf7043cec58d0b56ac1c8de2ff1bdcf?branch=rawhide

Comment 4 Adam Samalik 2023-08-17 11:31:03 UTC
Nice, thanks!

Any chance we can get a c8s build soon? We can't release c8s now with the current build. Alternatively we could tag in the previous build temporarily so we could release other updates at least.

Comment 5 Johnny Hughes 2023-08-17 13:48:36 UTC
I am absolutely happy to roll in that change (just change to ${NAME} in the c8s branch) and build and push this all the way through the build system today if everyone is OK with that.