get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/91646/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 91646,
    "url": "http://patchwork.dpdk.org/api/patches/91646/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210416170458.50188-4-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210416170458.50188-4-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210416170458.50188-4-bruce.richardson@intel.com",
    "date": "2021-04-16T17:04:47",
    "name": "[03/14] build: simplify the driver build configuration file",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f92a44b22b69cca556b1876f716ee5fd7af45a8b",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210416170458.50188-4-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 16449,
            "url": "http://patchwork.dpdk.org/api/series/16449/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=16449",
            "date": "2021-04-16T17:04:44",
            "name": "Build file updates",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/16449/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/91646/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/91646/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CE43FA0C41;\n\tFri, 16 Apr 2021 19:05:32 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2ED32161A20;\n\tFri, 16 Apr 2021 19:05:20 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 8DBB940687\n for <dev@dpdk.org>; Fri, 16 Apr 2021 19:05:09 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Apr 2021 10:05:08 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.223.116])\n by orsmga006.jf.intel.com with ESMTP; 16 Apr 2021 10:05:07 -0700"
        ],
        "IronPort-SDR": [
            "\n SX+U8mh9Wi1rgXF0tcFY2Y+mO1VTcRJKbuHY5lJvG22X5JT0TIC2tQ56Pxzni0QPFpcsZQmCG8\n gvb69k01//qg==",
            "\n lsjB985sK/UKa8T9C6gjkxyi+mMq/IcgEPYdnjYfEbGE+SKakWuI09ZFIeLODPGcI3lvTzz0RK\n SqrqoaM+j99g=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9956\"; a=\"280388213\"",
            "E=Sophos;i=\"5.82,226,1613462400\"; d=\"scan'208\";a=\"280388213\"",
            "E=Sophos;i=\"5.82,226,1613462400\"; d=\"scan'208\";a=\"384375792\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>",
        "Date": "Fri, 16 Apr 2021 18:04:47 +0100",
        "Message-Id": "<20210416170458.50188-4-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210416170458.50188-1-bruce.richardson@intel.com>",
        "References": "<20210401115009.1063844-1-bruce.richardson@intel.com>\n <20210416170458.50188-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 03/14] build: simplify the driver build\n configuration file",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "As with the library meson.build file, we can use the \"continue\" keyword to\nreduce the level of indentation used for the majority of the build file.\nSince we are changing the whitespace indentation level, we also update the\nbody of the foreach loop to use the meson standard, 4-space indentation.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n drivers/meson.build | 384 ++++++++++++++++++++++----------------------\n 1 file changed, 189 insertions(+), 195 deletions(-)",
    "diff": "diff --git a/drivers/meson.build b/drivers/meson.build\nindex 9aa86e7ed..f90330b5a 100644\n--- a/drivers/meson.build\n+++ b/drivers/meson.build\n@@ -49,199 +49,193 @@ if cc.has_argument('-Wno-format-truncation')\n endif\n \n foreach subpath:subdirs\n-\tdrivers = []\n-\tstd_deps = []\n-\n-\t# subpath can be either \"class\" or \"class/driver\"\n-\tif subpath.contains('/')\n-\t\tdriver_path = subpath.split('/')\n-\t\tclass = driver_path[0]\n-\t\tdrivers += driver_path[1]\n-\telse\n-\t\tclass = subpath\n-\t\tsubdir(class)\n-\tendif\n-\n-\t# save class name on first occurrence\n-\tif not dpdk_driver_classes.contains(class)\n-\t\tdpdk_driver_classes += class\n-\tendif\n-\t# get already enabled drivers of the same class\n-\tenabled_drivers = get_variable(class + '_drivers', [])\n-\n-\tforeach drv:drivers\n-\t\tdrv_path = join_paths(class, drv)\n-\n-\t\t# set up empty variables used for build\n-\t\tbuild = true # set to false to disable, e.g. missing deps\n-\t\treason = '<unknown reason>' # set if build == false to explain\n-\t\tname = drv\n-\t\tsources = []\n-\t\theaders = []\n-\t\tobjs = []\n-\t\tcflags = default_cflags\n-\t\tincludes = [include_directories(drv_path)]\n-\t\t# set up internal deps. Drivers can append/override as necessary\n-\t\tdeps = std_deps\n-\t\t# ext_deps: Stores external library dependency got\n-\t\t# using dependency() (preferred) or find_library().\n-\t\t# For the find_library() case (but not with dependency()) we also\n-\t\t# need to specify the \"-l\" flags in pkgconfig_extra_libs variable\n-\t\t# too, so that it can be reflected in the pkgconfig output for\n-\t\t# static builds.\n-\t\text_deps = []\n-\t\tpkgconfig_extra_libs = []\n-\n-\t\tif not enable_drivers.contains(drv_path)\n-\t\t\tbuild = false\n-\t\t\treason = 'not in enabled drivers build config'\n-\t\telif disable_drivers.contains(drv_path)\n-\t\t\tif always_enable.contains(drv_path)\n-\t\t\t\tmessage('Driver @0@ cannot be disabled, not disabling.'.format(drv_path))\n-\t\t\telse\n-\t\t\t\tbuild = false\n-\t\t\t\treason = 'explicitly disabled via build config'\n-\t\t\tendif\n-\t\telse\n-\t\t\t# pull in driver directory which should update all the local variables\n-\t\t\tsubdir(drv_path)\n-\t\tendif\n-\n-\t\tif build\n-\t\t\t# get dependency objs from strings\n-\t\t\tshared_deps = ext_deps\n-\t\t\tstatic_deps = ext_deps\n-\t\t\tforeach d:deps\n-\t\t\t\tif not is_variable('shared_rte_' + d)\n-\t\t\t\t\tbuild = false\n-\t\t\t\t\treason = 'missing internal dependency, \"@0@\"'.format(d)\n-\t\t\t\t\tmessage('Disabling @1@ [@2@]: missing internal dependency \"@0@\"'\n-\t\t\t\t\t\t\t.format(d, name, 'drivers/' + drv_path))\n-\t\t\t\telse\n-\t\t\t\t\tshared_deps += [get_variable('shared_rte_' + d)]\n-\t\t\t\t\tstatic_deps += [get_variable('static_rte_' + d)]\n-\t\t\t\tendif\n-\t\t\tendforeach\n-\t\tendif\n-\n-\t\tif not build\n-\t\t\t# some driver directories are placeholders which\n-\t\t\t# are never built, so we allow suppression of the\n-\t\t\t# component disable printout in those cases\n-\t\t\tif reason != ''\n-\t\t\t\tdpdk_drvs_disabled += drv_path\n-\t\t\t\tset_variable(drv_path.underscorify() +\n-\t\t\t\t\t\t'_disable_reason', reason)\n-\t\t\tendif\n-\t\telse\n-\t\t\tenabled_drivers += name\n-\t\t\tlib_name = '_'.join(['rte', class, name])\n-\t\t\tdpdk_conf.set(lib_name.to_upper(), 1)\n-\n-\t\t\tdpdk_extra_ldflags += pkgconfig_extra_libs\n-\n-\t\t\tinstall_headers(headers)\n-\n-\t\t\t# generate pmdinfo sources by building a temporary\n-\t\t\t# lib and then running pmdinfogen on the contents of\n-\t\t\t# that lib. The final lib reuses the object files and\n-\t\t\t# adds in the new source file.\n-\t\t\tout_filename = lib_name + '.pmd.c'\n-\t\t\ttmp_lib = static_library('tmp_' + lib_name,\n-\t\t\t\t\tsources,\n-\t\t\t\t\tinclude_directories: includes,\n-\t\t\t\t\tdependencies: static_deps,\n-\t\t\t\t\tc_args: cflags)\n-\t\t\tobjs += tmp_lib.extract_all_objects()\n-\t\t\tsources = custom_target(out_filename,\n-\t\t\t\t\tcommand: [pmdinfo, tmp_lib.full_path(),\n-\t\t\t\t\t\t'@OUTPUT@', pmdinfogen],\n-\t\t\t\t\toutput: out_filename,\n-\t\t\t\t\tdepends: [tmp_lib])\n-\n-\t\t\t# now build the static driver\n-\t\t\tstatic_lib = static_library(lib_name,\n-\t\t\t\tsources,\n-\t\t\t\tobjects: objs,\n-\t\t\t\tinclude_directories: includes,\n-\t\t\t\tdependencies: static_deps,\n-\t\t\t\tc_args: cflags,\n-\t\t\t\tinstall: true)\n-\n-\t\t\t# now build the shared driver\n-\t\t\tversion_map = '@0@/@1@/version.map'.format(\n-\t\t\t\t\tmeson.current_source_dir(),\n-\t\t\t\t\tdrv_path)\n-\t\t\timplib = 'lib' + lib_name + '.dll.a'\n-\n-\t\t\tdef_file = custom_target(lib_name + '_def',\n-\t\t\t\tcommand: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n-\t\t\t\tinput: version_map,\n-\t\t\t\toutput: '@0@_exports.def'.format(lib_name))\n-\n-\t\t\tmingw_map = custom_target(lib_name + '_mingw',\n-\t\t\t\tcommand: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n-\t\t\t\tinput: version_map,\n-\t\t\t\toutput: '@0@_mingw.map'.format(lib_name))\n-\n-\t\t\tlk_deps = [version_map, def_file, mingw_map]\n-\t\t\tif is_windows\n-\t\t\t\tif is_ms_linker\n-\t\t\t\t\tlk_args = ['-Wl,/def:' + def_file.full_path()]\n-\t\t\t\t\tif meson.version().version_compare('<0.54.0')\n-\t\t\t\t\t\tlk_args += ['-Wl,/implib:drivers\\\\' + implib]\n-\t\t\t\t\tendif\n-\t\t\t\telse\n-\t\t\t\t\tlk_args = ['-Wl,--version-script=' + mingw_map.full_path()]\n-\t\t\t\tendif\n-\t\t\telse\n-\t\t\t\tlk_args = ['-Wl,--version-script=' + version_map]\n-\t\t\t\tif developer_mode\n-\t\t\t\t\t# on unix systems check the output of the\n-\t\t\t\t\t# check-symbols.sh script, using it as a\n-\t\t\t\t\t# dependency of the .so build\n-\t\t\t\t\tlk_deps += custom_target(lib_name + '.sym_chk',\n-\t\t\t\t\t\tcommand: [check_symbols,\n-\t\t\t\t\t\t\tversion_map, '@INPUT@'],\n-\t\t\t\t\t\tcapture: true,\n-\t\t\t\t\t\tinput: static_lib,\n-\t\t\t\t\t\toutput: lib_name + '.sym_chk')\n-\t\t\t\tendif\n-\t\t\tendif\n-\n-\t\t\tshared_lib = shared_library(lib_name,\n-\t\t\t\tsources,\n-\t\t\t\tobjects: objs,\n-\t\t\t\tinclude_directories: includes,\n-\t\t\t\tdependencies: shared_deps,\n-\t\t\t\tc_args: cflags,\n-\t\t\t\tlink_args: lk_args,\n-\t\t\t\tlink_depends: lk_deps,\n-\t\t\t\tversion: abi_version,\n-\t\t\t\tsoversion: so_version,\n-\t\t\t\tinstall: true,\n-\t\t\t\tinstall_dir: driver_install_path)\n-\n-\t\t\t# create a dependency object and add it to the global dictionary so\n-\t\t\t# testpmd or other built-in apps can find it if necessary\n-\t\t\tshared_dep = declare_dependency(link_with: shared_lib,\n-\t\t\t\t\tinclude_directories: includes,\n-\t\t\t\t\tdependencies: shared_deps)\n-\t\t\tstatic_dep = declare_dependency(\n-\t\t\t\t\tinclude_directories: includes,\n-\t\t\t\t\tdependencies: static_deps)\n-\n-\t\t\tdpdk_drivers += static_lib\n-\n-\t\t\tset_variable('shared_@0@'.format(lib_name), shared_dep)\n-\t\t\tset_variable('static_@0@'.format(lib_name), static_dep)\n-\t\t\tdependency_name = ''.join(lib_name.split('rte_'))\n-\t\t\tif developer_mode\n-\t\t\t\tmessage('drivers/@0@: Defining dependency \"@1@\"'.format(\n-\t\t\t\t\t\tdrv_path, dependency_name))\n-\t\t\tendif\n-\t\tendif # build\n-\tendforeach\n-\n-\tset_variable(class + '_drivers', enabled_drivers)\n+    drivers = []\n+    std_deps = []\n+\n+    # subpath can be either \"class\" or \"class/driver\"\n+    if subpath.contains('/')\n+        driver_path = subpath.split('/')\n+        class = driver_path[0]\n+        drivers += driver_path[1]\n+    else\n+        class = subpath\n+        subdir(class)\n+    endif\n+\n+    # save class name on first occurrence\n+    if not dpdk_driver_classes.contains(class)\n+        dpdk_driver_classes += class\n+    endif\n+    # get already enabled drivers of the same class\n+    enabled_drivers = get_variable(class + '_drivers', [])\n+\n+    foreach drv:drivers\n+        drv_path = join_paths(class, drv)\n+\n+        # set up empty variables used for build\n+        build = true # set to false to disable, e.g. missing deps\n+        reason = '<unknown reason>' # set if build == false to explain\n+        name = drv\n+        sources = []\n+        headers = []\n+        objs = []\n+        cflags = default_cflags\n+        includes = [include_directories(drv_path)]\n+        # set up internal deps. Drivers can append/override as necessary\n+        deps = std_deps\n+        # ext_deps: Stores external library dependency got\n+        # using dependency() (preferred) or find_library().\n+        # For the find_library() case (but not with dependency()) we also\n+        # need to specify the \"-l\" flags in pkgconfig_extra_libs variable\n+        # too, so that it can be reflected in the pkgconfig output for\n+        # static builds.\n+        ext_deps = []\n+        pkgconfig_extra_libs = []\n+\n+        if not enable_drivers.contains(drv_path)\n+            build = false\n+            reason = 'not in enabled drivers build config'\n+        elif disable_drivers.contains(drv_path)\n+            if always_enable.contains(drv_path)\n+                message('Driver @0@ cannot be disabled, not disabling.'.format(drv_path))\n+            else\n+                build = false\n+                reason = 'explicitly disabled via build config'\n+            endif\n+        else\n+            # pull in driver directory which should update all the local variables\n+            subdir(drv_path)\n+        endif\n+\n+        if build\n+            # get dependency objs from strings\n+            shared_deps = ext_deps\n+            static_deps = ext_deps\n+            foreach d:deps\n+                if not is_variable('shared_rte_' + d)\n+                    build = false\n+                    reason = 'missing internal dependency, \"@0@\"'.format(d)\n+                    message('Disabling @1@ [@2@]: missing internal dependency \"@0@\"'\n+                            .format(d, name, 'drivers/' + drv_path))\n+                else\n+                    shared_deps += [get_variable('shared_rte_' + d)]\n+                    static_deps += [get_variable('static_rte_' + d)]\n+                endif\n+            endforeach\n+        endif\n+\n+        if not build\n+            # some driver directories are placeholders which\n+            # are never built, so we allow suppression of the\n+            # component disable printout in those cases\n+            if reason != ''\n+                dpdk_drvs_disabled += drv_path\n+                set_variable(drv_path.underscorify() + '_disable_reason', reason)\n+            endif\n+            continue\n+        endif\n+\n+        enabled_drivers += name\n+        lib_name = '_'.join(['rte', class, name])\n+        dpdk_conf.set(lib_name.to_upper(), 1)\n+\n+        dpdk_extra_ldflags += pkgconfig_extra_libs\n+\n+        install_headers(headers)\n+\n+        # generate pmdinfo sources by building a temporary\n+        # lib and then running pmdinfogen on the contents of\n+        # that lib. The final lib reuses the object files and\n+        # adds in the new source file.\n+        out_filename = lib_name + '.pmd.c'\n+        tmp_lib = static_library('tmp_' + lib_name, sources,\n+                include_directories: includes,\n+                dependencies: static_deps,\n+                c_args: cflags)\n+        objs += tmp_lib.extract_all_objects()\n+        sources = custom_target(out_filename,\n+                command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],\n+                output: out_filename,\n+                depends: [tmp_lib])\n+\n+        # now build the static driver\n+        static_lib = static_library(lib_name,\n+                sources,\n+                objects: objs,\n+                include_directories: includes,\n+                dependencies: static_deps,\n+                c_args: cflags,\n+                install: true)\n+\n+        # now build the shared driver\n+        version_map = '@0@/@1@/version.map'.format(meson.current_source_dir(), drv_path)\n+        implib = 'lib' + lib_name + '.dll.a'\n+\n+        def_file = custom_target(lib_name + '_def',\n+                command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n+                input: version_map,\n+                output: '@0@_exports.def'.format(lib_name))\n+\n+        mingw_map = custom_target(lib_name + '_mingw',\n+                command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n+                input: version_map,\n+                output: '@0@_mingw.map'.format(lib_name))\n+\n+        lk_deps = [version_map, def_file, mingw_map]\n+        if is_windows\n+            if is_ms_linker\n+                lk_args = ['-Wl,/def:' + def_file.full_path()]\n+                if meson.version().version_compare('<0.54.0')\n+                    lk_args += ['-Wl,/implib:drivers\\\\' + implib]\n+                endif\n+            else\n+                lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]\n+            endif\n+        else\n+            lk_args = ['-Wl,--version-script=' + version_map]\n+            if developer_mode\n+                # on unix systems check the output of the\n+                # check-symbols.sh script, using it as a\n+                # dependency of the .so build\n+                lk_deps += custom_target(lib_name + '.sym_chk',\n+                        command: [check_symbols, version_map, '@INPUT@'],\n+                        capture: true,\n+                        input: static_lib,\n+                        output: lib_name + '.sym_chk')\n+            endif\n+        endif\n+\n+        shared_lib = shared_library(lib_name, sources,\n+                objects: objs,\n+                include_directories: includes,\n+                dependencies: shared_deps,\n+                c_args: cflags,\n+                link_args: lk_args,\n+                link_depends: lk_deps,\n+                version: abi_version,\n+                soversion: so_version,\n+                install: true,\n+                install_dir: driver_install_path)\n+\n+        # create a dependency object and add it to the global dictionary so\n+        # testpmd or other built-in apps can find it if necessary\n+        shared_dep = declare_dependency(link_with: shared_lib,\n+                include_directories: includes,\n+                dependencies: shared_deps)\n+        static_dep = declare_dependency(\n+                include_directories: includes,\n+                dependencies: static_deps)\n+\n+        dpdk_drivers += static_lib\n+\n+        set_variable('shared_@0@'.format(lib_name), shared_dep)\n+        set_variable('static_@0@'.format(lib_name), static_dep)\n+        dependency_name = ''.join(lib_name.split('rte_'))\n+        if developer_mode\n+            message('drivers/@0@: Defining dependency \"@1@\"'.format(\n+                    drv_path, dependency_name))\n+        endif\n+    endforeach\n+\n+    set_variable(class + '_drivers', enabled_drivers)\n endforeach\n",
    "prefixes": [
        "03/14"
    ]
}