get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91644,
    "url": "https://patches.dpdk.org/api/patches/91644/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210416170458.50188-2-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20210416170458.50188-2-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210416170458.50188-2-bruce.richardson@intel.com",
    "date": "2021-04-16T17:04:45",
    "name": "[01/14] build: simplify library build file",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "44d567e4fdf82ce3b45ca15a583805accf497ec8",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210416170458.50188-2-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 16449,
            "url": "https://patches.dpdk.org/api/series/16449/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16449",
            "date": "2021-04-16T17:04:44",
            "name": "Build file updates",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/16449/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91644/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/91644/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 19063A0C41;\n\tFri, 16 Apr 2021 19:05:17 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BE7401619F4;\n\tFri, 16 Apr 2021 19:05:10 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id 9A9DC40687\n for <dev@dpdk.org>; Fri, 16 Apr 2021 19:05:08 +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:06 -0700",
            "from silpixa00399126.ir.intel.com ([10.237.223.116])\n by orsmga006.jf.intel.com with ESMTP; 16 Apr 2021 10:05:05 -0700"
        ],
        "IronPort-SDR": [
            "\n YwmT8yjGyJo2A1a1AZ8p/4wBROb9KSBdThHFxGc+CAquIPk9p3OWpZslCwGFnJC9DdgYa1rLNx\n e3TkRcTYyCJA==",
            "\n bTnemhaMoe4qnKI4ieXWqq1rIWxBB6kxBdcc0XD57IckmhwysEDfcOWbJ7LDcDXmz+sZyP8FUG\n wF9gborKm3LA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9956\"; a=\"280388206\"",
            "E=Sophos;i=\"5.82,226,1613462400\"; d=\"scan'208\";a=\"280388206\"",
            "E=Sophos;i=\"5.82,226,1613462400\"; d=\"scan'208\";a=\"384375772\""
        ],
        "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:45 +0100",
        "Message-Id": "<20210416170458.50188-2-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 01/14] build: simplify library build 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": "Two simplifications can be made to the build file which reduce indentation\nlevels and make it easier to read:\n\n1. When meson build support was first added, the compat library existed in\nDPDK as a single header file. Since that header has been merged into EAL,\nwe no longer need to support header-only libraries, so can shorten the\ncode.\n\n2. From meson 0.49 onwards we have the \"continue\" keyword available to\nbreak out of one loop iteration and begin the next. This allows us to\nremove blocks in the build configuration file which were conditional on the\n\"build\" variable being true. Instead we can use \"continue\" to abort\nprocessing at the point where the \"build\" value becomes false.\n\nSince this patch changes the indentation level of large parts of the\nmeson.build file, we use the opportunity to adjust the whitespace used to\nthe meson-standard 4-spec indentation level.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/meson.build | 303 +++++++++++++++++++++++-------------------------\n 1 file changed, 147 insertions(+), 156 deletions(-)",
    "diff": "diff --git a/lib/meson.build b/lib/meson.build\nindex 4eed83e57..95fcd0189 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -54,165 +54,156 @@ default_cflags += ['-DALLOW_EXPERIMENTAL_API']\n default_cflags += ['-DALLOW_INTERNAL_API']\n \n if cc.has_argument('-Wno-format-truncation')\n-\tdefault_cflags += '-Wno-format-truncation'\n+    default_cflags += '-Wno-format-truncation'\n endif\n \n enabled_libs = [] # used to print summary at the end\n \n foreach l:libraries\n-\tbuild = true\n-\treason = '<unknown reason>' # set if build == false to explain why\n-\tname = l\n-\tuse_function_versioning = false\n-\tsources = []\n-\theaders = []\n-\tindirect_headers = [] # public headers not directly included by apps\n-\tdriver_sdk_headers = [] # public headers included by drivers\n-\tincludes = []\n-\tcflags = default_cflags\n-\tobjs = [] # other object files to link against, used e.g. for\n-\t          # instruction-set optimized versions of code\n-\n-\t# use \"deps\" for internal DPDK dependencies, and \"ext_deps\" for\n-\t# external package/library requirements\n-\text_deps = []\n-\tdeps = []\n-\t# eal is standard dependency once built\n-\tif dpdk_conf.has('RTE_LIB_EAL')\n-\t\tdeps += ['eal']\n-\tendif\n-\n-\tdir_name = 'librte_' + l\n-\tsubdir(dir_name)\n-\n-\tif build\n-\t\tshared_deps = ext_deps\n-\t\tstatic_deps = ext_deps\n-\t\tforeach d:deps\n-\t\t\tif not is_variable('shared_rte_' + d)\n-\t\t\t\terror('Missing internal dependency \"@0@\" for @1@ [@2@]'\n-\t\t\t\t\t\t.format(d, name, 'lib/' + dir_name))\n-\t\t\tendif\n-\t\t\tshared_deps += [get_variable('shared_rte_' + d)]\n-\t\t\tstatic_deps += [get_variable('static_rte_' + d)]\n-\t\tendforeach\n-\tendif\n-\n-\tif not build\n-\t\tdpdk_libs_disabled += name\n-\t\tset_variable(name.underscorify() + '_disable_reason', reason)\n-\telse\n-\t\tenabled_libs += name\n-\t\tdpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)\n-\t\tinstall_headers(headers)\n-\t\tinstall_headers(indirect_headers)\n-\t\tif get_option('enable_driver_sdk')\n-\t\t\tinstall_headers(driver_sdk_headers)\n-\t\tendif\n-\t\tdpdk_chkinc_headers += headers\n-\n-\t\tlibname = 'rte_' + name\n-\t\tincludes += include_directories(dir_name)\n-\n-\t\tif sources.length() == 0\n-\t\t\t# if no C files, just set a dependency on header path\n-\t\t\tshared_dep = declare_dependency(include_directories: includes)\n-\t\t\tstatic_dep = shared_dep\n-\t\telse\n-\t\t\tif is_windows and use_function_versioning and developer_mode\n-\t\t\t\tmessage('@0@: Function versioning is not supported by Windows.'\n-\t\t\t\t\t\t.format(name))\n-\t\t\tendif\n-\n-\t\t\tif use_function_versioning\n-\t\t\t\tcflags += '-DRTE_USE_FUNCTION_VERSIONING'\n-\t\t\tendif\n-\n-\t\t\t# first build static lib\n-\t\t\tstatic_lib = static_library(libname,\n-\t\t\t\t\tsources,\n-\t\t\t\t\tobjects: objs,\n-\t\t\t\t\tc_args: cflags,\n-\t\t\t\t\tdependencies: static_deps,\n-\t\t\t\t\tinclude_directories: includes,\n-\t\t\t\t\tinstall: true)\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\tif not use_function_versioning or is_windows\n-\t\t\t\t# use pre-build objects to build shared lib\n-\t\t\t\tsources = []\n-\t\t\t\tobjs += static_lib.extract_all_objects(recursive: false)\n-\t\t\telse\n-\t\t\t\t# for compat we need to rebuild with\n-\t\t\t\t# RTE_BUILD_SHARED_LIB defined\n-\t\t\t\tcflags += '-DRTE_BUILD_SHARED_LIB'\n-\t\t\tendif\n-\t\t\tversion_map = '@0@/@1@/version.map'.format(\n-\t\t\t\t\tmeson.current_source_dir(), dir_name)\n-\t\t\timplib = dir_name + '.dll.a'\n-\n-\t\t\tdef_file = custom_target(libname + '_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(libname))\n-\n-\t\t\tmingw_map = custom_target(libname + '_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(libname))\n-\n-\t\t\tif is_ms_linker\n-\t\t\t\tlk_args = ['-Wl,/def:' + def_file.full_path()]\n-\t\t\t\tif meson.version().version_compare('<0.54.0')\n-\t\t\t\t\tlk_args += ['-Wl,/implib:lib\\\\' + implib]\n-\t\t\t\tendif\n-\t\t\telse\n-\t\t\t\tif is_windows\n-\t\t\t\t\tlk_args = ['-Wl,--version-script=' + mingw_map.full_path()]\n-\t\t\t\telse\n-\t\t\t\t\tlk_args = ['-Wl,--version-script=' + version_map]\n-\t\t\t\tendif\n-\t\t\tendif\n-\n-\t\t\tlk_deps = [version_map, def_file, mingw_map]\n-\t\t\tif developer_mode and not is_windows\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(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: name + '.sym_chk')\n-\t\t\tendif\n-\n-\t\t\tshared_lib = shared_library(libname,\n-\t\t\t\t\tsources,\n-\t\t\t\t\tobjects: objs,\n-\t\t\t\t\tc_args: cflags,\n-\t\t\t\t\tdependencies: shared_deps,\n-\t\t\t\t\tinclude_directories: includes,\n-\t\t\t\t\tlink_args: lk_args,\n-\t\t\t\t\tlink_depends: lk_deps,\n-\t\t\t\t\tversion: abi_version,\n-\t\t\t\t\tsoversion: so_version,\n-\t\t\t\t\tinstall: true)\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-\n-\t\t\tdpdk_libraries = [shared_lib] + dpdk_libraries\n-\t\t\tdpdk_static_libraries = [static_lib] + dpdk_static_libraries\n-\t\tendif # sources.length() > 0\n-\n-\t\tset_variable('shared_rte_' + name, shared_dep)\n-\t\tset_variable('static_rte_' + name, static_dep)\n-\t\tif developer_mode\n-\t\t\tmessage('lib/@0@: Defining dependency \"@1@\"'.format(\n-\t\t\t\t\tdir_name, name))\n-\t\tendif\n-\tendif # if build\n+    build = true\n+    reason = '<unknown reason>' # set if build == false to explain why\n+    name = l\n+    use_function_versioning = false\n+    sources = []\n+    headers = []\n+    indirect_headers = [] # public headers not directly included by apps\n+    driver_sdk_headers = [] # public headers included by drivers\n+    includes = []\n+    cflags = default_cflags\n+    objs = [] # other object files to link against, used e.g. for\n+              # instruction-set optimized versions of code\n+\n+    # use \"deps\" for internal DPDK dependencies, and \"ext_deps\" for\n+    # external package/library requirements\n+    ext_deps = []\n+    deps = []\n+    # eal is standard dependency once built\n+    if dpdk_conf.has('RTE_LIB_EAL')\n+        deps += ['eal']\n+    endif\n+\n+    dir_name = 'librte_' + l\n+    subdir(dir_name)\n+\n+    if not build\n+        dpdk_libs_disabled += name\n+        set_variable(name.underscorify() + '_disable_reason', reason)\n+        continue\n+    endif\n+\n+    shared_deps = ext_deps\n+    static_deps = ext_deps\n+    foreach d:deps\n+        if not is_variable('shared_rte_' + d)\n+            error('Missing internal dependency \"@0@\" for @1@ [@2@]'\n+                    .format(d, name, 'lib/' + dir_name))\n+        endif\n+        shared_deps += [get_variable('shared_rte_' + d)]\n+        static_deps += [get_variable('static_rte_' + d)]\n+    endforeach\n+\n+    enabled_libs += name\n+    dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1)\n+    install_headers(headers)\n+    install_headers(indirect_headers)\n+    if get_option('enable_driver_sdk')\n+        install_headers(driver_sdk_headers)\n+    endif\n+    dpdk_chkinc_headers += headers\n+\n+    libname = 'rte_' + name\n+    includes += include_directories(dir_name)\n+\n+    if is_windows and use_function_versioning\n+        message('@0@: Function versioning is not supported by Windows.'.format(name))\n+    endif\n+\n+    if use_function_versioning\n+        cflags += '-DRTE_USE_FUNCTION_VERSIONING'\n+    endif\n+\n+    # first build static lib\n+    static_lib = static_library(libname,\n+            sources,\n+            objects: objs,\n+            c_args: cflags,\n+            dependencies: static_deps,\n+            include_directories: includes,\n+            install: true)\n+    static_dep = declare_dependency(\n+            include_directories: includes,\n+            dependencies: static_deps)\n+\n+    if not use_function_versioning or is_windows\n+        # use pre-build objects to build shared lib\n+        sources = []\n+        objs += static_lib.extract_all_objects(recursive: false)\n+    else\n+        # for compat we need to rebuild with\n+        # RTE_BUILD_SHARED_LIB defined\n+        cflags += '-DRTE_BUILD_SHARED_LIB'\n+    endif\n+    version_map = '@0@/@1@/version.map'.format(\n+            meson.current_source_dir(), dir_name)\n+    implib = dir_name + '.dll.a'\n+\n+    def_file = custom_target(libname + '_def',\n+            command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n+            input: version_map,\n+            output: '@0@_exports.def'.format(libname))\n+\n+    mingw_map = custom_target(libname + '_mingw',\n+            command: [map_to_win_cmd, '@INPUT@', '@OUTPUT@'],\n+            input: version_map,\n+            output: '@0@_mingw.map'.format(libname))\n+\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:lib\\\\' + implib]\n+        endif\n+    else\n+        if is_windows\n+            lk_args = ['-Wl,--version-script=' + mingw_map.full_path()]\n+        else\n+            lk_args = ['-Wl,--version-script=' + version_map]\n+        endif\n+    endif\n+\n+    lk_deps = [version_map, def_file, mingw_map]\n+    if not is_windows\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(name + '.sym_chk',\n+                command: [check_symbols,\n+                    version_map, '@INPUT@'],\n+                capture: true,\n+                input: static_lib,\n+                output: name + '.sym_chk')\n+    endif\n+\n+    shared_lib = shared_library(libname,\n+            sources,\n+            objects: objs,\n+            c_args: cflags,\n+            dependencies: shared_deps,\n+            include_directories: includes,\n+            link_args: lk_args,\n+            link_depends: lk_deps,\n+            version: abi_version,\n+            soversion: so_version,\n+            install: true)\n+    shared_dep = declare_dependency(link_with: shared_lib,\n+            include_directories: includes,\n+            dependencies: shared_deps)\n+\n+    dpdk_libraries = [shared_lib] + dpdk_libraries\n+    dpdk_static_libraries = [static_lib] + dpdk_static_libraries\n+\n+    set_variable('shared_rte_' + name, shared_dep)\n+    set_variable('static_rte_' + name, static_dep)\n+    if developer_mode\n+        message('lib/@0@: Defining dependency \"@1@\"'.format(dir_name, name))\n+    endif\n endforeach\n",
    "prefixes": [
        "01/14"
    ]
}