Skip to content

Commit

Permalink
Switch to downloading python as tar.xz archives
Browse files Browse the repository at this point in the history
This could significantly reduce download size for python interpreter
  • Loading branch information
katyukha committed Aug 6, 2023
1 parent 1afb7bd commit be3cfe4
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions subpackages/lib/source/odood/lib/venv.d
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const struct VirtualEnv {

// Define paths and links to download python
string python_download_link =
"https://www.python.org/ftp/python/%s/Python-%s.tgz".format(
"https://www.python.org/ftp/python/%s/Python-%s.tar.xz".format(
build_version, build_version);
auto python_download_path = tmp_dir.join(
"python-%s.tgz".format(build_version));
Expand Down Expand Up @@ -290,27 +290,19 @@ const struct VirtualEnv {
// Extract only if needed
info("Unpacking python...");
Process("tar")
.withArgs(["-xzf", python_download_path.toString])
.withArgs(["-xf", python_download_path.toString])
.inWorkDir(tmp_dir)
.execute()
.ensureStatus(true);
}

// Configure python build
info("Running python's configure script...");
auto configure_status = Process(python_build_dir.join("configure"))
Process(python_build_dir.join("configure"))
.withArgs(python_configure_opts)
.inWorkDir(python_build_dir)
.execute();

if (configure_status.isNotOk()) {
import std.stdio;
if (python_build_dir.join("config.status").exists) {
writeln("Config.status:");
python_build_dir.join("config.status").readFileText.writeln;
}
}
configure_status.ensureOk(true);
.execute()
.ensureOk(true);

// Build python itself
info("Building python...");
Expand Down

0 comments on commit be3cfe4

Please sign in to comment.