authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-04 13:15:53-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-02-05 16:30:33-08:00
log387d550b6c3e73989513ea720437fdc5aac195d3
tree6a3a309158ae082f024f6a694fef72d11c63c525
parent076f7e5bd5389e159865d99e0e86edc905cffc42

compiler: remove btrfs workaround functionality

has been fixed in the kernel code for a while now

3 files changed, 2 insertions(+), 22 deletions(-)

lib/std/zig.zig-1
...@@ -737,7 +737,6 @@ pub const EnvVar = enum {...@@ -737,7 +737,6 @@ pub const EnvVar = enum {
737 ZIG_BUILD_MULTILINE_ERRORS,737 ZIG_BUILD_MULTILINE_ERRORS,
738 ZIG_VERBOSE_LINK,738 ZIG_VERBOSE_LINK,
739 ZIG_VERBOSE_CC,739 ZIG_VERBOSE_CC,
740 ZIG_BTRFS_WORKAROUND,
741 ZIG_DEBUG_CMD,740 ZIG_DEBUG_CMD,
742 ZIG_IS_DETECTING_LIBC_PATHS,741 ZIG_IS_DETECTING_LIBC_PATHS,
743 ZIG_IS_TRYING_TO_NOT_CALL_ITSELF,742 ZIG_IS_TRYING_TO_NOT_CALL_ITSELF,
src/Package/Fetch.zig+1-12
...@@ -129,7 +129,6 @@ pub const JobQueue = struct {...@@ -129,7 +129,6 @@ pub const JobQueue = struct {
129 /// two hashes of the same package do not match.129 /// two hashes of the same package do not match.
130 /// If this is true, `recursive` must be false.130 /// If this is true, `recursive` must be false.
131 debug_hash: bool,131 debug_hash: bool,
132 work_around_btrfs_bug: bool,
133 mode: Mode,132 mode: Mode,
134 /// Set of hashes that will be additionally fetched even if they are marked133 /// Set of hashes that will be additionally fetched even if they are marked
135 /// as lazy.134 /// as lazy.
...@@ -524,16 +523,7 @@ fn runResource(...@@ -524,16 +523,7 @@ fn runResource(
524 // Fetch and unpack a resource into a temporary directory.523 // Fetch and unpack a resource into a temporary directory.
525 var unpack_result = try unpackResource(f, resource, uri_path, tmp_directory);524 var unpack_result = try unpackResource(f, resource, uri_path, tmp_directory);
526525
527 var pkg_path: Cache.Path = .{ .root_dir = tmp_directory, .sub_path = unpack_result.root_dir };526 const pkg_path: Cache.Path = .{ .root_dir = tmp_directory, .sub_path = unpack_result.root_dir };
528
529 // Apply btrfs workaround if needed. Reopen tmp_directory.
530 if (native_os == .linux and f.job_queue.work_around_btrfs_bug) {
531 // https://github.com/ziglang/zig/issues/17095
532 pkg_path.root_dir.handle.close(io);
533 pkg_path.root_dir.handle = cache_root.handle.createDirPathOpen(io, tmp_dir_sub_path, .{
534 .open_options = .{ .iterate = true },
535 }) catch @panic("btrfs workaround failed");
536 }
537527
538 // Load, parse, and validate the unpacked build.zig.zon file. It is allowed528 // Load, parse, and validate the unpacked build.zig.zon file. It is allowed
539 // for the file to be missing, in which case this fetched package is529 // for the file to be missing, in which case this fetched package is
...@@ -2276,7 +2266,6 @@ const TestFetchBuilder = struct {...@@ -2276,7 +2266,6 @@ const TestFetchBuilder = struct {
2276 .recursive = false,2266 .recursive = false,
2277 .read_only = false,2267 .read_only = false,
2278 .debug_hash = false,2268 .debug_hash = false,
2279 .work_around_btrfs_bug = false,
2280 .mode = .needed,2269 .mode = .needed,
2281 };2270 };
22822271
src/main.zig+1-9
...@@ -5098,8 +5098,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,...@@ -5098,8 +5098,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,
5098 }5098 }
5099 }5099 }
51005100
5101 const work_around_btrfs_bug = native_os == .linux and
5102 EnvVar.ZIG_BTRFS_WORKAROUND.isSet(environ_map);
5103 const root_prog_node = std.Progress.start(io, .{5101 const root_prog_node = std.Progress.start(io, .{
5104 .disable_printing = (color == .off),5102 .disable_printing = (color == .off),
5105 .root_name = "Compile Build Script",5103 .root_name = "Compile Build Script",
...@@ -5244,7 +5242,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,...@@ -5244,7 +5242,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,
5244 .read_only = false,5242 .read_only = false,
5245 .recursive = true,5243 .recursive = true,
5246 .debug_hash = false,5244 .debug_hash = false,
5247 .work_around_btrfs_bug = work_around_btrfs_bug,
5248 .unlazy_set = unlazy_set,5245 .unlazy_set = unlazy_set,
5249 .mode = fetch_mode,5246 .mode = fetch_mode,
5250 };5247 };
...@@ -5254,9 +5251,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,...@@ -5254,9 +5251,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,
5254 job_queue.global_cache = .{5251 job_queue.global_cache = .{
5255 .path = p,5252 .path = p,
5256 .handle = Io.Dir.cwd().openDir(io, p, .{}) catch |err| {5253 .handle = Io.Dir.cwd().openDir(io, p, .{}) catch |err| {
5257 fatal("unable to open system package directory '{s}': {s}", .{5254 fatal("unable to open system package directory '{s}': {t}", .{ p, err });
5258 p, @errorName(err),
5259 });
5260 },5255 },
5261 };5256 };
5262 job_queue.read_only = true;5257 job_queue.read_only = true;
...@@ -6938,8 +6933,6 @@ fn cmdFetch(...@@ -6938,8 +6933,6 @@ fn cmdFetch(
6938 dev.check(.fetch_command);6933 dev.check(.fetch_command);
69396934
6940 const color: Color = .auto;6935 const color: Color = .auto;
6941 const work_around_btrfs_bug = native_os == .linux and
6942 EnvVar.ZIG_BTRFS_WORKAROUND.isSet(environ_map);
6943 var opt_path_or_url: ?[]const u8 = null;6936 var opt_path_or_url: ?[]const u8 = null;
6944 var override_global_cache_dir: ?[]const u8 = EnvVar.ZIG_GLOBAL_CACHE_DIR.get(environ_map);6937 var override_global_cache_dir: ?[]const u8 = EnvVar.ZIG_GLOBAL_CACHE_DIR.get(environ_map);
6945 var debug_hash: bool = false;6938 var debug_hash: bool = false;
...@@ -7010,7 +7003,6 @@ fn cmdFetch(...@@ -7010,7 +7003,6 @@ fn cmdFetch(
7010 .recursive = false,7003 .recursive = false,
7011 .read_only = false,7004 .read_only = false,
7012 .debug_hash = debug_hash,7005 .debug_hash = debug_hash,
7013 .work_around_btrfs_bug = work_around_btrfs_bug,
7014 .mode = .all,7006 .mode = .all,
7015 };7007 };
7016 defer job_queue.deinit();7008 defer job_queue.deinit();