qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: fam@euphon.net, berrange@redhat.com, stefanb@linux.vnet.ibm.com,
	richard.henderson@linaro.org, qemu-devel@nongnu.org,
	Wainer dos Santos Moschetta <wainersm@redhat.com>,
	f4bug@amsat.org, cota@braap.org, stefanha@redhat.com,
	pbonzini@redhat.com, marcandre.lureau@redhat.com,
	aurelien@aurel32.net
Subject: Re: [PATCH v1 2/3] tests/docker: better handle symlinked libs
Date: Wed, 22 Jan 2020 23:15:17 +0100	[thread overview]
Message-ID: <00801ef6-a06e-1c69-eb79-01d2cfac53b0@redhat.com> (raw)
In-Reply-To: <87muafzdnq.fsf@linaro.org>

On 1/22/20 4:58 PM, Alex Bennée wrote:
> 
> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> 
>> On 1/22/20 2:24 PM, Wainer dos Santos Moschetta wrote:
>>> On 1/22/20 8:22 AM, Alex Bennée wrote:
>>>> When we are copying we want to ensure we grab the first
>>>> resolution (the found in path section). However even that binary might
>>>> be a symlink so lets make sure we chase the symlinks to copy the right
>>>> binary to where it can be found.
>>>>
>>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>>> ---
>>>>    tests/docker/docker.py | 3 ++-
>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/tests/docker/docker.py b/tests/docker/docker.py
>>>> index 31d8adf836..96d4326d53 100755
>>>> --- a/tests/docker/docker.py
>>>> +++ b/tests/docker/docker.py
>>>> @@ -109,7 +109,7 @@ def _get_so_libs(executable):
>>>>        ensure theright data is copied."""
>>>>        libs = []
>>>> -    ldd_re = re.compile(r"(/.*/)(\S*)")
>>>> +    ldd_re = re.compile(r"=> ?(/.*/)(\S*)")
>>
>> Why the 'optional space' after "=>"?
> 
> Actually what I want is an optional "=> "

Maybe r"(?:\S+ => )?(\S*) \(:?0x[0-9a-f]+\)"?

optional non-capturing upto "=> ",
capture until space,
non-capture address in parenthesis.

> 
>>
>>>>        try:
>>>>            ldd_output = subprocess.check_output(["ldd",
>>>> executable]).decode('utf-8')
>>>>            for line in ldd_output.split("\n"):
>>>> @@ -145,6 +145,7 @@ def _copy_binary_with_libs(src, bin_dest, dest_dir):
>>>>        if libs:
>>>>            for l in libs:
>>>>                so_path = os.path.dirname(l)
>>>> +            real_l = os.path.realpath(l)
>>> real_l is not used.
>>
>> I suppose the idea is to use it as:
>>
>>                  _copy_with_mkdir(real_l, dest_dir, so_path)
> 
> Yes - looks like I need to retest.
> 
>>
>>> - Wainer
>>>
>>>>                _copy_with_mkdir(l, dest_dir, so_path)
>>>
> 
> 



  reply	other threads:[~2020-01-22 22:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 10:22 [PATCH v1 0/3] current testing/next queue Alex Bennée
2020-01-22 10:22 ` [PATCH v1 1/3] tests/docker: move most cross compilers to buster base Alex Bennée
2020-01-22 10:22 ` [PATCH v1 2/3] tests/docker: better handle symlinked libs Alex Bennée
2020-01-22 13:24   ` Wainer dos Santos Moschetta
2020-01-22 14:46     ` Philippe Mathieu-Daudé
2020-01-22 15:58       ` Alex Bennée
2020-01-22 22:15         ` Philippe Mathieu-Daudé [this message]
2020-01-22 10:22 ` [PATCH v1 3/3] gitlab-ci: Refresh the list of iotests Alex Bennée
2020-01-22 13:37 ` [PATCH v1 0/3] current testing/next queue Wainer dos Santos Moschetta
2020-01-22 14:15   ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00801ef6-a06e-1c69-eb79-01d2cfac53b0@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=cota@braap.org \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).