fix version checking
This commit is contained in:
parent
5504f44747
commit
157cf44871
1 changed files with 5 additions and 2 deletions
|
|
@ -64,8 +64,11 @@ pub fn getVersion(b: *Build, options: Options) []const u8 {
|
||||||
|
|
||||||
fn findBuildRoot(allocator: std.mem.Allocator, io: std.Io) ![]const u8 {
|
fn findBuildRoot(allocator: std.mem.Allocator, io: std.Io) ![]const u8 {
|
||||||
var buf: [std.fs.max_path_bytes]u8 = undefined;
|
var buf: [std.fs.max_path_bytes]u8 = undefined;
|
||||||
// `realPath` now returns the length written rather than a slice.
|
// Not `Dir.cwd().realPath`: on Linux that resolves the handle through
|
||||||
const start_len = try std.Io.Dir.cwd().realPath(io, &buf);
|
// `/proc/self/fd/{fd}`, and `Dir.cwd()` is the `AT_FDCWD` sentinel (-100)
|
||||||
|
// rather than a real descriptor, so it always fails with `FileNotFound`.
|
||||||
|
// That silently turned every version string into "unknown".
|
||||||
|
const start_len = try std.process.currentPath(io, &buf);
|
||||||
var cwd: []const u8 = buf[0..start_len];
|
var cwd: []const u8 = buf[0..start_len];
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue