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

Topgrade cannot upgrade zshell framework (https://wiki.zshell.dev) #709

Closed
2 of 6 tasks
scrambler-crypto opened this issue Feb 22, 2024 · 6 comments · Fixed by #713
Closed
2 of 6 tasks

Topgrade cannot upgrade zshell framework (https://wiki.zshell.dev) #709

scrambler-crypto opened this issue Feb 22, 2024 · 6 comments · Fixed by #713
Labels
C-bug Something isn't working

Comments

@scrambler-crypto
Copy link

Erroneous Behavior

Topgrade cannot upgrade zshell framework (https://wiki.zshell.dev)
the upgrade process starts correctly but after few seconds it hangs up.
The error message is the following:

The update took 8.44 seconds
zsh:1: warning: 10 jobs SIGHUPed

Expected Behavior

Topgrade upgrade correctly the framework

Steps to reproduce

install the zshell framework
launch topgrade

Possible Cause (Optional)

Problem persists without calling from topgrade

  • Yes
  • No

Did you run topgrade through Remote Execution

  • Yes
  • No

If yes, does the issue still occur when you run topgrade directly in your
remote host

  • Yes
  • No

Configuration file (Optional)

(default file)

Additional Details

  • Operation System/Version
    Ubuntu 23.10

  • Installation
    topgrade installed with cargo install

  • Topgrade version (topgrade -V)
    ❯ topgrade -V
    Topgrade 14.0.1

Verbose Output (topgrade -v)

DEBUG Executing command `/usr/bin/zsh -i -c 'source /home/davide/.zshrc && zi self-update && zi update --all -p'`
Updating »»»» ❮ Zi ❯ …
From https://github.com/z-shell/zi
 * branch            main       -> FETCH_HEAD
Already up to date.
Compiling »»» ❮ Zi ❯ …
Reloading »»» ❮ Zi ❯ …
Initiating parallel update …
Spawning the next 15 concurrent update jobs: snippets …
Spawning the next 15 concurrent update jobs: plugins …
Spawning the next 15 concurrent update jobs: plugins …
The update took 6.13 seconds
zsh:1: warning: 10 jobs SIGHUPed
DEBUG Command failed: Err(
   0: Command failed: `/usr/bin/zsh -i -c 'source /home/davide/.zshrc && zi self-update && zi update --all -p'`
   1: `/usr/bin/zsh` failed: exit status: 1

Location:
/home/davide/.cargo/registry/src/index.crates.io-6f17d22bba15001f/topgrade-14.0.1/src/steps/zsh.rs:144)
DEBUG Step "zi" failed:
0: Command failed: /usr/bin/zsh -i -c 'source /home/davide/.zshrc && zi self-update && zi update --all -p'
1: /usr/bin/zsh failed: exit status: 1

Location:
/home/davide/.cargo/registry/src/index.crates.io-6f17d22bba15001f/topgrade-14.0.1/src/steps/zsh.rs:144
DEBUG Step "zim"
DEBUG Detected "/usr/bin/zsh" as "zsh"
DEBUG Executing command zsh -c '[[ -n ${ZIM_HOME} ]] && print -n ${ZIM_HOME}'
DEBUG Command failed: Err(
0: Command failed: zsh -c '[[ -n ${ZIM_HOME} ]] && print -n ${ZIM_HOME}'
1: zsh failed: exit status: 1

Location:
/home/davide/.cargo/registry/src/index.crates.io-6f17d22bba15001f/topgrade-14.0.1/src/steps/zsh.rs:154)
DEBUG Step "oh-my-zsh"
DEBUG Detected "/usr/bin/zsh" as "zsh"
DEBUG Step "oh-my-bash"
DEBUG Detected "/usr/bin/bash" as "bash"
DEBUG Step "fisher"

@scrambler-crypto scrambler-crypto added the C-bug Something isn't working label Feb 22, 2024
@scrambler-crypto
Copy link
Author

the command zi self-update && zi update --all -p works correctly as expected if launched by my user in my shell (zsh).
I'd add to the report that with some old version of topgrade (some months ago) there was no problem.

@ss-o
Copy link

ss-o commented Feb 23, 2024

the command zi self-update && zi update --all -p works correctly as expected if launched by my user in my shell (zsh). I'd add to the report that with some old version of topgrade (some months ago) there was no problem.

It is because parallel update uses the special zsh feature ‘&!’ which leaves the process in the background and disowned. In other words, the shell does not wait for the command to finish, and the return status is 0.

@SteveLauC
Copy link
Member

SteveLauC commented Feb 23, 2024

I guess this was introduced in Make zinit and zi use parallel updates where the -p option was added

@SteveLauC
Copy link
Member

Also cc @karman011, I think this is the issue you reported in this comment.

@scrambler-crypto
Copy link
Author

So, am I correct saying that the update process is correctly run but is wrongly reported as FAILED?
As I use the topgrade flags to avoid re-run when there is an error and continue even with errors to the next app, it is only a "cosmetic" bug on my side, but maybe worth of correction.

@SteveLauC
Copy link
Member

So, am I correct saying that the update process is correctly run but is wrongly reported as FAILED?

No, I guess it is indeed a bug

I am considering reverting that PR if we cannot hanlde that -p option correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants