diff --git a/lib/std/zig.zig b/lib/std/zig.zig index 4f0f47b11f..16c15e5109 100644 --- a/lib/std/zig.zig +++ b/lib/std/zig.zig @@ -737,7 +737,6 @@ pub const EnvVar = enum { ZIG_BUILD_MULTILINE_ERRORS, ZIG_VERBOSE_LINK, ZIG_VERBOSE_CC, - ZIG_BTRFS_WORKAROUND, ZIG_DEBUG_CMD, ZIG_IS_DETECTING_LIBC_PATHS, ZIG_IS_TRYING_TO_NOT_CALL_ITSELF, diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig index d42e441d77..5a600421e9 100644 --- a/src/Package/Fetch.zig +++ b/src/Package/Fetch.zig @@ -129,7 +129,6 @@ pub const JobQueue = struct { /// two hashes of the same package do not match. /// If this is true, `recursive` must be false. debug_hash: bool, - work_around_btrfs_bug: bool, mode: Mode, /// Set of hashes that will be additionally fetched even if they are marked /// as lazy. @@ -524,16 +523,7 @@ fn runResource( // Fetch and unpack a resource into a temporary directory. var unpack_result = try unpackResource(f, resource, uri_path, tmp_directory); - var pkg_path: Cache.Path = .{ .root_dir = tmp_directory, .sub_path = unpack_result.root_dir }; - - // Apply btrfs workaround if needed. Reopen tmp_directory. - if (native_os == .linux and f.job_queue.work_around_btrfs_bug) { - // https://github.com/ziglang/zig/issues/17095 - pkg_path.root_dir.handle.close(io); - pkg_path.root_dir.handle = cache_root.handle.createDirPathOpen(io, tmp_dir_sub_path, .{ - .open_options = .{ .iterate = true }, - }) catch @panic("btrfs workaround failed"); - } + const pkg_path: Cache.Path = .{ .root_dir = tmp_directory, .sub_path = unpack_result.root_dir }; // Load, parse, and validate the unpacked build.zig.zon file. It is allowed // for the file to be missing, in which case this fetched package is @@ -2276,7 +2266,6 @@ const TestFetchBuilder = struct { .recursive = false, .read_only = false, .debug_hash = false, - .work_around_btrfs_bug = false, .mode = .needed, }; diff --git a/src/main.zig b/src/main.zig index 0efab88f6a..1e9c0de656 100644 --- a/src/main.zig +++ b/src/main.zig @@ -5098,8 +5098,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8, } } - const work_around_btrfs_bug = native_os == .linux and - EnvVar.ZIG_BTRFS_WORKAROUND.isSet(environ_map); const root_prog_node = std.Progress.start(io, .{ .disable_printing = (color == .off), .root_name = "Compile Build Script", @@ -5244,7 +5242,6 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8, .read_only = false, .recursive = true, .debug_hash = false, - .work_around_btrfs_bug = work_around_btrfs_bug, .unlazy_set = unlazy_set, .mode = fetch_mode, }; @@ -5254,9 +5251,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8, job_queue.global_cache = .{ .path = p, .handle = Io.Dir.cwd().openDir(io, p, .{}) catch |err| { - fatal("unable to open system package directory '{s}': {s}", .{ - p, @errorName(err), - }); + fatal("unable to open system package directory '{s}': {t}", .{ p, err }); }, }; job_queue.read_only = true; @@ -6938,8 +6933,6 @@ fn cmdFetch( dev.check(.fetch_command); const color: Color = .auto; - const work_around_btrfs_bug = native_os == .linux and - EnvVar.ZIG_BTRFS_WORKAROUND.isSet(environ_map); var opt_path_or_url: ?[]const u8 = null; var override_global_cache_dir: ?[]const u8 = EnvVar.ZIG_GLOBAL_CACHE_DIR.get(environ_map); var debug_hash: bool = false; @@ -7010,7 +7003,6 @@ fn cmdFetch( .recursive = false, .read_only = false, .debug_hash = debug_hash, - .work_around_btrfs_bug = work_around_btrfs_bug, .mode = .all, }; defer job_queue.deinit();