get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 90361,
    "url": "http://patches.dpdk.org/api/patches/90361/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210401115009.1063844-5-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<20210401115009.1063844-5-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210401115009.1063844-5-bruce.richardson@intel.com",
    "date": "2021-04-01T11:49:59",
    "name": "[RFC,04/14] build: simplify the driver build configuration file",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d58f83b224c073bef165f1a526179c9e3db66a74",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210401115009.1063844-5-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 16057,
            "url": "http://patches.dpdk.org/api/series/16057/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16057",
            "date": "2021-04-01T11:49:55",
            "name": "Build file update proposals",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/16057/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/90361/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/90361/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 E193DA0548;\n\tThu,  1 Apr 2021 13:50:51 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BB5DE1410C7;\n\tThu,  1 Apr 2021 13:50:31 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id 38F6F1410DB\n for <dev@dpdk.org>; Thu,  1 Apr 2021 13:50:29 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Apr 2021 04:50:27 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.223.116])\n by FMSMGA003.fm.intel.com with ESMTP; 01 Apr 2021 04:50:26 -0700"
        ],
        "IronPort-SDR": [
            "\n kQXPJLXJNx23ZATvyU8udwZlNmt4fZ6k8Gx9JllUCbGzPWqlN4hBS+rDtaAtXZ0vrtvTnbAzdy\n khIO7JJQMCxg==",
            "\n sqLM53ypArf4MD97hbRjmjpPHBJkTzbIUTqHwkc6LHB6PWQUkwegSjzuWwB5oaY0bfaCZ5elyk\n pPI50qLxPt0A=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9940\"; a=\"179760780\"",
            "E=Sophos;i=\"5.81,296,1610438400\"; d=\"scan'208\";a=\"179760780\"",
            "E=Sophos;i=\"5.81,296,1610438400\"; d=\"scan'208\";a=\"446062624\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, david.marchand@redhat.com, bluca@debian.org,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Date": "Thu,  1 Apr 2021 12:49:59 +0100",
        "Message-Id": "<20210401115009.1063844-5-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210401115009.1063844-1-bruce.richardson@intel.com>",
        "References": "<20210401115009.1063844-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [RFC PATCH 04/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 | 361 ++++++++++++++++++++++----------------------\n 1 file changed, 177 insertions(+), 184 deletions(-)",
    "diff": "diff --git a/drivers/meson.build b/drivers/meson.build\nindex 9c8eded697..57b15bda03 100644\n--- a/drivers/meson.build\n+++ b/drivers/meson.build\n@@ -31,188 +31,181 @@ 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 disabled_drivers.contains(drv_path)\n-\t\t\tbuild = false\n-\t\t\treason = 'explicitly disabled via build config'\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\t# on unix systems check the output of the\n-\t\t\t\t# check-symbols.sh script, using it as a\n-\t\t\t\t# dependency of the .so build\n-\t\t\t\tlk_deps += custom_target(lib_name + '.sym_chk',\n-\t\t\t\t\tcommand: [check_symbols,\n-\t\t\t\t\t\tversion_map, '@INPUT@'],\n-\t\t\t\t\tcapture: true,\n-\t\t\t\t\tinput: static_lib,\n-\t\t\t\t\toutput: lib_name + '.sym_chk')\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\tmessage('drivers/@0@: Defining dependency \"@1@\"'.format(\n-\t\t\t\t\tdrv_path, dependency_name))\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 disabled_drivers.contains(drv_path)\n+            build = false\n+            reason = 'explicitly disabled via build config'\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+            # 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+\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+        message('drivers/@0@: Defining dependency \"@1@\"'.format(drv_path, dependency_name))\n+    endforeach\n+\n+    set_variable(class + '_drivers', enabled_drivers)\n endforeach\n",
    "prefixes": [
        "RFC",
        "04/14"
    ]
}