pkgm fails when used with separate filesystems

Open
#7 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
deno, typescript

Research direction

Start with /usr/local/bin/pkgm and trace sudo_install, mirror_directory, and processEntry around the failing Deno.link call. Reproduce the neovim.io install across separate filesystems, then verify that installation completes and that nvim is available as shown in the report.

Written by the indexing model from the issue text.

Description

Running pkgm install on a system with separate filesystems does not currently work. For example, I have separate filesystems (zfs) for /usr, /root, and /home. This is what I get when attempting to install neovim via pkgm:

$ pkgm install neovim.io
warning: --json is not stable use --json=v1
error: Uncaught (in promise) Error: Invalid cross-device link (os error 18): link '/home/dewey/.pkgx/neovim.io/v0.10.3/share/locale/sk/LC_MESSAGES/nvim.mo' -> '/usr/local/pkgs/neovim.io/v0.10.3/share/locale/sk/LC_MESSAGES/nvim.mo'
      await Deno.link(sourcePath, targetPath);
      ^
    at async Object.link (ext:deno_fs/30_fs.js:443:3)
    at async processEntry (file:///usr/local/bin/pkgm:196:7)
    at async processEntry (file:///usr/local/bin/pkgm:192:9)
    at async processEntry (file:///usr/local/bin/pkgm:192:9)
    at async processEntry (file:///usr/local/bin/pkgm:192:9)
    at async processEntry (file:///usr/local/bin/pkgm:192:9)
    at async processEntry (file:///usr/local/bin/pkgm:192:9)
    at async mirror_directory (file:///usr/local/bin/pkgm:179:3)
    at async sudo_install (file:///usr/local/bin/pkgm:145:5)
    at async file:///usr/local/bin/pkgm:54:7

The same operation seems to work in a "big root" single-filesystem instance (such as as the case in a podman/docker container):

root@12b50b6ab237:/# pkgm install neovim.io
warning: --json is not stable use --json=v1

root@12b50b6ab237:/# which nvim
/usr/local/bin/nvim

root@12b50b6ab237:/# nvim --version
NVIM v0.10.3
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info
Dominant language
TypeScript
Stars
60
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pkgxdev/pkgm

All issues in pkgxdev/pkgm

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.