From d405f439c1d0e6d3713539376d3d03a9fa318dd7 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Mon, 24 Jun 2024 15:25:40 -0700 Subject: [PATCH] Move `ulimit` workaround into `yum` reqs func --- conda_smithy/configure_feedstock.py | 10 +++++++++- conda_smithy/templates/build_steps.sh.tmpl | 9 +-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/conda_smithy/configure_feedstock.py b/conda_smithy/configure_feedstock.py index 34a307faf..164b05e0e 100644 --- a/conda_smithy/configure_feedstock.py +++ b/conda_smithy/configure_feedstock.py @@ -1357,12 +1357,20 @@ def generate_yum_requirements(forge_config, forge_dir): yum_build_setup = textwrap.dedent( """\ + ( + # Due to https://bugzilla.redhat.com/show_bug.cgi?id=1537564 old + # versions of rpm are drastically slowed down when the number of + # file descriptors is very high. This can be visible during a + # `yum install` step of a feedstock build. + # => Set a lower limit in a subshell for the `yum install`s only. + ulimit -n 1024 + # Install the yum requirements defined canonically in the # "recipe/yum_requirements.txt" file. After updating that file, # run "conda smithy rerender" and this line will be updated # automatically. /usr/bin/sudo -n yum install -y {} - + ) """.format( " ".join(requirements) diff --git a/conda_smithy/templates/build_steps.sh.tmpl b/conda_smithy/templates/build_steps.sh.tmpl index dff8d82ec..93fb76eef 100644 --- a/conda_smithy/templates/build_steps.sh.tmpl +++ b/conda_smithy/templates/build_steps.sh.tmpl @@ -62,14 +62,7 @@ setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" {% if build_setup -%} {{ build_setup }}{% endif -%} {% if yum_build_setup is defined -%} -( -# Due to https://bugzilla.redhat.com/show_bug.cgi?id=1537564 old versions of rpm -# are drastically slowed down when the number of file descriptors is very high. -# This can be visible during a `yum install` step of a feedstock build. -# => Set a lower limit in a subshell for the `yum install`s only. -ulimit -n 1024 -{{ yum_build_setup }} -){% endif -%} +{{ yum_build_setup }}{% endif -%} # make the build number clobber make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"