Bug 113934 - SRPMS: test for MMN version it too fragile
Summary: SRPMS: test for MMN version it too fragile
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: httpd
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-20 12:55 UTC by Sysoltsev Slawa
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-03-23 09:48:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch that would fix described problem (601 bytes, patch)
2004-01-20 12:59 UTC, Sysoltsev Slawa
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2004:084 0 normal SHIPPED_LIVE Important: httpd security update 2004-03-23 05:00:00 UTC

Description Sysoltsev Slawa 2004-01-20 12:55:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6)
Gecko/20040113

Description of problem:
I tried to build httpd package by Intel compiler and got a problem:



20020903' '!=' x20020903
#: Error: Upstream MMN is now 20020903, packaged MMN is 20020903.
#: Update the mmn macro and rebuild.
#exit 1

The problem is that to get MMN version C preprocessor is used: 
echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include `pwd`/include/ap_mmn.h |
grep -v '#'
without grep �v this would give with gcc:
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "/users/compiler/tc_5/WORK_DIR/BUILD/httpd-2.0.46/include/ap_mmn.h" 1
# 2 "<command line>" 2
# 1 "<stdin>"
20020903

The reason this test doesn�t work with Intel compiler is in different
control of empty lines in preprocessor output: gcc uses #line
directive to jump over few empty lines of output, Intel compiler
simply leaves these empty lines, so the output of `echo
MODULE_MAGIC_NUMBER_MAJOR | cpp -include `pwd`/include/ap_mmn.h` has
got many empty lines. To get MMN version in this case these empty
lines must be cut along with gcc�s #line directives, so to get MMN
version you should use:
`echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include `pwd`/include/ap_mmn.h
| grep -v '#' | grep -v �^[[:space:]]*$�`

This little enhancement would make test for MMN a bit more robust.


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


How reproducible:
Always

Steps to Reproduce:
1. make the wrapper called cpp, that would add -x c - to the command
line and call Intel compiler for C preprocessing
2. make sure your hand-made wrapper is in PATH before system cpp
3. try to build httpd from source rpm
    

Actual Results:  error emitted by check in spec file:
#: Error: Upstream MMN is now 20020903, packaged MMN is 20020903.
#: Update the mmn macro and rebuild.


Expected Results:  succesfully built package

Additional info:

Comment 1 Sysoltsev Slawa 2004-01-20 12:59:28 UTC
Created attachment 97120 [details]
Patch that would fix described problem

Comment 2 Joe Orton 2004-01-20 13:06:32 UTC
Replacing the greps with:
   sed -n '/^2/p'
is the simplest solution, can you try that with icc?


Comment 3 Sysoltsev Slawa 2004-01-20 13:10:39 UTC
super! works well.

Comment 4 Joe Orton 2004-01-20 15:12:01 UTC
Fixed in 2.0.48-9 for Raw Hide; leaving open for inclusion in future
RHEL3 update.

Comment 5 Mark J. Cox 2004-03-23 09:48:55 UTC
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2004-084.html



Note You need to log in before you can comment on or make changes to this bug.