Tuesday, October 12, 2010

rpath - an interesting story

Finally, I got my koji build done. Thanks to Chris Tyler for the help to correct my last error in the spec file. It's quite a long story to work through wireshark package. In the early stage, I encountered the error with rpath. It's basically the library path being hard corded in the file, which causes the build process confusion when it can't find the path (or something like that).

I got the rpath error in the lab and didn't have enough time to resolve it before I had to leave the lab. Later, I test the build at home, where I use a 32 bit processor. The rpath error didn't show (lucky!). I dealt with other problems and got the build done. I wasn't fully understand the rpath nature because I didn't try it again in the lab.

Then I got the access to the machines in CDOT. I tried to do the mock build in ireland. Now I remembered that I still have the rpath problem. First I try to follow the hint in the error massage to run:

$ QA_RPATHS=$[ 0x0001|0x0010 ] rpmbuild -ba wireshark.spec

The errors are gone, but when run rpmlint afterward, the rpath errors come back. So, the above command just ignore the rpath. It didn't solve the problem.

I found the page Packaging:Guidelines. I realized that I need to run chrpath on each file in the error line. Please go the that page to get the details if you are interested. Now the rpmlint is happy and errors are gone.

The mock build is kind of tedious. I repeated half a dozen times since I added the build requires each time I run into an error. Eventually, all the build requirements are satisfied and mock build succeeded.

Finally, I moved to koji. First a certificate was applied and pasted to ireland. Then I run koji build, and I failed. I went to check the build.log. Guess who is making trouble? rpath, again? In my spec file, the chrapth command run for each file has rpath in it. Two of these files are in /usr/lib64/.... The koji build  failed in i686 architecture since lib64 doesn't exist in that case. Today I asked Chris for help. He told me to use %{_libdir} instead of /usr/lib64. That's it, koji went through.

Looking back, it's quite an interesting learning curve. Looking back further, It's breath taking. I started Seneca in summer 2009. I remember at the time half of the class were struggling with ULI101: sort, tail, pipe ... etc. Can you imaging to deal with a course like SBR600 in such a short time. Oh well...

No comments:

Post a Comment