Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
720d53e
Start of version specifier support.
jsirois Jun 25, 2025
6592ef1
Add eq / ne and wildcard support.
jsirois Jun 25, 2025
df5da81
Fix fmt 100 cols.
jsirois Jun 26, 2025
295534f
Mostly correct specifier parsing.
jsirois Jun 27, 2025
d0c4ef4
Simplify a bit.
jsirois Jun 27, 2025
23f75fb
Add major,minor,patch accessors.
jsirois Jun 28, 2025
d25f3e7
Detect more bad versions and provide fmt.
jsirois Jun 28, 2025
e95177b
Add InterpreterConstraints which uses Specifier.
jsirois Jun 29, 2025
1c16f22
Better test output.
jsirois Jun 29, 2025
86dfcc6
Skip PyPy tests for Windows ARM.
jsirois Jun 29, 2025
66e3885
Add a comment about Windows ARM / PyPy.
jsirois Jun 29, 2025
15a0032
Factor out Version and trim_ws.
jsirois Jun 29, 2025
5ba7948
Move Version tests to Version.zig.
jsirois Jun 29, 2025
d0359a9
Simplify Version fmt.
jsirois Jun 29, 2025
3d3dcb5
Better support ICs without alloc.
jsirois Jun 30, 2025
d277ad1
Respect ICs and PEX_PYTHON_PATH on boot.
jsirois Jun 30, 2025
eb490ee
Fix test for Windows ARM.
jsirois Jun 30, 2025
ab39e1e
Really fix for Windows ARM.
jsirois Jun 30, 2025
440f1b0
Re-use `string.trim_ascii_ws`.
jsirois Jul 1, 2025
5cef2b2
Fix fmt.
jsirois Jul 3, 2025
af0631c
Add the ability to iterate Python versions compatible with ICs.
jsirois Jul 3, 2025
d372387
Allow for requesting versions up to N years ahead.
jsirois Jul 3, 2025
21cd47c
Restructure interpreter.zig as Interpreter.zig.
jsirois Jul 3, 2025
06bd184
Add support for Python shlex.quote equivalent.
jsirois Jul 16, 2025
1eef597
Support PEX layout identification.
jsirois Jul 17, 2025
69f24ec
Attempt Windows ARM IC test fix.
jsirois Jul 17, 2025
616e261
Another attempt at Windows ARM IC test fix.
jsirois Jul 17, 2025
82dece0
Yet another attempt at Windows ARM IC test fix.
jsirois Jul 17, 2025
e13c54f
Fix layout identification for Windows.
jsirois Jul 17, 2025
927a4a3
Another attempt at Windows fix.
jsirois Jul 17, 2025
28771bd
Fix test.
jsirois Jul 17, 2025
914068d
Re-structure layout.isDir -> fs.isDir & os.getenv -> os.getEnv.
jsirois Jul 17, 2025
b19272a
Introduce specialized subprocess.check{Call,Output}.
jsirois Jul 17, 2025
3483fe9
Sort imports.
jsirois Jul 18, 2025
717edab
The --sh-boot script mainly filled out.
jsirois Jul 18, 2025
9b74e74
Less allocation.
jsirois Jul 18, 2025
9095806
Optimal allocation.
jsirois Jul 18, 2025
2c4aa25
Fix --sh-boot backslash escapes.
jsirois Jul 18, 2025
f3e9c43
Fix pexcz memory handling.
jsirois Jul 18, 2025
1990149
Add notes explaining maxMinor calc.
jsirois Jul 18, 2025
b7ee4a3
Fixup default CZEX_ROOT to respect OS.
jsirois Jul 18, 2025
ef20df9
Get `--sh-boot` CZEXes minimally working.
jsirois Jul 19, 2025
4bfdca3
Add `Tag.eql`.
jsirois Jul 19, 2025
ae9b965
Test a parse of no constraints.
jsirois Jul 19, 2025
f99e764
Honor PEX_PYTHON and encapsulate PEX_PYTHON_PATH.
jsirois Jul 20, 2025
733fffe
Fix for Windows.
jsirois Jul 20, 2025
3d9e8ab
Allocate less.
jsirois Jul 20, 2025
9089e0a
Bump max test output.
jsirois Jul 20, 2025
c4fff46
Add a zls-friendly check build step.
jsirois Jul 28, 2025
31d1642
Start mixing in pexcz ICs to sh-boot names.
jsirois Jul 28, 2025
217099b
Fix debug mode leak detection for pexcz binary.
jsirois Jul 28, 2025
37b93cd
Address pexcz ICs for `--sh-boot`.
jsirois Jul 29, 2025
c3e0545
Fix build partially for 0.15.1.
jsirois Aug 22, 2025
10a6674
Fix fmt.
jsirois Aug 22, 2025
7548cbb
Fix project commands to hande Python PI.
jsirois Sep 8, 2025
6a63546
More build fixes anticipating 0.15.1.
jsirois Sep 8, 2025
25413e3
Clean up link libc style in build.
jsirois Sep 8, 2025
60daa97
Add a note about riscv64 situation.
jsirois Sep 9, 2025
1ce7be8
Add riscv64 support.
jsirois Sep 9, 2025
3baa0c9
Fix alpha + comments.
jsirois Sep 9, 2025
5428489
More alpha + comment fixes.
jsirois Sep 9, 2025
2c317c4
Add preliminary Linux musl support.
jsirois Sep 9, 2025
f81f7f6
Kill commented code.
jsirois Sep 9, 2025
fbb4dcd
Restore `-Dtargets=All` build.
jsirois Sep 9, 2025
8311678
Basic `--sh-boot` working at marginal perf win.
jsirois Sep 19, 2025
ec7bd92
Fix `--sh-boot` current interp test.
jsirois Sep 19, 2025
395cd17
Switch to self hosted intel Mac.
jsirois Sep 19, 2025
a72a6b9
Prepare a release.
jsirois Sep 19, 2025
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
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- os: ubuntu-24.04-arm
python-version: '3.13'

