Joe McDonnell has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/6521 )

Change subject: IMPALA-3926: fix RPATH for libstdc++.so and libgcc.so
......................................................................


Patch Set 7:

(2 comments)

Overall, this makes sense to me.

http://gerrit.cloudera.org:8080/#/c/6521/7/functions.sh
File functions.sh:

http://gerrit.cloudera.org:8080/#/c/6521/7/functions.sh@612
PS7, Line 612: <dst dir> and <binary> must be relative paths from the current 
directory.
This is stale. <src lib> and <binary> must be relative paths from the current 
directory.


http://gerrit.cloudera.org:8080/#/c/6521/7/functions.sh@626
PS7, Line 626:   # We need to figure out how many "../" are in the relative 
path from the dst dir to
             :   # to the src dir, since the dst may be nested arbitrarily 
deeply (e.g. debug/bin/).
             :   local rel_path=""
             :   local curr_dir="$binary_dir"
             :   while [[ "$curr_dir" != "." ]]; do
             :     curr_dir="$(dirname "$curr_dir")"
             :     rel_path="../$rel_path"
             :   done
I'm thinking we might want to use python for this relative path calculation. 
os.path.relpath handles everything nicely:
https://docs.python.org/2/library/os.path.html#os.path.relpath
It was added in python 2.6, which should be ok.

I think this would do it:
python -c "import os.path; print os.path.relpath('${src_lib}', 
'${dst_lib_dir}')"
(Or you could do it after pushd into ${dst_lib_dir} and then you don't need the 
second argument.)

This would handle things even if the inputs are absolute paths.



-- 
To view, visit http://gerrit.cloudera.org:8080/6521
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: native-toolchain
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie3f8481a8dfe35273a763586e9d2da0d4008ac67
Gerrit-Change-Number: 6521
Gerrit-PatchSet: 7
Gerrit-Owner: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Hector Acosta <hector.aco...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <phi...@cloudera.com>
Gerrit-Reviewer: Tianyi Wang <tw...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Comment-Date: Tue, 17 Sep 2019 23:38:21 +0000
Gerrit-HasComments: Yes

Reply via email to