Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1923912rwb; Fri, 12 Aug 2022 08:57:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR65en7nwmoR6LGWTCWiPIy7IGjPyYwuJRBg5A9udELuzPDtbfEINkY6EGAMPO5r6HfgGe26 X-Received: by 2002:a05:6402:444c:b0:43b:d375:e932 with SMTP id o12-20020a056402444c00b0043bd375e932mr4148004edb.399.1660319867520; Fri, 12 Aug 2022 08:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660319867; cv=none; d=google.com; s=arc-20160816; b=OZPEYnFAQIi0AoLMypTu7bOKo77Rt9SoxXZ/8e4YX6dJrNKsw3fW9vT8ZYpEeKzecO uv+lxgE2TJLp7SYZyAlKBoSgJOdFVQrgBS8A9UCRyCkMnptyCbrEUhLUdewYGpAFzqfH 0d+GQr5Ed7HvuHkVASRpgHYbaFNpNbtG/RWo1VEMVf2lCBEaVLkic7Fy5L3ZCOIxoeWJ aPDGsIMpVTQYq35PeZ2hRQiPhPssdeloYEMCDSzYqx5OF4Wlr8FhtGiB0UrMj0uY4GdG CgCjNw1uvHJM/jZmVeiQ9xH181VSGSG17UZAL7zAD4Jl/h3bsLtjg906hz3eNUtyTCLG SBiA== 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:subject :references:cc:to:from:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=tf0l4aPherXUkmlg17IlKi6+bHkWAozOA4SEAXA5Fdc=; b=DkyJY22xIYNzPNdjyySd/dvm8T8JHDj9xihtVeqUjTM7uOZhPNYuozcRVZM/N8thns H3vb6FEeXvZNmoywr8a+IaKec5HBS8oNhvLMPj+iWmIb73klDQHVVHddOfOXo1VA1t7Q oilqCaJmAGGspXrNRiI8kbgP+iCxPk2hvcgdkJUTjSUUqDxs6HdvQ8s13UdNnBSSHpya tfx/qVJTDISD1nvNxei4NidWL6LSVGkXfP6BY/DKY+4E1/UJw4dI0QSZSN9seMMP1Cnr xiJMieSW5hYnmMGQBUOVOAQ5LilAudHvTT9EjHXNJZsp1wv/kHfp4uH2NZjV/pqUnIw+ X/1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=NjjQHOj4; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd31-20020a1709076e1f00b007308550af97si2166296ejc.735.2022.08.12.08.57.20; Fri, 12 Aug 2022 08:57:47 -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=@digikod.net header.s=20191114 header.b=NjjQHOj4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236964AbiHLPaE (ORCPT + 99 others); Fri, 12 Aug 2022 11:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234273AbiHLPaD (ORCPT ); Fri, 12 Aug 2022 11:30:03 -0400 Received: from smtp-bc09.mail.infomaniak.ch (smtp-bc09.mail.infomaniak.ch [IPv6:2001:1600:3:17::bc09]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F947CB62 for ; Fri, 12 Aug 2022 08:30:00 -0700 (PDT) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [10.4.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4M47045hnZzMqDVK; Fri, 12 Aug 2022 17:29:56 +0200 (CEST) Received: from ns3096276.ip-94-23-54.eu (unknown [23.97.221.149]) by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4M47041ZGnzlrKd0; Fri, 12 Aug 2022 17:29:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1660318196; bh=os1y2RaZXpvAPI4x/Kt6ufZlR7Y3TXa/5EBs1HgStPQ=; h=Date:From:To:Cc:References:Subject:In-Reply-To:From; b=NjjQHOj4WEACVa+xDGjILXnFy5XnjPmlCEtyh2SaOS2Lled9uOoY+Cgv2IWI6Kv2G eQEgBhSQe7WKHruYwnS/X77IzbcZYHD8tmLasVjBJtE7KLZGUP4srfc+zLJ6gGCdA7 BKQ3nDXlPorpPTJHUivrmF8vV8ovr241v/5Y/5CU= Message-ID: Date: Fri, 12 Aug 2022 17:29:55 +0200 MIME-Version: 1.0 User-Agent: Content-Language: en-US From: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= To: Guillaume Tucker , 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: <76a2ac43-6e3d-0b62-7c8c-eec5f247f8f8@collabora.com> <3de9a64e-6f27-8f76-9626-6ee082d382ea@digikod.net> Subject: Re: [PATCH] selftests/landlock: fix broken include of linux/landlock.h In-Reply-To: <3de9a64e-6f27-8f76-9626-6ee082d382ea@digikod.net> Content-Type: text/plain; charset=UTF-8; format=flowed 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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Shuah, do you plan to send a pull request before merge window closes? On 05/08/2022 19:16, Mickaël Salaün wrote: > > On 04/08/2022 21:38, Guillaume Tucker wrote: >> 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. > > Looks good to me, thanks! Shuah, feel free to add > Signed-off-by: Mickaël Salaün > >> >> 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) >>