Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp881860rwb; Thu, 4 Aug 2022 12:45:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR4xXnQRVhuk8bAKoBGNdPSLk4tvjuKiJe9ta+ne/JY0nHI4M6RKEoxgsBRk+2E+aSY+sWqR X-Received: by 2002:a05:6402:15a:b0:431:71b9:86f3 with SMTP id s26-20020a056402015a00b0043171b986f3mr3554340edu.249.1659642311018; Thu, 04 Aug 2022 12:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659642311; cv=none; d=google.com; s=arc-20160816; b=xPAijFvy2uZCKBsOdN6NJLEhXtEAs3O4MfnAAhkrat8EsLPN1xqQCsa1deZaa1RW86 JAk5Y54nwhswXIWgTtAHdhM6Mg8ZGNexo6gMvvBOqS/BQQP57RpUUVhr7GmDF0K7mB5l dxBtZ8iXM47V9x15cyjjX8erJ+HsPmE9dGBkcUEIVuugSH8PU8ifdh1hFIMldSkv7fqK 7DfdT69YvQJubGUDxS4/JgsTZjhDY+JbSe82Gj+PD8BC8cCUAWKB+vt/GtZyBPwos7zN 9dOf2DA9BCwuFZuOmGYVryvLyNjBYpoUP85Dwh51jI9hXzxKRY80+SDDWtoBO6cQlr6W eK2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5dQkBNIvJPkGbfFELN5kn8lJPk788agYp3vVKqKLXQQ=; b=fYTXm7SJyHySG/w7MhVm7b6cAAoB6VxgrxckXEdZJ3VU/7VnChpK4QJOMYEZ4ZcWf5 j1st1NdFcWY4P++PwFE8EVwXH7TK+pRit1mHYgwCD3BliLT5QbU7y2J7QtjDPFFL0/yk 5adS4IZFpaN2TXXokBU1VA8FLdb/8PFDDTnN8oNZKBBX3OAkECr0rfkvXIvpE8261PZu 2VQ17penVrfanayD2uTncGAW99l2lCbsTbXC5oCL2aGnnKMOV5LyOzL6Hem4O5Wcl+rM BskXG1ElHPT0nKedm+xB+to6/Ad9wSXnmey3ypnN7vKuwrXlnRwI7djBdYleHVxZHBa9 Lrjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eCtIdWnL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a50cd43000000b0043d4fe7f8e7si2226029edj.330.2022.08.04.12.44.44; Thu, 04 Aug 2022 12:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=eCtIdWnL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235224AbiHDTij (ORCPT + 99 others); Thu, 4 Aug 2022 15:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233658AbiHDTig (ORCPT ); Thu, 4 Aug 2022 15:38:36 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBB8E6E2C3; Thu, 4 Aug 2022 12:38:34 -0700 (PDT) Received: from [192.168.43.224] (92.40.178.239.threembb.co.uk [92.40.178.239]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: gtucker) by madras.collabora.co.uk (Postfix) with ESMTPSA id BC6A66601BFA; Thu, 4 Aug 2022 20:38:32 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1659641913; bh=YR06TcNC313+o+tpJhkeCXhA11OnSzpwetPY80MPTq8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=eCtIdWnL2e3j3b9gdVcogqaPJdIXpTMgJxLBj4dlqklzGGr+zjNymQNEg7n7pyu4d GHPEo9M+McUemcrv9Otu2/Z3Fn3IP7VHZBgkh8JdXIgkRumV3jUOUH5bWWDLXChCj1 3kyMMD36iE+unBbMXx/uLjMr6ij+L+dRnYM/tSRs0lFwcSU2llcza8j3lFy/3rL3QO B0pR71xhOFsP6GtYzQ9WcKE/BEq9TueMWvOGCDNenJsuNwqohBwmv/Qunff/g1u9PP DO2U1/v78mnY1VI+v/I3DZXZ2f0mQesixMRx4sbXDY5m4+YPxTM8M6VhekCvZUBjIl oNSnzdAWn2foQ== Message-ID: <76a2ac43-6e3d-0b62-7c8c-eec5f247f8f8@collabora.com> Date: Thu, 4 Aug 2022 21:38:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] selftests/landlock: fix broken include of linux/landlock.h Content-Language: en-US To: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Shuah Khan Cc: Anders Roxell , Tim.Bird@sony.com, kernel@collabora.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org References: From: Guillaume Tucker In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/08/2022 12:36, Mickaël Salaün wrote: > > On 03/08/2022 22:13, Guillaume Tucker wrote: >> Revert part of the earlier changes to fix the kselftest build when >> using a sub-directory from the top of the tree as this broke the >> landlock test build as a side-effect when building with "make -C >> tools/testing/selftests/landlock". >> >> Reported-by: Mickaël Salaün >> Fixes: a917dd94b832 ("selftests/landlock: drop deprecated headers dependency") >> Fixes: f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL") >> Signed-off-by: Guillaume Tucker >> --- >>   tools/testing/selftests/landlock/Makefile | 7 +++++-- >>   1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing/selftests/landlock/Makefile >> index a6959df28eb0..02868ac3bc71 100644 >> --- a/tools/testing/selftests/landlock/Makefile >> +++ b/tools/testing/selftests/landlock/Makefile >> @@ -9,10 +9,13 @@ TEST_GEN_PROGS := $(src_test:.c=) >>   TEST_GEN_PROGS_EXTENDED := true >>     OVERRIDE_TARGETS := 1 >> +top_srcdir := ../../../.. > > Not sure it changes much, but most other selftests Makefiles use "top_srcdir = ../../../.." (without ":="). Why this change? I didn't simply apply your diff but edited the file by hand to test various combinations and see what side effects it might have. So when I added top_srcdir I typed it by hand and used := as a reflex since it's the standard way of assigning variables. Using = instead only makes a difference when the r-value has something dynamic as it will be re-evaluated every time it's used. So for constant values, I guess it's more of a question of coding style and conventions. Maybe all the top_srcdir variables should be changed to := but that's unnecessary churn... Either way, it's benign. Shuah, feel free to change this back to = in this particular case if it's more consistent with other Makefiles. Consistency is often better than arbitrary rules. Or conversely, change to := for the khdr_dir definition... Entirely up to you I think. Thanks, Guillaume >>   include ../lib.mk >>   +khdr_dir = $(top_srcdir)/usr/include >> + >>   $(OUTPUT)/true: true.c >>       $(LINK.c) $< $(LDLIBS) -o $@ -static >>   -$(OUTPUT)/%_test: %_test.c ../kselftest_harness.h common.h >> -    $(LINK.c) $< $(LDLIBS) -o $@ -lcap >> +$(OUTPUT)/%_test: %_test.c $(khdr_dir)/linux/landlock.h ../kselftest_harness.h common.h >> +    $(LINK.c) $< $(LDLIBS) -o $@ -lcap -I$(khdr_dir)