Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp349411ybv; Wed, 19 Feb 2020 00:43:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzBxMOB3P2df6ieSUJFUIPRjfkeZV+DIe/tOGFHbkxyN8r5sxoIVBNXNWRNp2LHhvUqvojv X-Received: by 2002:a05:6830:4b9:: with SMTP id l25mr19391358otd.266.1582101790554; Wed, 19 Feb 2020 00:43:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582101790; cv=none; d=google.com; s=arc-20160816; b=ChApU5387icgBK+NRIu5QMTpGxjYVd5XJgArkiBZW+F1TeNzdO5dbPlnNL+BW6ZbrJ XuVi9qqvJ7tzOO6d6wjJ5xU5EoUq0Ep6zODGubLt5phCTzrGImbY83Zogx0S7SYv7rml IW4sa5Eil2edmBObTMkFdT6iddOpYfa4mLKtXIRC5wHkX1P851i7vm1SzWpq8QRcDcFL lmWkZAv0zQhAhSST9ATOOWzfK119rNT418F8iyjFpPZhMu6tE8oKUFZRKtwj7oWBPRIT eZZJpuDgs71D03ES8xIXqig+hiBfJeZ4fUHwLoCXBUhSl7exzJeJX36fLcWJq9Tcg0hA ZQew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=gcGrTtSZqo75NtjJJ7mVC6SXcJFXr8kJ31jQXw/H/KQ=; b=VmeyJ8xQX16mQM/ySqO0gAILJogArSwLEw0kGG/ihRl3TRoOV9LS7fn5iKV4Ic/b3/ +3vOjsVJ/eddbO3DGZhrnZMMrpZsRSo9g8uE1uJivUFzZyMoFATFrxhEAAkOJbStMf+O fsSZOcjhyQscoykSU4G/mnSVfAzTPXIMdOaVw1JqOHSNx4V+/o6HGw9ITLqrchKKuwIX QwCEf74zeBCgz5YqsyVBWkhnh7lu2rThqvf548llzfK6BFLo8vCQ7cuI4qFp7xYRKzeX uWi7snoBPxoxK/OuAADthzs0zwnSSQmKUMAf0AaXzfz5ufBW+Ls1iripdssaP6KCFKrZ g+3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t130si9522791oib.202.2020.02.19.00.42.58; Wed, 19 Feb 2020 00:43:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727592AbgBSIm3 (ORCPT + 99 others); Wed, 19 Feb 2020 03:42:29 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:38480 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727513AbgBSImY (ORCPT ); Wed, 19 Feb 2020 03:42:24 -0500 Received: by mail-oi1-f194.google.com with SMTP id r137so3474135oie.5; Wed, 19 Feb 2020 00:42:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gcGrTtSZqo75NtjJJ7mVC6SXcJFXr8kJ31jQXw/H/KQ=; b=NyWvCZmb/ZhQuWuhTB6KcDNc6/NifMcxvCzFi0KeeNpo0KBdzXEhQNeRpwWFBTW+SC rr/KEcuzwVkx+DZroLcnUPZlftpDYzmEwoyLK7Ci8+auP4LXhAYfJdivbjnL54fj+ylx MYbzSc9FhXx+Ud98tw3fVOEoOs/0otB0ClAD4e72BBj8GT12tW1OQfaaLmV3wXsYMKOX l0PGGeKwEYZX+jTqbZI1X58F6KWkGHOH8fYbUn5dXUXK/BcNIni9sn+wHVC6wXXfDQ9A 3ESbxREPl1rg2EZoYspUTbzaixSlXtTVrG8xzptprJxz67x92Fmc8chfJwvvpLFlCch7 XlrQ== X-Gm-Message-State: APjAAAW6V1G0Jt5ZOJT8M5ZhB+SAfegdtKIjFlzxZg6TB18GYS9szwYW O6t3gkH94OzOBRCIzt1oahXAURv6gHNI8JWkJ0knDkV4 X-Received: by 2002:aca:1a06:: with SMTP id a6mr3748069oia.148.1582101742559; Wed, 19 Feb 2020 00:42:22 -0800 (PST) MIME-Version: 1.0 References: <20200219074950.23344-1-masahiroy@kernel.org> In-Reply-To: <20200219074950.23344-1-masahiroy@kernel.org> From: Geert Uytterhoeven Date: Wed, 19 Feb 2020 09:42:10 +0100 Message-ID: Subject: Re: [PATCH] kconfig: make 'imply' obey the direct dependency To: Masahiro Yamada Cc: linux-kbuild , Arnd Bergmann , Nicolas Pitre , Richard Cochran , Thomas Gleixner , John Stultz , Josh Triplett , Mark Brown , Ulf Magnusson , Jonathan Corbet , Michal Marek , "open list:DOCUMENTATION" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yamada-san, On Wed, Feb 19, 2020 at 8:51 AM Masahiro Yamada wrote: > The 'imply' statement may create unmet direct dependency when the > implied symbol depends on m. > > [Test Code] > > config FOO > tristate "foo" > imply BAZ > > config BAZ > tristate "baz" > depends on BAR > > config BAR > def_tristate m > > config MODULES > def_bool y > option modules > > If you set FOO=y, BAZ is also promoted to y, which results in the > following .config file: > > CONFIG_FOO=y > CONFIG_BAZ=y > CONFIG_BAR=m > CONFIG_MODULES=y > > This ignores the dependency "BAZ depends on BAR". > > Unlike 'select', what is worse, Kconfig never shows the > "WARNING: unmet direct dependencies detected for ..." for this case. > > Because 'imply' should be weaker than 'depends on', Kconfig should > take the direct dependency into account. > > Describe this case in Documentation/kbuild/kconfig-language.rst for > clarification. > > Commit 237e3ad0f195 ("Kconfig: Introduce the "imply" keyword") says that > a symbol implied by y is restricted to y or n, excluding m. > > As for the combination of FOO=y and BAR=m, the case of BAZ=m is excluded > by the 'imply', and BAZ=y is also excluded by 'depends on'. So, only the > possible value is BAZ=n. > > Having said that, this case was probably "We don't care" at that time > because Kconfig did not handle 'depends on m' correctly until > commit f622f8279581 ("kconfig: warn unmet direct dependency of tristate > symbols selected by y") fixed it. > > Backporting this to 4.19+ will probably be fine. If you care this > problem on 4.14.x, you need to backport f622f8279581 as well. > > Signed-off-by: Masahiro Yamada Thanks a lot! This fixes the build issues in https://lore.kernel.org/alsa-devel/CAMuHMdW8SvDgQJyenTtEm4Xn2Ma6PK9pfwKR2_gn60t2AqNWXg@mail.gmail.com/ Tested-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds