Skip to content

Commit

Permalink
Fix source extract issues in CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
swnf committed Nov 12, 2024
1 parent cb69780 commit d076280
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pyodide_build/buildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import shutil
import subprocess
import sys
import warnings
from collections.abc import Iterator
from datetime import datetime
from pathlib import Path
Expand Down Expand Up @@ -349,12 +348,18 @@ def _download_and_extract(self) -> None:
shutil.copy(tarballpath, self.src_dist_dir)
return

with warnings.catch_warnings():
# Python 3.12-3.13 emits a DeprecationWarning when using shutil.unpack_archive without a filter,
# but filter doesn't work well for zip files, so we suppress the warning until we find a better solution.
# https://github.com/python/cpython/issues/112760
warnings.simplefilter("ignore")
shutil.unpack_archive(tarballpath, self.build_dir)
# Use a Python 3.14-like filter (see https://github.com/python/cpython/issues/112760)
# Can be removed once we use Python 3.14
# The "data" filter will reset ownership but preserve permissions and modification times
# Without it, permissions and modification times will be silently skipped if the uid/git
# is too large for the chown() call. This behavior can lead to "Permission denied" errors
# (missing x bit) or random strange `make` behavior (due to wrong mtime order) in the CI
# pipeline.
shutil.unpack_archive(
tarballpath,
self.build_dir,
filter=None if tarballpath.suffix == ".zip" else "data",
)

extract_dir_name = self.source_metadata.extract_dir
if extract_dir_name is None:
Expand Down

0 comments on commit d076280

Please sign in to comment.