lczech / gappa

A toolkit for analyzing and visualizing phylogenetic (placement) data
GNU General Public License v3.0
56 stars 7 forks source link

local build directory hard coded into binary? #17

Closed michaelgelliot closed 1 year ago

michaelgelliot commented 2 years ago

Hi there, After compiling gappa I find a large number of local paths in which the application was built (i.e. "/home/mick/....") hard coded into the binary. This can be seen by running "strings gappa | grep 'X'" where X is the username of the person who did the complication. Is this on purpose, and will this influence the function of the app if I move into /usr/bin? Cheers for any advice, best wishes, Mick

lczech commented 2 years ago

Hi Mick (@michaelgelliot),

thanks for bringing this up, this is interesting. If I run the command you provided on my gappa binary (locally compiled in release mode, so probably the same that you have done), the only strings that fit your description are some that simply list the cpp files of the source code of gappa, for example

/home/lucas/Dropbox/GitHub/gappa/src/main.cpp

I am not entirely sure why they are there, but highly likely just for some bookkeeping and such, and totally unrelated to the execution of the program. The strings command lists string content that is part of the binary (such as the plain text of error messages that the program stores, or command line argument descriptions) - it is not related to the execution paths of the program.

Is that also similar to what you are seeing, or do you have other types of paths in there that might cause more trouble? If so, could you please share some of them?

Also, generally, there should not be any dependencies of the gappa binary to local files within the gappa directory itself (only to libraries on the system - so you won't be able to move the binary to a different computer - this is possible with some extra compile flags, but not done by default, as it is a bit tricky to get to work on all systems). I have tried to configure the build and compilation specifically to avoid local dependencies, and hence to ensure that you can simply move the gappa binary to any path on the same system. The program to test this is ldd on unix and otool -L or something like that on mac. If you run this on gappa (i.e., otool -L gappa), you should not get any paths to the gappa directory, and just some system libraries listed. Could you please check this as well? Also, have you actually tried to move the gappa binary to /usr/bin? As said, it should just work - please check. If not, let me know ;-)

Cheers Lucas

lczech commented 1 year ago

Hi @michaelgelliot,

closing the issue now, as the strings that you describe should not affect portability of the binary in any way. If you have further questions, feel free to comment here or re-open the issue as needed :-)

Cheers Lucas