Print

Print


2Andy (Andrew Hanushevsky):

We use a standard RPM script to build the RPM. You can find it in
xrootd/packaging/makesrpm.sh
it is driven off gthe particular platform in question as you will see in the enclosing directory. There is nothing magical about it. All the standad toold you mentioned are used.

I didn't think about and now looked into the packaging directory. Both debian and rhel use cmake to build packages, so at first I was confused. Then I tried to build rpm package on Fedora 28. I installed all the necessary tools and packages, then ran makesrpm.sh and after that rpmbuild --rebuild *.src.rpm. After you words I was surprised to find that xrootd-libs-20180801.df577ab9-1.fc28.x86_64.rpm has references to build directory, namely

$ strings libXrdCryptossl-4.so | grep /home
/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslCipher.cc
/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509.cc
/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509Crl.cc

(I extracted this file from rpm using mc) whilst its debug version returns nothing:

$ strings libXrdCryptossl-4.so-20180801.df577ab9-1.fc28.x86_64.debug | grep /home

Be aware that when cmake creates artifacts in the "src" directory, it also sets runpath and a few other references so that you can run he executabes in he "src" directory and be sure you are not referencing anthing out side ot it.

I didn't think about that but now I think it is reasonable.

These get stripped off when you build an RPM and we strip them off manually for other kinds of builds.

Now I get puzzled. I tried to rebuild the package and checked rpm "archive" (I didn't install the package actually) and I see references to build directory, as in my case, so this is not the information that can be/should be stripped out?

he paths are forced by cmake to make sure that when you run something out of the cmake artifact directory (i.e. "src") you only reference things that are relevant to the build. When you create the distribution package, all of that stuff is stripped out so no side-effects should remain.

How this is stripped out? By strip? I tried manually do that on mention above .so file like

$ strip -s --strip-unneeded libXrdCryptossl-4.so

and still see

strings libXrdCryptossl-4.so | grep /home
/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslCipher.cc
/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509.cc
/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509Crl.cc

2bbockelm (Brian Bockelman):

Here's the info about RPATH:
https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling#default-rpath-settings

Thanks for the link, I'll read it later.

Are you doing a "make install"? That should be stripping out the RPATH, although it appears the default behavior drifted through different releases.

More:

make DESTDIR=${pkgdir} install

or less

DESTDIR=${pkgdir} cmake --build . --target install

Are you also stripping/relocating the debug symbols?

By default for my distribution.

I have impression that you guys know how the xrootd is build for RH, could you help me understand why I still see references to build directory for that .so? Then I could figure out what is going on my system.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xrootd/xrootd","title":"xrootd/xrootd","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/xrootd/xrootd"}},"updates":{"snippets":[{"icon":"PERSON","message":"@vp1981 in #790: 2Andy (Andrew Hanushevsky):\r\n\u003e We use a standard RPM script to build the RPM. You can find it in\r\n```xrootd/packaging/makesrpm.sh```\r\nit is driven off gthe particular platform in question as you will see in the enclosing directory. There is nothing magical about it. All the standad toold you mentioned are used.\r\n\r\nI didn't think about and now looked into the packaging directory. Both debian and rhel use cmake to build packages, so at first I was confused. Then I tried to build rpm package on Fedora 28. I installed all the necessary tools and packages, then ran ```makesrpm.sh``` and after that ```rpmbuild --rebuild *.src.rpm```. After you words I was surprised to find that ```xrootd-libs-20180801.df577ab9-1.fc28.x86_64.rpm``` has references to build directory, namely\r\n```\r\n$ strings libXrdCryptossl-4.so | grep /home\r\n/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslCipher.cc\r\n/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509.cc\r\n/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509Crl.cc\r\n```\r\n(I extracted this file from rpm using mc) whilst its debug version returns nothing:\r\n```\r\n$ strings libXrdCryptossl-4.so-20180801.df577ab9-1.fc28.x86_64.debug | grep /home\r\n```\r\n\r\n\u003e Be aware that when cmake creates artifacts in the \"src\" directory, it also sets runpath and a few other references so that you can run he executabes in he \"src\" directory and be sure you are not referencing anthing out side ot it.\r\n\r\nI didn't think about that but now I think it is reasonable.\r\n\r\n\u003e These get stripped off when you build an RPM and we strip them off manually for other kinds of builds.\r\n\r\nNow I get puzzled. I tried to rebuild the package and checked rpm \"archive\" (I didn't install the package actually) and I see references to build directory, as in my case, so this is not the information that can be/should be stripped out?\r\n\r\n\u003e he paths are forced by cmake to make sure that when you run something out of the cmake artifact directory (i.e. \"src\") you only reference things that are relevant to the build. When you create the distribution package, all of that stuff is stripped out so no side-effects should remain.\r\n\r\nHow this is stripped out? By ```strip```? I tried manually do that on mention above ```.so``` file like\r\n```\r\n$ strip -s --strip-unneeded libXrdCryptossl-4.so\r\n```\r\nand still see\r\n```\r\nstrings libXrdCryptossl-4.so | grep /home\r\n/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslCipher.cc\r\n/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509.cc\r\n/home/vladimir/rpmbuild/BUILD/xrootd/xrootd/src/XrdCrypto/XrdCryptosslX509Crl.cc\r\n```\r\n\r\n2bbockelm (Brian Bockelman):\r\n\r\n\u003e Here's the info about RPATH:\r\nhttps://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling#default-rpath-settings\r\n\r\nThanks for the link, I'll read it later.\r\n\r\n\u003e Are you doing a \"make install\"? That should be stripping out the RPATH, although it appears the default behavior drifted through different releases.\r\n\r\nMore:\r\n```\r\nmake DESTDIR=${pkgdir} install\r\n```\r\nor less\r\n```\r\nDESTDIR=${pkgdir} cmake --build . --target install\r\n```\r\n\r\n\u003e Are you also stripping/relocating the debug symbols?\r\n\r\nBy default for my distribution.\r\n\r\nI have impression that you guys know how the xrootd is build for RH, could you help me understand why I still see references to build directory for that ```.so```? Then I could figure out what is going on my system."}],"action":{"name":"View Issue","url":"https://github.com/xrootd/xrootd/issues/790#issuecomment-410116329"}}} [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/issues/790#issuecomment-410116329", "url": "https://github.com/xrootd/xrootd/issues/790#issuecomment-410116329", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } }, { "@type": "MessageCard", "@context": "http://schema.org/extensions", "hideOriginalBody": "false", "originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB", "title": "Re: [xrootd/xrootd] libXrdCryptossl-4.so has references to build directory, how to get rid of them? (#790)", "sections": [ { "text": "", "activityTitle": "**Vladimir Lomov**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@vp1981", "facts": [ ] } ], "potentialAction": [ { "name": "Add a comment", "@type": "ActionCard", "inputs": [ { "isMultiLine": true, "@type": "TextInput", "id": "IssueComment", "isRequired": false } ], "actions": [ { "name": "Comment", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"xrootd/xrootd\",\n\"issueId\": 790,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}" } ] }, { "name": "Close issue", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"xrootd/xrootd\",\n\"issueId\": 790\n}" }, { "targets": [ { "os": "default", "uri": "https://github.com/xrootd/xrootd/issues/790#issuecomment-410116329" } ], "@type": "OpenUri", "name": "View on GitHub" }, { "name": "Unsubscribe", "@type": "HttpPOST", "target": "https://api.github.com", "body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 363396870\n}" } ], "themeColor": "26292E" } ]

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1