nim-lang / nimble

Package manager for the Nim programming language.
Other
1.25k stars 188 forks source link

[Enhancement] Change installation directory structure #346

Closed samdmarshall closed 7 years ago

samdmarshall commented 7 years ago

Currently the installation directory structure looks like this:

/Users/Samantha/.nimble/
├── bin
│   ├── c2nim -> /Users/Samantha/.nimble/pkgs/c2nim-0.9.12/c2nim
│   ├── rite -> /Users/Samantha/.nimble/pkgs/pewpewthespells-0.1/rite
│   └── ritual -> /Users/Samantha/.nimble/pkgs/pewpewthespells-0.1/ritual
├── nimbledata.json
├── packages_official.json
├── packages_temp.json
└── pkgs
    ├── OTP-0.1.1
    ├── asynctools-0.1.0
    ├── base32-0.1.1
    ├── c2nim-0.9.12
    ├── cmd-0.1.0
    ├── compiler-#head
    ├── hmac-0.1.1
    ├── influx-0.1.0
    ├── jester-0.1.1
    ├── kiwi-0.1.0
    ├── libclang-0.1.0
    ├── libssh2-0.1.0
    ├── llvm-3.5
    ├── lua-1.0
    ├── nimSHA2-0.1.1
    ├── notmuch-0.1.0
    ├── parsetoml-0.2.0
    ├── plists-0.1.0
    ├── pluginmanager-0.1.0
    ├── progress-0.1.0
    ├── pythonpathlib-0.1
    ├── rune-0.1.0
    ├── untar-0.1.0
    ├── yaml-0.9.0
    └── zip-0.1.1

My proposal would be to change it to look more like the layout that homebrew uses for installation of packages:

/usr/local/Cellar/
├── adns
│   └── 1.5.1
├── alot
│   ├── 0.5.1
│   └── HEAD-d532672
├── ansible
│   └── 2.3.0.0
├── asciinema
│   └── HEAD-9a74fc3
├── autoconf
│   └── 2.69
├── automake
│   └── 1.15
├── battery-level
│   └── 0.4.1
├── c2nim
│   └── HEAD-9a8a739
├── cairo
│   └── 1.14.8
├── cmake
│   └── 3.8.0
├── cmdparse
│   └── HEAD-2a62ff0
├── cmus
│   └── HEAD-c64e0d5_2
├── cmus-airpods
│   └── HEAD-e75954b
├── cmus-control
│   └── 1.0.2
├── cs-tools
│   └── HEAD-c10149b
├── dagger
│   └── HEAD-e9137eb
├── diff-so-fancy
│   └── 0.11.4
├── diffoscope
│   └── 81
├── dirmngr
│   └── 1.1.1_3
├── docker
│   └── 17.04.0
├── docker-machine
│   └── 0.10.0
├── docker-machine-driver-xhyve
│   ├── 0.3.1
│   └── 0.3.2
├── x264
│   └── r2748
├── xapian
│   └── 1.4.3
├── xvid
│   └── 1.3.4
├── xz
│   └── 5.2.3
├── ykclient
│   └── 2.15
├── ykpers
│   └── 1.17.3
├── youtube-dl
│   └── 2017.04.17
└── yubico-piv-tool
    └── 1.4.2

Where you have a directory that contains all of the packages, then a level under that per package (by name) then a subdirectory under each package based on version. This would allow more flexibility when installing packages as well as being able to support multiple versions of the same package in use at any given time via version pinning.

dom96 commented 7 years ago

being able to support multiple versions of the same package in use at any given time via version pinning

If I understand you correctly, this is already supported.

untar-0.1.0 and untar-0.2.0 can both be present.

samdmarshall commented 7 years ago

ah interesting, I still think that this kind of a change would be more beneficial for organizational reasons.

dom96 commented 7 years ago

Perhaps, but it would be a pain to change and the benefits aren't worth the effort IMO.