[DTrace-devel] fail to build rpm package for dtrace-uitls

Fred Liu fred.fliu at gmail.com
Mon Apr 23 21:22:02 PDT 2018


2018-04-23 20:18 GMT+08:00 Tomas Jedlicka <tomas.jedlicka at oracle.com>:
> Oh, I see. We will fix the readme. Thanks for bringing this up.
>
> The problem you see is caused by missing "kernel-uek-devel" package
> installed with same version as spec file requires. This is a problem as
> UEK5 has not been released yet and thus there is no such package
> available yet (unless you build your own kernel-uek RPMs from github).
>
> You need to bootstrap the build and that is a bit tricky at this moment
> as without dtrace-utils-devel you don't have DTrace headers installed.
> At the same time you are trying to build dtrace-utils-devel.
>
> I am doing this boostrap procedure:
>
>     - Get your kernel (UEK5 or generic 4.14. with our patches) built and
> booted into.
>     - Install by hand DTrace headers from
> <kernel>/include/uapi/linux/dtrace/* to the /usr/include/linux/dtrace/*
>     - Use rpmbuild with the "build_local 1" define. This should pick headers
> from system location just fine
>
> If you hit problems with dtrace_kernels (other kernel-uek-devel packages
> required to
> produce translators) then you should start with reducing value of RPM macro
> dtrace_kernels
> to only one you are currently running. Values of this macro are used to
> search for installed kernel
> devel sources in /lib/modules/<......>/build or /usr/src/kernels/<.....>.

Wow, that is almost the same as my hacking before I asked in this mail!.
I can use UEK5 master to generate rpm packages with all default kernel options:

-rw-r--r--+ 1 root root 509370368 Apr 23 15:52 kernel-4.14.32+-2.x86_64.rpm
-rw-r--r--+ 1 root root 142234976 Apr 23 15:54
kernel-devel-4.14.32+-2.x86_64.rpm
-rw-r--r--+ 1 root root   1183044 Apr 23 15:52
kernel-headers-4.14.32+-2.x86_64.rpm

And it looks like kernel-headers-4.14.32+-2.x86_64.rpm has conflict
and no use in installation.
After booting into this new kernel I continue to build dtrace-utils
rpm packages like your instruction with extra following hackings

1): ln -s /usr/src/kernels/4.14.32+(from
kernel-devel-4.14.32+-2.x86_64.rpm)
/usr/src/kernels/4.14.32-1.el7.centosuek.
2): updating spec file:

%ifarch x86_64
%if 0%{?oraclelinux} == 6
%{!?build_kernel: %define build_kernel 4.1.12-112.14.10%{?dist}uek}
%{!?dtrace_kernels: %define dtrace_kernels %{build_kernel}
3.8.13-118.19.4%{?dist}uek}
%else
%{!?build_kernel: %define build_kernel 4.14.32-1%{?dist}uek}
%{!?dtrace_kernels: %define dtrace_kernels 4.14.32-1%{?dist}uek}  #fred
%endif
%else

And I finally get successful build:

[root at pvg03 dtrace-utils]# rpmbuild -ba --define 'local_build 1'
dtrace-utils.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.vSnmST
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf dtrace-utils-1.0.0
+ /usr/bin/tar -xf /root/rpmbuild/SOURCES/dtrace-utils-1.0.0.tar.bz2
+ cd dtrace-utils-1.0.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ mkdir -p /root/rpmbuild/BUILD/dtrace-utils-1.0.0/usr/include/linux/dtrace
+ cp -dr --preserve=mode,timestamps /usr/include/linux/dtrace
/root/rpmbuild/BUILD/dtrace-utils-1.0.0/usr/include/linux/
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.XVXEjx
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd dtrace-utils-1.0.0
++ getconf _NPROCESSORS_ONLN
+ make -j 4 VERSION=1.0.0 KERNELDIRPREFIX=/usr/src/kernels
KERNELDIRSUFFIX= 'KERNELS=4.14.32-1.el7.centosuek '
HDRPREFIX=/root/rpmbuild/BUILD/dtrace-utils-1.0.0/usr/include
SED: libdtrace/signal.d
AWK: libdtrace/errno.d
CC: libdtrace/drti.c
CC-32: libdtrace/drti.c
YACC: libdtrace/dt_grammar.c
MKNAMES: libdtrace/dt_names.c
libdtrace/drti.c:52:1: warning: constructor priorities from 0 to 100
are reserved for the implementation [enabled by default]
 {
 ^
libdtrace/drti.c:52:1: warning: constructor priorities from 0 to 100
are reserved for the implementation [enabled by default]
 {
 ^
M4: libdtrace/procfs.d.in
.........................
........................
........................
equires: /bin/bash ld-linux-x86-64.so.2()(64bit)
ld-linux-x86-64.so.2(GLIBC_2.3)(64bit) libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.4)(64bit)
libc.so.6(GLIBC_2.5)(64bit) libc.so.6(GLIBC_2.8)(64bit)
libdl.so.2()(64bit) libdtrace-ctf.so.1()(64bit)
libdtrace-ctf.so.1(LIBDTRACE_CTF_1.0)(64bit)
libdtrace-ctf.so.1(LIBDTRACE_CTF_1.3)(64bit) libdtrace.so.1()(64bit)
libdtrace.so.1(LIBDTRACE_1.0)(64bit) libelf.so.1()(64bit)
libelf.so.1(ELFUTILS_1.0)(64bit) libelf.so.1(ELFUTILS_1.5)(64bit)
libelf.so.1(ELFUTILS_1.6)(64bit) libm.so.6()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit) libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libpthread.so.0(GLIBC_2.3.3)(64bit) librt.so.1()(64bit)
librt.so.1(GLIBC_2.2.5)(64bit) libz.so.1()(64bit) rtld(GNU_HASH)
Processing files: dtrace-utils-devel-1.0.0-10.el7.centos.x86_64
Provides: dtrace-headers = 1.0.0 dtrace-utils-devel =
1.0.0-10.el7.centos dtrace-utils-devel(x86-64) = 1.0.0-10.el7.centos
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit)
libdtrace-ctf.so.1()(64bit) libdtrace.so.1()(64bit)
libdtrace.so.1(LIBDTRACE_PRIVATE)(64bit) libelf.so.1()(64bit)
libelf.so.1(ELFUTILS_1.0)(64bit) libelf.so.1(ELFUTILS_1.5)(64bit)
rtld(GNU_HASH)
Obsoletes: dtrace-modules-shared-headers dtrace-modules-provider-headers
Processing files: dtrace-utils-testsuite-1.0.0-10.el7.centos.x86_64
Provides: dtrace-utils-testsuite = 1.0.0-10.el7.centos
dtrace-utils-testsuite(x86-64) = 1.0.0-10.el7.centos
libproc-dlmlib.so.0()(64bit) libproc-lookup-victim-lib.so.0()(64bit)
Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <=
3.0.4-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files
/root/rpmbuild/BUILDROOT/dtrace-utils-1.0.0-10.el7.centos.x86_64
Wrote: /root/rpmbuild/SRPMS/dtrace-utils-1.0.0-10.el7.centos.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/dtrace-utils-1.0.0-10.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/dtrace-utils-devel-1.0.0-10.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/dtrace-utils-testsuite-1.0.0-10.el7.centos.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.MDSiyw
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd dtrace-utils-1.0.0
+ '[' /root/rpmbuild/BUILDROOT/dtrace-utils-1.0.0-10.el7.centos.x86_64
'!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/dtrace-utils-1.0.0-10.el7.centos.x86_64
+ rm -rf /root/rpmbuild/BUILD/dtrace-utils-1.0.0
+ exit 0
[root at pvg03 dtrace-utils]#


Thanks!

Fred

>
> Sorry for extra complexity. We are trying to simplify this as much as
> possible but it is
> not easy if we are not part of the upstream kernel tree.
>
> I hope it makes things bit more clear. If not then do not hesitate to ask
> more questions.
>
> Tomas
>
>
> On 04/23/2018 01:14 PM, Fred Liu wrote:
>>
>> Tomas,
>>
>> That is exactly what I reference. BTW, there is typo in that page:
>>
>> git archive -o ~/rpmbuild/SOURCE/dtrace-utils-1.0.0.tar.bz2
>> --prefix=dtrace-utils-1.0.0/ 1.0-branch
>>
>> The correct one should be(adding the missing 'S'):
>> git archive -o ~/rpmbuild/SOURCES/dtrace-utils-1.0.0.tar.bz2
>> --prefix=dtrace-utils-1.0.0/ 1.0-branch
>>
>> Thanks.
>>
>> Fred
>>
>> 2018-04-23 19:04 GMT+08:00 Tomas Jedlicka <tomas.jedlicka at oracle.com>:
>>>
>>> Hi Fred,
>>>
>>> I suggest to start with updated README.md which has been added to github
>>> repositories.
>>>
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_dtrace-2Dutils_blob_master_README.md&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=TH500uwHRHLHqjhgluCyxMsbZEewvpf7ynuq0G-WrEk&m=azXy2F0kocXMif0zYWiABdeFyT2lOgP3unRLZKB7o7k&s=9fjE5j3bot9OhWdd4pj01UqTIpNQmhHL6qvw5BTUBeI&e=
>>>
>>> Please check especially:
>>>
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_dtrace-2Dutils_blob_master_README.md-233-2Dpackaging-2Dinformation&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=TH500uwHRHLHqjhgluCyxMsbZEewvpf7ynuq0G-WrEk&m=azXy2F0kocXMif0zYWiABdeFyT2lOgP3unRLZKB7o7k&s=png42LL7AS2TnZpBEJni5jgp-lMAqOCv5nYulk0-3PE&e=
>>>
>>> It is very likely that the RPM build is pulling in dependencies on
>>> specific kernel-uek-devel
>>> packages which you don't have. Try adjusting build arguments from
>>> command line and/or
>>> install the packages.
>>>
>>> Tomas
>>>
>>> On 04/23/2018 12:46 PM, Fred Liu wrote:
>>>>
>>>> Hello,
>>>>
>>>> I can successfully build the source but fail to build rpm package.
>>>>
>>>> [root at pvg04 dtrace-utils-1.0.0]# rpmbuild -ba dtrace-utils.spec
>>>> Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.g5f1jq
>>>> + umask 022
>>>> + cd /root/rpmbuild/BUILD
>>>> + cd /root/rpmbuild/BUILD
>>>> + rm -rf dtrace-utils-1.0.0
>>>> + /usr/bin/tar -xf /root/rpmbuild/SOURCES/dtrace-utils-1.0.0.tar.bz2
>>>> + cd dtrace-utils-1.0.0
>>>> + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
>>>> + mkdir -p
>>>> /root/rpmbuild/BUILD/dtrace-utils-1.0.0/usr/include/linux/dtrace
>>>> + cp -dr --preserve=mode,timestamps
>>>> /usr/src/kernels/4.14.32-1.el7uek/include/uapi/linux/dtrace
>>>> /root/rpmbuild/BUILD/dtrace-utils-1.0.0/usr/include/linux/
>>>> + exit 0
>>>> Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.G10uSE
>>>> + umask 022
>>>> + cd /root/rpmbuild/BUILD
>>>> + cd dtrace-utils-1.0.0
>>>> ++ getconf _NPROCESSORS_ONLN
>>>> + make -j 4 VERSION=1.0.0 KERNELDIRPREFIX=/usr/src/kernels
>>>> KERNELDIRSUFFIX= 'KERNELS=4.14.28-1.el7uek* 4.1.12-124.9.1.el7uek* '
>>>> HDRPREFIX=/root/rpmbuild/BUILD/dtrace-utils-1.0.0/usr/include
>>>> SED: libdtrace/signal.d
>>>> AWK: libdtrace/errno.d
>>>> CC: libdtrace/drti.c
>>>> CC-32: libdtrace/drti.c
>>>> YACC: libdtrace/dt_grammar.c
>>>> MKNAMES: libdtrace/dt_names.c
>>>> libdtrace/drti.c:52:1: warning: constructor priorities from 0 to 100
>>>> are reserved for the implementation [enabled by default]
>>>>    {
>>>>    ^
>>>> M4: libdtrace/procfs.d.in
>>>> libdtrace/drti.c:52:1: warning: constructor priorities from 0 to 100
>>>> are reserved for the implementation [enabled by default]
>>>>    {
>>>>    ^
>>>> Macro "TASK_RUNNING" has no definition on this system.
>>>> libdtrace/procfs.m4:14:0: warning: "__KERNEL__" redefined [enabled by
>>>> default]
>>>>    #define __KERNEL__
>>>>    ^
>>>> <command-line>:0:0: note: this is the location of the previous
>>>> definition
>>>> Error: Not all tokens in libdtrace/procfs.d.in defined in headers.
>>>> make: ***
>>>> [/root/rpmbuild/BUILD/dtrace-utils-1.0.0/build/dlibs/4.14.28/procfs.d]
>>>> Error 1
>>>> make: *** Deleting file
>>>> `/root/rpmbuild/BUILD/dtrace-utils-1.0.0/build/dlibs/4.14.28/procfs.d'
>>>> make: *** Waiting for unfinished jobs....
>>>> error: Bad exit status from /var/tmp/rpm-tmp.G10uSE (%build)
>>>>
>>>>
>>>> RPM build errors:
>>>>       Bad exit status from /var/tmp/rpm-tmp.G10uSE (%build)
>>>> [root at pvg04 dtrace-utils-1.0.0]#
>>>>
>>>> BTW, I mostly following
>>>>
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_dtrace-2Dutils_blob_master_README&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=TH500uwHRHLHqjhgluCyxMsbZEewvpf7ynuq0G-WrEk&m=5Rn0_XksmmEH5Af-My2-4QPk8Xg8QoSuyhVJsdzS174&s=68u81fT9s-Gsm9EiNdATeSyngyqfUzN06qeCnDA5Oec&e=.
>>>>
>>>> Any ideas?
>>>>
>>>> Thanks.
>>>>
>>>> Fred
>>>>
>>>> _______________________________________________
>>>> DTrace-devel mailing list
>>>> DTrace-devel at oss.oracle.com
>>>> https://oss.oracle.com/mailman/listinfo/dtrace-devel
>>>
>>>
>>> _______________________________________________
>>> DTrace-devel mailing list
>>> DTrace-devel at oss.oracle.com
>>> https://oss.oracle.com/mailman/listinfo/dtrace-devel
>
>



More information about the DTrace-devel mailing list