Skip to content

Commit 7204739

Browse files
committed
buildenv: change archive retrieval strategy
This is needed to preserve the prefix in the files, ugh.
1 parent 420934d commit 7204739

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

cpython-unix/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def build_cpython(
644644
dest_path = BUILD / basename
645645

646646
with dest_path.open("wb") as fh:
647-
fh.write(build_env.get_output_archive("python"))
647+
fh.write(build_env.get_output_archive())
648648

649649

650650
def main():

pythonbuild/buildenv.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ def get_tools_archive(self, dest, name):
7070
with open(dest, "wb") as fh:
7171
fh.write(data)
7272

73-
def get_output_archive(self, path, as_tar=False):
74-
data = container_get_archive(self.container, "/build/out/%s" % path)
73+
def get_output_archive(self, path=None, as_tar=False):
74+
p = "/build/out"
75+
if path:
76+
p += "/%s" % path
77+
78+
data = container_get_archive(self.container, p)
7579
data = io.BytesIO(data)
7680

7781
if as_tar:
@@ -151,9 +155,13 @@ def get_tools_archive(self, dest, name):
151155
with dest.open("wb") as fh:
152156
create_tar_from_directory(fh, self.td / "out" / "tools")
153157

154-
def get_output_archive(self, path, as_tar=False):
158+
def get_output_archive(self, path=None, as_tar=False):
159+
p = self.td / "out"
160+
if path:
161+
p = p / path
162+
155163
data = io.BytesIO()
156-
create_tar_from_directory(data, self.td / "out" / path)
164+
create_tar_from_directory(data, p)
157165

158166
data.seek(0)
159167

0 commit comments

Comments
 (0)