PATCH: regress/libexec/ld.so/randomdata fix
The regression tests under randomdata do not work. They must build libaa before running. libaa doesn't have a target for regress so even though it's a SUBDIR in ../Makefile, it doesn't do anything. Index: regress/libexec/ld.so/randomdata/libaa/Makefile === RCS file: /cvs/src/regress/libexec/ld.so/randomdata/libaa/Makefile,v retrieving revision 1.1.1.1 diff -u -p -d -r1.1.1.1 Makefile --- regress/libexec/ld.so/randomdata/libaa/Makefile 16 Aug 2012 17:21:05 - 1.1.1.1 +++ regress/libexec/ld.so/randomdata/libaa/Makefile 19 Jul 2014 08:27:34 - @@ -3,4 +3,6 @@ LIB= aa SRCS+= aa.c +regress: all + .include bsd.lib.mk
Re: PATCH: regress/libexec/ld.so/randomdata fix
The regression tests under randomdata do not work. They must build libaa before running. libaa doesn't have a target for regress so even though it's a SUBDIR in ../Makefile, it doesn't do anything. They do; the magic to build libaa comes from regress/libexec/ld.so/randomdata/Makefile.inc . There are no regress tests to run in the libaa directory itself, but it needs to be in SUBDIR to get the obj directory and symlink created.
Re: PATCH: regress/libexec/ld.so/randomdata fix
On Sat, Jul 19, 2014 at 06:03:18PM +, Miod Vallat wrote: They do; the magic to build libaa comes from regress/libexec/ld.so/randomdata/Makefile.inc . There are no regress tests to run in the libaa directory itself, but it needs to be in SUBDIR to get the obj directory and symlink created. The problem is that even though libaa is in SUBDIR, it doesn't do anything when make is called in libaa. It runs 'make regress' in libaa and libaa doesn't have a regress target so it's a nop. I have a log from a partial run of 'make regression-tests' (I hit a bug in kqueue which hangs indefinitely) and it showed up as failing. I went into libexec/ld.so/randomdata and ran 'make depend regress' and it doesn't work without that patch. It would get built if something called 'make' since libaa would have a matching target then. I checked the top level /usr/src/Makefile and the parent of randomdata and they do not call the default target. I just installed an i386 snapshot on a laptop (no local changes yet) and tried it against the latest -current. I still see this behavior when I go into the directory and run 'make depend regress'. It's working for you?
Re: PATCH: regress/libexec/ld.so/randomdata fix
I have a log from a partial run of 'make regression-tests' (I hit a bug in kqueue which hangs indefinitely) and it showed up as failing. I went into libexec/ld.so/randomdata and ran 'make depend regress' and it doesn't work without that patch. It would get built if something called 'make' since libaa would have a matching target then. I checked the top level /usr/src/Makefile and the parent of randomdata and they do not call the default target. I just installed an i386 snapshot on a laptop (no local changes yet) and tried it against the latest -current. I still see this behavior when I go into the directory and run 'make depend regress'. It's working for you? Yes, it works for me. But I have run `make obj' first. If I don't `make obj', it will indeed fail, but not because of a missing regress target: $ make depend regress === libaa mkdep -a aa.c === prog-dynamic mkdep -a /usr/src/regress/libexec/ld.so/randomdata/prog-dynamic/../prog/prog.c === prog-static mkdep -a /usr/src/regress/libexec/ld.so/randomdata/prog-static/../prog/prog.c === prog-pie mkdep -a /usr/src/regress/libexec/ld.so/randomdata/prog-pie/../prog/prog.c === ld.so-cookie mkdep -a test.c === libaa === prog-dynamic cc -O2 -fstack-shuffle -pipe-c /usr/src/regress/libexec/ld.so/randomdata/prog-dynamic/../prog/prog.c Warning: target /usr/src/regress/libexec/ld.so/randomdata/prog-dynamic/../libaa/libaa.a (prerequisite of: prog) does not have any command (BUG) cc -o prog prog.o -Wl,-rpath,/usr/src/regress/libexec/ld.so/randomdata/prog-dynamic/../libaa -L/usr/src/regress/libexec/ld.so/randomdata/prog-dynamic/../libaa -laa /usr/bin/ld: cannot find -laa collect2: ld returned 1 exit status *** Error 1 in prog-dynamic (bsd.prog.mk:84 'prog') FAILED *** Error 1 in prog-dynamic (bsd.regress.mk:101 'regress') *** Error 1 in /usr/src/regress/libexec/ld.so/randomdata (bsd.subdir.mk:48 'regress') ... but that's a different issue, which can get fixed in Makefile.inc. And then, running `make obj', even in regress/, is recommended.
Re: PATCH: regress/libexec/ld.so/randomdata fix
Ah, I see; you're running `make regress' ; simply running `make' should work correctly (it implies building, and the running the regress target, when Makefile includes bsd.regress.mk).
Re: PATCH: regress/libexec/ld.so/randomdata fix
On Sat, Jul 19, 2014 at 06:59:14PM +, Miod Vallat wrote: Ah, I see; you're running `make regress' ; simply running `make' should work correctly (it implies building, and the running the regress target, when Makefile includes bsd.regress.mk). That would fix it for the local case inside of /usr/src/regress. Wouldn't it still be an issue at the top level /usr/src/Makefile when you run 'make regression-tests' which calls make depend make regress instead of make? I looked at the comments in /usr/src/regress/Makefile and it says to run 'make depend' followed by 'make regress'. I went looking in the tree for other cases where there's a lib dependency. /usr/src/regress/misc/sse2/libbar has 'regress: all'. Let me know which way you would prefer it fixed and I'll submit a new patch.
Re: PATCH: regress/libexec/ld.so/randomdata fix
Ah, I see; you're running `make regress' ; simply running `make' should work correctly (it implies building, and the running the regress target, when Makefile includes bsd.regress.mk). That would fix it for the local case inside of /usr/src/regress. Wouldn't it still be an issue at the top level /usr/src/Makefile when you run 'make regression-tests' which calls make depend make regress instead of make? I looked at the comments in /usr/src/regress/Makefile and it says to run 'make depend' followed by 'make regress'. I went looking in the tree for other cases where there's a lib dependency. /usr/src/regress/misc/sse2/libbar has 'regress: all'. Let me know which way you would prefer it fixed and I'll submit a new patch. Well, according to bsd.regress.mk(5), `regress' is the target to use to run the tests, so it makes sense for it to do whatever is necessary to build things first. So your diffs are going in the right direction.