get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 80364,
    "url": "https://patches.dpdk.org/api/patches/80364/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201012130348.3212-3-conor.walsh@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": "<20201012130348.3212-3-conor.walsh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201012130348.3212-3-conor.walsh@intel.com",
    "date": "2020-10-12T13:03:46",
    "name": "[v6,2/4] devtools: abi and UX changes for test-meson-builds.sh",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fd73dd05ffd995ca57ef93dde5322748b32ca156",
    "submitter": {
        "id": 1935,
        "url": "https://patches.dpdk.org/api/people/1935/?format=api",
        "name": "Conor Walsh",
        "email": "conor.walsh@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/20201012130348.3212-3-conor.walsh@intel.com/mbox/",
    "series": [
        {
            "id": 12882,
            "url": "https://patches.dpdk.org/api/series/12882/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=12882",
            "date": "2020-10-12T13:03:44",
            "name": "devtools: abi breakage checks",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/12882/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/80364/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/80364/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 CE50EA04B6;\n\tMon, 12 Oct 2020 15:07:04 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7CE9C1D72D;\n\tMon, 12 Oct 2020 15:06:29 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id 3A6B01D6FD\n for <dev@dpdk.org>; Mon, 12 Oct 2020 15:06:25 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Oct 2020 06:04:00 -0700",
            "from unknown (HELO silpixa00400466.ir.intel.com) ([10.237.213.195])\n by orsmga002.jf.intel.com with ESMTP; 12 Oct 2020 06:03:58 -0700"
        ],
        "IronPort-SDR": [
            "\n ZIsb9VtQ1alNI8b1G7erp+kM+LmxuIOwv8wfaqJAjiX8TpqzSOjwMiBRmbALc+4+GSAlbjuJyj\n Efqc+VdqvnXQ==",
            "\n K8o0hZwZdYfkUp6kKdQfbVqw76dygtiBDke9RQEpvoxwTqq3lld7xlIaYB6TlokWQLmD4UZmoP\n pfDGug1qsQLQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9771\"; a=\"145056141\"",
            "E=Sophos;i=\"5.77,366,1596524400\"; d=\"scan'208\";a=\"145056141\"",
            "E=Sophos;i=\"5.77,366,1596524400\"; d=\"scan'208\";a=\"329742084\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Conor Walsh <conor.walsh@intel.com>",
        "To": "mdr@ashroe.eu, nhorman@tuxdriver.com, bruce.richardson@intel.com,\n thomas@monjalon.net, david.marchand@redhat.com",
        "Cc": "dev@dpdk.org,\n\tConor Walsh <conor.walsh@intel.com>",
        "Date": "Mon, 12 Oct 2020 13:03:46 +0000",
        "Message-Id": "<20201012130348.3212-3-conor.walsh@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20201012130348.3212-1-conor.walsh@intel.com>",
        "References": "<20201012080829.3446-1-conor.walsh@intel.com>\n <20201012130348.3212-1-conor.walsh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 2/4] devtools: abi and UX changes for\n\ttest-meson-builds.sh",
        "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": "This patch adds new features to test-meson-builds.sh that help to make\nthe process of using the script easier, the patch also includes\nchanges to make the abi breakage checks more performant.\nChanges/Additions:\n - Command line arguments added, the changes are fully backwards\n   compatible and all previous environmental variables are still supported\n - All paths supplied by user are converted to absolute paths if they\n   are relative as meson has a bug that can sometimes error if a\n   relative path is supplied to it.\n - abi check/generation code moved to function to improve readability\n - Only 2 abi checks will now be completed:\n    - 1 x86_64 gcc or clang check\n    - 1 ARM gcc or clang check\n   It is not necessary to check abi breakages in every build\n - abi checks can now make use of prebuilt abi references from a http\n   or local source, it is hoped these would be hosted on dpdk.org in\n   the future.\nInvoke using \"./test-meson-builds.sh [-b <build directory>]\n   [-a <dpdk tag or latest for abi check>] [-u <uri for abi references>]\n   [-d <directory for abi references>]\"\n - <build directory>: directory to store builds (relative or absolute)\n - <dpdk tag or latest for abi check>: dpdk tag e.g. \"v20.11\" or \"latest\"\n - <uri for abi references>: http location or directory to get prebuilt\n   abi references from\n - <directory for abi references>: directory to store abi references\n   (relative or absolute)\ne.g. \"./test-meson-builds.sh -a latest\"\nIf no flags are specified test-meson-builds.sh will run the standard\nmeson tests with default options unless environmental variables are\nspecified.\n\nSigned-off-by: Conor Walsh <conor.walsh@intel.com>\n\n---\n devtools/test-meson-builds.sh | 170 +++++++++++++++++++++++++++-------\n 1 file changed, 138 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh\nindex a87de635a..b45506fb0 100755\n--- a/devtools/test-meson-builds.sh\n+++ b/devtools/test-meson-builds.sh\n@@ -1,12 +1,73 @@\n #! /bin/sh -e\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2018 Intel Corporation\n+# Copyright(c) 2018-2020 Intel Corporation\n \n # Run meson to auto-configure the various builds.\n # * all builds get put in a directory whose name starts with \"build-\"\n # * if a build-directory already exists we assume it was properly configured\n # Run ninja after configuration is done.\n \n+# Get arguments\n+usage()\n+{\n+\techo \"Usage: $0\n+\t      [-b <build directory>]\n+\t      [-a <dpdk tag or latest for abi check>]\n+\t      [-u <uri for abi references>]\n+\t      [-d <directory for abi references>]\" 1>&2; exit 1;\n+}\n+\n+DPDK_ABI_DEFAULT_URI=\"http://dpdk.org/abi-refs\"\n+\n+while getopts \"a:u:d:b:h\" arg; do\n+\tcase $arg in\n+\ta)\n+\t\tif [ -n \"$DPDK_ABI_REF_VERSION\" ]; then\n+\t\t\techo \"DPDK_ABI_REF_VERSION and -a cannot both be set\"\n+\t\t\texit 1\n+\t\tfi\n+\t\tDPDK_ABI_REF_VERSION=${OPTARG} ;;\n+\tu)\n+\t\tif [ -n \"$DPDK_ABI_TAR_URI\" ]; then\n+\t\t\techo \"DPDK_ABI_TAR_URI and -u cannot both be set\"\n+\t\t\texit 1\n+\t\tfi\n+\t\tDPDK_ABI_TAR_URI=${OPTARG} ;;\n+\td)\n+\t\tif [ -n \"$DPDK_ABI_REF_DIR\" ]; then\n+\t\t\techo \"DPDK_ABI_REF_DIR and -d cannot both be set\"\n+\t\t\texit 1\n+\t\tfi\n+\t\tDPDK_ABI_REF_DIR=${OPTARG} ;;\n+\tb)\n+\t\tif [ -n \"$DPDK_BUILD_TEST_DIR\" ]; then\n+\t\t\techo \"DPDK_BUILD_TEST_DIR and -a cannot both be set\"\n+\t\t\texit 1\n+\t\tfi\n+\t\tDPDK_BUILD_TEST_DIR=${OPTARG} ;;\n+\th)\n+\t\tusage ;;\n+\t*)\n+\t\tusage ;;\n+\tesac\n+done\n+\n+if [ -n \"$DPDK_ABI_REF_VERSION\" ] ; then\n+\tif [ \"$DPDK_ABI_REF_VERSION\" = \"latest\" ] ; then\n+\t\tDPDK_ABI_REF_VERSION=$(git ls-remote --tags http://dpdk.org/git/dpdk |\n+\t        \tsed \"s/.*\\///\" | grep -v \"r\\|{}\" |\n+\t\t\tgrep '^[^.]*.[^.]*$' | tail -n 1)\n+\telif [ -z \"$(git ls-remote http://dpdk.org/git/dpdk refs/tags/$DPDK_ABI_REF_VERSION)\" ] ; then\n+\t\techo \"$DPDK_ABI_REF_VERSION is not a valid DPDK tag\"\n+\t\texit 1\n+\tfi\n+fi\n+if [ -z $DPDK_ABI_TAR_URI ] ; then\n+\tDPDK_ABI_TAR_URI=$DPDK_ABI_DEFAULT_URI\n+fi\n+# allow the generation script to override value with env var\n+abi_checks_done=${DPDK_ABI_GEN_REF:-0}\n+\n # set pipefail option if possible\n PIPEFAIL=\"\"\n set -o | grep -q pipefail && set -o pipefail && PIPEFAIL=1\n@@ -16,7 +77,11 @@ srcdir=$(dirname $(readlink -f $0))/..\n \n MESON=${MESON:-meson}\n use_shared=\"--default-library=shared\"\n-builds_dir=${DPDK_BUILD_TEST_DIR:-.}\n+builds_dir=${DPDK_BUILD_TEST_DIR:-$srcdir/builds}\n+# ensure path is absolute meson returns error when some paths are relative\n+if echo \"$builds_dir\" | grep -qv '^/'; then\n+        builds_dir=$srcdir/$builds_dir\n+fi\n \n if command -v gmake >/dev/null 2>&1 ; then\n \tMAKE=gmake\n@@ -123,39 +188,49 @@ install_target () # <builddir> <installdir>\n \tfi\n }\n \n-build () # <directory> <target compiler | cross file> <meson options>\n+abi_gen_check () # no options\n {\n-\ttargetdir=$1\n-\tshift\n-\tcrossfile=\n-\t[ -r $1 ] && crossfile=$1 || targetcc=$1\n-\tshift\n-\t# skip build if compiler not available\n-\tcommand -v ${CC##* } >/dev/null 2>&1 || return 0\n-\tif [ -n \"$crossfile\" ] ; then\n-\t\tcross=\"--cross-file $crossfile\"\n-\t\ttargetcc=$(sed -n 's,^c[[:space:]]*=[[:space:]]*,,p' \\\n-\t\t\t$crossfile | tr -d \"'\" | tr -d '\"')\n-\telse\n-\t\tcross=\n+\tabirefdir=${DPDK_ABI_REF_DIR:-$builds_dir/__reference}/$DPDK_ABI_REF_VERSION\n+\tmkdir -p $abirefdir\n+\t# ensure path is absolute meson returns error when some are relative\n+\tif echo \"$abirefdir\" | grep -qv '^/'; then\n+\t\tabirefdir=$srcdir/$abirefdir\n \tfi\n-\tload_env $targetcc || return 0\n-\tconfig $srcdir $builds_dir/$targetdir $cross --werror $*\n-\tcompile $builds_dir/$targetdir\n-\tif [ -n \"$DPDK_ABI_REF_VERSION\" ]; then\n-\t\tabirefdir=${DPDK_ABI_REF_DIR:-reference}/$DPDK_ABI_REF_VERSION\n-\t\tif [ ! -d $abirefdir/$targetdir ]; then\n+\tif [ ! -d $abirefdir/$targetdir ]; then\n+\n+\t\t# try to get abi reference\n+\t\tif echo \"$DPDK_ABI_TAR_URI\" | grep -q '^http'; then\n+\t\t\tif [ $abi_checks_done -gt -1 ]; then\n+\t\t\t\tif curl --head --fail --silent \\\n+\t\t\t\t\t\"$DPDK_ABI_TAR_URI/$DPDK_ABI_REF_VERSION/$targetdir.tar.gz\" \\\n+\t\t\t\t\t>/dev/null; then\n+\t\t\t\t\tcurl -o $abirefdir/$targetdir.tar.gz \\\n+\t\t\t\t\t$DPDK_ABI_TAR_URI/$DPDK_ABI_REF_VERSION/$targetdir.tar.gz\n+\t\t\t\tfi\n+\t\t\tfi\n+\t\telif [ $abi_checks_done -gt -1 ]; then\n+\t\t\tif [ -f \"$DPDK_ABI_TAR_URI/$targetdir.tar.gz\" ]; then\n+\t\t\t\tcp $DPDK_ABI_TAR_URI/$targetdir.tar.gz \\\n+\t\t\t\t\t$abirefdir/\n+\t\t\tfi\n+\t\tfi\n+\t\tif [ -f \"$abirefdir/$targetdir.tar.gz\" ]; then\n+\t\t\ttar -xf $abirefdir/$targetdir.tar.gz \\\n+\t\t\t\t-C $abirefdir >/dev/null\n+\t\t\trm -rf $abirefdir/$targetdir.tar.gz\n+\t\t# if no reference can be found then generate one\n+\t\telse\n \t\t\t# clone current sources\n \t\t\tif [ ! -d $abirefdir/src ]; then\n \t\t\t\tgit clone --local --no-hardlinks \\\n-\t\t\t\t\t--single-branch \\\n-\t\t\t\t\t-b $DPDK_ABI_REF_VERSION \\\n-\t\t\t\t\t$srcdir $abirefdir/src\n+\t\t\t\t\t  --single-branch \\\n+\t\t\t\t\t  -b $DPDK_ABI_REF_VERSION \\\n+\t\t\t\t\t  $srcdir $abirefdir/src\n \t\t\tfi\n \n \t\t\trm -rf $abirefdir/build\n \t\t\tconfig $abirefdir/src $abirefdir/build $cross \\\n-\t\t\t\t-Dexamples= $*\n+\t\t\t       -Dexamples= $*\n \t\t\tcompile $abirefdir/build\n \t\t\tinstall_target $abirefdir/build $abirefdir/$targetdir\n \t\t\t$srcdir/devtools/gen-abi.sh $abirefdir/$targetdir\n@@ -164,17 +239,46 @@ build () # <directory> <target compiler | cross file> <meson options>\n \t\t\tfind $abirefdir/$targetdir/usr/local -name '*.a' -delete\n \t\t\trm -rf $abirefdir/$targetdir/usr/local/bin\n \t\t\trm -rf $abirefdir/$targetdir/usr/local/share\n+\t\t\trm -rf $abirefdir/$targetdir/usr/local/lib\n \t\tfi\n+\tfi\n \n-\t\tinstall_target $builds_dir/$targetdir \\\n-\t\t\t$(readlink -f $builds_dir/$targetdir/install)\n-\t\t$srcdir/devtools/gen-abi.sh \\\n-\t\t\t$(readlink -f $builds_dir/$targetdir/install)\n+\tinstall_target $builds_dir/$targetdir \\\n+\t\t$(readlink -f $builds_dir/$targetdir/install)\n+\t$srcdir/devtools/gen-abi.sh \\\n+\t\t$(readlink -f $builds_dir/$targetdir/install)\n+\t# check abi if not generating references\n+\tif [ -z $DPDK_ABI_GEN_REF ] ; then\n \t\t$srcdir/devtools/check-abi.sh $abirefdir/$targetdir \\\n \t\t\t$(readlink -f $builds_dir/$targetdir/install)\n \tfi\n }\n \n+build () # <directory> <target compiler | cross file> <meson options>\n+{\n+\ttargetdir=$1\n+\tshift\n+\tcrossfile=\n+\t[ -r $1 ] && crossfile=$1 || targetcc=$1\n+\tshift\n+\t# skip build if compiler not available\n+\tcommand -v ${CC##* } >/dev/null 2>&1 || return 0\n+\tif [ -n \"$crossfile\" ] ; then\n+\t\tcross=\"--cross-file $crossfile\"\n+\t\ttargetcc=$(sed -n 's,^c[[:space:]]*=[[:space:]]*,,p' \\\n+\t\t\t$crossfile | tr -d \"'\" | tr -d '\"')\n+\telse\n+\t\tcross=\n+\tfi\n+\tload_env $targetcc || return 0\n+\tconfig $srcdir $builds_dir/$targetdir $cross --werror $*\n+\tcompile $builds_dir/$targetdir\n+\tif [ -n \"$DPDK_ABI_REF_VERSION\" ] && [ $abi_checks_done -lt 1 ] ; then\n+\t\tabi_gen_check\n+\t\tabi_checks_done=$((abi_checks_done+1))\n+\tfi\n+}\n+\n if [ \"$1\" = \"-vv\" ] ; then\n \tTEST_MESON_BUILD_VERY_VERBOSE=1\n elif [ \"$1\" = \"-v\" ] ; then\n@@ -189,7 +293,7 @@ fi\n # shared and static linked builds with gcc and clang\n for c in gcc clang ; do\n \tcommand -v $c >/dev/null 2>&1 || continue\n-\tfor s in static shared ; do\n+\tfor s in shared static ; do\n \t\texport CC=\"$CCACHE $c\"\n \t\tbuild build-$c-$s $c --default-library=$s\n \t\tunset CC\n@@ -211,6 +315,8 @@ build build-x86-mingw $srcdir/config/x86/cross-mingw -Dexamples=helloworld\n \n # generic armv8a with clang as host compiler\n f=$srcdir/config/arm/arm64_armv8_linux_gcc\n+# run abi checks with 1 arm build\n+abi_checks_done=$((abi_checks_done-1))\n export CC=\"clang\"\n build build-arm64-host-clang $f $use_shared\n unset CC\n@@ -231,7 +337,7 @@ done\n build_path=$(readlink -f $builds_dir/build-x86-default)\n export DESTDIR=$build_path/install\n # No need to reinstall if ABI checks are enabled\n-if [ -z \"$DPDK_ABI_REF_VERSION\" ]; then\n+if [ -z \"$DPDK_ABI_REF_VERSION\" ] ; then\n \tinstall_target $build_path $DESTDIR\n fi\n \n",
    "prefixes": [
        "v6",
        "2/4"
    ]
}