From f3143635c241fae894b22c38fc262ceacab67605 Mon Sep 17 00:00:00 2001 From: memsharded Date: Fri, 27 Sep 2024 13:38:55 +0200 Subject: [PATCH] tar extract filters --- reference/conanfile/methods/source.rst | 5 +++++ reference/tools/files/basic.rst | 9 +++++++++ reference/tools/files/downloads.rst | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/reference/conanfile/methods/source.rst b/reference/conanfile/methods/source.rst index 8da62d1aa929..d5e6e79199b3 100644 --- a/reference/conanfile/methods/source.rst +++ b/reference/conanfile/methods/source.rst @@ -43,6 +43,11 @@ A ``source()`` implementation might use the convenient ``get()`` helper, or use os.unlink(zip_name) +.. important:: + + Please read the note in :ref:`conan_tools_files_unzip` regarding Python 3.14 breaking changes and + the new tar archive extract filters. + Applying patches to downloaded sources can be done (and should be done) in the ``source()`` method if those patches apply to all possible configurations. As explained below, it is not possible to introduce conditionals in the diff --git a/reference/tools/files/basic.rst b/reference/tools/files/basic.rst index 1be78f58e882..6aca231dae8d 100644 --- a/reference/tools/files/basic.rst +++ b/reference/tools/files/basic.rst @@ -223,6 +223,15 @@ Use the ``pattern`` argument if you want to filter specific files and paths to d unzip(self, "bigfile.zip", pattern="*.txt") +.. important:: + + In Conan 2.8 ``unzip()`` provides a new ``extract_filter=None`` argument and a new + ``tools.files.unzip:filter`` configuration was added to prepare for future Python 3.14 + breaking changes, in which the ``data`` filter for extracting tar archives will be made the default. + The recommendation is to start using the ``data`` filter as soon as possible (the conf can be + defined in ``global.conf``, or it can be explicitly added as argument in recipes ``unzip()`` and ``get()`` + helpers) as that is the current security recommendation while downloading sources from the internet. + .. currentmodule:: conan.tools.files.files diff --git a/reference/tools/files/downloads.rst b/reference/tools/files/downloads.rst index 4b6252e4a35e..cbb1c2778f8b 100644 --- a/reference/tools/files/downloads.rst +++ b/reference/tools/files/downloads.rst @@ -11,6 +11,13 @@ conan.tools.files.get() .. autofunction:: get +.. important:: + + ``get()`` calls internally ``unzip()``. + Please read the note in :ref:`conan_tools_files_unzip` regarding Python 3.14 breaking changes and + the new tar archive extract filters. + + conan.tools.files.ftp_download() --------------------------------