Skip to content
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
18 changes: 13 additions & 5 deletions xbstrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import shutil
import stat
import subprocess
import sys
import tarfile
import tempfile
import urllib.request
Expand Down Expand Up @@ -3191,7 +3192,14 @@ def pull_archive(cfg, subject):
os.mkdir(subject.prefix_dir)
with tarfile.open(subject.archive_file, "r:gz") as tar:
for info in tar:
tar.extract(info, subject.prefix_dir)
if sys.version_info >= (3, 12):
# Maybe should have a more aggressive filter, but we have
# legitimate "evil-looking" tool tars (specifically, GCC
# tarballs link to the binutils directory, which is outside
# of the root)
tar.extract(info, subject.prefix_dir, filter="fully_trusted")
else:
tar.extract(info, subject.prefix_dir)
else:
# TODO: Also support packages here.
raise GenericError("Unexpected subject for pull-archive")
Expand Down Expand Up @@ -3569,7 +3577,7 @@ def add_source_dependencies(s):

def add_tool_dependencies(s):
for subject_id in s.tool_stage_dependencies:
(tool_name, stage_name) = (subject_id.name, subject_id.stage)
tool_name, stage_name = (subject_id.name, subject_id.stage)
dep_tool = self._cfg.get_tool_pkg(tool_name)
if self.build_scope is not None and dep_tool not in self.build_scope:
if self.pull_out_of_scope:
Expand Down Expand Up @@ -3984,7 +3992,7 @@ def run_plan(self):
else:
_util.log_info("Nothing to do")
for item in printed:
(action, subject) = (item.action, item.subject)
action, subject = (item.action, item.subject)
if self.explain:
symbol = f"#{numbering[item]}"
eprint(f"{symbol:>5} ", end="")
Expand Down Expand Up @@ -4053,7 +4061,7 @@ def run_plan(self):

any_failed_items = False
for n, item in enumerate(scheduled):
(action, subject) = (item.action, item.subject)
action, subject = (item.action, item.subject)

# Check if any prerequisites failed; this can generally only happen with --keep-going.
any_failed_edges = False
Expand Down Expand Up @@ -4190,7 +4198,7 @@ def emit_progress(status):
if any_failed_items:
_util.log_info("The following steps failed:")
for item in scheduled:
(action, subject) = (item.action, item.subject)
action, subject = (item.action, item.subject)
assert item.exec_status != ExecutionStatus.NULL
if item.exec_status == ExecutionStatus.SUCCESS:
continue
Expand Down
4 changes: 2 additions & 2 deletions xbstrap/pipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def do_compute_graph(args):
}
)
for key in plan.materialized_steps():
(action, subject) = (key.action, key.subject)
action, subject = (key.action, key.subject)
if action == xbstrap.base.Action.WANT_TOOL:
if subject in job.tools:
continue
Expand Down Expand Up @@ -265,7 +265,7 @@ def do_compute_graph(args):
plan.compute_plan(no_ordering=True)

for key in plan.materialized_steps():
(action, subject) = (key.action, key.subject)
action, subject = (key.action, key.subject)
if action == xbstrap.base.Action.WANT_TOOL:
if subject in item.job.tools:
continue
Expand Down
4 changes: 2 additions & 2 deletions xbstrap/vcs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def get_local_commit(ref):
except subprocess.CalledProcessError:
return None
assert len(out) == 1
(commit, outref) = out[0].split(" ")
commit, outref = out[0].split(" ")
return commit

def get_remote_commit(ref):
Expand All @@ -131,7 +131,7 @@ def get_remote_commit(ref):
except subprocess.CalledProcessError:
return None
assert len(out) == 1
(commit, outref) = out[0].split("\t")
commit, outref = out[0].split("\t")
return commit

known_commit = None
Expand Down