get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122525,
    "url": "https://patches.dpdk.org/api/patches/122525/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1674674707-3094-2-git-send-email-roretzla@linux.microsoft.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": "<1674674707-3094-2-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1674674707-3094-2-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-01-25T19:25:05",
    "name": "[1/3] build: unblock the use of the MSVC compiler",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2c8f921f53b4680c82728d15266a0359d1ad87f9",
    "submitter": {
        "id": 2077,
        "url": "https://patches.dpdk.org/api/people/2077/?format=api",
        "name": "Tyler Retzlaff",
        "email": "roretzla@linux.microsoft.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/1674674707-3094-2-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 26653,
            "url": "https://patches.dpdk.org/api/series/26653/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26653",
            "date": "2023-01-25T19:25:04",
            "name": "unblock the use of the MSVC compiler",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/26653/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/122525/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/122525/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 97CCD42478;\n\tWed, 25 Jan 2023 20:25:30 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 030DC42DC4;\n\tWed, 25 Jan 2023 20:25:18 +0100 (CET)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id E178A42DB0\n for <dev@dpdk.org>; Wed, 25 Jan 2023 20:25:14 +0100 (CET)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 22C8820E61DC; Wed, 25 Jan 2023 11:25:14 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 22C8820E61DC",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1674674714;\n bh=cLthw9benSdyB+VEOCQn3ow5c3iJhusfDJ42yisPScw=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=DZmJKMhM3zcsz8tN0dE7W/WFF//NEpW1I24SOYB+d7e31HFuxx3/Mg16I8GASV3oG\n 6phh8PuIw86Fp1sCtWS4M7HOQyBKj5/oVtPJYrfETLQTy0rwWzYV4hLHy8rdnyEPdV\n jCkb5mlQQH3RrgxaACwEn615znSA6q0EYVWmYp/A=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH 1/3] build: unblock the use of the MSVC compiler",
        "Date": "Wed, 25 Jan 2023 11:25:05 -0800",
        "Message-Id": "<1674674707-3094-2-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1674674707-3094-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1674674707-3094-1-git-send-email-roretzla@linux.microsoft.com>",
        "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"
    },
    "content": "Detect when MSVC toolset is available and tweak toolchain arguments\nwhere the meson build system offers no abstraction.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n buildtools/meson.build | 10 +++++++---\n config/meson.build     | 21 ++++++++++++++-------\n config/x86/meson.build |  8 +++++---\n lib/meson.build        | 13 ++++++++++---\n 4 files changed, 36 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/buildtools/meson.build b/buildtools/meson.build\nindex e1c600e..838c39f 100644\n--- a/buildtools/meson.build\n+++ b/buildtools/meson.build\n@@ -4,7 +4,9 @@\n pkgconf = find_program('pkg-config', 'pkgconf', required: false)\n check_symbols = find_program('check-symbols.sh')\n ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')\n-objdump = find_program('objdump', 'llvm-objdump')\n+if cc.get_id() != 'msvc'\n+    objdump = find_program('objdump', 'llvm-objdump')\n+endif\n \n python3 = import('python').find_installation(required: false)\n if python3.found()\n@@ -18,8 +20,10 @@ map_to_win_cmd = py3 + files('map_to_win.py')\n sphinx_wrapper = py3 + files('call-sphinx-build.py')\n get_cpu_count_cmd = py3 + files('get-cpu-count.py')\n get_numa_count_cmd = py3 + files('get-numa-count.py')\n-binutils_avx512_check = (py3 + files('binutils-avx512-check.py') +\n-                        [objdump] + cc.cmd_array())\n+if cc.get_id() != 'msvc'\n+    binutils_avx512_check = (py3 + files('binutils-avx512-check.py') +\n+                            [objdump] + cc.cmd_array())\n+endif\n \n # select library and object file format\n pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()]\ndiff --git a/config/meson.build b/config/meson.build\nindex 6d9ffd4..898b743 100644\n--- a/config/meson.build\n+++ b/config/meson.build\n@@ -16,7 +16,8 @@ endforeach\n \n # MS linker requires special treatment.\n # TODO: use cc.get_linker_id() with Meson >= 0.54\n-is_ms_linker = is_windows and (cc.get_id() == 'clang')\n+is_ms_compiler = is_windows and (cc.get_id() == 'msvc')\n+is_ms_linker = is_windows and (cc.get_id() == 'clang' or is_ms_compiler)\n \n # set the major version, which might be used by drivers and libraries\n # depending on the configuration options\n@@ -130,11 +131,13 @@ dpdk_conf.set('RTE_MACHINE', cpu_instruction_set)\n machine_args = []\n \n # ppc64 does not support -march= at all, use -mcpu and -mtune for that\n-if host_machine.cpu_family().startswith('ppc')\n-    machine_args += '-mcpu=' + cpu_instruction_set\n-    machine_args += '-mtune=' + cpu_instruction_set\n-else\n-    machine_args += '-march=' + cpu_instruction_set\n+if not is_ms_compiler\n+    if host_machine.cpu_family().startswith('ppc')\n+        machine_args += '-mcpu=' + cpu_instruction_set\n+        machine_args += '-mtune=' + cpu_instruction_set\n+    else\n+        machine_args += '-march=' + cpu_instruction_set\n+    endif\n endif\n \n toolchain = cc.get_id()\n@@ -252,7 +255,11 @@ if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false\n endif\n \n # add -include rte_config to cflags\n-add_project_arguments('-include', 'rte_config.h', language: 'c')\n+if is_ms_compiler\n+    add_project_arguments('/FI', 'rte_config.h', language: 'c')\n+else\n+    add_project_arguments('-include', 'rte_config.h', language: 'c')\n+endif\n \n # enable extra warnings and disable any unwanted warnings\n # -Wall is added by default at warning level 1, and -Wextra\ndiff --git a/config/x86/meson.build b/config/x86/meson.build\nindex 54345c4..11f0bcc 100644\n--- a/config/x86/meson.build\n+++ b/config/x86/meson.build\n@@ -25,9 +25,11 @@ if cc.has_argument('-mavx512f')\n endif\n \n # we require SSE4.2 for DPDK\n-if cc.get_define('__SSE4_2__', args: machine_args) == ''\n-    message('SSE 4.2 not enabled by default, explicitly enabling')\n-    machine_args += '-msse4'\n+if not is_ms_compiler\n+    if cc.get_define('__SSE4_2__', args: machine_args) == ''\n+        message('SSE 4.2 not enabled by default, explicitly enabling')\n+        machine_args += '-msse4'\n+    endif\n endif\n \n base_flags = ['SSE', 'SSE2', 'SSE3','SSSE3', 'SSE4_1', 'SSE4_2']\ndiff --git a/lib/meson.build b/lib/meson.build\nindex a90fee3..82e4666 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -235,9 +235,16 @@ foreach l:libraries\n                 output: '@0@_exports.def'.format(libname))\n         lk_deps += [def_file]\n \n-        lk_args = ['-Wl,/def:' + def_file.full_path()]\n-        if meson.version().version_compare('<0.54.0')\n-            lk_args += ['-Wl,/implib:lib\\\\librte_' + l + '.dll.a']\n+        if is_ms_compiler\n+            lk_args = ['/def:' + def_file.full_path()]\n+            if meson.version().version_compare('<0.54.0')\n+                lk_args += ['/implib:lib\\\\librte_' + l + '.dll.a']\n+            endif\n+        else\n+            lk_args = ['-Wl,/def:' + def_file.full_path()]\n+            if meson.version().version_compare('<0.54.0')\n+                lk_args += ['-Wl,/implib:lib\\\\librte_' + l + '.dll.a']\n+            endif\n         endif\n     else\n         if is_windows\n",
    "prefixes": [
        "1/3"
    ]
}