zpmod icon indicating copy to clipboard operation
zpmod copied to clipboard

[bug]: (eval):ZIModule_:1: can't write zwc file: /proc/self/fd/15.zwc

Open amogus07 opened this issue 9 months ago • 9 comments

Environment

Fedora Workstation 39

Reproduction steps

  1. Install zpmod acording to the "Without Zi" section
  2. Add the two lines at the top of $ZDOTDIR/.zshrc according to the instructions

Expected behavior

zpmod operates normally according to README.md

Current behavior

Upon opening a new terminal session, the following message appears: "(eval):ZIModule_:1: can't write zwc file: /proc/self/fd/15.zwc"

Code snippet

module_path+=( "/home/konstantink/.zi/zmodules/zpmod/Src" )
zmodload zi/zpmod

# zsh plugin management functions
export ZPLUGINDIR="$ZDOTDIR/plugins"
getplugin () {
    url=$1
    reponame=$(echo "$url" | frawk -F/ '{print $NF}' | sed -e 's/.git$//')
    git clone "$url" "$ZPLUGINDIR/$reponame"
}

loadplugin () {
    for name in "$@"; do
        zplugin="$ZPLUGINDIR/$name/$name.plugin.zsh"
        [[ -f "$zplugin" ]] || echo "plugin $name not found..." && . "$zplugin" || echo "failed to load  $name"
    done
}

export FPATH="$ZDOTDIR/completions/eza/completions/zsh:$FPATH"

# Enable colors and change prompt:
#autoload -U colors && colors	# Load colors
#PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
setopt autocd		# Automatically cd into typed directory.
stty stop undef		# Disable ctrl-s to freeze terminal.
setopt interactive_comments

# History in cache directory:
HISTSIZE=10000000
SAVEHIST=10000000
HISTFILE="$HOME/.local/share/zsh_history"

# Basic auto/tab complete:
autoload -U compinit bashcompinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
bashcompinit
_comp_options+=(globdots)		# Include hidden files.
eval "$(register-python-argcomplete pipx)"

loadplugin zsh-autosuggestions H-S-MW zsh-editing-workbench zsh-fancy-completions zui zbrowse

. "$HOME/.cargo/env"

path_append () {
    case ":${PATH}:" in
        *:"$1":*)
            ;;
        *)
        PATH="${PATH:+$PATH}:$1"
    esac
}
# include .local/bin
path_append "$HOME/.local/bin"

# include .bin
path_append "$HOME/.bin"

# include spicetify path
path_append "$HOME/.spicetify"

# include volta path
export VOLTA_HOME="$HOME/.volta"
path_append "$VOLTA_HOME/bin"

fastfetch

eval "$(navi widget zsh)"
eval "$(zoxide init zsh)"
eval "$(starship init zsh)"
loadplugin F-Sy-H

. "$HOME/.config/broot/launcher/bash/br"

Additional information

I don't use Zi

Self-service

  • [ ] I'd be willing to address this documentation request myself.

Have you read the Contributing Guidelines?

Are you familiar with the Contributor Covenant Code of Conduct?

Contact Details

[email protected]

amogus07 avatar Nov 20 '23 05:11 amogus07

Hi @amogus07 :wave:

I need to be able reproduce the issue, here are some tips to narrow it down:

Load only zpmod module and check if the issue persists. If yes, then I need your machine and environment information so can re-reproduce the an issue. If no, then the issue is caused by something else, and you can find what it is by adding code snippets back to .zshrc, but in parts until you find what exactly caused it.

ss-o avatar Nov 20 '23 16:11 ss-o

@ss-o It seems starship is the culprit

amogus07 avatar Nov 27 '23 07:11 amogus07

So, is there anything I can do about it?

amogus07 avatar Dec 06 '23 22:12 amogus07

So, is there anything I can do about it?

I am guessing that Starhip or its related files are located where zpmod module is missing permissions. For example, if Starship is located at /usr/bin/starship, then migrating it to
~/.local/bin/starship (and all other files if any) should solve the issue :thinking:

ss-o avatar Dec 06 '23 23:12 ss-o

I am guessing that Starhip or its related files are located where zpmod module is missing permissions. For example, if Starship is located at /usr/bin/starship, then migrating it to ~/.local/bin/starship (and all other files if any) should solve the issue 🤔

tried that, didn't work

amogus07 avatar Dec 26 '23 20:12 amogus07

@amogus07 have you tried to profile/debug the .zshrc loading? E.g.:

Place the following at the top of .zshrc:

[[ $ZSHRC_PROFILE -gt 0 ]] && zmodload zsh/zprof

Then execute ZSHRC_PROFILE=1 zsh and run zprof > profile.txt to write the details.

If you have no luck identifying the issue, you can try benchmark#method-1 or similar methods to pinpoint the issue.

Finally, you can run the docker container re-produce the issue, and share the instructions.

ss-o avatar Dec 30 '23 12:12 ss-o

Could you explain how to set up the docker container for testing or provide some resources? I'm no familiar with docker.

amogus07 avatar Jan 08 '24 21:01 amogus07

You can use https://github.com/z-shell/playground as an example, if you need additional support let me know :dart:

ss-o avatar Jan 12 '24 13:01 ss-o

I don't use starship and am also running into this.

Load only zpmod module and check if the issue persists. If yes, then I need your machine and environment information so can re-reproduce the an issue.

How can I verify that only the zpmod module is loaded? Use an empty zshrc/zprofile? That said AFAIK that's all that is loaded and it occurs.

zsh 5.9 via linuxbrew on ubuntu 22.04; if that helps / is needed.

13steinj avatar Apr 10 '24 04:04 13steinj