diff options
author | Dave Love <dave.love@manchester.ac.uk> | 2021-01-04 21:08:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 22:08:54 +0100 |
commit | 11dd7ffad631b8bf1665605db75b7c1b8e9eddcb (patch) | |
tree | 2640cac899dd3812af265b6b611067fa2da086ea /var | |
parent | 1b3300870589eabeb2169bf7af3bdd5d8b65eb15 (diff) | |
download | spack-11dd7ffad631b8bf1665605db75b7c1b8e9eddcb.tar.gz spack-11dd7ffad631b8bf1665605db75b7c1b8e9eddcb.tar.bz2 spack-11dd7ffad631b8bf1665605db75b7c1b8e9eddcb.tar.xz spack-11dd7ffad631b8bf1665605db75b7c1b8e9eddcb.zip |
Add procenv (#20121)
* Add procenv
* procenv: Only buildrequire check
* procenv: Patch for gcc 10
* procenv: Add omitted patch
* Indent doc string
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/procenv/7cafed1316ddb16fe0689d54ba10c05dd2edd347.patch | 34 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/procenv/package.py | 29 |
2 files changed, 63 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/procenv/7cafed1316ddb16fe0689d54ba10c05dd2edd347.patch b/var/spack/repos/builtin/packages/procenv/7cafed1316ddb16fe0689d54ba10c05dd2edd347.patch new file mode 100644 index 0000000000..a185ad2120 --- /dev/null +++ b/var/spack/repos/builtin/packages/procenv/7cafed1316ddb16fe0689d54ba10c05dd2edd347.patch @@ -0,0 +1,34 @@ +From 7cafed1316ddb16fe0689d54ba10c05dd2edd347 Mon Sep 17 00:00:00 2001 +From: Lukas Maerdian <lukas.maerdian@canonical.com> +Date: Mon, 10 Aug 2020 15:11:23 +0200 +Subject: [PATCH] Fix GCC-10 build when used with -Werror=format-overflow= + (Fixes #15) + +Process names have a maximum length of 16 bytes and the buffer used has a +length of 16 bytes, but the compiler is picky about writing and arbirary +string into that small buffer. Tell the compiler to write max. 15 chars + +'\0', to make it happy. +https://stackoverflow.com/questions/23534263/what-is-the-maximum-allowed-limit-on-the-length-of-a-process-name +--- + src/platform/linux/platform.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/platform/linux/platform.c b/src/platform/linux/platform.c +index a392bc0..49ea36c 100644 +--- a/src/platform/linux/platform.c ++++ b/src/platform/linux/platform.c +@@ -1263,12 +1263,12 @@ handle_proc_branch_linux (void) + + if ((p=strstr (buffer, "Name:")) == buffer) { + p += 1+strlen ("Name:"); /* jump over tab char */ +- sprintf (name, "%s", p); ++ sprintf (name, "%.15s", p); + } + + if ((p=strstr (buffer, "PPid:")) == buffer) { + p += 1+strlen ("PPid:"); /* jump over tab char */ +- sprintf (ppid, "%s", p); ++ sprintf (ppid, "%.15s", p); + + /* got all we need now */ + break; diff --git a/var/spack/repos/builtin/packages/procenv/package.py b/var/spack/repos/builtin/packages/procenv/package.py new file mode 100644 index 0000000000..0192379f81 --- /dev/null +++ b/var/spack/repos/builtin/packages/procenv/package.py @@ -0,0 +1,29 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Procenv(AutotoolsPackage): + """A command-line tool that displays as much detail about itself and + its environment as possible. It can be used as a test tool, to + understand the type of environment a process runs in, and for + comparing system environments.""" + + homepage = "https://github.com/jamesodhunt/procenv/" + url = "https://github.com/jamesodhunt/procenv/archive/0.51.tar.gz" + + version('0.51', sha256='b831c14729e06a285cc13eba095817ce3b6d0ddf484b1264951b03ee4fe25bc9') + + # https://github.com/jamesodhunt/procenv/pull/16 + patch("7cafed1316ddb16fe0689d54ba10c05dd2edd347.patch", when="@:0.51") + + depends_on('expat') + depends_on('libpcap') + # Fixme: package these and use conditionally (on linux) + # depends_on('libselinux') + # depends_on('libapparmor') + depends_on('numactl') + depends_on('check', type='build') |