Skip to content

Cannot unzip tar files when using Python 3.14 #303

@Kadva7

Description

@Kadva7

While I was trying to compile the graal compiler using the instructions provided in its README I kept getting the same error:

tarfile.AbsoluteLinkError: 'musl-toolchain/x86_64-linux-musl/lib/ld-musl-x86_64.so.1' is a link to an absolute path

After a bit of investigating/searching for answers I pondered upon the tarfile documentation for Python 3.14 where I saw a change/new default for Python 3.14:

Changed in version 3.14: Set the default extraction filter to data, which disallows some dangerous features such as links to absolute paths or paths outside of the destination. Previously, the filter strategy was equivalent to fully_trusted.

Using this new information I tried once again with a lower Python version (Python 3.11) and it seems to have worked - the musl tar file extracted without any problems.

Steps to reproduce

(Delete cache of extracted musl tar file if it exists, on Linux in ~/.mx/cache/)
Clone graal compiler repository (by cloning the graal repo and going intocompiler/ )
Follow the steps
During the step to build (using mx build) observe tarfile extraction failure

Expected behaviour

While compiling graal compiler it extraction of tar files succeeds without any errors.

Observed

While trying to extract musl gcc toolchain it fails with tarfile.AbsoluteLinkError: 'musl-toolchain/x86_64-linux-musl/lib/ld-musl-x86_64.so.1'

Debug info

Platform: Linux (EndeavourOS) x86_64
Kernel version: 7.0.10-zen1-1-zen
Python version affected: Python 3.14

Included two files, stack trace from Python error and mxbuild logs (using --build-logs=full option).

Python stack-trace:

python-stack-trace.txt

mxbuild logs:

buildlog-20260526-231432.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions