Patchwork [v5,3/7] selftests/seccomp: Force rebuild according to dependencies

login
register
mail settings
Submitter Mickaël Salaün
Date May 26, 2017, 6:43 p.m.
Message ID <20170526184402.30267-4-mic@digikod.net>
Download mbox | patch
Permalink /patch/9750991/
State New
Headers show

Comments

Mickaël Salaün - May 26, 2017, 6:43 p.m.
Rebuild the seccomp tests when kselftest_harness.h is updated.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Will Drewry <wad@chromium.org>
---
 tools/testing/selftests/seccomp/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Shuah Khan - June 2, 2017, 7:31 p.m.
Hi Mickaël,

On 05/26/2017 12:43 PM, Mickaël Salaün wrote:
> Rebuild the seccomp tests when kselftest_harness.h is updated.
> 
> Signed-off-by: Mickaël Salaün <mic@digikod.net>
> Acked-by: Kees Cook <keescook@chromium.org>
> Cc: Andy Lutomirski <luto@amacapital.net>
> Cc: Shuah Khan <shuah@kernel.org>
> Cc: Will Drewry <wad@chromium.org>
> ---
>  tools/testing/selftests/seccomp/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
> index 5fa6fd2246b1..aeb0c805f3ca 100644
> --- a/tools/testing/selftests/seccomp/Makefile
> +++ b/tools/testing/selftests/seccomp/Makefile
> @@ -4,3 +4,5 @@ LDFLAGS += -lpthread
>  
>  include ../lib.mk
>  
> +$(TEST_GEN_PROGS): seccomp_bpf.c ../kselftest_harness.h
> +	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
> 

This change breaks seccomp build:

make -C tools/testing/selftests/seccomp/
make: Entering directory '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp'
make: *** No rule to make target '../kselftest_harness.h', needed by '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp/seccomp_bpf'.  Stop.
make: Leaving directory '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp'
shuah@mazurka:/mnt/data/lkml/linux_4.12$ cd tools/testing/selftests/seccomp/
shuah@mazurka:/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp$ make
make: *** No rule to make target '../kselftest_harness.h', needed by '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp/seccomp_bpf'.  Stop.


Did you happen to try building with this change?

thanks,
-- Shuah
Mickaël Salaün - June 3, 2017, 11:13 a.m.
Hi Shuah,

On 02/06/2017 21:31, Shuah Khan wrote:
> Hi Mickaël,
> 
> On 05/26/2017 12:43 PM, Mickaël Salaün wrote:
>> Rebuild the seccomp tests when kselftest_harness.h is updated.
>>
>> Signed-off-by: Mickaël Salaün <mic@digikod.net>
>> Acked-by: Kees Cook <keescook@chromium.org>
>> Cc: Andy Lutomirski <luto@amacapital.net>
>> Cc: Shuah Khan <shuah@kernel.org>
>> Cc: Will Drewry <wad@chromium.org>
>> ---
>>  tools/testing/selftests/seccomp/Makefile | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
>> index 5fa6fd2246b1..aeb0c805f3ca 100644
>> --- a/tools/testing/selftests/seccomp/Makefile
>> +++ b/tools/testing/selftests/seccomp/Makefile
>> @@ -4,3 +4,5 @@ LDFLAGS += -lpthread
>>  
>>  include ../lib.mk
>>  
>> +$(TEST_GEN_PROGS): seccomp_bpf.c ../kselftest_harness.h
>> +	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
>>
> 
> This change breaks seccomp build:
> 
> make -C tools/testing/selftests/seccomp/
> make: Entering directory '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp'
> make: *** No rule to make target '../kselftest_harness.h', needed by '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp/seccomp_bpf'.  Stop.
> make: Leaving directory '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp'
> shuah@mazurka:/mnt/data/lkml/linux_4.12$ cd tools/testing/selftests/seccomp/
> shuah@mazurka:/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp$ make
> make: *** No rule to make target '../kselftest_harness.h', needed by '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp/seccomp_bpf'.  Stop.
> 
> 
> Did you happen to try building with this change?

Yes I did, and it builds fine for me (with the same command and
patches). There is only one warning from GCC with
../kselftest_harness.h:368 because of the trick from OPTIONAL_HANDLER(),
which is intentional (and not modified by my patches).

I don't get why your "make" said that there is "No rule to make target"
../kselftest_harness.h . This file exists (patch 1/7) so there is no
need to create it…
gen_kselftest_tar.sh works fine too.

Thanks,
 Mickaël
Shuah Khan - June 5, 2017, 6:17 p.m.
Hi Mickaël,

On 06/03/2017 05:13 AM, Mickaël Salaün wrote:
> Hi Shuah,
> 
> On 02/06/2017 21:31, Shuah Khan wrote:
>> Hi Mickaël,
>>
>> On 05/26/2017 12:43 PM, Mickaël Salaün wrote:
>>> Rebuild the seccomp tests when kselftest_harness.h is updated.
>>>
>>> Signed-off-by: Mickaël Salaün <mic@digikod.net>
>>> Acked-by: Kees Cook <keescook@chromium.org>
>>> Cc: Andy Lutomirski <luto@amacapital.net>
>>> Cc: Shuah Khan <shuah@kernel.org>
>>> Cc: Will Drewry <wad@chromium.org>
>>> ---
>>>  tools/testing/selftests/seccomp/Makefile | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
>>> index 5fa6fd2246b1..aeb0c805f3ca 100644
>>> --- a/tools/testing/selftests/seccomp/Makefile
>>> +++ b/tools/testing/selftests/seccomp/Makefile
>>> @@ -4,3 +4,5 @@ LDFLAGS += -lpthread
>>>  
>>>  include ../lib.mk
>>>  
>>> +$(TEST_GEN_PROGS): seccomp_bpf.c ../kselftest_harness.h
>>> +	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
>>>
>>
>> This change breaks seccomp build:
>>
>> make -C tools/testing/selftests/seccomp/
>> make: Entering directory '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp'
>> make: *** No rule to make target '../kselftest_harness.h', needed by '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp/seccomp_bpf'.  Stop.
>> make: Leaving directory '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp'
>> shuah@mazurka:/mnt/data/lkml/linux_4.12$ cd tools/testing/selftests/seccomp/
>> shuah@mazurka:/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp$ make
>> make: *** No rule to make target '../kselftest_harness.h', needed by '/mnt/data/lkml/linux_4.12/tools/testing/selftests/seccomp/seccomp_bpf'.  Stop.
>>
>>
>> Did you happen to try building with this change?
> 
> Yes I did, and it builds fine for me (with the same command and
> patches). There is only one warning from GCC with
> ../kselftest_harness.h:368 because of the trick from OPTIONAL_HANDLER(),
> which is intentional (and not modified by my patches).
> 
> I don't get why your "make" said that there is "No rule to make target"
> ../kselftest_harness.h . This file exists (patch 1/7) so there is no
> need to create it…
> gen_kselftest_tar.sh works fine too.
> 

I think I know what's going on here. It is my bad. Never mind, we are good.
I will apply this patch to linux-kselftest next.

thanks,
-- Shuah

Patch

diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
index 5fa6fd2246b1..aeb0c805f3ca 100644
--- a/tools/testing/selftests/seccomp/Makefile
+++ b/tools/testing/selftests/seccomp/Makefile
@@ -4,3 +4,5 @@  LDFLAGS += -lpthread
 
 include ../lib.mk
 
+$(TEST_GEN_PROGS): seccomp_bpf.c ../kselftest_harness.h
+	$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@