diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml index a36682a..7afc6e1 100755 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -11,11 +11,7 @@ jobs: linux_64_: CONFIG: linux_64_ UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-comp7 - linux_aarch64_: - CONFIG: linux_aarch64_ - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-aarch64 + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 linux_ppc64le_: CONFIG: linux_ppc64le_ UPLOAD_PACKAGES: 'True' diff --git a/.ci_support/README b/.ci_support/README index e4e2dce..a47316b 100644 --- a/.ci_support/README +++ b/.ci_support/README @@ -1 +1,6 @@ -This file is automatically generated by conda-smithy. To change any matrix elements, you should change conda-smithy's input conda_build_config.yaml and re-render the recipe, rather than editing these files directly. \ No newline at end of file +This file is automatically generated by conda-smithy. If any +particular build configuration is expected, but it is not found, +please make sure all dependencies are satisfiable. To add/modify any +matrix elements, you should create/change conda-smithy's input +recipe/conda_build_config.yaml and re-render the recipe, rather than +editing these files directly. diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index e7c13cd..0fafaf2 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -3,7 +3,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '9' +- '10' cdt_name: - cos6 channel_sources: @@ -13,9 +13,9 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '9' +- '10' docker_image: -- quay.io/condaforge/linux-anvil-comp7 +- quay.io/condaforge/linux-anvil-cos7-x86_64 libarchive: - '3.5' libcurl: @@ -42,8 +42,6 @@ xz: zip_keys: - - c_compiler_version - cxx_compiler_version -- - cdt_name - - docker_image zlib: - '1.2' zstd: diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_.yaml index 5999237..b8d04e6 100644 --- a/.ci_support/linux_aarch64_.yaml +++ b/.ci_support/linux_aarch64_.yaml @@ -5,7 +5,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '9' +- '10' cdt_arch: - aarch64 cdt_name: @@ -17,7 +17,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '9' +- '10' docker_image: - quay.io/condaforge/linux-anvil-aarch64 libarchive: diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_.yaml index d4344a5..a3149b8 100644 --- a/.ci_support/linux_ppc64le_.yaml +++ b/.ci_support/linux_ppc64le_.yaml @@ -3,7 +3,7 @@ bzip2: c_compiler: - gcc c_compiler_version: -- '9' +- '10' cdt_name: - cos7 channel_sources: @@ -13,7 +13,7 @@ channel_targets: cxx_compiler: - gxx cxx_compiler_version: -- '9' +- '10' docker_image: - quay.io/condaforge/linux-anvil-ppc64le libarchive: diff --git a/.gitattributes b/.gitattributes index ce52713..7f32763 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ bld.bat text eol=crlf # github helper pieces to make some files not show up in diffs automatically .azure-pipelines/* linguist-generated=true .circleci/* linguist-generated=true +.ci_support/README linguist-generated=true .drone/* linguist-generated=true .drone.yml linguist-generated=true .github/* linguist-generated=true diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index a85ae38..d71d6ae 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -5,6 +5,8 @@ # changes to this script, consider a proposal to conda-smithy so that other feedstocks can also # benefit from the improvement. +# -*- mode: jinja-shell -*- + set -xeuo pipefail export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh @@ -25,10 +27,12 @@ conda-build: root-dir: ${FEEDSTOCK_ROOT}/build_artifacts CONDARC -GET_BOA=boa -BUILD_CMD=mambabuild -conda install --yes --quiet "conda-forge-ci-setup=3" conda-build pip ${GET_BOA:-} -c conda-forge + +mamba install --update-specs --yes --quiet --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 +mamba update --update-specs --yes --quiet --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -53,7 +57,7 @@ if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then # Drop into an interactive shell /bin/bash else - conda $BUILD_CMD "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" ( startgroup "Validating outputs" ) 2> /dev/null diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 0c6515f..9236239 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -14,7 +14,7 @@ set -xeo pipefail THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" PROVIDER_DIR="$(basename $THISDIR)" -FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) +FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" if [ -z ${FEEDSTOCK_NAME} ]; then diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b25d24d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. + +language: generic + + + +matrix: + include: + - env: CONFIG=linux_aarch64_ UPLOAD_PACKAGES=True PLATFORM=linux-aarch64 DOCKER_IMAGE=quay.io/condaforge/linux-anvil-aarch64 + os: linux + arch: arm64 + dist: focal + +script: + - export CI=travis + - export GIT_BRANCH="$TRAVIS_BRANCH" + - export FEEDSTOCK_NAME=$(basename ${TRAVIS_REPO_SLUG}) + - if [[ "${TRAVIS_PULL_REQUEST:-}" == "false" ]]; then export IS_PR_BUILD="False"; else export IS_PR_BUILD="True"; fi + + + - if [[ ${PLATFORM} =~ .*linux.* ]]; then CONDA_FORGE_DOCKER_RUN_ARGS="--network=host --security-opt=seccomp=unconfined" ./.scripts/run_docker_build.sh; fi \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index ed3f451..6ec1401 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,5 +1,5 @@ BSD 3-clause license -Copyright (c) 2015-2021, conda-forge contributors +Copyright (c) 2015-2022, conda-forge contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 7fd2a06..c31fd2e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Home: https://fedorahosted.org/elfutils/ Package license: LGPL-3.0-only -Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/elfutils-feedstock/blob/master/LICENSE.txt) +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/elfutils-feedstock/blob/main/LICENSE.txt) Summary: a set of utilities and libraries for handling ELF (Executable and Linkable Format) files. @@ -13,15 +13,22 @@ Current build status ==================== - +
+ + +
Travis + + linux + +
Azure
- - + + @@ -29,22 +36,22 @@ Current build status @@ -72,18 +79,43 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `elfutils` can be installed with: +Once the `conda-forge` channel has been enabled, `elfutils` can be installed with `conda`: ``` conda install elfutils ``` -It is possible to list all of the versions of `elfutils` available on your platform with: +or with `mamba`: + +``` +mamba install elfutils +``` + +It is possible to list all of the versions of `elfutils` available on your platform with `conda`: ``` conda search elfutils --channel conda-forge ``` +or with `mamba`: + +``` +mamba search elfutils --channel conda-forge +``` + +Alternatively, `mamba repoquery` may provide more information: + +``` +# Search all versions available on your platform: +mamba repoquery search elfutils --channel conda-forge + +# List packages depending on `elfutils`: +mamba repoquery whoneeds elfutils --channel conda-forge + +# List dependencies of `elfutils`: +mamba repoquery depends elfutils --channel conda-forge +``` + About conda-forge ================= @@ -99,10 +131,12 @@ for each of the installable packages. Such a repository is known as a *feedstock A feedstock is made up of a conda recipe (the instructions on what and how to build the package) and the necessary configurations for automatic building using freely available continuous integration services. Thanks to the awesome service provided by -[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/) -and [TravisCI](https://travis-ci.com/) it is possible to build and upload installable -packages to the [conda-forge](https://anaconda.org/conda-forge) -[Anaconda-Cloud](https://anaconda.org/) channel for Linux, Windows and OSX respectively. +[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/), +[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), +[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) +it is possible to build and upload installable packages to the +[conda-forge](https://anaconda.org/conda-forge) [Anaconda-Cloud](https://anaconda.org/) +channel for Linux, Windows and OSX respectively. To manage the continuous integration and simplify feedstock maintenance [conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. diff --git a/build-locally.py b/build-locally.py index 8b74348..eec38a0 100755 --- a/build-locally.py +++ b/build-locally.py @@ -22,10 +22,6 @@ def setup_environment(ns): os.environ["MINIFORGE_HOME"] = os.path.join( os.path.dirname(__file__), "miniforge3" ) - if "OSX_SDK_DIR" not in os.environ: - os.environ["OSX_SDK_DIR"] = os.path.join( - os.path.dirname(__file__), "SDKs" - ) def run_docker_build(ns): @@ -65,11 +61,12 @@ def verify_config(ns): raise ValueError( f"only Linux/macOS configs currently supported, got {ns.config}" ) - elif ns.config.startswith("osx") and platform.system() == "Darwin": + elif ns.config.startswith("osx"): if "OSX_SDK_DIR" not in os.environ: raise RuntimeError( - "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=/opt'" - "to download the SDK automatically to '/opt/MacOSX.sdk'" + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=SDKs' " + "to download the SDK automatically to 'SDKs/MacOSX.sdk'. " + "Setting this variable implies agreement to the licensing terms of the SDK by Apple." ) diff --git a/recipe/build.sh b/recipe/build.sh index 65c206c..6c03313 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,18 +1,15 @@ #!/bin/bash export LIBS="$(pkg-config --libs-only-l zlib) $LIBS" export LDFLAGS="$(pkg-config --libs-only-L zlib) -lrt $LDFLAGS" -export CFLAGS="$(pkg-config --cflags zlib) -Wno-unused-but-set-variable -Wno-unused-variable -Wno-null-dereference $CFLAGS" -./configure --prefix=$PREFIX --with-zlib --enable-libdebuginfod=dummy || (cat config.log && exit 1) +# tests introspect debug information in some of the binaries built. Build with -g and strip at install +export CFLAGS="$(pkg-config --cflags zlib) -Wno-unused-but-set-variable -Wno-unused-variable -Wno-null-dereference $CFLAGS -g" +# tests don't work with NDEBUG +export CPPFLAGS="${CPPFLAGS/-DNDEBUG/}" +autoreconf --install --force +mkdir build && cd build +../configure --prefix=$PREFIX --mandir=$PREFIX/man --enable-test-rpath --with-zlib --enable-libdebuginfod=dummy || (cat config.log && exit 1) make -j${CPU_COUNT} -# Unfortunately some tests fail, so we can't run "make check" here. -# This is probably due to this package being a very sensitive package. -# I believe this happens because it is not ready to be packaged into -# an environment such as conda where it will run in different OSes, -# environments, etc. -# -# For example, when running the tests on my personal machine, using -# the docker image provided by condaforge, 8 tests failed, while in -# CircleCI, 4 tests failed. +make check -j${CPU_COUNT} V=1 || (cat tests/test-suite.log && exit 1) -make install +make install-strip diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b1849df..5791363 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -8,9 +8,12 @@ source: fn: elfutils-{{ version }}.tar.bz2 url: https://fedorahosted.org/releases/e/l/elfutils/{{ version }}/elfutils-{{ version }}.tar.bz2 sha256: 7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177 + patches: + - patches/0001-rm-test-nlist-too-fragile.patch + - patches/0002-check-for-cap_sys_ptrace-when-needed-or-skip.patch build: - number: 0 + number: 1 skip: true # [not linux] run_exports: - {{ pin_subpackage('elfutils', max_pin='x.x') }} @@ -21,6 +24,9 @@ requirements: - {{ compiler('cxx') }} - pkg-config - make + - autoconf + - automake + - libtool host: - bzip2 - libarchive diff --git a/recipe/patches/0001-rm-test-nlist-too-fragile.patch b/recipe/patches/0001-rm-test-nlist-too-fragile.patch new file mode 100644 index 0000000..17dbe94 --- /dev/null +++ b/recipe/patches/0001-rm-test-nlist-too-fragile.patch @@ -0,0 +1,35 @@ +From de1e62b970669080c78d9c2e070c9082364a1d21 Mon Sep 17 00:00:00 2001 +From: Tim Snyder +Date: Fri, 1 Apr 2022 03:05:01 +0000 +Subject: [PATCH 1/2] rm test-nlist too fragile + +builds with special CFLAGS -g -O0 and doesn't let rpath in at all +--- + tests/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index bfb8b13..ba96eb1 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -33,7 +33,7 @@ tests_rpath = no + endif + + check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ +- showptable update1 update2 update3 update4 test-nlist \ ++ showptable update1 update2 update3 update4 \ + show-die-info get-files next-files get-lines next-lines \ + get-pubnames \ + get-aranges allfcts line2addr addrscopes funcscopes \ +@@ -93,7 +93,7 @@ test-nlist$(EXEEXT): test-nlist.c + $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(test_nlist_CFLAGS) $(GCOV_FLAGS) -o $@ $< $(test_nlist_LDADD) + +-TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ ++TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile \ + update1 update2 update3 update4 \ + run-show-die-info.sh run-get-files.sh run-get-lines.sh \ + run-next-files.sh run-next-lines.sh \ +-- +2.35.1 + diff --git a/recipe/patches/0002-check-for-cap_sys_ptrace-when-needed-or-skip.patch b/recipe/patches/0002-check-for-cap_sys_ptrace-when-needed-or-skip.patch new file mode 100644 index 0000000..aba846b --- /dev/null +++ b/recipe/patches/0002-check-for-cap_sys_ptrace-when-needed-or-skip.patch @@ -0,0 +1,87 @@ +From 60323b0a3e6b84678130bc393147efbc34977ce1 Mon Sep 17 00:00:00 2001 +From: Tim Snyder +Date: Sat, 2 Apr 2022 01:18:33 +0000 +Subject: [PATCH] check for cap_sys_ptrace when needed or skip + +--- + tests/backtrace-subr.sh | 13 +++++++++++++ + tests/run-backtrace-data.sh | 3 +++ + tests/run-backtrace-dwarf.sh | 3 +++ + tests/run-deleted.sh | 2 ++ + 4 files changed, 21 insertions(+) + +diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh +index 53c719d..8b58c50 100644 +--- a/tests/backtrace-subr.sh ++++ b/tests/backtrace-subr.sh +@@ -90,6 +90,18 @@ check_unsupported() + fi + } + ++check_cap_sys_ptrace() ++{ ++ # if we don't have cap_sys_ptrace, then skip ++ if capsh --print | grep '^Current: =\s*$'; then ++ # current is empty, look in bounding ++ capsh --print | grep '^Bounding set .*[=,]cap_sys_ptrace[,$]' || ( echo "requires cap_sys_ptrace" >&2 && exit 77 ) ++ else ++ # look in current ++ capsh --print | grep '^Current: =.*[ ,]cap_sys_ptrace[,$]' || ( echo "requires cap_sys_ptrace" >&2 && exit 77 ) ++ fi ++} ++ + check_native_unsupported() + { + err=$1 +@@ -129,6 +141,7 @@ check_native() + { + child=$1 + tempfiles $child.{bt,err} ++ check_cap_sys_ptrace # --backtrace-exec requires ptrace + (set +ex; testrun ${abs_builddir}/backtrace --backtrace-exec=${abs_builddir}/$child 1>$child.bt 2>$child.err; true) + cat $child.{bt,err} + check_native_unsupported $child.err $child +diff --git a/tests/run-backtrace-data.sh b/tests/run-backtrace-data.sh +index f67a43e..501ebf7 100755 +--- a/tests/run-backtrace-data.sh ++++ b/tests/run-backtrace-data.sh +@@ -21,6 +21,9 @@ + # its own maps and registers and will find valgrinds instead. + unset VALGRIND_CMD + ++# this test also requires ptrace ++check_cap_sys_ptrace ++ + tempfiles data.{bt,err} + (set +ex; + testrun ${abs_builddir}/backtrace-data 1>data.bt 2>data.err; +diff --git a/tests/run-backtrace-dwarf.sh b/tests/run-backtrace-dwarf.sh +index 7ed795d..fe97231 100755 +--- a/tests/run-backtrace-dwarf.sh ++++ b/tests/run-backtrace-dwarf.sh +@@ -23,6 +23,9 @@ + # will warn and complain about various opcodes it doesn't understand... + unset VALGRIND_CMD + ++# test also requires ptrace ++check_cap_sys_ptrace ++ + tempfiles dwarf.{bt,err} + (set +ex; testrun ${abs_builddir}/backtrace-dwarf 1>dwarf.bt 2>dwarf.err; true) + cat dwarf.{bt,err} +diff --git a/tests/run-deleted.sh b/tests/run-deleted.sh +index a1ec1ec..a5e30ef 100755 +--- a/tests/run-deleted.sh ++++ b/tests/run-deleted.sh +@@ -17,6 +17,8 @@ + + . $srcdir/backtrace-subr.sh + ++check_cap_sys_ptrace ++ + tempfiles deleted deleted-lib.so + cp -p ${abs_builddir}/deleted ${abs_builddir}/deleted-lib.so . + +-- +2.35.1 +
linux_64 - - variant + + variant
linux_aarch64 - - variant + + variant
linux_ppc64le - - variant + + variant