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 {
737737 ZIG_BUILD_MULTILINE_ERRORS,
738738 ZIG_VERBOSE_LINK,
739739 ZIG_VERBOSE_CC,
740 ZIG_BTRFS_WORKAROUND,
741740 ZIG_DEBUG_CMD,
742741 ZIG_IS_DETECTING_LIBC_PATHS,
743742 ZIG_IS_TRYING_TO_NOT_CALL_ITSELF,
src/Package/Fetch.zig+1-12
......@@ -129,7 +129,6 @@ pub const JobQueue = struct {
129129 /// two hashes of the same package do not match.
130130 /// If this is true, `recursive` must be false.
131131 debug_hash: bool,
132 work_around_btrfs_bug: bool,
133132 mode: Mode,
134133 /// Set of hashes that will be additionally fetched even if they are marked
135134 /// as lazy.
......@@ -524,16 +523,7 @@ fn runResource(
524523 // Fetch and unpack a resource into a temporary directory.
525524 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 };
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 }
526 const pkg_path: Cache.Path = .{ .root_dir = tmp_directory, .sub_path = unpack_result.root_dir };
537527
538528 // Load, parse, and validate the unpacked build.zig.zon file. It is allowed
539529 // for the file to be missing, in which case this fetched package is
......@@ -2276,7 +2266,6 @@ const TestFetchBuilder = struct {
22762266 .recursive = false,
22772267 .read_only = false,
22782268 .debug_hash = false,
2279 .work_around_btrfs_bug = false,
22802269 .mode = .needed,
22812270 };
22822271
src/main.zig+1-9
......@@ -5098,8 +5098,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,
50985098 }
50995099 }
51005100
5101 const work_around_btrfs_bug = native_os == .linux and
5102 EnvVar.ZIG_BTRFS_WORKAROUND.isSet(environ_map);
51035101 const root_prog_node = std.Progress.start(io, .{
51045102 .disable_printing = (color == .off),
51055103 .root_name = "Compile Build Script",
......@@ -5244,7 +5242,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,
52445242 .read_only = false,
52455243 .recursive = true,
52465244 .debug_hash = false,
5247 .work_around_btrfs_bug = work_around_btrfs_bug,
52485245 .unlazy_set = unlazy_set,
52495246 .mode = fetch_mode,
52505247 };
......@@ -5254,9 +5251,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8,
52545251 job_queue.global_cache = .{
52555252 .path = p,
52565253 .handle = Io.Dir.cwd().openDir(io, p, .{}) catch |err| {
5257 fatal("unable to open system package directory '{s}': {s}", .{
5258 p, @errorName(err),
5259 });
5254 fatal("unable to open system package directory '{s}': {t}", .{ p, err });
52605255 },
52615256 };
52625257 job_queue.read_only = true;
......@@ -6938,8 +6933,6 @@ fn cmdFetch(
69386933 dev.check(.fetch_command);
69396934
69406935 const color: Color = .auto;
6941 const work_around_btrfs_bug = native_os == .linux and
6942 EnvVar.ZIG_BTRFS_WORKAROUND.isSet(environ_map);
69436936 var opt_path_or_url: ?[]const u8 = null;
69446937 var override_global_cache_dir: ?[]const u8 = EnvVar.ZIG_GLOBAL_CACHE_DIR.get(environ_map);
69456938 var debug_hash: bool = false;
......@@ -7010,7 +7003,6 @@ fn cmdFetch(
70107003 .recursive = false,
70117004 .read_only = false,
70127005 .debug_hash = debug_hash,
7013 .work_around_btrfs_bug = work_around_btrfs_bug,
70147006 .mode = .all,
70157007 };
70167008 defer job_queue.deinit();