Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgm fails when used with separate filesystems #7

Open
dehylton opened this issue Jan 16, 2025 · 4 comments
Open

pkgm fails when used with separate filesystems #7

dehylton opened this issue Jan 16, 2025 · 4 comments

Comments

@dehylton
Copy link

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
@mxcl
Copy link
Member

mxcl commented Jan 17, 2025

Makes sense. We can detect this and install straight to /usr/local.

@jhheider
Copy link
Contributor

jacob@illithid Downloads % ln -s /Volumes/Samsung\ SSD\ 980/Library foo
jacob@illithid Downloads % ls -l foo
lrwxr-xr-x@ 1 jacob  staff  32 Jan 17 18:02 foo -> /Volumes/Samsung SSD 980/Library

symlinks work across filesystem boundaries (on APFS+).

@mxcl
Copy link
Member

mxcl commented Jan 17, 2025

symlink means the installed products can be edited by the user which is one of the protections of pkgm. Like could be configurable long term so you can safe space.

@jhheider
Copy link
Contributor

hm, maybe that's an ask the user and direct them to a link with the pros/cons. Symlinks to just work, but then you're at the mercy of the user (which is "fine" for most single-user systems), or fall back to ~/.local/bin, or use /usr/local/pkgx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants