Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp409581rwe; Thu, 25 Aug 2022 02:37:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR5iQr9kML7k6jREcCCMzeDdvixx+A1JCXO12P2Oeqk3yg0PhVtD1r0LQqj7pzzdU2HDIl+y X-Received: by 2002:a05:6a00:21c2:b0:52b:ff44:6680 with SMTP id t2-20020a056a0021c200b0052bff446680mr3100221pfj.57.1661420275708; Thu, 25 Aug 2022 02:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661420275; cv=none; d=google.com; s=arc-20160816; b=P6oxRIcr6hdUzecUOsIn21wq5xykm5hQBE+NW92IjU4dVRv5JLgB30oS47jqASldPf 74aPl/Y0En1+XWiV5tMr0UBd5asQX7sAFW+8dC83LAsAUwDNUDNqLkd0b3q56U1r/uwu lQNaVDOxRVA+tcqfOvffbxmEhT8SV1jB+AhUI3miZYM/XwBw2hzmco5RwhJO3lNAEmK+ D7ddbwf1aEAC4iBI58q6Tm3Meb5SMsL3vBasSHuiFBH78VmyzKkhgGejsamqkMqNKHfZ gg98H1pbQFJPOdtI0cVNHMoPtSNZ+igkem4QJra2zE+U6zUmtjfw0sP02OcNIBmXO2PS MpMA== 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 :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=lrB2E4JD5pz2tJVvbbfPsURq1coPXiMUQI3CKqIvBdE=; b=lIoHYFAWJIV2cMrE78AbUqRm1ITOaoux1lub6cWtlFiVLK4BaSAtK18Z8fDZ2Ur3Ze /7mN3V98TkMjkfiQUJZ5sT1oeshDvRoFa5CZcxNdHjjOoERVChPUvIxzYG0AvVh/UBu8 XfoRVpKPZYRJCYT1ZczgR2gN5kYPIwh2JgK+TZofm/u0VpcyVwErZ5IkrjlrWXuzbwua VwaeGFFgy+wrssBfnfwKqU7HCqhDyjjptLXbYu0HvWxqaHxyuKGkA9Z9BhR6YUV9bAKH b+iIYM8SubdGQeHBfhMxInn9KdSEPsk9Si89vGbRtCxvaw30kxKKyUiKiAD+3wN1SqNW PL4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=jh+9OLvq; 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 o21-20020a056a0015d500b00536f8a6acadsi7196086pfu.2.2022.08.25.02.37.44; Thu, 25 Aug 2022 02:37:55 -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=jh+9OLvq; 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 S240140AbiHYJbf (ORCPT + 99 others); Thu, 25 Aug 2022 05:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238202AbiHYJba (ORCPT ); Thu, 25 Aug 2022 05:31:30 -0400 Received: from smtp-bc0b.mail.infomaniak.ch (smtp-bc0b.mail.infomaniak.ch [45.157.188.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24DAC785A9 for ; Thu, 25 Aug 2022 02:31:27 -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 4MCyQP1P46zMqDVD; Thu, 25 Aug 2022 11:31:25 +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 4MCyQN3ghkzlh8TL; Thu, 25 Aug 2022 11:31:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1661419885; bh=CkxqIj5ppbkjqi2GIhMLEArRVaHpESPBLrlgJrYmOqs=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=jh+9OLvqNwAbhISkiftw4MmTNT4pHs+fZpj4FpkmLFc/cc5INadRj05vaTMzHp0TH MvRiVzPfi6dOPgpD+tkdN3pFsU85X2TTYnFfpbStn8bH6D1OhxGceky3/XxV8wRXBv lZX5WzTRP7ylhT5IzCo7lcWDuYKM2LnNYyFQLImA= Message-ID: Date: Thu, 25 Aug 2022 11:31:23 +0200 MIME-Version: 1.0 User-Agent: Content-Language: en-US To: Anders Roxell Cc: Guillaume Tucker , Guillaume , Shuah Khan , 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: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Subject: Re: [PATCH] selftests/landlock: fix broken include of linux/landlock.h In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 22/08/2022 16:00, Anders Roxell wrote: > On Sat, 13 Aug 2022 at 14:31, Mickaël Salaün wrote: >> >> >> On 13/08/2022 12:01, Anders Roxell wrote: >>> On Wed, 3 Aug 2022 at 22:14, 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 >>> >>> Building with this patch doesn't work, it gives this output: >>> make[3]: Entering directory >>> '/home/anders/src/kernel/next/tools/testing/selftests/landlock' >>> make[3]: Leaving directory >>> '/home/anders/src/kernel/next/tools/testing/selftests/landlock' >>> make[3]: *** No rule to make target >>> '/home/anders/.cache/tuxmake/builds/78/build/kselftest/landlock/base_test', >>> needed by 'all'. Stop. >>> >>> I'm building like this: >>> tuxmake --runtime podman --target-arch x86_64 --toolchain gcc-12 >>> --kconfig defconfig kselftest >>> >>> which translates into this make command: >>> make --silent --keep-going --jobs=32 >>> O=/home/anders/.cache/tuxmake/builds/78/build >>> INSTALL_PATH=/home/anders/.cache/tuxmake/builds/78/build/kselftest_install >>> ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- kselftest-install >> >> This works well for me. > > Interesting I used this command (inspired by yours): make --silent --keep-going --jobs=32 "O=${HOME}/build" "INSTALL_PATH=${HOME}/build/kselftest_install" ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- kselftest-install Can you run this command without using tuxmake? > >> Which commit is checkout? > > I used the latest next tag, I tried to on todays tag as well > next-20220822 and I see > the same issue. > building without 'O=...' I can build the landlock tests... Can you test it with Linux v5.19 and v6.0-rc2 and see if there is a difference? Is your workspace clean? What is the version of your make? Can you replace this line from the Makefile with static names? "src_test := $(wildcard *_test.c)" > >> >> >>> >>> building without this patch works, see below: >>> >>> make[3]: Entering directory >>> '/home/anders/src/kernel/next/tools/testing/selftests/landlock' >>> x86_64-linux-gnu-gcc -Wall -O2 -isystem >>> /home/anders/.cache/tuxmake/builds/77/build/usr/include base_test.c >>> -o /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/base_test >>> -lcap >>> x86_64-linux-gnu-gcc -Wall -O2 -isystem >>> /home/anders/.cache/tuxmake/builds/77/build/usr/include fs_test.c >>> -o /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/fs_test >>> -lcap >>> x86_64-linux-gnu-gcc -Wall -O2 -isystem >>> /home/anders/.cache/tuxmake/builds/77/build/usr/include >>> ptrace_test.c -o >>> /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/ptrace_test >>> -lcap >>> x86_64-linux-gnu-gcc -Wall -O2 -isystem >>> /home/anders/.cache/tuxmake/builds/77/build/usr/include true.c -o >>> /home/anders/.cache/tuxmake/builds/77/build/kselftest/landlock/true >>> -static >>> make[3]: Leaving directory >>> '/home/anders/src/kernel/next/tools/testing/selftests/landlock' >> Does this work if you revert this patch, commit a917dd94b832 >> ("selftests/landlock: drop deprecated headers dependency") and commit >> f2745dc0ba3d ("selftests: stop using KSFT_KHDR_INSTALL")? >> >> This patch mainly revert commit a917dd94b832, so I don't see the issue. >> >> >>> >>> Cheers, >>> Anders >>> >>>> --- >>>> 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 := ../../../.. >>>> 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) >>>> -- >>>> 2.30.2 >>>>