From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 174EDC5DF63 for ; Wed, 6 Nov 2019 15:39:14 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 95E322173E for ; Wed, 6 Nov 2019 15:39:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hnUqiP+e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95E322173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DE2061C2A5; Wed, 6 Nov 2019 16:39:12 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id C8E801C296 for ; Wed, 6 Nov 2019 16:39:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573054751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vcc+R5+JtNFysZ2blS+CZCqe4UDLci2utYRPTfPnlPg=; b=hnUqiP+esc8MC2kfqD56efPwHn4hKmQ0/ip6mRC3e5/Y4JS+Na09zbP0XXJYUtYfAAOaRn KG2sLJEILoEnhVFTwlkCQ89Jh5QU0CqSZvIaai/58RJwgoZLotP02FXIfUOdXDvZ7RZRld A4HhC1QK05lPY6yi11R1ccdVbTVH1EU= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-psgUL0B4OhO8L5F3I7HTMw-1; Wed, 06 Nov 2019 10:39:07 -0500 Received: by mail-ua1-f72.google.com with SMTP id c12so1344040uap.18 for ; Wed, 06 Nov 2019 07:39:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fPe74d8CHP7nUvohtqmck/U95zLNUR3d7bPZwWj+jwM=; b=V8/dSqdH9pysLKAP2rIlG4of0dRYoCtDNuXYwtEAep+JbJrTEfppBhHWAAlpGHcgM9 HJWkqD/Ki3/HxN4jsO9+nsEG5+/wPFpP/PVoPTU9oPjy6N4wuKQtk/XrNSLiIMqoKyW+ 8mBt0p1rhF4DLthY+TJ11EB4KHmEiKPBqvojXpicrx691W6y07SKfd2jjW2UqITqnf9R a/OTH+JEwZ1CLGfO6I2HswnwaNHtcrOTq9ZPbJS05MSKaC1XNVG1NQFg/ta/AIYl7sfS ZlbogFefjGnKwmRAChUeg2MoOv5mDM1/9bkdPMeBsrTEnK0tYMZ6EFDuwg1ws4Ah/qJs 3DWQ== X-Gm-Message-State: APjAAAXR9C7JUw6O2wwu2B8DzLs856GoO4hLZzkknQxa0crsmOx5Inb1 kxft+ri6mW0bJR0B7LGmdEGEOD1zzmcIWdLNLBE6tti8/xWSUvwjEJsMh8WrSx+y4XjIIlDMctI aK1HPAWcPmpm+JXDhlHA= X-Received: by 2002:a9f:3772:: with SMTP id a47mr1573311uae.53.1573054747024; Wed, 06 Nov 2019 07:39:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyizmGx6XVWs4fOSjkIRqNayVfjAnwNhS4lC5YwlNoM66SNo0AghhDHPE4//YYGL33h6H8EN9ZyErUmJf71NpU= X-Received: by 2002:a9f:3772:: with SMTP id a47mr1573286uae.53.1573054746472; Wed, 06 Nov 2019 07:39:06 -0800 (PST) MIME-Version: 1.0 References: <0bdec3d7e6659e3a41b9888a8b3a13eb428426f6.1571910363.git.anatoly.burakov@intel.com> In-Reply-To: <0bdec3d7e6659e3a41b9888a8b3a13eb428426f6.1571910363.git.anatoly.burakov@intel.com> From: David Marchand Date: Wed, 6 Nov 2019 16:38:55 +0100 Message-ID: To: Anatoly Burakov Cc: dev , Pawel Modrak , "Mcnamara, John" , "Kinsella, Ray" , Bruce Richardson , Thomas Monjalon X-MC-Unique: psgUL0B4OhO8L5F3I7HTMw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v5 02/10] buildtools: add script for updating symbols abi version X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Oct 24, 2019 at 11:46 AM Anatoly Burakov wrote: > > From: Pawel Modrak > > Add a script that automatically merges all stable ABI's under one > ABI section with the new version, while leaving experimental > section exactly as it is. > > Signed-off-by: Pawel Modrak > Signed-off-by: Anatoly Burakov > Acked-by: Bruce Richardson > --- > > Notes: > v3: > - Add comments to regex patterns > > v2: > - Reworked script to be pep8-compliant and more reliable > > buildtools/update_version_map_abi.py | 170 +++++++++++++++++++++++++++ > 1 file changed, 170 insertions(+) > create mode 100755 buildtools/update_version_map_abi.py > > diff --git a/buildtools/update_version_map_abi.py b/buildtools/update_ver= sion_map_abi.py > new file mode 100755 > index 0000000000..50283e6a3d > --- /dev/null > +++ b/buildtools/update_version_map_abi.py > @@ -0,0 +1,170 @@ > +#!/usr/bin/env python > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2019 Intel Corporation > + > +""" > +A Python program to update the ABI version and function names in a DPDK > +lib_*_version.map file. Called from the buildtools/update_abi.sh utility= . > +""" > + > +from __future__ import print_function > +import argparse > +import sys > +import re > + > + > +def __parse_map_file(f_in): > + # match function name, followed by semicolon, followed by EOL, optio= nally > + # with whitespace inbetween each item > + func_line_regex =3D re.compile(r"\s*" > + r"(?P[a-zA-Z_0-9]+)" > + r"\s*" > + r";" > + r"\s*" > + r"$") > + # match section name, followed by opening bracked, followed by EOL, > + # optionally with whitespace inbetween each item > + section_begin_regex =3D re.compile(r"\s*" > + r"(?P[a-zA-Z0-9_\.]+)" > + r"\s*" > + r"{" > + r"\s*" > + r"$") > + # match closing bracket, optionally followed by section name (for wh= en we > + # inherit from another ABI version), followed by semicolon, followed= by > + # EOL, optionally with whitespace inbetween each item > + section_end_regex =3D re.compile(r"\s*" > + r"}" > + r"\s*" > + r"(?P[a-zA-Z0-9_\.]+)?" > + r"\s*" > + r";" > + r"\s*" > + r"$") > + > + # for stable ABI, we don't care about which version introduced which > + # function, we just flatten the list. there are dupes in certain fil= es, so > + # use a set instead of a list > + stable_lines =3D set() > + # copy experimental section as is > + experimental_lines =3D [] > + is_experimental =3D False > + > + # gather all functions > + for line in f_in: > + # clean up the line > + line =3D line.strip('\n').strip() > + > + # is this an end of section? > + match =3D section_end_regex.match(line) > + if match: > + # whatever section this was, it's not active any more > + is_experimental =3D False > + continue > + > + # if we're in the middle of experimental section, we need to cop= y > + # the section verbatim, so just add the line > + if is_experimental: > + experimental_lines +=3D [line] > + continue > + > + # skip empty lines > + if not line: > + continue > + > + # is this a beginning of a new section? > + match =3D section_begin_regex.match(line) > + if match: > + cur_section =3D match.group("version") > + # is it experimental? > + is_experimental =3D cur_section =3D=3D "EXPERIMENTAL" > + continue > + > + # is this a function? > + match =3D func_line_regex.match(line) > + if match: > + stable_lines.add(match.group("func")) > + > + return stable_lines, experimental_lines > + > + > +def __regenerate_map_file(f_out, abi_version, stable_lines, > + experimental_lines): > + # print ABI version header > + print("DPDK_{} {{".format(abi_version), file=3Df_out) Some libraries are entirely experimental (librte_bpf for example). https://patchwork.dpdk.org/patch/62018/ +Libraries marked as ``experimental`` are entirely not considered part of a= n ABI +version, and may change without warning at any time. Experimental librarie= s +always have a major version of ``0`` to indicate they exist outside of +:ref:`abi_versioning` , with the minor version incremented with each ABI c= hange +to library. So you must create a DPDK_XX "stable" block only if the map file contained a non empty "stable" block before. -- David Marchand