Merge pull request #1556 from der-teufel-programming/fix-build+utf8

Fix build+utf8
This commit is contained in:
Mitchell Hashimoto
2024-02-27 11:33:00 -08:00
committed by GitHub
14 changed files with 22 additions and 22 deletions

View File

@ -24,7 +24,7 @@ const Command = @import("src/Command.zig");
// but we liberally update it. In the future, we'll be more careful about // but we liberally update it. In the future, we'll be more careful about
// using released versions so that package managers can integrate better. // using released versions so that package managers can integrate better.
comptime { comptime {
const required_zig = "0.12.0-dev.2818+97290e0bf"; const required_zig = "0.12.0-dev.3033+031f23117";
const current_zig = builtin.zig_version; const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable; const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable;
if (current_zig.order(min_zig) == .lt) { if (current_zig.order(min_zig) == .lt) {

12
flake.lock generated
View File

@ -147,11 +147,11 @@
}, },
"nixpkgs-zig-0-12": { "nixpkgs-zig-0-12": {
"locked": { "locked": {
"lastModified": 1708536163, "lastModified": 1709060268,
"narHash": "sha256-UdGZLYXoIJRal/J/uYlMqPi27LE92wdsIHtDOWRVXhM=", "narHash": "sha256-IGt0MDqdojBXdE97ORxL2Pk5x4GHFEOc3G7tjsMXLfU=",
"owner": "vancluever", "owner": "vancluever",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "aba18e2126357afc8a997c12dcf027517b7432b0", "rev": "c7dc015475bd4ac5de01a04680aa08777879add1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -194,11 +194,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1708776432, "lastModified": 1709035693,
"narHash": "sha256-BgVtWuK4v0J0z+8wj2ww0T7M85NrknimOFDVp7Yx7XU=", "narHash": "sha256-ac5fR8n4RPjP5GHhFMdtUhdL6e/eFCxIOO+7UoP1B/g=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "14ec3b93067932906652567e01bfc171f72c750e", "rev": "e1c418c2315adaeca6f27fd8919141eb7992866d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -157,7 +157,7 @@ pub fn build(b: *std.Build) !void {
} }
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.files = srcs, .files = srcs,
.flags = flags.items, .flags = flags.items,
}); });

View File

@ -46,7 +46,7 @@ pub fn build(b: *std.Build) !void {
if (libpng_enabled) try flags.append("-DFT_CONFIG_OPTION_USE_PNG=1"); if (libpng_enabled) try flags.append("-DFT_CONFIG_OPTION_USE_PNG=1");
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.files = srcs, .files = srcs,
.flags = flags.items, .flags = flags.items,
}); });

View File

@ -66,7 +66,7 @@ fn buildGlslang(
}); });
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.flags = flags.items, .flags = flags.items,
.files = &.{ .files = &.{
// GenericCodeGen // GenericCodeGen
@ -125,7 +125,7 @@ fn buildGlslang(
if (target.result.os.tag != .windows) { if (target.result.os.tag != .windows) {
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.flags = flags.items, .flags = flags.items,
.files = &.{ .files = &.{
"glslang/OSDependent/Unix/ossource.cpp", "glslang/OSDependent/Unix/ossource.cpp",
@ -133,7 +133,7 @@ fn buildGlslang(
}); });
} else { } else {
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.flags = flags.items, .flags = flags.items,
.files = &.{ .files = &.{
"glslang/OSDependent/Windows/ossource.cpp", "glslang/OSDependent/Windows/ossource.cpp",

View File

@ -73,7 +73,7 @@ pub fn build(b: *std.Build) !void {
lib.addCSourceFiles(.{ .flags = flags.items, .files = &.{"bridge.cpp"} }); lib.addCSourceFiles(.{ .flags = flags.items, .files = &.{"bridge.cpp"} });
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.flags = flags.items, .flags = flags.items,
.files = &.{ .files = &.{
"hwy/aligned_allocator.cc", "hwy/aligned_allocator.cc",

View File

@ -35,7 +35,7 @@ pub fn build(b: *std.Build) !void {
}); });
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.files = srcs, .files = srcs,
.flags = flags.items, .flags = flags.items,
}); });

View File

@ -95,7 +95,7 @@ pub fn build(b: *std.Build) !void {
} }
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.files = srcs, .files = srcs,
.flags = flags.items, .flags = flags.items,
}); });

View File

@ -71,7 +71,7 @@ fn buildOniguruma(
defer flags.deinit(); defer flags.deinit();
try flags.appendSlice(&.{}); try flags.appendSlice(&.{});
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.flags = flags.items, .flags = flags.items,
.files = &.{ .files = &.{
"src/regerror.c", "src/regerror.c",

View File

@ -57,7 +57,7 @@ pub fn build(b: *std.Build) !void {
} }
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.files = srcs, .files = srcs,
.flags = flags.items, .flags = flags.items,
}); });

View File

@ -58,7 +58,7 @@ fn buildSpirvCross(
}); });
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.flags = flags.items, .flags = flags.items,
.files = &.{ .files = &.{
// Core // Core

View File

@ -21,7 +21,7 @@ pub fn build(b: *std.Build) !void {
try flags.append("-DUTF8PROC_EXPORTS"); try flags.append("-DUTF8PROC_EXPORTS");
defer flags.deinit(); defer flags.deinit();
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.files = &.{"utf8proc.c"}, .files = &.{"utf8proc.c"},
.flags = flags.items, .flags = flags.items,
}); });

View File

@ -34,7 +34,7 @@ pub fn build(b: *std.Build) !void {
"-DZ_HAVE_UNISTD_H", "-DZ_HAVE_UNISTD_H",
}); });
lib.addCSourceFiles(.{ lib.addCSourceFiles(.{
.dependency = upstream, .root = upstream.path(""),
.files = srcs, .files = srcs,
.flags = flags.items, .flags = flags.items,
}); });

View File

@ -88,7 +88,7 @@ fn homeWindows(buf: []u8) !?[]u8 {
const fba = fba_instance.allocator(); const fba = fba_instance.allocator();
const drive = std.process.getEnvVarOwned(fba, "HOMEDRIVE") catch |err| switch (err) { const drive = std.process.getEnvVarOwned(fba, "HOMEDRIVE") catch |err| switch (err) {
error.OutOfMemory => return Error.BufferTooSmall, error.OutOfMemory => return Error.BufferTooSmall,
error.InvalidUtf8, error.EnvironmentVariableNotFound => return null, error.InvalidWtf8, error.EnvironmentVariableNotFound => return null,
}; };
// could shift the contents if this ever happens // could shift the contents if this ever happens
if (drive.ptr != buf.ptr) @panic("codebug"); if (drive.ptr != buf.ptr) @panic("codebug");
@ -101,7 +101,7 @@ fn homeWindows(buf: []u8) !?[]u8 {
const fba = fba_instance.allocator(); const fba = fba_instance.allocator();
const homepath = std.process.getEnvVarOwned(fba, "HOMEPATH") catch |err| switch (err) { const homepath = std.process.getEnvVarOwned(fba, "HOMEPATH") catch |err| switch (err) {
error.OutOfMemory => return Error.BufferTooSmall, error.OutOfMemory => return Error.BufferTooSmall,
error.InvalidUtf8, error.EnvironmentVariableNotFound => return null, error.InvalidWtf8, error.EnvironmentVariableNotFound => return null,
}; };
// could shift the contents if this ever happens // could shift the contents if this ever happens
if (homepath.ptr != path_buf.ptr) @panic("codebug"); if (homepath.ptr != path_buf.ptr) @panic("codebug");