Skip to content
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 build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// nix flake update --commit-lock-file
// ```
// If you do not use Nix, a ZLS maintainer can take care of this.
.minimum_zig_version = "0.16.0-dev.1976+8e091047b",
.minimum_zig_version = "0.16.0-dev.2075+62d6bbc7d",
// If you do not use Nix, a ZLS maintainer can take care of this.
// Whenever the dependencies are updated, run the following command:
// ```bash
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/Server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,9 @@ fn initializedHandler(server: *Server, arena: std.mem.Allocator, notification: t
try server.resolveConfiguration();
}

if (std.crypto.random.intRangeLessThan(usize, 0, 32768) == 0) {
const rng_impl: std.Random.IoSource = .{ .io = server.io };
const rng = rng_impl.interface();
if (rng.intRangeLessThan(usize, 0, 32768) == 0) {
server.showMessage(.Warning, "HELP ME, I AM STUCK INSIDE AN LSP!", .{});
}
}
Expand Down
1 change: 0 additions & 1 deletion src/build_runner/build_runner.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub const dependencies = @import("@dependencies");
pub const std_options: std.Options = .{
.side_channels_mitigations = .none,
.http_disable_tls = true,
.crypto_fork_safety = false,
};

///! This is a modified build runner to extract information out of build.zig
Expand Down
4 changes: 3 additions & 1 deletion src/testing.zig
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ pub const FailingAllocator = struct {
/// `likelihood == 0` means that every allocation will fail
/// `likelihood == std.math.intMax(u32)` means that no allocation will be forced to fail
pub fn init(internal_allocator: std.mem.Allocator, likelihood: u32) FailingAllocator {
const clock = std.Io.Clock.boot;
const timestamp = clock.now(std.testing.io) catch std.Io.Timestamp.zero;
return .{
.internal_allocator = internal_allocator,
.random = .init(std.crypto.random.int(u64)),
.random = .init(@intCast(timestamp.toMilliseconds())),
.likelihood = likelihood,
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/translate_c.zig
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn translate(
const global_cache_dir = config.global_cache_dir.?;

var random_bytes: [16]u8 = undefined;
std.crypto.random.bytes(&random_bytes);
io.random(&random_bytes);
var sub_path: [std.fs.base64_encoder.calcSize(16)]u8 = undefined;
_ = std.fs.base64_encoder.encode(&sub_path, &random_bytes);

Expand Down