Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tar extract filters #3857

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions reference/conanfile/methods/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions reference/tools/files/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions reference/tools/files/downloads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
--------------------------------

Expand Down