Skip to content

Symbolic link to directory creation fails because of too long paths even if path <= 260 characters #216

@Joshua-Schroijen

Description

@Joshua-Schroijen

Hello!

I have noticed a strange issue with using ln -s inside of MSYS2 which I'm inclined to consider a bug. Even after I enabled long paths inside of the Windows registry ln -s will complain about paths being too long to symlink to and will exit with an error code of 1 when creating symlinks to directories. The strange thing is that this also happens when the paths are far less than 260 characters long. If the paths are short enough, the symlink will be created regardless of the error. If the path is longer than 260 characters, the symlink will not be created.

Steps to reproduce

Run the following commands inside of MSYS2 after enabling long paths in the Windows registry and rebooting:

mkdir -p /c/foo
cd /c/foo
ln -s .. bar
mkdir -p /c/betts/underscores/aiding/elegance/arginine/turkmen/ballet/bumsen/bendigo/steam/chronically/kannur/source/stalled/mangled/toolkit/strength/fateful/kurosawa/effectiveness/yardage/newport/repairers/prawn/angela/resembles/projekt/avalanche/storedge/alibi/gauteng/chaim/estudio/zante/thickened/retention/wieder/pretzel/maastricht/speciality/universalist/heine/nagios/spans/meetup/binders/strict/tooltip/beastiality/terrace  
cd /c/betts/underscores/aiding/elegance/arginine/turkmen/ballet/bumsen/bendigo/steam/chronically/kannur/source/stalled/mangled/toolkit/strength/fateful/kurosawa/effectiveness/yardage/newport/repairers/prawn/angela/resembles/projekt/avalanche/storedge/alibi/gauteng/chaim/estudio/zante/thickened/retention/wieder/pretzel/maastricht/speciality/universalist/heine/nagios/spans/meetup/binders/strict/tooltip/beastiality/terrace  
ln -s .. foo

MSYS2 Version

uname -a for my MSYS2 installation:

MSYS_NT-10.0-19045 ___________ 3.5.3.x86_64 2024-05-06 06:45 UTC x86_64 Msys

Implications

This bug can cause many kinds of frustrating problems because many shell scripts and tools like tar often need to create symlinks to other directories

I thank you in advance for investigating this bug!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions