Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#118 closed defect (fixed)

rpm-build: Strange failure

Reported by: dmik Owned by:
Priority: critical Milestone:
Component: rpm Version:
Severity: low Keywords:
Cc:

Description

I can't name it differently. I can only describe what happens. This applies to rpm-build.i386, version 4.8.1-22.oc00. The detailed description follows in the subsequent comments.

Attachments (1)

Снимок экрана 2015-02-13 в 21.18.09.png (14.4 KB) - added by dmik 5 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 5 years ago by dmik

Let's take this .spec file: source:/spec/trunk/SPECS/help2man.spec@539. If you remove lines 82-84 containing this garbage:

    # @todo: don't remove these comment lines! See http://trac.netlabs.org/rpm/ticket/118 for more info.
    #################################
    #################################

and attempt to build this RPM with rpm-build -bb help2man.spec, the build process will fail giving you this:

+ /@unixroot/usr/lib/rpm/brp-strip.os2
Processing files: help2man-1.46.4-2.oc00.noarch
error: File not found: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/bin/help2man
error: File not found by glob: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/info/*
error: File not found by glob: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/man/man1/
Executing(%doc): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.tNQepE
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd D:\Users\dmik/rpmbuild/BUILD
+ cd help2man-1.46.4
+ DOCDIR=D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46.4
+ export DOCDIR
+ rm -rf D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46.4
+ /@unixroot/usr/bin/mkdir.exe -p D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46
+ cp -pr README NEWS THANKS COPYING D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.
+ exit 0
error: File not found: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46


RPM build errors:
    File not found: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/bin/help2man
    File not found by glob: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/info/*
    File not found by glob: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/man/man1/*
    File not found: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46.4

However, if you add these garbage lines back, the failure gets magically fixed and you get a normal log like this:

+ /@unixroot/usr/lib/rpm/brp-strip.os2
Processing files: help2man-1.46.4-2.oc00.noarch
Executing(%doc): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.nGop4X
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd D:\Users\dmik/rpmbuild/BUILD
+ cd help2man-1.46.4
+ DOCDIR=D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46.4
+ export DOCDIR
+ rm -rf D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46.4
+ /@unixroot/usr/bin/mkdir.exe -p D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46.4
+ cp -pr README NEWS THANKS COPYING D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/share/doc/help2man-1.46.4
+ exit 0
Requires(interp): /@unixroot/usr/bin/sh /@unixroot/usr/bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /@unixroot/usr/bin/sh /@unixroot/usr/sbin/install-info.exe
Requires(preun): /@unixroot/usr/bin/sh /@unixroot/usr/sbin/install-info.exe
Checking for unpackaged file(s): /@unixroot/usr/lib/rpm/check-files.os2 D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386
Wrote: D:/Users/dmik/rpmbuild/RPMS/noarch/help2man-1.46.4-2.oc00.noarch.rpm
Executing(%clean): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.Mbz0TZ
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd D:\Users\dmik/rpmbuild/BUILD
+ cd help2man-1.46.4
+ /@unixroot/usr/bin/rm.exe -rf D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386
+ exit 0

These garbage lines is what I had to add as a very stupid workaround to fix the build. It seems that somehow rpmbuild reacts to the length of the .spec file or to some details of its contents when performs the Processing files: phase. Someone with good knowledge of RPM internals should debug this.

comment:2 Changed 5 years ago by dmik

Note that the failed lines

error: File not found: D:/Users/ /D:/Users/dmik/rpmbuild/BUILDROOT/help2man-1.46.4-2.oc00.i386/@unixroot/usr/bin/help2man

and alike actually look like on the screenshot attached below. I.e. there is a symbol with code 0x0B between the first D:/Users occurrence and the second one. Looks like some unexpected expansion/truncation/whatever.

Last edited 5 years ago by dmik (previous) (diff)

comment:3 Changed 5 years ago by dmik

  • Priority changed from major to critical

comment:4 Changed 5 years ago by ydario

works for me, at least on laptop. Will try on my server later.

comment:5 Changed 4 years ago by diver

  • Severity set to low

I see exactly the same issue with http://trac.netlabs.org/rpm/browser/spec/trunk/SPECS/cups.spec?rev=689

Right now I have no idea how to overcome this.

comment:6 Changed 4 years ago by diver

I tried the cups spec with rpm 4.13 and it worked. So either the bug is fixed with 4.13 or i'm lucky.

comment:7 Changed 3 years ago by diver

  • Resolution set to fixed
  • Status changed from new to closed

I mark this as fixed, as I didn't face it with rpm 4.13 anymore. If it's still around we might open it again.

comment:8 Changed 3 years ago by dmik

This is not fixed in fact. I got that when building the latest perl.spec with a lot of changes. The message is slightly different but the symptoms are absolutely the same. After hardly debugging it, it turns out that there is a bug in the OS/2 hack by Yuri in rpmCleanPath in source:/rpm/trunk/rpmio/rpmfileutil.c related to removal of the leading root (unixroot) dir when it's concatenated with an absolute path with a drive letter. Basically, the rpmCleanPath function with the OS/2 hack involved may return not the same pointer as it was given and this breaks the function's documentation and some code under some circumstances. I will fix it.

comment:9 Changed 3 years ago by dmik

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:10 Changed 3 years ago by dmik

  • Resolution set to fixed
  • Status changed from reopened to closed

This is fixed by r1073. Note that the code is still not perfect (see comments) but that's a general RPM issue. They have very low quality code that deals with things like path concatenation and such. It relies on many assumptions that are not always true on Unix needless to say about OS/2.

comment:11 Changed 3 years ago by dmik

JFYI, r1074 fixes one particular use case where D:/mydir is concatenated with D:/mydir2.

Note: See TracTickets for help on using tickets.