Rustc --print sysroot opens a new instance of my terminal emulator

This is perhaps one of the oddest bugs I've encountered, and I'm not sure it can be classified as a rustc issue, but I was hoping someone might be able to help me out here.

Fast facts:

  • I'm trying out hyper terminal
  • To install hyper, I put the AppImage executable in my $PATH such that hyper opens the terminal
  • I use zsh, and my .zshrc includes the line export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src". This is the problematic line.
  • When I open a new instance of hyper, I get a recursive set of windows. I think 5 windows spawn, and the last one finally errors with 'hyper' is not installed for the toolchain 'nightly-x86_64-unknown-linux-gnu'. Why the fifth window errors while the previous ones do not is beyond my understanding.
  • When I take the line out of my zshrc, the problem does not occur.
  • If I just type rustc --print sysroot in hyper (when the line is not in my zshrc), one instance of the terminal pops up. At some point rustc --print sysroot is starting the application in a manner similar to just typing hyper.
  • If I do any of this in alacritty, 0 issues occur. The alacritty binary is in the same place as the hyper binary ($HOME/.bin/{alacritty,hyper})

Does anyone have any idea why this would happen or how I can fix it? It's worth noting that renaming the hyper AppImage to hyper2 does not resolve the problem.

EDIT: This occurs whenever I use rustup, actually. rustup --version results in the same output as hyper --version for some reason. I'm fairly confident the rustup binary has not changed (last modified 18 Dec 2019, and using it in Alacritty yields normal behavior)

EDIT 2: This doesn't happen if I install using the deb instead of the AppImage...

If you can run the same line in alacritty and hyper and get different 2 results, I'm guessing it's something related to hyper and rustc is just hitting the right edge case.

Do you have a link to the project's repo? It might be useful asking on their issue tracker.

I'm guessing rustc does 5 operations (whatever they may be) and after the fifth it figures out hyper isn't installed? For example, imagine needing to run 5 cargo commands to figure out what programs are installed globally, and every time a binary runs a subprocess hyper creates a new window.

Do you have a link to the project's repo? It might be useful asking on their issue tracker.

I did actually: rustc --print sysroot launches hyper (recursively, considering it's in my zshrc) · Issue #4542 · vercel/hyper · GitHub

I'm guessing rustc does 5 operations (whatever they may be) and after the fifth it figures out hyper isn't installed?

I don't think this is the case, because if I take it out of my zshrc and run it one time, it only opens one hyper window. The only time it opens more is when my zshrc includes the line, so it's creating a recursion where a new window opens, runs the zshrc, and that line opens another window, which runs the zshrc... So it's not 5 times in a row and gives up after the 5th time. It's 5 times recursively and gives up during the 5th recursion.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.