asdf-vm / asdf-vm/asdf-plugins

Colliding paths on case-insensitive filesystems

Open
#1,062 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
1.4k
Forks
552
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

When `asdf` clones this repo for the first time (such as when adding a plugin for the first time) on a case-insensitive filesystem, some plugins have case-sensitive paths, so Git cannot put them in the work tree.

### Steps to Reproduce

1. Clone this repository in a case-insensitive filesystem (for example, the default filesystem on macOS). This can be done by adding a plugin for the first time on a fresh install of asdf.

See the output:
```
initializing plugin repository...Cloning into '/Users/gabriel.soldani/.asdf/repository'...
remote: Enumerating objects: 6174, done.
remote: Counting objects: 100% (1852/1852), done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 6174 (delta 1824), reused 1773 (delta 1770), pack-reused 4322 (from 1)
Receiving objects: 100% (6174/6174), 1.42 MiB | 6.48 MiB/s, done.
Resolving deltas: 100% (3396/3396), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

'plugins/luaJIT'
'plugins/luajit'
'plugins/R'
'plugins/r'
```

### Expected Behaviour

Colliding paths should be avoided so asdf works consistently across case-sensitive and case-insensitive filesystems for users, and contributors can use case-insensitive filesystems.

`asdf plugin add` restricts plugin names to lowercase characters. I'm not sure if the paths Git picks in collisions is part of its contract or an implementation detail. In my case it picked the lowercase variants, but if it picked the mixed-case variants these plugins would be inaccessible.

Backwards compatibility for systems relying on the mixed case variant (in scripts and configuration files), if required, can be done by asdf when it maps a plugin name to its path.

### Actual Behaviour

The following message is printed:

```
initializing plugin repository...Cloning into '/Users/gabriel.soldani/.asdf/repository'...
remote: Enumerating objects: 6174, done.
remote: Counting objects: 100% (1852/1852), done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 6174 (delta 1824), reused 1773 (delta 1770), pack-reused 4322 (from 1)
Receiving objects: 100% (6174/6174), 1.42 MiB | 6.48 MiB/s, done.
Resolving deltas: 100% (3396/3396), done.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

'plugins/luaJIT'
'plugins/luajit'
'plugins/R'
'plugins/r'
```

### Environment

```shell
OS:
Darwin [hostname redacted] 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:36 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6020 arm64

SHELL:
zsh 5.9 (arm64-apple-darwin24.0)

BASH VERSION:
5.2.37(1)-release

ASDF VERSION:
v0.14.1

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/gabriel.soldani/.asdf
ASDF_DIR=/opt/homebrew/opt/asdf/libexec
ASDF_CONFIG_FILE=/Users/gabriel.soldani/.asdfrc

ASDF INSTALLED PLUGINS:
nodejs https://github.com/asdf-vm/asdf-nodejs.git master c36e6f0
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the first plugin-add clone on a case-insensitive filesystem and inspect the colliding paths under plugins/, including plugins/luaJIT, plugins/luajit, plugins/R, and plugins/r. Done means the repository can be cloned and used consistently on case-sensitive and case-insensitive filesystems without colliding plugin paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, macos, shell
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.