- os: macos-13
- os: macos-x86_64
python-version: '3.13'
- os: macos-15
python-version: '3.13'
Expand All @@ -91,9 +91,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Configure Python
if: matrix.os == 'windows-11-arm'
run: echo "UV_NO_MANAGED_PYTHON=1" >> "${GITHUB_ENV}"
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6
with:
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 0.0.3

Support `--sh-boot` PEXes and more targets.

## 0.0.2

Support PEXes with user sources.
Expand Down
221 changes: 175 additions & 46 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,23 +1,102 @@
const std = @import("std");

// TODO: XXX: Uncomment musl variants. There are currently issues building libzip / zstd / zlib.
// Linux targets:
const linux_aarch64_gnu: std.Target.Query = .{
.cpu_arch = .aarch64,
.os_tag = .linux,
.abi = .gnu,
};
const linux_aarch64_musl: std.Target.Query = .{
.cpu_arch = .aarch64,
.os_tag = .linux,
.abi = .musl,
};
const linux_arm32hf: std.Target.Query = .{
.cpu_arch = .arm,
.os_tag = .linux,
.abi = .gnueabihf,
};
const linux_ppc64le: std.Target.Query = .{
.cpu_arch = .powerpc64le,
.os_tag = .linux,
.abi = .gnu,
};
const linux_riscv64: std.Target.Query = .{
.cpu_arch = .riscv64,
.os_tag = .linux,
.abi = .gnu,
};
const linux_s390x: std.Target.Query = .{
.cpu_arch = .s390x,
.os_tag = .linux,
.abi = .gnu,
};
const linux_x86_64_gnu: std.Target.Query = .{
.cpu_arch = .x86_64,
.os_tag = .linux,
.abi = .gnu,
};
const linux_x86_64_musl: std.Target.Query = .{
.cpu_arch = .x86_64,
.os_tag = .linux,
.abi = .musl,
};

// Macos targets:
const macos_aarch64: std.Target.Query = .{
.cpu_arch = .aarch64,
.os_tag = .macos,
};
const macos_x86_64: std.Target.Query = .{
.cpu_arch = .x86_64,
.os_tag = .macos,
};

// Windows targets:
const windows_aarch64: std.Target.Query = .{
.cpu_arch = .aarch64,
.os_tag = .windows,
};
const windows_x86_64: std.Target.Query = .{
.cpu_arch = .x86_64,
.os_tag = .windows,
};

const supported_targets: []const std.Target.Query = &.{
// Linux targets:
.{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .gnu },
// .{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .musl },
.{ .cpu_arch = .s390x, .os_tag = .linux, .abi = .gnu },
.{ .cpu_arch = .arm, .os_tag = .linux, .abi = .gnueabihf },
.{ .cpu_arch = .powerpc64le, .os_tag = .linux, .abi = .gnu },
.{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .gnu },
// .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl },
// Macos targets:
.{ .cpu_arch = .aarch64, .os_tag = .macos },
.{ .cpu_arch = .x86_64, .os_tag = .macos },
// Windows targets:
.{ .cpu_arch = .aarch64, .os_tag = .windows },
.{ .cpu_arch = .x86_64, .os_tag = .windows },
linux_aarch64_gnu,
linux_aarch64_musl,
linux_arm32hf,
linux_ppc64le,
linux_riscv64,
linux_s390x,
linux_x86_64_gnu,
linux_x86_64_musl,
macos_aarch64,
macos_x86_64,
windows_aarch64,
windows_x86_64,
};

