Skip to content

Dir.makePath infinite loops when a path component is a symlink #17330

@Jarred-Sumner

Description

@Jarred-Sumner

Zig Version

0.12.0-dev.163+6780a6bbf

Steps to Reproduce and Observed Behavior

  1. Paste into repro.zig
const std = @import("std");
test {
    try std.fs.cwd().symLink("../../boop", "folder", .{});
    try std.fs.cwd().makePath("folder/infinite-loop");
}
  1. zig test repro.zig
  2. Infinite loop

Expected Behavior

It shouldn't infinite loop

It is a valid question whether it should follow the symlink and "continue" creating the directory through the symlink, joining the path. There is an argument for either case.

But it shouldn't infinite loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorstandard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions