From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BF42A0547 for ; Thu, 27 May 2021 19:38:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02D0F410EE; Thu, 27 May 2021 19:38:04 +0200 (CEST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mails.dpdk.org (Postfix) with ESMTP id 7E84740143 for ; Thu, 27 May 2021 19:38:01 +0200 (CEST) Received: by mail-wr1-f52.google.com with SMTP id j14so693691wrq.5 for ; Thu, 27 May 2021 10:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mayadata-io.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=6P/40OV9G165+Uh/Mi3SVGSsv4tos7Mj/LfYSQO7kUA=; b=KoYZ2grskhoXLf2lDgp0KOmu0srP5uB91t0+xROJL4ji4RqLp26t13dYvbP6/oYeFL 3pZUPYVrxe9YFU/iZfLnQ6n9qAXJyu6hWTFFtoFTdO41lQ3RViUK7iiHDPXZkd7G6NaO I+T+jHIEuyIPm5Pl3ibTiv1qI/AGaObKeYZjt/YsCwGUaQpOwK+gS/n65MWHu6f3Pqsu QSZeGisg6Yil1JB3BwpKPHhCNP+eD7/utyO5MWiUl9Yn3bt/hXUAwPRLMQs/PLJaRyII 8jKc9T/A3Vm15olp78wmvqJwUSjoaGtQAi+iaJQslIinB0idpR/BcSmiIfLpI3EIN4dS Rkaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6P/40OV9G165+Uh/Mi3SVGSsv4tos7Mj/LfYSQO7kUA=; b=LNsrbkxBYPcxfGSecIjZbvFdmaBm9MASxLuJxZoTV85WzL4JMtgBh33m0Zr1dkcTbn 323EjQNT9rqc+EubLREctfKS0X3tKqXZKRipV/x9eU50MpShYG3c9xoMoRbeQM2brQpU CtLOQfDNTFtD56tublAiI1FdS30LmOe/5oaMc6k4fFCVIso+/Va+gJBuOV35MY6e8Dvf KQywyxa8Pe6FZKMtVcOGb5pVEDU3xKuKaK2AbIC1IY43iC9bt+3vNQdT+ZSDLtxdp+ZC gAW/wCUMVAEDO5redYXkbGELupHWjTM6+Nw0qenACQEXvPFZLbnkaAd4DzfZtl5xIbS8 8Heg== X-Gm-Message-State: AOAM531nZd3gUtDTkUZK6oyxC6P3PyMakyGvOUsZ+X96MlcLnh5/uIed nfEaIZwYjEevoQQFaaxtPC3HBSjaM9B9mw== X-Google-Smtp-Source: ABdhPJwHi2buYhCPIB+jZxhOKlvvdGNWUhyd5q61Bu/S30WtHE2au5B+tQA1UZzUql9pr6wBe6H6bg== X-Received: by 2002:a5d:4384:: with SMTP id i4mr4677809wrq.332.1622137080679; Thu, 27 May 2021 10:38:00 -0700 (PDT) Received: from [192.168.0.57] (cpc98320-croy25-2-0-cust77.19-2.cable.virginm.net. [80.235.134.78]) by smtp.gmail.com with ESMTPSA id l8sm4423456wry.55.2021.05.27.10.37.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 May 2021 10:38:00 -0700 (PDT) From: Nick Connolly X-Google-Original-From: Nick Connolly To: Bruce Richardson , Ranjit Menon Cc: dev@dpdk.org, dmitry.kozliuk@gmail.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, pallavi.kadam@intel.com, stable@dpdk.org References: <20210401122723.23082-1-nick.connolly@mayadata.io> <20210426100733.22478-1-nick.connolly@mayadata.io> Message-ID: <77be8951-5cc8-dd20-a084-9485ccceef28@mayadata.io> Date: Thu, 27 May 2021 18:37:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210426100733.22478-1-nick.connolly@mayadata.io> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [dpdk-stable] [PATCH v3] build: fix symlink of drivers for Windows X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi Bruce, Would you have some time to take a look at this?  It's a replacement for the symlink-drivers-solibs.sh script for windows builds. Thanks, Nick On 26/04/2021 11:07, Nick Connolly wrote: > The symlink-drivers-solibs.sh script was disabled as part of 'install' > for Windows because there is no support for shell scripts. However, > this means that driver related DLLs are not present in the installed > 'libdir' directory. Add a python script to perform the install and use > it for Windows if the version of meson supports using an external > program with add_install_script (>= 0.55.0). > > On Windows, symbolic links are somewhat problematic since the > SeCreateSymbolicLinkPrivilege is required to be able to create them. > In addition, different cross-compilation environments handle symbolic > links differently, e.g. WSL, Msys2, Cygwin. Rather than trying to > distinguish these scenarios, the python script will perform a file copy > for any Windows specific names. > > On Windows, the shared library outputs have different names depending > upon which toolset has been used to build them. The script currently > handles Clang and GCC. > > On Linux the functionality is unchanged, but could be replaced with the > python script once the required minimum version of meson is >= 0.55.0. > > Fixes: 5c7d86948764 ("build: fix install on Windows") > Cc: stable@dpdk.org > > Signed-off-by: Nick Connolly > Tested-by: Narcisa Vasile > Acked-by: Narcisa Vasile > --- > v3: > * rebase > > v2: > * 0.55.0 is required to use external program with add_install_script > > buildtools/symlink-drivers-solibs.py | 49 ++++++++++++++++++++++++++++ > config/meson.build | 4 +++ > 2 files changed, 53 insertions(+) > create mode 100644 buildtools/symlink-drivers-solibs.py > > diff --git a/buildtools/symlink-drivers-solibs.py b/buildtools/symlink-drivers-solibs.py > new file mode 100644 > index 000000000..5627ddd9d > --- /dev/null > +++ b/buildtools/symlink-drivers-solibs.py > @@ -0,0 +1,49 @@ > +#!/usr/bin/env python3 > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2021 Intel Corporation > + > +import os > +import sys > +import glob > +import shutil > + > +# post-install script for meson/ninja builds to symlink the PMDs stored in > +# $libdir/dpdk/pmds-*/ to $libdir. This is needed as some PMDs depend on > +# others, e.g. PCI device PMDs depending on the PCI bus driver. > + > +# parameters to script are paths relative to install prefix: > +# 1. directory for installed regular libs e.g. lib64 > +# 2. subdirectory of libdir where the pmds are > +# 3. directory for installed regular binaries e.g. bin > + > +os.chdir(os.environ['MESON_INSTALL_DESTDIR_PREFIX']) > + > +lib_dir = sys.argv[1] > +pmd_subdir = sys.argv[2] > +bin_dir = sys.argv[3] > +pmd_dir = os.path.join(lib_dir, pmd_subdir) > + > +# copy Windows PMDs to avoid any issues with symlinks since the > +# build could be a cross-compilation under WSL, Msys or Cygnus. > +# the filenames are dependent upon the specific toolchain in use. > + > +def copy_pmd_files(pattern, to_dir): > + for file in glob.glob(os.path.join(pmd_dir, pattern)): > + to = os.path.join(to_dir, os.path.basename(file)) > + shutil.copy2(file, to) > + print(to + ' -> ' + file) > + > +copy_pmd_files('*rte_*.dll', bin_dir) > +copy_pmd_files('*rte_*.pdb', bin_dir) > +copy_pmd_files('*rte_*.lib', lib_dir) > +copy_pmd_files('*rte_*.dll.a', lib_dir) > + > +# symlink shared objects > + > +os.chdir(lib_dir) > +for file in glob.glob(os.path.join(pmd_subdir, 'librte_*.so*')): > + to = os.path.basename(file) > + if os.path.exists(to): > + os.remove(to) > + os.symlink(file, to) > + print(to + ' -> ' + file) > diff --git a/config/meson.build b/config/meson.build > index 017bb2efb..9e04c4c76 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -59,6 +59,10 @@ eal_pmd_path = join_paths(get_option('prefix'), driver_install_path) > if not is_windows > meson.add_install_script('../buildtools/symlink-drivers-solibs.sh', > get_option('libdir'), pmd_subdir_opt) > +elif meson.version().version_compare('>=0.55.0') > + # 0.55.0 is required to use external program with add_install_script > + meson.add_install_script(py3, '../buildtools/symlink-drivers-solibs.py', > + get_option('libdir'), pmd_subdir_opt, get_option('bindir')) > endif > > # init disable/enable driver lists that will be populated in different places