From 9e094817ca9856da6157f82da7b3842c4f223747 Mon Sep 17 00:00:00 2001 From: Felix Kuehnl Date: Tue, 11 Oct 2022 12:25:23 +0200 Subject: [PATCH 1/4] Added `.xs` to the list of extensions that trigger the addition of a C compiler app for Perl recipes created by conda skeleton. --- conda_build/skeletons/cpan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_build/skeletons/cpan.py b/conda_build/skeletons/cpan.py index 94a1efa5c7..090d298644 100644 --- a/conda_build/skeletons/cpan.py +++ b/conda_build/skeletons/cpan.py @@ -205,7 +205,7 @@ def get_build_dependencies_from_src_archive(package_url, sha256, src_cache): need_f = any([f.name.lower().endswith(('.f', '.f90', '.f77', '.f95', '.f03')) for f in tf]) # Fortran builds use CC to perform the link (they do not call the linker directly). need_c = True if need_f else \ - any([f.name.lower().endswith('.c') for f in tf]) + any([f.name.lower().endswith(('.c', '.xs')) for f in tf]) need_cxx = any([f.name.lower().endswith(('.cxx', '.cpp', '.cc', '.c++')) for f in tf]) need_autotools = any([f.name.lower().endswith('/configure') for f in tf]) From ea74523942deb03da9b5294999d1c600d6051983 Mon Sep 17 00:00:00 2001 From: Felix Kuehnl Date: Tue, 11 Oct 2022 13:11:12 +0200 Subject: [PATCH 2/4] Added news item for this PR --- news/4599-add-cpan-xs-detection | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 news/4599-add-cpan-xs-detection diff --git a/news/4599-add-cpan-xs-detection b/news/4599-add-cpan-xs-detection new file mode 100644 index 0000000000..c0938e4785 --- /dev/null +++ b/news/4599-add-cpan-xs-detection @@ -0,0 +1,19 @@ +### Enhancements + +* + +### Bug fixes + +* conda skeleton cpan now correctly adds a C compiler as dependency if the distribution contains an `.xs` file + +### Deprecations + +* + +### Docs + +* + +### Other + +* From 531ace752005ad4c8ff7ed7a5b432d01c80fa057 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Thu, 15 Dec 2022 20:37:45 +0100 Subject: [PATCH 3/4] test: Add CPAN skeleton test for XS --- tests/test_api_skeleton_cpan.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test_api_skeleton_cpan.py diff --git a/tests/test_api_skeleton_cpan.py b/tests/test_api_skeleton_cpan.py new file mode 100644 index 0000000000..fa53452b37 --- /dev/null +++ b/tests/test_api_skeleton_cpan.py @@ -0,0 +1,23 @@ +# Copyright (C) Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +''' +Integrative tests of the CPAN skeleton that start from +conda_build.api.skeletonize and check the output files +''' + + +import pytest + +from conda_build import api +from conda_build.jinja_context import compiler + + +@pytest.mark.slow +@pytest.mark.flaky(rerun=5, reruns_delay=2) +def test_xs_needs_c_compiler(testing_config): + """Perl packages with XS files need a C compiler""" + # This uses Sub::Identify=0.14 since it includes no .c files but a .xs file. + api.skeletonize("Sub::Identify", version="0.14", repo="cpan", config=testing_config) + m = api.render("perl-sub-identify/0.14", finalize=False, bypass_env_check=True)[0][0] + build_requirements = m.get_value("requirements/build") + assert compiler("c", testing_config) in build_requirements From 6a810eb6166199c04e1886e2e3dc3765c4127b62 Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Thu, 15 Dec 2022 20:51:17 +0100 Subject: [PATCH 4/4] Make linter happy Although 2014 doesn't make sense, really... --- tests/test_api_skeleton_cpan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_api_skeleton_cpan.py b/tests/test_api_skeleton_cpan.py index fa53452b37..815cb43522 100644 --- a/tests/test_api_skeleton_cpan.py +++ b/tests/test_api_skeleton_cpan.py @@ -1,4 +1,4 @@ -# Copyright (C) Anaconda, Inc +# Copyright (C) 2014 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause ''' Integrative tests of the CPAN skeleton that start from