Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame^] | 1 | open_posix_testsuite/generate-makefiles.sh: Fix determinism issue |
| 2 | |
| 3 | Currently the list of tests is generated by the order of the files found |
| 4 | within the directories. This results in differences in the run.sh and |
| 5 | Makefiles. Within Yocto Project this results in differing target |
| 6 | test packages. The fix is simple, just sort the output from locate-test. |
| 7 | |
| 8 | mk/lib.mk: Sort wildcard expansion for determinism |
| 9 | |
| 10 | The order of the objects linked into libltp.a varies depending on the |
| 11 | order of the files found on disk. This results in most ltp binaries |
| 12 | differing depending on that order too. |
| 13 | |
| 14 | Sort the wildcard expansion of *.c which leads to reproducible binaries. |
| 15 | |
| 16 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> |
| 17 | Upstream-Status: Submitted [http://lists.linux.it/pipermail/ltp/2021-March/021272.html http://lists.linux.it/pipermail/ltp/2021-March/021273.html] |
| 18 | |
| 19 | Index: git/testcases/open_posix_testsuite/scripts/generate-makefiles.sh |
| 20 | =================================================================== |
| 21 | --- git.orig/testcases/open_posix_testsuite/scripts/generate-makefiles.sh |
| 22 | +++ git/testcases/open_posix_testsuite/scripts/generate-makefiles.sh |
| 23 | @@ -24,7 +24,7 @@ generate_locate_test_makefile() { |
| 24 | |
| 25 | echo "Generating $maketype Makefiles" |
| 26 | |
| 27 | - locate-test --$maketype | sed -e 's,^./,,g' > make-gen.$maketype |
| 28 | + locate-test --$maketype | sed -e 's,^./,,g' | sort > make-gen.$maketype |
| 29 | |
| 30 | generate_makefiles make-gen.$maketype $* |
| 31 | |
| 32 | Index: git/include/mk/lib.mk |
| 33 | =================================================================== |
| 34 | --- git.orig/include/mk/lib.mk |
| 35 | +++ git/include/mk/lib.mk |
| 36 | @@ -50,6 +50,7 @@ endif |
| 37 | MAKE_TARGETS += $(LIB) |
| 38 | |
| 39 | LIBSRCS ?= $(wildcard $(abs_srcdir)/*.c) |
| 40 | +LIBSRCS := $(sort $(LIBSRCS)) |
| 41 | LIBSRCS := $(abspath $(LIBSRCS)) |
| 42 | LIBSRCS := $(subst $(abs_srcdir)/,,$(wildcard $(LIBSRCS))) |
| 43 | LIBSRCS := $(filter-out $(FILTER_OUT_LIBSRCS),$(LIBSRCS)) |