Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/63168/?format=api
http://patches.dpdk.org/api/patches/63168/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/623a108a040152d3fce713d8b09d0b0157ddc67e.1574270323.git.anatoly.burakov@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": "<623a108a040152d3fce713d8b09d0b0157ddc67e.1574270323.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/623a108a040152d3fce713d8b09d0b0157ddc67e.1574270323.git.anatoly.burakov@intel.com", "date": "2019-11-20T17:23:31", "name": "[v8,04/12] buildtools: add script for updating symbols abi version", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "cafcafeb5664103652688e9f902f7630567bea50", "submitter": { "id": 4, "url": "http://patches.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/623a108a040152d3fce713d8b09d0b0157ddc67e.1574270323.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 7549, "url": "http://patches.dpdk.org/api/series/7549/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7549", "date": "2019-11-20T17:23:27", "name": "Implement the new ABI policy and add helper scripts", "version": 8, "mbox": "http://patches.dpdk.org/series/7549/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/63168/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/63168/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AF38AA04C1;\n\tWed, 20 Nov 2019 18:24:19 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8E0F82C2B;\n\tWed, 20 Nov 2019 18:24:19 +0100 (CET)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id 32FFC2B87\n for <dev@dpdk.org>; Wed, 20 Nov 2019 18:24:17 +0100 (CET)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 20 Nov 2019 09:24:16 -0800", "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.223.151])\n by orsmga008.jf.intel.com with ESMTP; 20 Nov 2019 09:24:14 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.69,222,1571727600\"; d=\"scan'208\";a=\"200794038\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "Pawel Modrak <pawelx.modrak@intel.com>, john.mcnamara@intel.com,\n ray.kinsella@intel.com, bruce.richardson@intel.com, thomas@monjalon.net,\n david.marchand@redhat.com", "Date": "Wed, 20 Nov 2019 17:23:31 +0000", "Message-Id": "\n <623a108a040152d3fce713d8b09d0b0157ddc67e.1574270323.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": [ "<cover.1574270323.git.anatoly.burakov@intel.com>", "<cover.1574270323.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1574270323.git.anatoly.burakov@intel.com>", "<cover.1573230233.git.anatoly.burakov@intel.com>\n <cover.1574270323.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH v8 04/12] buildtools: add script for updating\n\tsymbols abi version", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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": "From: Pawel Modrak <pawelx.modrak@intel.com>\n\nAdd a script that automatically merges all stable ABI's under one\nABI section with the new version, while leaving experimental\nsection exactly as it is.\n\nSigned-off-by: Pawel Modrak <pawelx.modrak@intel.com>\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nAcked-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n\nNotes:\n v7:\n - Do not remove stable ABI if it was empty\n \n v6:\n - Split map file generation function in two\n - Do not print stable ABI if it wasn't present\n \n v3:\n - Add comments to regex patterns\n \n v2:\n - Reworked script to be pep8-compliant and more reliable\n\n buildtools/update_version_map_abi.py | 175 +++++++++++++++++++++++++++\n 1 file changed, 175 insertions(+)\n create mode 100755 buildtools/update_version_map_abi.py", "diff": "diff --git a/buildtools/update_version_map_abi.py b/buildtools/update_version_map_abi.py\nnew file mode 100755\nindex 0000000000..87fed54653\n--- /dev/null\n+++ b/buildtools/update_version_map_abi.py\n@@ -0,0 +1,175 @@\n+#!/usr/bin/env python\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2019 Intel Corporation\n+\n+\"\"\"\n+A Python program that updates and merges all available stable ABI versions into\n+one ABI version, while leaving experimental ABI exactly as it is. The intended\n+ABI version is supplied via command-line parameter. This script is to be called\n+from the buildtools/update_abi.sh utility.\n+\"\"\"\n+\n+from __future__ import print_function\n+import argparse\n+import sys\n+import re\n+\n+\n+def __parse_map_file(f_in):\n+ # match function name, followed by semicolon, followed by EOL, optionally\n+ # with whitespace inbetween each item\n+ func_line_regex = re.compile(r\"\\s*\"\n+ r\"(?P<func>[a-zA-Z_0-9]+)\"\n+ r\"\\s*\"\n+ r\";\"\n+ r\"\\s*\"\n+ r\"$\")\n+ # match section name, followed by opening bracked, followed by EOL,\n+ # optionally with whitespace inbetween each item\n+ section_begin_regex = re.compile(r\"\\s*\"\n+ r\"(?P<version>[a-zA-Z0-9_\\.]+)\"\n+ r\"\\s*\"\n+ r\"{\"\n+ r\"\\s*\"\n+ r\"$\")\n+ # match closing bracket, optionally followed by section name (for when we\n+ # inherit from another ABI version), followed by semicolon, followed by\n+ # EOL, optionally with whitespace inbetween each item\n+ section_end_regex = re.compile(r\"\\s*\"\n+ r\"}\"\n+ r\"\\s*\"\n+ r\"(?P<parent>[a-zA-Z0-9_\\.]+)?\"\n+ r\"\\s*\"\n+ r\";\"\n+ r\"\\s*\"\n+ r\"$\")\n+\n+ # for stable ABI, we don't care about which version introduced which\n+ # function, we just flatten the list. there are dupes in certain files, so\n+ # use a set instead of a list\n+ stable_lines = set()\n+ # copy experimental section as is\n+ experimental_lines = []\n+ in_experimental = False\n+ has_stable = False\n+\n+ # gather all functions\n+ for line in f_in:\n+ # clean up the line\n+ line = line.strip('\\n').strip()\n+\n+ # is this an end of section?\n+ match = section_end_regex.match(line)\n+ if match:\n+ # whatever section this was, it's not active any more\n+ in_experimental = False\n+ continue\n+\n+ # if we're in the middle of experimental section, we need to copy\n+ # the section verbatim, so just add the line\n+ if in_experimental:\n+ experimental_lines += [line]\n+ continue\n+\n+ # skip empty lines\n+ if not line:\n+ continue\n+\n+ # is this a beginning of a new section?\n+ match = section_begin_regex.match(line)\n+ if match:\n+ cur_section = match.group(\"version\")\n+ # is it experimental?\n+ in_experimental = cur_section == \"EXPERIMENTAL\"\n+ if not in_experimental:\n+ has_stable = True\n+ continue\n+\n+ # is this a function?\n+ match = func_line_regex.match(line)\n+ if match:\n+ stable_lines.add(match.group(\"func\"))\n+\n+ return has_stable, stable_lines, experimental_lines\n+\n+\n+def __generate_stable_abi(f_out, abi_version, lines):\n+ # print ABI version header\n+ print(\"DPDK_{} {{\".format(abi_version), file=f_out)\n+\n+ # print global section if it exists\n+ if lines:\n+ print(\"\\tglobal:\", file=f_out)\n+ # blank line\n+ print(file=f_out)\n+\n+ # print all stable lines, alphabetically sorted\n+ for line in sorted(lines):\n+ print(\"\\t{};\".format(line), file=f_out)\n+\n+ # another blank line\n+ print(file=f_out)\n+\n+ # print local section\n+ print(\"\\tlocal: *;\", file=f_out)\n+\n+ # end stable version\n+ print(\"};\", file=f_out)\n+\n+\n+def __generate_experimental_abi(f_out, lines):\n+ # start experimental section\n+ print(\"EXPERIMENTAL {\", file=f_out)\n+\n+ # print all experimental lines as they were\n+ for line in lines:\n+ # don't print empty whitespace\n+ if not line:\n+ print(\"\", file=f_out)\n+ else:\n+ print(\"\\t{}\".format(line), file=f_out)\n+\n+ # end section\n+ print(\"};\", file=f_out)\n+\n+\n+def __main():\n+ arg_parser = argparse.ArgumentParser(\n+ description='Merge versions in linker version script.')\n+\n+ arg_parser.add_argument(\"map_file\", type=str,\n+ help='path to linker version script file '\n+ '(pattern: *version.map)')\n+ arg_parser.add_argument(\"abi_version\", type=str,\n+ help='target ABI version (pattern: MAJOR.MINOR)')\n+\n+ parsed = arg_parser.parse_args()\n+\n+ if not parsed.map_file.endswith('version.map'):\n+ print(\"Invalid input file: {}\".format(parsed.map_file),\n+ file=sys.stderr)\n+ arg_parser.print_help()\n+ sys.exit(1)\n+\n+ if not re.match(r\"\\d{1,2}\\.\\d{1,2}\", parsed.abi_version):\n+ print(\"Invalid ABI version: {}\".format(parsed.abi_version),\n+ file=sys.stderr)\n+ arg_parser.print_help()\n+ sys.exit(1)\n+\n+ with open(parsed.map_file) as f_in:\n+ has_stable, stable_lines, experimental_lines = __parse_map_file(f_in)\n+\n+ with open(parsed.map_file, 'w') as f_out:\n+ need_newline = has_stable and experimental_lines\n+ if has_stable:\n+ __generate_stable_abi(f_out, parsed.abi_version, stable_lines)\n+ if need_newline:\n+ # separate sections with a newline\n+ print(file=f_out)\n+ if experimental_lines:\n+ __generate_experimental_abi(f_out, experimental_lines)\n+\n+\n+if __name__ == \"__main__\":\n+ __main()\n", "prefixes": [ "v8", "04/12" ] }{ "id": 63168, "url": "