diff --git a/build.zig.zon b/build.zig.zon index 40a5ffb8f..e83ed2c9c 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -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 diff --git a/flake.lock b/flake.lock index 369a0bdd0..586b35633 100644 --- a/flake.lock +++ b/flake.lock @@ -36,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1767634882, - "narHash": "sha256-2GffSfQxe3sedHzK+sTKlYo/NTIAGzbFCIsNMUPAAnk=", + "lastModified": 1767799921, + "narHash": "sha256-r4GVX+FToWVE2My8VVZH4V0pTIpnu2ZE8/Z4uxGEMBE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3c9db02515ef1d9b6b709fc60ba9a540957f661c", + "rev": "d351d0653aeb7877273920cd3e823994e7579b0b", "type": "github" }, "original": { @@ -80,11 +80,11 @@ ] }, "locked": { - "lastModified": 1767659903, - "narHash": "sha256-Jc/KmlLyn2T8P/ZpgBoMkULsfmn8B4PjnwiXzlEA9Zg=", + "lastModified": 1767919086, + "narHash": "sha256-t9Z7r8yJDbRqoAhm7vsohHAhMGF373NCWt/XeHlZAWw=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "1508a4f84129c2824ee4fcbdec31c63bdcf08756", + "rev": "d7671671de8bd3afcabffefc77c75ed9777b249b", "type": "github" }, "original": { diff --git a/src/Server.zig b/src/Server.zig index 7d1e0443d..694362d7e 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -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!", .{}); } } diff --git a/src/build_runner/build_runner.zig b/src/build_runner/build_runner.zig index 5685430ef..edb3c328c 100644 --- a/src/build_runner/build_runner.zig +++ b/src/build_runner/build_runner.zig @@ -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 diff --git a/src/testing.zig b/src/testing.zig index 49e250a65..d5bf58677 100644 --- a/src/testing.zig +++ b/src/testing.zig @@ -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, }; } diff --git a/src/translate_c.zig b/src/translate_c.zig index e003534fc..180f31f58 100644 --- a/src/translate_c.zig +++ b/src/translate_c.zig @@ -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);