posix: Do not include testcases.h, ptestcases.h in source tree

Message ID 875zwg6t7p.fsf@oldenburg.str.redhat.com
State Committed
Headers

Commit Message

Florian Weimer Nov. 29, 2018, 11:03 a.m. UTC
  * Andreas Schwab:

> On Nov 28 2018, Florian Weimer <fweimer@redhat.com> wrote:
>
>> @@ -261,13 +261,15 @@ bug-glob1-ARGS = "$(objpfx)"
>>  tst-execvp3-ARGS = --test-dir=$(objpfx)
>>  CFLAGS-tst-spawn3.c += -DOBJPFX=\"$(objpfx)\"
>>  
>> -testcases.h: TESTS TESTS2C.sed
>> +$(objpfx)testcases.h: TESTS TESTS2C.sed
>>  	LC_ALL=C sed -f TESTS2C.sed < $< > $@T
>> -	mv -f $@T $@
>> +	$(move-if-change) $@T $@
>> +$(objpfx)runtests.o: $(objpfx)testcases.h
>
> You should not use move-if-change without a stamp file.  But why do you
> need it in the first place?

You are right, mv is just fine here.

What about the patch below?  (Actual file removal diff still missing due
to encoding problems.)

Thanks,
Florian
-----
posix: Do not include testcases.h, ptestcases.h in source tree

These files were both auto-generated and shipped in the source tree.
We can assume that sed is available and always generate the files
during the build.

2018-11-29  Florian Weimer  <fweimer@redhat.com>

	* posix/Makefile (before-compile): Remove testcases.h and
	ptestcases.h.
	(testcases.h, ptestcases.h): Move to $(objpfx).
	(runtests.o): Add dependency on testcases.h.
	(runptests.o): Add dependency on ptestcases.h.
	* posix/testcases.h, posix/ptestcases.h: Remove files.
	* scripts/build-many-glibcs.py (Context.fix_glibc_timestamps): Do
	not touch posix/testcases.h and posix/ptestcases.h.
  

Comments

Andreas Schwab Nov. 29, 2018, 12:38 p.m. UTC | #1
On Nov 29 2018, Florian Weimer <fweimer@redhat.com> wrote:

> 	* posix/Makefile (before-compile): Remove testcases.h and
> 	ptestcases.h.
> 	(testcases.h, ptestcases.h): Move to $(objpfx).
> 	(runtests.o): Add dependency on testcases.h.
> 	(runptests.o): Add dependency on ptestcases.h.
> 	* posix/testcases.h, posix/ptestcases.h: Remove files.
> 	* scripts/build-many-glibcs.py (Context.fix_glibc_timestamps): Do
> 	not touch posix/testcases.h and posix/ptestcases.h.

You need to add them to generated.  Ok with that change.

Andreas.
  

Patch

diff --git a/posix/Makefile b/posix/Makefile
index d67f68d0db..a7cb28804c 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -115,7 +115,7 @@  others		:= getconf
 install-bin	:= getconf
 install-others-programs	:= $(inst_libexecdir)/getconf
 
-before-compile	+= testcases.h ptestcases.h $(objpfx)posix-conf-vars-def.h
+before-compile	+= $(objpfx)posix-conf-vars-def.h
 
 # So they get cleaned up.
 generated += $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
@@ -261,13 +261,15 @@  bug-glob1-ARGS = "$(objpfx)"
 tst-execvp3-ARGS = --test-dir=$(objpfx)
 CFLAGS-tst-spawn3.c += -DOBJPFX=\"$(objpfx)\"
 
-testcases.h: TESTS TESTS2C.sed
+$(objpfx)testcases.h: TESTS TESTS2C.sed
 	LC_ALL=C sed -f TESTS2C.sed < $< > $@T
-	mv -f $@T $@
+	mv $@T $@
+$(objpfx)runtests.o: $(objpfx)testcases.h
 
-ptestcases.h: PTESTS PTESTS2C.sed
+$(objpfx)ptestcases.h: PTESTS PTESTS2C.sed
 	LC_ALL=C sed -f PTESTS2C.sed < $< > $@T
-	mv -f $@T $@
+	mv $@T $@
+$(objpfx)runptests.o: $(objpfx)ptestcases.h
 
 $(objpfx)tst-getopt-cancel: $(shared-thread-library)
 
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 98acabc7a0..9051ff17b1 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -846,8 +846,7 @@  class Context(object):
         # Some other files have such dependencies but do not need to
         # be touched because nothing in a build depends on the files
         # in question.
-        for f in ('locale/C-translit.h', 'posix/ptestcases.h',
-                  'posix/testcases.h', 'sysdeps/gnu/errlist.c',
+        for f in ('locale/C-translit.h', 'sysdeps/gnu/errlist.c',
                   'sysdeps/mach/hurd/bits/errno.h',
                   'sysdeps/sparc/sparc32/rem.S',
                   'sysdeps/sparc/sparc32/sdiv.S',