testroot.pristine creation falls over copying dynamic linker

Message ID alpine.DEB.2.21.1907312132270.25113@digraph.polyomino.org.uk
State Superseded
Headers

Commit Message

Joseph Myers July 31, 2019, 9:34 p.m. UTC
  On Wed, 31 Jul 2019, Carlos O'Donell wrote:

> > > Maybe we need a filter like this?  It just prefers the RHS path if there
> > > is on, else uses the first path available:
> > > 
> > > -	        | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
> > > +	        | grep / | sed 's@.*=> /@/@' | sed 's/^[^/]*//' | sed 's/
> > > .*//'` ;\
> > 
> > I can confirm that doing that (for both Makefile lines with such a sed
> > command) allows the MIPS tests to run in cases where they previously fell
> > over because the path on the LHS does not exist in the root filesystem.
> 
> Shall we get this fix in for 2.30?

I think it's desirable for 2.30 (to avoid problems testing for an ABI on a 
system without that ABI's dynamic linker installed in the root filesystem 
under its canonical name), but I haven't really thought about what cases 
ought to be tested to confirm the change is safe.

For reference, this is the implied patch of DJ's that I tested.
  

Comments

Carlos O'Donell Aug. 1, 2019, 3:43 a.m. UTC | #1
On 7/31/19 5:34 PM, Joseph Myers wrote:
> On Wed, 31 Jul 2019, Carlos O'Donell wrote:
> 
>>>> Maybe we need a filter like this?  It just prefers the RHS path if there
>>>> is on, else uses the first path available:
>>>>
>>>> -	        | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
>>>> +	        | grep / | sed 's@.*=> /@/@' | sed 's/^[^/]*//' | sed 's/
>>>> .*//'` ;\
>>>
>>> I can confirm that doing that (for both Makefile lines with such a sed
>>> command) allows the MIPS tests to run in cases where they previously fell
>>> over because the path on the LHS does not exist in the root filesystem.
>>
>> Shall we get this fix in for 2.30?
> 
> I think it's desirable for 2.30 (to avoid problems testing for an ABI on a
> system without that ABI's dynamic linker installed in the root filesystem
> under its canonical name), but I haven't really thought about what cases
> ought to be tested to confirm the change is safe.

Please take your time here and work with DJ to determine what is needed.

We can then backport to the stable 2.30 branch to ensure it works.
  

Patch

diff --git a/Makefile b/Makefile
index ac1125853b..c91e151042 100644
--- a/Makefile
+++ b/Makefile
@@ -385,7 +385,7 @@  ifeq ($(run-built-tests),yes)
 	for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1  \
 		$(rtld-prefix) \
 		$(objpfx)testroot.pristine/bin/sh \
-	        | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
+	        | grep / | sed 's@.*=> /@/@' | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
 	  do \
 	    test -d `dirname $(objpfx)testroot.pristine$$dso` || \
 	      mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\
@@ -394,7 +394,7 @@  ifeq ($(run-built-tests),yes)
 	for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1  \
 		$(rtld-prefix) \
 		$(objpfx)support/$(LINKS_DSO_PROGRAM) \
-	        | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
+	        | grep / | sed 's@.*=> /@/@' | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
 	  do \
 	    test -d `dirname $(objpfx)testroot.pristine$$dso` || \
 	      mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\