stow
stow copied to clipboard
Dotfiles option doesn't work with directories
Paging @jvkersch in case he has any insight.
I use stow
to manage my dotfiles. If I am trying to stow my config for zathura, I run stow --dotfiles zathura
from ~/dotfiles
, which contains zathura/dot-config/zathura/zathurarc
. This outputs:
stow: ERROR: stow_contents() called with non-directory path: dotfiles/zathura/.config
I have no problem if I change the path to zathura/.config
. Furthermore, stow --dotfiles bash
works fine on the file bash/dot-bashrc
. It only fails with directories.
I'll freely admit I know little of the internals here, so I'm sorry if I'm just misunderstanding how to use it. But the error message makes it seem like stow
is converting the path before getting the path contents and stowing, when it should be getting the path contents, then converting the path, and finally stowing.
Thanks for any insight you can provide.
Thanks for the report! I didn't implement --dotfiles
, so would welcome some help triaging this one.
I got bitten by this one too when trying the new release 2.3.0
, following is more verbose log when the issue is triggered. Hopefully my comment isn't just seen as a noisy +1 and can help in debugging...
$ stow --ignore='^setup.sh' --ignore='^README.*' --ignore='^@.*'--ignore='^_.*' --target="$HOME" --no-folding --dotfiles alacritty --verbose=5
stow dir is /home/bricewge/project/dotfiles
stow dir path relative to target /home/bricewge is project/dotfiles
cwd now /home/bricewge
cwd restored to /home/bricewge/project/dotfiles
cwd now /home/bricewge
Planning stow of package alacritty...
. not protected
Stowing contents of project/dotfiles/alacritty (cwd=/home/bricewge)
=> project/dotfiles/alacritty
is_a_node(.)
link_task_action(.): no task
dir_task_action(.): no task
parent_link_scheduled_for_removal(.): prefix
parent_link_scheduled_for_removal(.): returning false
is_a_node(.): really exists
Ignoring path _alacritty.terminfo due to --ignore=(?^:^_.*\z)
Ignoring path setup.sh due to --ignore=(?^:^setup.sh\z)
project/dotfiles/alacritty/.stow-local-ignore didn't exist
/home/bricewge/.stow-global-ignore didn't exist
Using built-in ignore list
Ignore list regexp for paths: /(?^:(^|/)(^/COPYING|^/LICENSE.*|^/README.*|^/\.stow\-local\-ignore$)(/|$))/
Ignore list regexp for segments: /(?^:^(\.git|.+~|\.#.+|\.svn|CVS|#.*#|\.gitignore|_darcs|\.hg|\.cvsignore|.+,v|RCS)$)/
Not ignoring dot-config
Adjusting: dot-config => .config
Stowing project/dotfiles / alacritty / .config
=> project/dotfiles/alacritty/dot-config
is_a_link(.config)
link_task_action(.config): no task
is_a_link(.config): returning 0
is_a_node(.config)
link_task_action(.config): no task
dir_task_action(.config): no task
parent_link_scheduled_for_removal(.config): prefix .config
parent_link_scheduled_for_removal(.config): returning false
is_a_node(.config): really exists
Evaluate existing node: .config
is_a_dir(.config)
dir_task_action(.config): no task
parent_link_scheduled_for_removal(.config): prefix .config
parent_link_scheduled_for_removal(.config): returning false
is_a_dir(.config): real dir
.config not protected
Stowing contents of project/dotfiles/alacritty/.config (cwd=/home/bricewge)
=> ../project/dotfiles/alacritty/dot-config
stow: ERROR: stow_contents() called with non-directory path: project/dotfiles/alacritty/.config
Definitely not noise, thanks a lot @bricewge for the extra debug! Unfortunately I'm now packing for a 2 week holiday so am unlikely to have time to look at this soon, but if anyone else can make headway in my absence that would be awesome :)
Apologies for not replying to the earlier report. I will try to reproduce and I'll see if I can make any headway before @aspiers returns from vacation.
I was able to reproduce, thanks all for the detailed info. I think we expand the stow directory too early on; my assumption when originally implementing this was that the dot-
entries would be at the top-level in the stow directory, but this is not the case here. Will do some more digging.
In the mean time, I've been using --target
and a separate stow directory for ~/.config as a work around:
stow -v --dotfiles --target=$HOME/.config stow-config
I have this same structure, one way that works is to keep ~/dotfiles at the root of $ HOME and this command works (@lhindir):
$ (~/dotfiles) stow -R --dotfiles zathura/ -v
LINK: .config => laptop/zathura/dot-config
And yes, indeed there is a bug, because in my environment if I try to pass a target it returns this same message:
$ (~/dotfiles) stow -R --dotfiles -t ~ zathura/ -v
stow: ERROR: unstow_contents() called with non-directory path: Workspace/git.gutierri.me/laptop/zathura/.config
I just came across this bug. and read through this issue and #63. It's not a dealbreaker (at least not for my use case), but it would be nice to have this feature working. Is there any ETA for this fix? Thanks!!
Also, stow -D --dotfiles does not seem to work at all, even when files do not contain any "dot-filename" replacements.
We get the to:
Planning unstow of package *...done
but there is no
UNLINK: *
when normally unstowing a package.
To echo NPastorale, this would be a great feature. Thanks!
This attempts to fix this problem: https://github.com/aspiers/stow/pull/70
~I did not test it properly (a very basic use case with a directory) yet. I will test it with a deeper layer of directories.~
I have added some unit tests and the pull requests is building in the CI system. I'm using it locally now also and seems to work.
It would have been lovely to have the limitations of the --dotfiles option in the manual published/released while waiting for the fix to be pushed out
It's been more than a year the bug was reported and two months since a fix has been proposed, any updates on this?
Indeed. Would love to see the fix get merged. 🙏
Came across the same issue today. Would highly appreciate if the fix got merged.
Also I can help noticing that it has been almost a whole year since the last commit on the master branch. Does the dev team need any help maintaining this project?
Just stumbled on this bug, would be nice if the fix got released.
Just hit this too. Any timeline for a fix?
I got bitten by this one too when use stow
to manage my dotfiles(e.g. ~/dotfiles/emacs/dot-emacs.d => ~/.emacs.d
).
I found that ensuring the ~/.emacs.d
directory doesn't exist(e.g. rm -rf ~/.emacs.d
) before running stow --dotfiles emacs
can solve this problem.
I don't know why, but it works for me. I use the latest release 2.3.1
It would be nice to have this fixed!
This works for now
~/dotfiles on stow [?]
❯ /usr/local/bin/tree -l tmux
tmux
└── dot-config -> .config
└── tmux
└── tmux.conf
2 directories, 1 file
~/dotfiles on stow [?]
❯ stow --ignore="^dot-config" tmux
Can this get fixed? It's like 2 years old :(
Use chezmoi it does support this out of the box.
Sent from my iPhone
On Nov 10, 2021, at 10:32 AM, genevera @.***> wrote:
Can this get fixed? It's like 2 years old :(
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Can we fix this yet? 🙏 Just got hit by this bug today?
-
--dotfiles
option for packages withdot-directories/dot-files
does not work - usual packages with
.directories/.files
work
I got tired of waiting for this to be merged. *
@AitorATuin would you be ok with me creating an AUR package using your patches? I would eventually remove it if your PR gets merged but until then I would love to have an easy way to install this.
EDIT: the package is now in the AUR as stow-dotfiles-git
*EDIT2: want to apologize about the wording here in case aspiers ever reads it while going through their backlog. I just assumed that he only was in charge of maintaining a mirror, didn't think he was working on it. Hopefully this gets merged and we can stop relying on manually patched versions of stow!
@jonathannerat Sure, use it if you want.
This issue (and my difficulties trying to figure out what actions stow
will take), prompted me to write my own alternative I'm calling fling
. It's working well for my personal use; maybe ya'll would like it too :)
I got bitten by this one too when use
stow
to manage my dotfiles(e.g.~/dotfiles/emacs/dot-emacs.d => ~/.emacs.d
).I found that ensuring the
~/.emacs.d
directory doesn't exist(e.g.rm -rf ~/.emacs.d
) before runningstow --dotfiles emacs
can solve this problem.I don't know why, but it works for me. I use the latest release
2.3.1
This works for me too, although in my particular case is isn't a feasible solution. I had to rename a dot-foo
directory to .foo
instead.
Since a lot of configs are going to be inside ~/.config
which will have to exist before stowing the above solution doesn't work.
Not sure if this is much help but I was able to get round the .config
issue by nesting my .config folder in a config folder. I then run stow config
and it places my nvim folder inside of .config
in my home dir. The .config
folder itself isn't sym linked but the folders in my dotfiles are.
![Screenshot 2022-01-04 at 11 19 41](https://user-images.githubusercontent.com/5328578/148051677-4d505ffa-0aea-4662-b5b4-3a2167a20e6c.png)
I ran into this issue too.
stow directory was setup as
.
└── nvim
└── dot-config
└── nvim
I needed to update to following to get my setup to work.
.
└── nvim
└── .config
└── nvim
Thanks to @hurricanehrndz, I just made a workaround for this problem. My workaround includes a .stow-local-ignore
instead of using --ignore
manually.
(I have a .stowrc
with --target=$HOME --dotfiles --verbose
)
[~/_dotfiles/stowable]
$ tree -a fish
fish
├── .config -> dot-config
├── .stow-local-ignore
└── dot-config
└── fish
├── config.fish
├── ...
├── ...
└── ...........
7 directories, 4 files
[~/_dotfiles/stowable]
$ cat fish/.stow-local-ignore
dot-config
[~/_dotfiles/stowable]
$ stow fish
LINK: .config/fish => ../_dotfiles/stowable/fish/.config/fish