Bug 729475 - mhddfs 0.1.38-6 is not built with $RPM_OPT_FLAGS
mhddfs 0.1.38-6 is not built with $RPM_OPT_FLAGS
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mhddfs (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jameson
Fedora Extras Quality Assurance
:
Depends On:
Blocks: DebugInfo
  Show dependency treegraph
 
Reported: 2011-08-09 16:26 EDT by Ville Skyttä
Modified: 2011-08-26 15:09 EDT (History)
2 users (show)

See Also:
Fixed In Version: mhddfs-0.1.38-9.fc14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-08-23 16:27:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ville Skyttä 2011-08-09 16:26:49 EDT
mhddfs 0.1.38-6 is not built with $RPM_OPT_FLAGS:

http://kojipkgs.fedoraproject.org/packages/mhddfs/0.1.38/6.fc17/data/logs/x86_64/build.log

Cc'ing reviewer.
Comment 1 Fedora Update System 2011-08-09 19:18:13 EDT
mhddfs-0.1.38-7.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-7.fc14
Comment 2 Nathan Owe 2011-08-09 19:36:08 EDT
Wow one thing that is weird, I can not find the review I did for mhddfs in my list of bugs or by searching.

I looked at the SPEC file and it seems to have been fixed. Every branch, master, f16, f15, f14 now has make %{?_smp_mflags}. Above it appears that f14 has been submited for an update. So this bug should be closed after mhddfs is accepted in bodhi.
Comment 3 Fedora Update System 2011-08-09 20:36:11 EDT
mhddfs-0.1.38-7.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-7.fc15
Comment 4 Fedora Update System 2011-08-09 20:43:30 EDT
mhddfs-0.1.38-7.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-7.fc16
Comment 5 Fedora Update System 2011-08-09 23:22:57 EDT
Package mhddfs-0.1.38-7.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mhddfs-0.1.38-7.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-7.fc14
then log in and leave karma (feedback).
Comment 6 Ville Skyttä 2011-08-10 02:13:31 EDT
(In reply to comment #2)
> Wow one thing that is weird, I can not find the review I did for mhddfs in my
> list of bugs or by searching.

Googling for "mhddfs review request" finds it quickly.

> I looked at the SPEC file and it seems to have been fixed. Every branch,
> master, f16, f15, f14 now has make %{?_smp_mflags}.

Although _smp_mflags should be used too, it has nothing to do with $RPM_OPT_FLAGS, and in fact, 0.1.38-7 is still not built with $RPM_OPT_FLAGS.  A proper fix would look something like this:

Patch Makefile to honor user CFLAGS instead of overwriting them and send the patch upstream:

-CFLAGS	=	-Wall $(shell pkg-config fuse --cflags) \
+CFLAGS	+=	-Wall $(shell pkg-config fuse --cflags) \

...and apply the patch in the specfile, and invoke make like:

CFLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags}
Comment 7 Jameson 2011-08-10 09:11:00 EDT
Should I be seeing more on these lines?

gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/flist.c -o obj/flist.o
gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/usage.c -o obj/usage.o
gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/tools.c -o obj/tools.o
gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/main.c -o obj/main.o
gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/debug.c -o obj/debug.o
gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/parse_options.c -o obj/parse_options.o
gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD obj/flist.o obj/usage.o obj/tools.o obj/main.o obj/debug.o obj/parse_options.o -o mhddfs -pthread -L/lib64 -lfuse -lrt -ldl 


I tried the patch you recommended, but most of his gcc lines in the make file don't mention CFLAGS, either.  Thanks.
Comment 8 Nathan Owe 2011-08-10 22:07:37 EDT
Even using sed would work 

sed -i 's|CFLAGS	=	-Wall $(shell pkg-config fuse --cflags|CFLAGS	=	-O2 -Wall $(shell pkg-config fuse --cflags|g' Makefile

 Here is the a patch file that will work: 
http://ndowens.fedorapeople.org/mhddfs-0.1.38-Makefile-cflags.patch
So in the %prep area add 
%patch0 -p0 -b .makefile-cflags

Of course you will need to a comment above the patch to explain why the patch is needed and also send the patch upstream through their bug tracker if they have one and if you use the bug tracker to submit the patch to upstream include the link to the bug in a comment above the patch. If there is no bug tracker and only email say that it was sent through email on whatever the date is that was sent.
Comment 9 Nathan Owe 2011-08-10 22:08:15 EDT
I would use the patch so upstream can use it
Comment 10 Jameson 2011-08-12 12:17:27 EDT
Ok.  I've made a patch, and ran a build with it in master.  Can someone verify that it is working, before I start pushing it into other branches?  Thanks.
Comment 11 Nathan Owe 2011-08-12 23:46:45 EDT
The patch included doesn't work. The one I have included does.  This is what the compile process shows currently:
 gcc -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/flist.c -o obj/flist.o

With the one I included it does
 gcc -O2 -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse   -DFUSE_USE_VERSION=26 -MMD -c src/flist.c -o obj/flist.o
Comment 12 Nathan Owe 2011-08-12 23:53:05 EDT
Though some input from Ville would be nice, looking at /var/lib/rpm/macros %{optflags} value is -O2 so that is why I made it only add -O2 if my patch is going to be in question.
Comment 13 Nathan Owe 2011-08-13 00:41:16 EDT
I redone my patch, the link http://ndowens.fedorapeople.org/mhddfs-0.1.38-Makefile-cflags.patch is my patch, I did CFLAGS += ${RPM_OPT_FLAGS}. I tested it and it does seem to add the optflags required to the one in the Makefile
Comment 14 Jameson 2011-08-13 00:52:22 EDT
But patching $RPM_OPT_FLAGS can't be passed to upstream.
Comment 15 Nathan Owe 2011-08-13 20:58:16 EDT
The patch I have created may not need to go upstream since I would believe to be only Fedora specific. According to the Packaging Guidelines:

Fedora-specific (or rejected upstream) patches

It may be that some patches truly are Fedora-specific; in that case, say so:

# This patch is temporary until we land the long term System.loadLibrary fix in OpenJDK
Patch0: jna-jni-path.patch

So I would probably put something like:
#This patch is temporary until the CFLAGS can be overridden through build flags
%{name}-%{version}-Makefile-cflags.patch
Comment 16 Ville Skyttä 2011-08-15 02:22:13 EDT
The recipe I posted in comment 6 does work, but you didn't quite follow it closely enough :)

This does not do the trick (it's how it is in the master branch at the moment):

    CFLAGS="$RPM_OPT_FLAGS"
    make %{?_smp_mflags}

Any one of these three will work:

    CFLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags}

    CFLAGS="$RPM_OPT_FLAGS" \
    make %{?_smp_mflags}

    export CFLAGS="$RPM_OPT_FLAGS"
    make %{?_smp_mflags}
Comment 17 Fedora Update System 2011-08-15 11:25:43 EDT
mhddfs-0.1.38-9.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-9.fc16
Comment 18 Fedora Update System 2011-08-15 11:26:55 EDT
mhddfs-0.1.38-9.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-9.fc15
Comment 19 Fedora Update System 2011-08-15 11:28:02 EDT
mhddfs-0.1.38-9.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-9.fc14
Comment 20 Fedora Update System 2011-08-15 16:26:34 EDT
Package mhddfs-0.1.38-9.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mhddfs-0.1.38-9.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/mhddfs-0.1.38-9.fc16
then log in and leave karma (feedback).
Comment 21 Fedora Update System 2011-08-23 16:27:47 EDT
mhddfs-0.1.38-9.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 22 Fedora Update System 2011-08-26 14:57:59 EDT
mhddfs-0.1.38-9.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 23 Fedora Update System 2011-08-26 15:09:05 EDT
mhddfs-0.1.38-9.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

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