This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: V8 test-in-container patch


On 09/10/18 16:21, Carlos O'Donell wrote:
> On 10/9/18 5:27 AM, Szabolcs Nagy wrote:
>> On 16/08/18 18:59, DJ Delorie wrote:
>>> +# The intention here is to do ONE install of our build into the
>>> +# testroot.pristine/ directory, then rsync (internal to
>>> +# support/test-container) that to testroot.root/ at the start of each
>>> +# test.  That way we can promise each test a "clean" install, without
>>> +# having to do the install for each test.
>>> +#
>>> +# In addition, we have to copy some files (which we build) into this
>>> +# root in addition to what glibc installs.  For example, many tests
>>> +# require /bin/sh be present, and any shared objects that /bin/sh
>>> +# depends on.  We also build a "test" program in either C or (if
>>> +# available) C++ just so we can copy in any shared objects (which we
>>> +# do not build) that GCC-compiled programs depend on.
>>> +
>>> +$(tests-container) $(addsuffix /tests,$(subdirs)) : \
>>> +		$(objpfx)testroot.pristine/install.stamp
>>> +$(objpfx)testroot.pristine/install.stamp :
>>> +	test -d $(objpfx)testroot.pristine || \
>>> +	  mkdir $(objpfx)testroot.pristine
>>> +	# We need a working /bin/sh for some of the tests.
>>> +	test -d $(objpfx)testroot.pristine/bin || \
>>> +	  mkdir $(objpfx)testroot.pristine/bin
>>> +	cp $(objpfx)support/shell-container $(objpfx)testroot.pristine/bin/sh
>>> +	cp $(objpfx)support/echo-container $(objpfx)testroot.pristine/bin/echo
>>> +	cp $(objpfx)support/true-container $(objpfx)testroot.pristine/bin/true
>>> +	# Copy these DSOs first so we can overwrite them with our own.
>>> +	for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1  \
>>> +		$(objpfx)elf/$(rtld-installed-name) \
>>> +		$(objpfx)testroot.pristine/bin/sh \
>>> +	        | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
>>> +	  do \
>>> +	    test -d `dirname $(objpfx)testroot.pristine$$dso` || \
>>> +	      mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\
>>> +	    $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
>>> +	  done
>>
>> in the aarch64 buildbot log i see
>>
>> for dso in ` env LD_TRACE_LOADED_OBJECTS=1  \
>> 	/home/szabolcs/tx1-ubuntu-aarch64/glibc-aarch64-linux/build/build/elf/ld-linux-aarch64.so.1 \
>> 	/home/szabolcs/tx1-ubuntu-aarch64/glibc-aarch64-linux/build/build/testroot.pristine/bin/sh \
>>         | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
>>   do \
>> ...
>> /home/szabolcs/tx1-ubuntu-aarch64/glibc-aarch64-linux/build/build/testroot.pristine/bin/sh: /lib/aarch64-linux-gnu/libc.so.6: version
>> `GLIBC_2.27' not found (required by /home/szabolcs/tx1-ubuntu-aarch64/glibc-aarch64-linux/build/build/testroot.pristine/bin/sh)
>>
>> i think some --library-path should be passed here.
> 
> Agreed. There should be a --library-path to the main build directory
> where libc.so.6 is present, otherwise it won't match the loader.
> 
> ...
> 	for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1  \
> 		$(objpfx)elf/$(rtld-installed-name) \
> 		--library-path $(objpfx):$(objpfx)/math:... \
>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
>                 Adds lookup for libc.so.6 and all other libraries.
> 
> 
> 		$(objpfx)testroot.pristine/bin/sh \
> 	        | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
> 	  do \
> ...
> 
> The list of lookup paths needs to be dynamic and you can probably
> crib the way testrun.sh knows, which I think is $(test-program-prefix)?
> 

if i replace $(objpfx)elf/$(rtld-installed-name) with
$(rtld-prefix) then i no longer get host libs from the
ubuntu multiarch directory into testroot.pristine,
instead i get stuff from my build directory, including
libgcc_s.so.1 and libstdc++.so.6 (which i copied there
before running the tests).

copying libs according to host lib paths only makes
sense if the container has the same lib paths set up.

is this step really needed? i thought all binaries in
the testroot are newly built so we should know exactly
the dependencies (including dlopen ones which are not
handled by this logic).

>>> +	for dso in `$(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1  \
>>> +		$(objpfx)elf/$(rtld-installed-name) \
>>> +		$(objpfx)support/links-dso-program \
>>> +	        | grep / | sed 's/^[^/]*//' | sed 's/ .*//'` ;\
>>> +	  do \
>>> +	    test -d `dirname $(objpfx)testroot.pristine$$dso` || \
>>> +	      mkdir -p `dirname $(objpfx)testroot.pristine$$dso` ;\
>>> +	    $(test-wrapper) cp $$dso $(objpfx)testroot.pristine$$dso ;\
>>> +	  done
>>> +	$(MAKE) install DESTDIR=$(objpfx)testroot.pristine
>>> +	touch $(objpfx)testroot.pristine/install.stamp
>>> +
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]