Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zig update 0.11.0-dev.86+b83e4d965 #72

Merged
merged 1 commit into from
Nov 11, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.10.0-dev.3027+0e26c6149
version: 0.11.0-dev.86+b83e4d965
- run: |
zig build test -Dfetch -Dci_target=${{matrix.os}}-${{matrix.arch}}
- run: |
Expand Down
4 changes: 2 additions & 2 deletions GitRepoStep.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Publish Date: 2022_05_05
//! Publish Date: 2022_09_09
//! This file is hosted at github.com/marler8997/zig-build-repos and is meant to be copied
//! to projects that use it.
const std = @import("std");
Expand Down Expand Up @@ -27,7 +27,7 @@ url: []const u8,
name: []const u8,
branch: ?[]const u8 = null,
sha: []const u8,
path: []const u8 = null,
path: []const u8,
sha_check: ShaCheck = .warn,
fetch_enabled: bool,

Expand Down
2 changes: 1 addition & 1 deletion build2.zig
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn addZigupExe(
const zarc_repo = GitRepoStep.create(b, .{
.url = "https://github.com/marler8997/zarc",
.branch = "protected",
.sha = "acd3f4b7fe1fbd2ac533f441f85a56bfaa489f49",
.sha = "8ed576df2c8f1bc0832b3b9a29f2bbd178656102",
});
exe.step.dependOn(&zarc_repo.step);
const zarc_repo_path = zarc_repo.getPath(&exe.step);
Expand Down
6 changes: 3 additions & 3 deletions test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ pub fn main() !u8 {
try std.fs.cwd().makeDir(install_dir);

// NOTE: for now we are incorrectly assuming the install dir is CWD/zig-out
const zigup = "." ++ sep ++ bin_dir ++ sep ++ "zigup" ++ builtin.target.exeFileExt();
const zigup = comptime "." ++ sep ++ bin_dir ++ sep ++ "zigup" ++ builtin.target.exeFileExt();
try std.fs.cwd().copyFile(
"zig-out" ++ sep ++ "bin" ++ sep ++ "zigup" ++ builtin.target.exeFileExt(),
comptime "zig-out" ++ sep ++ "bin" ++ sep ++ "zigup" ++ builtin.target.exeFileExt(),
std.fs.cwd(),
zigup,
.{},
Expand Down Expand Up @@ -191,7 +191,7 @@ pub fn main() !u8 {
defer allocator.free(scratch_bin2_path);

{
var file = try std.fs.cwd().createFile(bin2_dir ++ sep ++ "zig" ++ builtin.target.exeFileExt(), .{});
var file = try std.fs.cwd().createFile(comptime bin2_dir ++ sep ++ "zig" ++ builtin.target.exeFileExt(), .{});
defer file.close();
try file.writer().writeAll("a fake executable");
}
Expand Down
14 changes: 10 additions & 4 deletions win32exelink.zig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const builtin = @import("builtin");
const std = @import("std");

const log = std.log.scoped(.zigexelink);
Expand Down Expand Up @@ -93,10 +94,15 @@ const win32 = struct {
pub const CTRL_LOGOFF_EVENT = @as(u32, 5);
pub const CTRL_SHUTDOWN_EVENT = @as(u32, 6);
pub const GetLastError = std.os.windows.kernel32.GetLastError;
pub const PHANDLER_ROUTINE = fn(
CtrlType: u32,
) callconv(@import("std").os.windows.WINAPI) BOOL;
pub extern "KERNEL32" fn SetConsoleCtrlHandler(
pub const PHANDLER_ROUTINE = switch (builtin.zig_backend) {
.stage1 => fn(
CtrlType: u32,
) callconv(@import("std").os.windows.WINAPI) BOOL,
else => *const fn(
CtrlType: u32,
) callconv(@import("std").os.windows.WINAPI) BOOL,
};
pub extern "kernel32" fn SetConsoleCtrlHandler(
HandlerRoutine: ?PHANDLER_ROUTINE,
Add: BOOL,
) callconv(@import("std").os.windows.WINAPI) BOOL;
Expand Down
2 changes: 1 addition & 1 deletion zigetsha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
116486f06e82aa7de9895e9145a22b384e029e5f
f16d9d35076e18b2ad1150fbfc53e647ca675a8a
13 changes: 7 additions & 6 deletions zigup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn makeZigPathLinkString(allocator: Allocator) ![]const u8 {
const zigup_dir = try std.fs.selfExeDirPathAlloc(allocator);
defer allocator.free(zigup_dir);

return try std.fs.path.join(allocator, &[_][]const u8{ zigup_dir, "zig" ++ builtin.target.exeFileExt() });
return try std.fs.path.join(allocator, &[_][]const u8{ zigup_dir, comptime "zig" ++ builtin.target.exeFileExt() });
}

// TODO: this should be in standard lib
Expand Down Expand Up @@ -334,7 +334,7 @@ pub fn runCompiler(allocator: Allocator, args: []const []const u8) !u8 {
}

var argv = std.ArrayList([]const u8).init(allocator);
try argv.append(try std.fs.path.join(allocator, &.{ compiler_dir, "files", "zig" ++ builtin.target.exeFileExt() }));
try argv.append(try std.fs.path.join(allocator, &.{ compiler_dir, "files", comptime "zig" ++ builtin.target.exeFileExt() }));
try argv.appendSlice(args[1..]);

// TODO: use "execve" if on linux
Expand Down Expand Up @@ -658,13 +658,14 @@ fn setDefaultCompiler(allocator: Allocator, compiler_dir: []const u8, exist_veri
switch (exist_verify) {
.existence_verified => {},
.verify_existence => {
(std.fs.openDirAbsolute(compiler_dir, .{}) catch |err| switch (err) {
var dir = std.fs.openDirAbsolute(compiler_dir, .{}) catch |err| switch (err) {
error.FileNotFound => {
std.log.err("compiler '{s}' is not installed", .{std.fs.path.basename(compiler_dir)});
return error.AlreadyReported;
},
else => |e| return e,
}).close();
};
dir.close();
},
}

Expand All @@ -673,7 +674,7 @@ fn setDefaultCompiler(allocator: Allocator, compiler_dir: []const u8, exist_veri

try verifyPathLink(allocator, path_link);

const link_target = try std.fs.path.join(allocator, &[_][]const u8{ compiler_dir, "files", "zig" ++ builtin.target.exeFileExt() });
const link_target = try std.fs.path.join(allocator, &[_][]const u8{ compiler_dir, "files", comptime "zig" ++ builtin.target.exeFileExt() });
defer allocator.free(link_target);
if (builtin.os.tag == .windows) {
try createExeLink(link_target, path_link);
Expand Down Expand Up @@ -843,7 +844,7 @@ const win32 = struct {
nFileIndexHigh: u32,
nFileIndexLow: u32,
};
pub extern "KERNEL32" fn GetFileInformationByHandle(
pub extern "kernel32" fn GetFileInformationByHandle(
hFile: ?@import("std").os.windows.HANDLE,
lpFileInformation: ?*BY_HANDLE_FILE_INFORMATION,
) callconv(@import("std").os.windows.WINAPI) BOOL;
Expand Down