-
Notifications
You must be signed in to change notification settings - Fork 3
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
some fixs and optimze #54
some fixs and optimze #54
Conversation
This can solve the problem of file descriptors not being freed
When the user has installed a higher zig, zvm verify zig version will failed, because the child process will use system environment variables
And I delete this code std.posix.symlink(zig_path, symlink_path) catch |err| switch (err) {
error.PathAlreadyExists => {
try std.fs.cwd().deleteFile(symlink_path);
try std.posix.symlink(zig_path, symlink_path);
},
else => return err,
}; replace with this: try std.posix.symlink(zig_path, symlink_path); I think it's not necessary to retry the deletion in case of an error |
rename origin `detect` func in `architecture.zig` to `platform_str` and make it become comptime func
IIRC I had a problem in the past, when there was already a symlink. So I'm not sure about this change. Let me try to reproduce it. |
That's cool, we should use it wherever its possible 👍 |
Expectedly, the symlink should be removed in the above function |
True, overlooked it! 👍 |
std.fs.accessAbsolute
to replacestd.fs.openDirAbsolute
This can solve the problem of file descriptors not being freed
When the user has installed a higher zig, zvm verify zig version will failed, because the child process will use system environment variables
comptime
rename origin
detect
func inarchitecture.zig
toplatform_str
and make it becomecomptime
func