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 D0215A0C4C for ; Mon, 12 Jul 2021 15:16:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6CC440685; Mon, 12 Jul 2021 15:16:01 +0200 (CEST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id 6FB8040685 for ; Mon, 12 Jul 2021 15:16:00 +0200 (CEST) Received: by mail-wr1-f47.google.com with SMTP id l7so24648238wrv.7 for ; Mon, 12 Jul 2021 06:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HGQd/XK7eRT7xEAKktLB3nmz9OsqieT04lnsP6zoRlM=; b=PbcyAaEbM5QHxVBvKZ8jguh4Q+l3T/e4pnm9l4uQUKYvT+ljBQpHkNdf0s5Ktmx4o8 9QhXSjbtkYdUAbTEVyY5mLm1pzRbB0GqqsjwWudODrYDcoKW1bt8qkLE0gngGhxw1Xez or+3RO59hXMhG+LbbDT0/TRzctz7EqMBYMrnnTwnQ2Hc+MpNKhW1xMKol0KN8LloYeCx XJmjGiE8gErlp8C+Wh7ae/WRh4Ams4+PR4Zj1RLJ8w2GexNOOEUhXtdM11xO02kJQI97 qH8dCfGN4ulYkAYPsoZaYIglQvC3nijL6ghC5XW8kyezaSPmnhGhwAcG/1y3ckTRA9IJ dWHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HGQd/XK7eRT7xEAKktLB3nmz9OsqieT04lnsP6zoRlM=; b=uPuchSAVv7wktY6KyvkOTFVkvCslumpkH5n2WUUCy2XIZm0nYD+Q3kyWSojwfG8CPp dy75KS33zC1A26t625PiOHykod8s0vkD5iO5tOn0CoT8Bzx4P5/b5Gy8DT4c+eL5PCZ4 Z8+BUE1WY2FqmeYBydXshSgQYFhc7AbM4TrM3+PLmFzSOL1REIrHdNeD/XL2dXl1TF2u XPSsfibqexT66l07w1dO6jRjxNEhD80Z6pA3OK1kksTaHteHim8BM6DmykB29V+DDyiJ cWnBNdIoP2CuFTR9jKcszc49pXx43imEwejpXyiPLtbZOy8kQuoxngIfEni2zj1te0cR F38g== X-Gm-Message-State: AOAM531XenVc+2SR91eZHeMUq/gWXCSKx95/zs2zcU3CK2s3r15xJ46G g7ZxhMavSi2PnEYp00OjfTM= X-Google-Smtp-Source: ABdhPJzUhgLrT+Im7+vbyY5A/fcEu4mte4h3rExSlf5oDBxWY1O5e9eW6l1lHelrv6sxRmFZZnuHWA== X-Received: by 2002:a5d:4983:: with SMTP id r3mr5011356wrq.383.1626095760205; Mon, 12 Jul 2021 06:16:00 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id x9sm9367641wrm.82.2021.07.12.06.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:15:59 -0700 (PDT) From: luca.boccassi@gmail.com To: Nick Connolly Cc: Narcisa Vasile , Bruce Richardson , dpdk stable Date: Mon, 12 Jul 2021 14:05:46 +0100 Message-Id: <20210712130551.2462159-111-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'build: support drivers symlink on Windows' has been queued to stable release 20.11.3 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, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/c5b7b05e91596475171c745b58e850c026b1d074 Thanks. Luca Boccassi --- >From c5b7b05e91596475171c745b58e850c026b1d074 Mon Sep 17 00:00:00 2001 From: Nick Connolly Date: Mon, 26 Apr 2021 11:07:32 +0100 Subject: [PATCH] build: support drivers symlink on Windows [ upstream commit cd27047dbee1eda0e8ed12300bc035636d89607b ] 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. Signed-off-by: Nick Connolly Tested-by: Narcisa Vasile Acked-by: Narcisa Vasile Reviewed-by: Bruce Richardson --- MAINTAINERS | 1 + buildtools/symlink-drivers-solibs.py | 49 ++++++++++++++++++++++++++++ config/meson.build | 4 +++ 3 files changed, 54 insertions(+) create mode 100644 buildtools/symlink-drivers-solibs.py diff --git a/MAINTAINERS b/MAINTAINERS index f45c8c1b13..dcde2ab5e1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -103,6 +103,7 @@ F: buildtools/gen-pmdinfo-cfile.sh F: buildtools/list-dir-globs.py F: buildtools/pkg-config/ F: buildtools/symlink-drivers-solibs.sh +F: buildtools/symlink-drivers-solibs.py F: devtools/test-meson-builds.sh Public CI diff --git a/buildtools/symlink-drivers-solibs.py b/buildtools/symlink-drivers-solibs.py new file mode 100644 index 0000000000..9c999508a9 --- /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 5b7439aefb..b2734fc0cf 100644 --- a/config/meson.build +++ b/config/meson.build @@ -61,6 +61,10 @@ 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 # set the machine type and cflags for it -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:42.366018406 +0100 +++ 0111-build-support-drivers-symlink-on-Windows.patch 2021-07-12 13:41:36.922131610 +0100 @@ -1 +1 @@ -From cd27047dbee1eda0e8ed12300bc035636d89607b Mon Sep 17 00:00:00 2001 +From c5b7b05e91596475171c745b58e850c026b1d074 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit cd27047dbee1eda0e8ed12300bc035636d89607b ] + @@ -27,2 +28,0 @@ -Cc: stable@dpdk.org - @@ -41 +41 @@ -index d5a6cee20b..a7eadba130 100644 +index f45c8c1b13..dcde2ab5e1 100644 @@ -44 +44 @@ -@@ -105,6 +105,7 @@ F: buildtools/call-sphinx-build.py +@@ -103,6 +103,7 @@ F: buildtools/gen-pmdinfo-cfile.sh @@ -50 +49,0 @@ - F: devtools/check-meson.py @@ -51,0 +51 @@ + Public CI @@ -108 +108 @@ -index 9f56fab1fe..e80421003b 100644 +index 5b7439aefb..b2734fc0cf 100644 @@ -111,4 +111,4 @@ -@@ -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) +@@ -61,6 +61,10 @@ if not is_windows + meson.add_install_script('../buildtools/symlink-drivers-solibs.sh', + get_option('libdir'), + pmd_subdir_opt) @@ -116,3 +116,3 @@ -+ # 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')) ++ # 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')) @@ -121 +121 @@ - # init disable/enable driver lists that will be populated in different places + # set the machine type and cflags for it