Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2523038rdb; Fri, 22 Sep 2023 00:37:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoJwZd5m5QwqwL2Saxhr1ZuCv9Q835a/YGHWY7oar3+muINF19astymaquj7Xz4AfTXQTl X-Received: by 2002:a17:90a:b384:b0:26b:c5b:bb44 with SMTP id e4-20020a17090ab38400b0026b0c5bbb44mr7213772pjr.13.1695368237516; Fri, 22 Sep 2023 00:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695368237; cv=none; d=google.com; s=arc-20160816; b=YzMpYe+agWlzDmj45J6jZ72vsDnahtD6BdQbmdmCxnYEnDTCMUyHU/fYBKJaNcCa/n +//NbWmGrA1+P5tQAqsWO4BbTWp88isgCekKli2e4umKwcCyzQrNn6qq/V0wAXTKbA8j znC4fnaZmSHkqh7drEyIpWPPHHpbF0vyxNJ+yY9K7MBIRZK8QxWM2ky/0hDxIg8Pcaqw dEwHYoyFd5S8/kZFMhyQSc7KxWIHnuII8OdWAsbn1guM5NSgDkPt4MTQDkw8S59stkdA VlN+oVJ8rR81ptITJ+yYJd4cEHgLe8svtyg8WcpmYA3xv2/haI9Ae2See+T6M2I0uE6I Qx0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Gu5tw2rTk4pevZuwsVBrAbnMQ68Mm44eby2RP49Zt9g=; fh=KizWA68bHECFpeYN0ocQ6xrGwsiWh/K05PtnAPM+dy0=; b=MMvhm/qMRVuOMqtIgrT3QSG5kESEgDspeQgnHqYX3KjLRe16kQ9UvSCs8Qrx+G8H83 gLLUM328yKAC19XPJ4RSHK/d33IYfTvocBEQM3iOLDgMunkIhnNXBYJ4/UXif+kg3U6h Pbs9Xk13evJ7xEiHnQKoWBVPRDOjXZ9xgEw0mRj5S9zRupGNfPDjRlI+eUzPX6ZccMKF sC2an6HgKCEjwylAITvFVHCcL4npFfoIVAtpIZol/jzzrZ1f9CF27CoYEQchd7+p0GdB VdZbPREPaLmdiZXKt1e7rorlH9sQ8tmfq18V5Yz9ir3pCycdAGuh+r4klgga9knrh4+2 SrZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+ztdVAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id lk4-20020a17090b33c400b0026b09e2e3eesi3587260pjb.47.2023.09.22.00.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 00:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+ztdVAP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 478498410273; Fri, 22 Sep 2023 00:28:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231262AbjIVH2c (ORCPT + 99 others); Fri, 22 Sep 2023 03:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbjIVH2b (ORCPT ); Fri, 22 Sep 2023 03:28:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73C1FF7; Fri, 22 Sep 2023 00:28:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D548C433C8; Fri, 22 Sep 2023 07:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695367705; bh=wgQZWXAwvdKZPHFA5FAhGqf9aLotY806Yvs6HB1H2gw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=m+ztdVAPrL7mMa6wX1EVnVgqn6QEODSE3XB2mUoauK32b9YeZBmDfaHCQTmgT7PM1 Be5C1gftDkFcy+pH35VA+VeDcXx6MQoVLbm4MmO1Wh95Pm4GEcTOwKoLZkyebv+Yyh zeLWA+Mv45IA3K/vkykJg1AfGL2VtHi35MAGrYSYvtV5owsg/mnPOFJ+YBLs6sdxKo pkk/xleZ+5Hs2KW4nCdHKkSr8kgXlXIyoX3EYTYLBt+M6c6WHgUwmVjvL+wZjMjWAG bTa9a4fsAQOzNs66+guBHD2ZTlc8KCuqlgh3JUfF8j47b8FAIh48OEYjyVft+tn7XJ KcSQwH9gV8Y+w== Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-57354433a7dso922940eaf.1; Fri, 22 Sep 2023 00:28:25 -0700 (PDT) X-Gm-Message-State: AOJu0YxMhsKrhpWILq4YNMN0EEnLlApQv/v3HLL5YFecPTEQmmDrZ9ey G+kEtP1jf0mgpUCsKwq0A48eEl6jrmBTW6vy5DY= X-Received: by 2002:a05:6870:248a:b0:1d5:a377:f360 with SMTP id s10-20020a056870248a00b001d5a377f360mr7476864oaq.41.1695367704525; Fri, 22 Sep 2023 00:28:24 -0700 (PDT) MIME-Version: 1.0 References: <20230920015559.1877441-1-aik@amd.com> In-Reply-To: From: Masahiro Yamada Date: Fri, 22 Sep 2023 16:27:48 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH kernel] kbuild: get rid of unwanted "+" when CONFIG_LOCALVERSION is set To: Alexey Kardashevskiy Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Schier , Nick Desaulniers , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 22 Sep 2023 00:28:36 -0700 (PDT) On Wed, Sep 20, 2023 at 10:30=E2=80=AFPM Alexey Kardashevskiy = wrote: > > > On 20/9/23 21:59, Masahiro Yamada wrote: > > On Wed, Sep 20, 2023 at 10:56=E2=80=AFAM Alexey Kardashevskiy wrote: > >> > >> The scripts/setlocalversion script correctly tries not adding "+" when > >> CONFIG_LOCALVERSION is defined. > > > > I am afraid you are misunderstanding the script. > > Possibly :) I should have read of "+set"... sorry :-/ Thanks for > spending time looking at this. > > > CONFIG_LOCALVERSION and the "+" sign is unrelated. > > How come? > > scripts/setlocalversion -> if [ "${LOCALVERSION+set}" !=3D "set" ] -> > scm_version --short -> echo "+". > > Where is that LOCALVERSION supposed to come from, and when? Is not > LOCALVERSION related to CONFIG_LOCALVERSION? 1) LOCALVERSION is an environment variable. $ LOCALVERSION=3D-foo make or $ make LOCALVERSION=3D-foo 2) CONFIG_LOCALVERSION is a CONFIG option $ make menuconfig and set the value. 1) and 2) are orthogonal. If you set both, you can get both of them. > >> However, instead of grepping for it > >> (as it is done for CONFIG_LOCALVERSION_AUTO=3Dy), it relies on LOCALVE= RSION > >> set in the shell which is not. > >> > >> Export LOCALVERSION so scripts/setlocalversion could see it and not ad= d > >> unwanted "+" at the end of the kernelrelease. > >> > >> Signed-off-by: Alexey Kardashevskiy > > > > > > So, scripts/setlocalversion will always see > > defined LOCALVERSION. > > > > With your patch, LOCALVERSION would be set to an empty value, > > which would make the following condition always false. > > > > elif [ "${LOCALVERSION+set}" !=3D "set" ]; then > > > > > > Your patch is equivalent to deleting > > line 175-183 of scripts/setlocalversion. > > > > Of course, that is wrong and unacceptable. > > Ok. What is the right way of getting rid of the "+"? Thanks, -- Best Regards Masahiro Yamada