FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 11-08-2010, 01:49 PM
Michal Hlavinka
 
Default What are differences between real and rpmbuild's environment?

Hi,

I'm trying to find out what are differences between environment for local rpm
build and usual user's environment. I've added regression tests to %check
section of ksh spec file. These tests never fails when executed in user's
environment, but some of them always fail when executed as part of rpm build
process. I've tried to compare variable in the environment and ulimit values,
but there does not seem to be any significant difference. I've also tried to use
the same script generated by rpmbuild for %check section (from
/var/tmp/rpm.*), but still it does not reproduce the problem. Any ideas?

Michal
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-08-2010, 02:26 PM
Rex Dieter
 
Default What are differences between real and rpmbuild's environment?

Michal Hlavinka wrote:

> I'm trying to find out what are differences between environment for local
> rpm build and usual user's environment.

You mean the difference between rpmbuild and... a manual "./configure;
make"?

For starters, see rpm's output from

rpm --eval "%{configure}" which sets variance build/optimization flags.

and rpmbuild also does:
LANG=C ; export LANG
unset DISPLAY

-- Rex

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-08-2010, 05:34 PM
"Richard W.M. Jones"
 
Default What are differences between real and rpmbuild's environment?

On Mon, Nov 08, 2010 at 03:49:28PM +0100, Michal Hlavinka wrote:
> I'm trying to find out what are differences between environment for
> local rpm build and usual user's environment. I've added regression
> tests to %check section of ksh spec file. These tests never fails
> when executed in user's environment, but some of them always fail
> when executed as part of rpm build process. I've tried to compare
> variable in the environment and ulimit values, but there does not
> seem to be any significant difference. I've also tried to use the
> same script generated by rpmbuild for %check section (from
> /var/tmp/rpm.*), but still it does not reproduce the problem. Any
> ideas?

Is the spec file using %configure? That adds a lot of flags to the
configure script. Similarly make _vs_ make %{_smp_flags}.

Have you tried 'printenv' at the top of the %check section?

Are you specifically running rpmbuild as the same user? Or are we
talking about rpmbuild in some other environment (mock or Koji)?
There is a Koji bug which affects ksh %check in particular
(RHBZ#639275).

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-09-2010, 08:02 AM
Michal Hlavinka
 
Default What are differences between real and rpmbuild's environment?

On Monday, November 08, 2010 16:26:22 Rex Dieter wrote:
> Michal Hlavinka wrote:
> > I'm trying to find out what are differences between environment for local
> > rpm build and usual user's environment.
>
> You mean the difference between rpmbuild and... a manual "./configure;
> make"?

something like that but without configure and make. Just the %check section.
Executed by rpmbuild at the end of rpm build process VS running %check section
script by hand with the same ksh binary.

>
> For starters, see rpm's output from
>
> rpm --eval "%{configure}" which sets variance build/optimization flags.

configure makes no difference here, because I'm always using the same ksh binary

>
> and rpmbuild also does:
> LANG=C ; export LANG
> unset DISPLAY

I tried this, no difference
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-09-2010, 08:07 AM
Michal Hlavinka
 
Default What are differences between real and rpmbuild's environment?

On Monday, November 08, 2010 19:34:14 Richard W.M. Jones wrote:
> On Mon, Nov 08, 2010 at 03:49:28PM +0100, Michal Hlavinka wrote:
> > I'm trying to find out what are differences between environment for
> > local rpm build and usual user's environment. I've added regression
> > tests to %check section of ksh spec file. These tests never fails
> > when executed in user's environment, but some of them always fail
> > when executed as part of rpm build process. I've tried to compare
> > variable in the environment and ulimit values, but there does not
> > seem to be any significant difference. I've also tried to use the
> > same script generated by rpmbuild for %check section (from
> > /var/tmp/rpm.*), but still it does not reproduce the problem. Any
> > ideas?
>
> Is the spec file using %configure? That adds a lot of flags to the
> configure script. Similarly make _vs_ make %{_smp_flags}.

I'm always using the same ksh binary, so this does not make any difference

> Have you tried 'printenv' at the top of the %check section?

tried, but there does not seem to be significant difference. Also the %check
script I used was the same script rpmbuild creates from the %check section (in
/var/tmp/rpm*) and it defines the same environment:

-------------------------------------------
#!/bin/sh

RPM_SOURCE_DIR="/home/mhlavink/gitf/ksh"
RPM_BUILD_DIR="/home/mhlavink/gitf/ksh"
RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -
fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic"
RPM_ARCH="x86_64"
RPM_OS="linux"
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
RPM_DOC_DIR="/usr/share/doc"
export RPM_DOC_DIR
RPM_PACKAGE_NAME="ksh"
RPM_PACKAGE_VERSION="20101026"
RPM_PACKAGE_RELEASE="1.fc14"
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
LANG=C
export LANG
unset CDPATH DISPLAY ||:
RPM_BUILD_ROOT="/home/mhlavink/rpmbuild/BUILDROOT/ksh-20101026-1.fc14.x86_64"
export RPM_BUILD_ROOT

PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
export PKG_CONFIG_PATH

set -x
umask 022
cd "/home/mhlavink/gitf/ksh"
cd 'ksh-20101026'
unset DISPLAY

SHELL=$(ls $(pwd)/arch/*/bin/ksh)
cp $SHELL ${SHELL}4check
export SHELL=${SHELL}4check
cd src/cmd/ksh93/tests/
ulimit -c unlimited
if [ ! -e /dev/fd ]
then
echo "ERROR: /dev/fd does not exist, regression tests skipped"
exit 0
fi
$SHELL ./shtests 2>&1 | tee testresults.log
killall ksh4check -s SIGKILL
...
-------------------------------------------

> Are you specifically running rpmbuild as the same user?

rpmbuild vs. just %check script executed by the same user on the same machine

> Or are we
> talking about rpmbuild in some other environment (mock or Koji)?
> There is a Koji bug which affects ksh %check in particular
> (RHBZ#639275).

I know. I reported that bug
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-09-2010, 11:31 AM
"Richard W.M. Jones"
 
Default What are differences between real and rpmbuild's environment?

On Tue, Nov 09, 2010 at 10:07:05AM +0100, Michal Hlavinka wrote:
> tried, but there does not seem to be significant difference. Also the %check
> script I used was the same script rpmbuild creates from the %check section (in
> /var/tmp/rpm*) and it defines the same environment:
>
> -------------------------------------------
> #!/bin/sh
>
> RPM_SOURCE_DIR="/home/mhlavink/gitf/ksh"
> RPM_BUILD_DIR="/home/mhlavink/gitf/ksh"
> RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -
> fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic"
> RPM_ARCH="x86_64"
> RPM_OS="linux"
> export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
> RPM_DOC_DIR="/usr/share/doc"
> export RPM_DOC_DIR
> RPM_PACKAGE_NAME="ksh"
> RPM_PACKAGE_VERSION="20101026"
> RPM_PACKAGE_RELEASE="1.fc14"
> export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
> LANG=C
> export LANG
> unset CDPATH DISPLAY ||:
> RPM_BUILD_ROOT="/home/mhlavink/rpmbuild/BUILDROOT/ksh-20101026-1.fc14.x86_64"
> export RPM_BUILD_ROOT
>
> PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
> export PKG_CONFIG_PATH
>
> set -x
> umask 022
> cd "/home/mhlavink/gitf/ksh"
> cd 'ksh-20101026'
> unset DISPLAY
>
> SHELL=$(ls $(pwd)/arch/*/bin/ksh)
> cp $SHELL ${SHELL}4check
> export SHELL=${SHELL}4check
> cd src/cmd/ksh93/tests/
> ulimit -c unlimited
> if [ ! -e /dev/fd ]
> then
> echo "ERROR: /dev/fd does not exist, regression tests skipped"
> exit 0
> fi
> $SHELL ./shtests 2>&1 | tee testresults.log
> killall ksh4check -s SIGKILL
> ...
> -------------------------------------------

Maybe something strange like the size in bytes of the environment
is crossing some limit?

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-09-2010, 01:58 PM
Michal Hlavinka
 
Default What are differences between real and rpmbuild's environment?

On Monday, November 08, 2010 15:49:28 Michal Hlavinka wrote:
> Hi,
>
> I'm trying to find out what are differences between environment for local
> rpm build and usual user's environment. I've added regression tests to
> %check section of ksh spec file. These tests never fails when executed in
> user's environment, but some of them always fail when executed as part of
> rpm build process. I've tried to compare variable in the environment and
> ulimit values, but there does not seem to be any significant difference.
> I've also tried to use the same script generated by rpmbuild for %check
> section (from
> /var/tmp/rpm.*), but still it does not reproduce the problem. Any ideas?
>
> Michal

Ok, I've forgot to mention a few things and I'll also add new information I've
found.

- Tests that are failing are all about pipe and sigpipe/pipefail.

- I've tried to reproduce this just with "empty" spec file - I've moved the
tests in %prep section just after sources are unpacked and patched (required
for running tests) and it still fails

- I've prepared simple script with just the first failing test and. I've
modified this test slightly so it can be used with bash too. BASH has no
problem with this test when executed from terminal. When it's executed from
prep section in rpmbuild it fails too.


This is the test script (defined as Source6
#########################
s=$SECONDS
set -o pipefail
for ((i=0; i < 30; i++))
do printf hello 2>/dev/null
sleep .1
done | /bin/sleep 1
(( (SECONDS-s) < 2 )) || printf >&2 'early termination not causing broken
pipe'
#########################

and it's being executed from %prep section:
#########################
%prep
export SHELL=/bin/bash
time $SHELL %{SOURCE6}
exit 1
#########################

Correct real time is 1 sec something, when broken, time is 3 seconds something
and error message is produced.

So it seems rpmbuild has a bug and breaks sigpipe somehow...
Any comments before I file bug?
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-09-2010, 02:23 PM
Andreas Schwab
 
Default What are differences between real and rpmbuild's environment?

Michal Hlavinka <mhlavink@redhat.com> writes:

> So it seems rpmbuild has a bug and breaks sigpipe somehow...

Perhaps it leaves it ignored? You can check with /proc/$$/status.

$ (trap ' SIGPIPE; bash x.sh)
early termination not causing broken

Andreas.

--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-09-2010, 02:30 PM
Panu Matilainen
 
Default What are differences between real and rpmbuild's environment?

On Tue, 9 Nov 2010, Michal Hlavinka wrote:

> On Monday, November 08, 2010 15:49:28 Michal Hlavinka wrote:
>> Hi,
>>
>> I'm trying to find out what are differences between environment for local
>> rpm build and usual user's environment. I've added regression tests to
>> %check section of ksh spec file. These tests never fails when executed in
>> user's environment, but some of them always fail when executed as part of
>> rpm build process. I've tried to compare variable in the environment and
>> ulimit values, but there does not seem to be any significant difference.
>> I've also tried to use the same script generated by rpmbuild for %check
>> section (from
>> /var/tmp/rpm.*), but still it does not reproduce the problem. Any ideas?
>>
>> Michal
>
> Ok, I've forgot to mention a few things and I'll also add new information I've
> found.
>
> - Tests that are failing are all about pipe and sigpipe/pipefail.
>
> - I've tried to reproduce this just with "empty" spec file - I've moved the
> tests in %prep section just after sources are unpacked and patched (required
> for running tests) and it still fails
>
> - I've prepared simple script with just the first failing test and. I've
> modified this test slightly so it can be used with bash too. BASH has no
> problem with this test when executed from terminal. When it's executed from
> prep section in rpmbuild it fails too.
>
>
> This is the test script (defined as Source6
> #########################
> s=$SECONDS
> set -o pipefail
> for ((i=0; i < 30; i++))
> do printf hello 2>/dev/null
> sleep .1
> done | /bin/sleep 1
> (( (SECONDS-s) < 2 )) || printf >&2 'early termination not causing broken
> pipe'
> #########################
>
> and it's being executed from %prep section:
> #########################
> %prep
> export SHELL=/bin/bash
> time $SHELL %{SOURCE6}
> exit 1
> #########################
>
> Correct real time is 1 sec something, when broken, time is 3 seconds something
> and error message is produced.
>
> So it seems rpmbuild has a bug and breaks sigpipe somehow...
> Any comments before I file bug?

Oh, SIGPIPE. That explains... nspr (to which rpm is indirectly married to
through nss) quietly sets SIG_IGN on SIGPIPE on initialization, triggering
these kind of obscure misbehaviors in rpm-related scripts. Ain't the first
time for sure, but the first time somebody manages to trigger the issue in
build.

Fixing is easy enough, but do file a bug so I wont forget. Extra bonus for
minimal reproducer.

- Panu -
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 11-09-2010, 03:14 PM
Michal Hlavinka
 
Default What are differences between real and rpmbuild's environment?

On Tuesday, November 09, 2010 16:30:17 Panu Matilainen wrote:
> On Tue, 9 Nov 2010, Michal Hlavinka wrote:
> > On Monday, November 08, 2010 15:49:28 Michal Hlavinka wrote:
> >> Hi,
> >>
> >> I'm trying to find out what are differences between environment for
> >> local rpm build and usual user's environment. I've added regression
> >> tests to %check section of ksh spec file. These tests never fails when
> >> executed in user's environment, but some of them always fail when
> >> executed as part of rpm build process. I've tried to compare variable
> >> in the environment and ulimit values, but there does not seem to be any
> >> significant difference. I've also tried to use the same script
> >> generated by rpmbuild for %check section (from
> >> /var/tmp/rpm.*), but still it does not reproduce the problem. Any ideas?
> >>
> >> Michal
> >
> > Ok, I've forgot to mention a few things and I'll also add new information
> > I've found.
> >
> > - Tests that are failing are all about pipe and sigpipe/pipefail.
> >
> > - I've tried to reproduce this just with "empty" spec file - I've moved
> > the tests in %prep section just after sources are unpacked and patched
> > (required for running tests) and it still fails
> >
> > - I've prepared simple script with just the first failing test and. I've
> > modified this test slightly so it can be used with bash too. BASH has no
> > problem with this test when executed from terminal. When it's executed
> > from prep section in rpmbuild it fails too.
> >
> >
> > This is the test script (defined as Source6
> > #########################
> > s=$SECONDS
> > set -o pipefail
> > for ((i=0; i < 30; i++))
> > do printf hello 2>/dev/null
> >
> > sleep .1
> >
> > done | /bin/sleep 1
> > (( (SECONDS-s) < 2 )) || printf >&2 'early termination not causing broken
> > pipe'
> > #########################
> >
> > and it's being executed from %prep section:
> > #########################
> > %prep
> > export SHELL=/bin/bash
> > time $SHELL %{SOURCE6}
> > exit 1
> > #########################
> >
> > Correct real time is 1 sec something, when broken, time is 3 seconds
> > something and error message is produced.
> >
> > So it seems rpmbuild has a bug and breaks sigpipe somehow...
> > Any comments before I file bug?
>
> Oh, SIGPIPE. That explains... nspr (to which rpm is indirectly married to
> through nss) quietly sets SIG_IGN on SIGPIPE on initialization, triggering
> these kind of obscure misbehaviors in rpm-related scripts. Ain't the first
> time for sure, but the first time somebody manages to trigger the issue in
> build.
>
> Fixing is easy enough, but do file a bug so I wont forget. Extra bonus for
> minimal reproducer.

Thanks, filed as #651463

Michal
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 06:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org