From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58A92A0527; Mon, 9 Nov 2020 18:20:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 95C106004; Mon, 9 Nov 2020 18:20:44 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 66A155AB8 for ; Mon, 9 Nov 2020 18:20:42 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D80385C04CD; Mon, 9 Nov 2020 12:20:40 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 09 Nov 2020 12:20:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= goDLxHRIgBxSE04e5k7r2kGeL4JHBqBYQ7/oNpMmAzo=; b=YZI7H+3Rl/r7Vckx U1Hvg72uY1nKlFLDbBRKCIHAVcUcffQb044o7nJOw0QXR5bP2D5slZV3pfhHJN9i ELUBfm0V6YBbirSmO8CaLzyOJg1B/N+/mgXq5iZimkYcohr3Clg4wMKCkFJFLMfQ 6uIAgNUnra9zndVIFUwWySvwdDu6hvlviOepm5gntyuLEZBjocjZJE5Alu+bNZnO duUNjPgoNWp0sNlXLFMKOJ8Exp62yIKYwqoPeKtZe61sMmV0ayWMagrrEMlXUb73 1/fc2qraoBKG5bq89zXPTypke04X09dAqXG6l7G+OMhUfzrF7tFgG2j4R4DNa3LW 6JuHzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=goDLxHRIgBxSE04e5k7r2kGeL4JHBqBYQ7/oNpMmA zo=; b=KZzVqcopebYDowoiNPy8C4iF8IflIA4XQ9JC/WU+6XCjLXHM62IP9QG5Q UAux6pE3OmFfwNZ8i26Mb8D8YVkSvVUXw7dvj9J52iltYOt0M9TieiMUIp6h5Z79 qMsuqLgB7VvJVXTW3chEcWRUq+UhRzFmUa1oBX+9cFfJG/nVeg1kcoCAg1ACOoJJ TwWYVc3HcpI4uTC9TzMwg77GDKuL1A09ZQF5yz65ooVJaGAnNTbve59YtGHZb+TL ex0ko5WeiZ3Mc1wfMfdwtJmM0XbeJd/WYcX3BzIwR7MaFQdsCkDSrMxVgMNTbiVv uPux8uJj+kVTGQx2qe+uellr5BaTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduhedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id F02BF328005E; Mon, 9 Nov 2020 12:20:39 -0500 (EST) From: Thomas Monjalon To: Ferruh Yigit Cc: Bruce Richardson , dev@dpdk.org, david.marchand@redhat.com Date: Mon, 09 Nov 2020 18:20:38 +0100 Message-ID: <3526179.Ta2yc0qjKd@thomas> In-Reply-To: <07886870-844e-ef22-912a-b945746e0c30@intel.com> References: <20201109130035.3948462-1-ferruh.yigit@intel.com> <6314906.8mj7T2phLV@thomas> <07886870-844e-ef22-912a-b945746e0c30@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] devtools: fix 32-bits build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 09/11/2020 18:15, Ferruh Yigit: > On 11/9/2020 5:01 PM, Thomas Monjalon wrote: > > 09/11/2020 17:48, Ferruh Yigit: > >> On 11/9/2020 4:19 PM, Bruce Richardson wrote: > >>> On Mon, Nov 09, 2020 at 05:14:24PM +0100, Thomas Monjalon wrote: > >>>> 09/11/2020 16:44, Bruce Richardson: > >>>>> On Mon, Nov 09, 2020 at 04:28:16PM +0100, Thomas Monjalon wrote: > >>>>>> 09/11/2020 15:55, Ferruh Yigit: > >>>>>>> If the 'PKG_CONFIG_PATH' is set in the environment before script run, > >>>>>>> 32 bit still uses that value for 64-bits libraries. > >>>>>>> > >>>>>>> From the build log: > >>>>>>> > >>>>>>> " > >>>>>>> Using DPDK_TARGET i386-pc-linux-gnu > >>>>>>> meson -Dexamples=l3fwd --buildtype=debugoptimized --werror > >>>>>>> -Dc_args=-m32 -Dc_link_args=-m32 > >>>>>>> /tmp/dpdk_maintain/self/dpdk/devtools/.. ./build-32b > >>>>>>> ... > >>>>>>> Using 'PKG_CONFIG_PATH' from environment with value: > >>>>>>> '/usr/local/lib64/pkgconfig/ > >>>>>>> " > >>>>>>> > >>>>>>> This causes build error when linking with the found libraries. > >>>>>>> > >>>>>>> Reproduced with 'librte_bpf' which only has 64 bit installed but still > >>>>>>> enables building 'af_xdp' and link fails. > >>>>>>> > >>>>>>> To fix this, using default 'PKG_CONFIG_PATH' variable unless > >>>>>>> 'CUSTOM_PKG_CONFIG_PATH' set, and set the 'CUSTOM_PKG_CONFIG_PATH' for > >>>>>>> 32 bit build. > >>>>>>> > >>>>>>> Fixes: 9b83106d8784 ("devtools: test 32-bit build") > >>>>>>> > >>>>>>> Signed-off-by: Ferruh Yigit > >>>>>>> --- > >>>>>>> Cc: Bruce Richardson > >>>>>>> Cc: Thomas Monjalon > >>>>>>> > >>>>>>> v2: > >>>>>>> * Enable overwriting default 'PKG_CONFIG_PATH' value > >>>>>> > >>>>>> It was not my conclusion. > >>>>>> I think we can just reset all env vars. > >>>>>> > >>>>> > >>>>> Perhaps, but I think that may cause more problems for people who want > >>>>> custom CFLAGS and LDFLAGS for building with extra 3rd-party packages. > >>>>> While this can be done using the config script that is sourced in, I > >>>>> suspect most of us do not use such a script. > >>>>> > >>>>> Therefore I'd suggest rather than clearing the env vars globally, we just > >>>>> override them temporarily for the 32-bit, using CFLAGS32, LDFLAGS32, > >>>>> PKG_CONFIG_PATH32 instead. That allows someone to have a 32-bit and 64-bit > >>>>> version of e.g. libbpf installed, with a PKG_CONFIG_PATH pointing to each. > >>>> > >>>> So you want to duplicate all vars just to avoid writing them cleanly in a file? > >>>> And what happens for other targets? > >>>> > >>>> I'm tending to nack this approach. > >>>> There is no problem in using a clean config file. > >>>> > >>> Well, when you put it that way :-) > >>> However, I was only thinking of the 3 variables above, though really it's > >>> only the PKG_CONFIG_PATH that is going to be the most likely culprit, so > >>> supporting just one extra var "PKG_CONFIG_PATH_32" seems reasonable. > >>> > >>> I'm also ok with your solution of just clearing the environment and relying > >>> on a config file too, though. > >>> > >> > >> I was worried for any side affects to reset the var, this is smaller change to > >> change only 'CUSTOM_PKG_CONFIG_PATH' for 'build-32b' > >> > >> I can send a new version to reset 'CUSTOM_PKG_CONFIG_PATH', > >> what is the intention/plan with the config file? > > > > You should use a config file to set PKG_CONFIG_PATH, PATH, > > DPDK_MESON_OPTIONS, etc accordingly to build with all > > your non-installed dependencies. > > CUSTOM_PKG_CONFIG_PATH is a way to avoid using the config file > > in a single case. > > > > Either use 'PKG_CONFIG_PATH' environment variable or a config file, both has the > same problem that we need two different pkg config path, one for 64bit and one > for 32bit. No. In the config file, you can set the right value by testing $DPDK_TARGET. Note: the config file is a shell script. > v2 of this patch provides a way to use correct one when needed. This is not a global fix. > Moving the default values from system environment or script hardcoded values to > a config file is something else and can be done later, what do you think? The root cause of your issue is using variables from the environment. The global fix is then to reset them all, while keeping a default value for PATH which is not only for compilation config. > > Don't be afraid breaking the assumption of theoritical users > > of this script. If we want to avoid PATH reset, > > we can add such line at the beginning of the script: > > default_path=${PATH:-/bin:/usr/bin}