fn build_exe(
b: *std.Build,
target: std.Build.ResolvedTarget,
optimize: std.builtin.OptimizeMode,
lib: *std.Build.Module,
config: *std.Build.Module,
) *std.Build.Step.Compile {
const exe = b.addExecutable(.{
.name = "pexcz",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
}),
});
exe.root_module.addImport("pexcz", lib);
exe.root_module.addImport("config", config);
return exe;
}

pub fn build(b: *std.Build) !void {
const benches = b.option(bool, "benches", "Build benchmarking executables.") orelse false;

Expand All @@ -43,14 +122,18 @@ pub fn build(b: *std.Build) !void {

const tool = b.addExecutable(.{
.name = "fetch_virtualenv",
.root_source_file = b.path("tools/fetch_virtualenv.zig"),
.target = b.graph.host,
.root_module = b.createModule(.{
.root_source_file = b.path("tools/fetch_virtualenv.zig"),
.target = b.graph.host,
.optimize = optimize,
}),
});
const tool_step = b.addRunArtifact(tool);
// TODO(John Sirois): Plumb --sha arg from a build option.
const virtualenv_py_resource = tool_step.addOutputFileArg("virtualenv.py");

const known_folders = b.dependency("known_folders", .{}).module("known-folders");
const zeit = b.dependency("zeit", .{}).module("zeit");

var target_dirs = try std.ArrayList([]const u8).initCapacity(b.allocator, target_queries.len);
defer target_dirs.deinit();
Expand Down Expand Up @@ -79,11 +162,13 @@ pub fn build(b: *std.Build) !void {
});
lib.addAnonymousImport("virtualenv.py", .{ .root_source_file = virtualenv_py_resource });
lib.addImport("known-folders", known_folders);
lib.addImport("zeit", zeit);
lib.linkLibrary(libzip_dep);

const clib = b.addSharedLibrary(.{
const clib = b.addLibrary(.{
.name = "pexcz",
.root_module = b.addModule("pexcz", .{
.linkage = .dynamic,
.root_module = b.createModule(.{
.root_source_file = b.path("src/clib.zig"),
.target = rt,
.optimize = optimize,
Expand All @@ -105,16 +190,7 @@ pub fn build(b: *std.Build) !void {
clib_output.dest_sub_path = b.pathJoin(&.{ target_dir, clib_output.dest_sub_path });
b.getInstallStep().dependOn(&clib_output.step);

const exe = b.addExecutable(.{
.name = "pexcz",
.root_module = b.addModule("pexcz", .{
.root_source_file = b.path("src/main.zig"),
.target = rt,
.optimize = optimize,
}),
});
exe.root_module.addImport("pexcz", lib);
exe.root_module.addImport("config", config);
const exe = build_exe(b, rt, optimize, lib, config);
exe.step.dependOn(&update_source_files.step);
var exe_output = b.addInstallArtifact(exe, .{});
exe_output.dest_sub_path = b.pathJoin(&.{ target_dir, exe_output.dest_sub_path });
Expand All @@ -133,17 +209,21 @@ pub fn build(b: *std.Build) !void {
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);

const exe_check = build_exe(b, rt, optimize, lib, config);
const check = b.step("check", "Check if pexcz compiles (used by zls).");
check.dependOn(&exe_check.step);

if (benches) {
const zip_exe = b.addExecutable(.{
.name = "zipopen",
.root_module = b.addModule("zipopen", .{
.root_module = b.createModule(.{
.root_source_file = b.path("bench/zipopen.zig"),
.target = rt,
.optimize = optimize,
.link_libc = true,
}),
});
zip_exe.root_module.addImport("pexcz", lib);
zip_exe.linkLibC();
const zip_exe_output = b.addInstallArtifact(zip_exe, .{});
zip_exe_output.dest_sub_path = b.pathJoin(&.{ target_dir, zip_exe_output.dest_sub_path });
b.getInstallStep().dependOn(&zip_exe_output.step);
Expand All @@ -159,25 +239,30 @@ pub fn build(b: *std.Build) !void {
"For named tests, only run those with names matching the filter.",
) orelse &.{};
const lib_unit_tests = b.addTest(.{
.root_source_file = b.path("src/lib.zig"),
.target = cur_tgt,
.optimize = optimize,
.filters = test_filters,
.root_module = b.createModule(.{
.root_source_file = b.path("src/lib.zig"),
.target = cur_tgt,
.optimize = optimize,
}),
});
lib_unit_tests.root_module.addAnonymousImport(
"virtualenv.py",
.{ .root_source_file = virtualenv_py_resource },
);
lib_unit_tests.root_module.addImport("known-folders", known_folders);
lib_unit_tests.root_module.addImport("zeit", zeit);
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);

const exe_test_options = b.addOptions();
exe_test_options.addOptionPath("pexcz_exe", pexcz_emitted_bin.?);
const exe_unit_tests = b.addTest(.{
.root_source_file = b.path("src/main.zig"),
.target = cur_tgt,
.optimize = optimize,
.filters = test_filters,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = cur_tgt,
.optimize = optimize,
}),
});
exe_unit_tests.root_module.addImport("options", exe_test_options.createModule());
const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests);
Expand Down Expand Up @@ -232,10 +317,15 @@ fn build_libzip(
.ZIP_UINT64_T = "uint64_t",
},
);
const lib = b.addStaticLibrary(.{
const lib = b.addLibrary(.{
.name = "zip",
.target = target,
.optimize = optimize,
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.pic = true,
}),
});
const zip_lib_dir = upstream.path("lib");
const flags: []const []const u8 = res: {
Expand Down Expand Up @@ -401,24 +491,63 @@ fn build_libzip(
lib.addConfigHeader(config);
lib.addConfigHeader(zip_config);

const zlib_dep = b.dependency("zlib", .{
.target = target,
.optimize = optimize,
const zlib_dep = b.dependency("zlib", .{});
const zlib = b.addLibrary(.{
.name = "z",
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.pic = true,
}),
});
lib.linkLibrary(zlib_dep.artifact("z"));
zlib.addCSourceFiles(.{
.root = zlib_dep.path(""),
.files = &.{
"adler32.c",
"crc32.c",
"deflate.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"zutil.c",
"compress.c",
"uncompr.c",
"gzclose.c",
"gzlib.c",
"gzread.c",
"gzwrite.c",
},
.flags = &.{
"-DHAVE_SYS_TYPES_H",
"-DHAVE_STDINT_H",
"-DHAVE_STDDEF_H",
"-DZ_HAVE_UNISTD_H",
},
});
zlib.installHeadersDirectory(zlib_dep.path(""), "", .{
.include_extensions = &.{
"zconf.h",
"zlib.h",
},
});
lib.linkLibrary(zlib);

const zstd_dependency = b.dependency("zstd", .{
.target = target,
.optimize = optimize,
.linkage = .static,
.pie = true,
.minify = true,
.dictbuilder = false,
.@"exclude-compressors-dfast-and-up" = true,
.@"exclude-compressors-greedy-and-up" = true,
});
lib.linkLibrary(zstd_dependency.artifact("zstd"));

lib.linkLibC();

const tool = b.addExecutable(.{
.name = "generate_zip_error_strings",
.root_module = b.createModule(.{
Expand Down
10 changes: 7 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// See: https://github.com/ziglang/zig/blob/master/doc/build.zig.zon.md
.{
.name = .pexcz,
.version = "0.0.2",
.version = "0.0.3",
.fingerprint = 0x97ea894d71a986ac,

.minimum_zig_version = "0.14.1",
Expand All @@ -16,13 +16,17 @@
.hash = "N-V-__8AAGRUYABUylxlPgK8vgvvxVLufaQalXyPsIKYJRMw",
},
.zlib = .{
.url = "git+https://github.com/allyourcodebase/zlib#6c72830882690c1eb2567a537525c3f432c1da50",
.hash = "zlib-1.3.1-ZZQ7lVgMAACwO4nUUd8GLhsuQ5JQq_VAhlEiENJTUv6h",
.url = "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz",
.hash = "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o",
},
.zstd = .{
.url = "git+https://github.com/allyourcodebase/zstd#01327d49cbc56dc24c20a167bb0055d7fc23de84",
.hash = "zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0",
},
.zeit = .{
.url = "git+https://github.com/rockorager/zeit#991f38266f86535e68431675e8feb84efa1f011b",
.hash = "zeit-0.6.0-5I6bk0t7AgCPM_cY1DoqJB2pnmG7MMtpdO5IxNpryJDy",
},
},

.paths = .{
Expand Down
Loading