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

windows terminal + cmd + nonadmin user fails #3098

Closed
Djtpj opened this issue Oct 25, 2022 · 14 comments
Closed

windows terminal + cmd + nonadmin user fails #3098

Djtpj opened this issue Oct 25, 2022 · 14 comments
Labels

Comments

@Djtpj
Copy link

Djtpj commented Oct 25, 2022

Problem

The rustup-init.exe file is not doing anything on install. It simply outputs the following text:

The Cargo home directory is located at:

  C:\Users\<username>\.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  C:\Users\<username>\.cargo\bin
                                                                                                                        
The Cargo home directory is located at:

  C:\Users\<userame>\.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  C:\Users\<username>\.cargo\bin

This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

This outputs the same thing every time I run it, and as far as I can tell changes nothing on the disk.CARGO_HOME does not change, or even exist.

Steps

  1. Open the rustup-init.exe file.

Possible Solution(s)

It is possible that in the past I have installed/attempted to install Rust, and there may be a broken installation, however I'm not sure if that's related. Again, there is no C:\Users\<username>\.cargo folder on the C:\ drive.

Notes

I'm using Windows 11.

And obviously, anywhere I use <username>, I'm substituting it for my actual Windows user name.

Rustup version

N/A

Installed toolchains

N/A
@Djtpj Djtpj added the bug label Oct 25, 2022
@Djtpj Djtpj changed the title Rustup Installer Repeating Itself Rustup Installer Repeating Itself And Doing Nothing Oct 25, 2022
@ChrisDenton
Copy link
Member

Can you say more about how you're opening rustup-init.exe? By double clicking the exe? Is it running in a command prompt? Or a third party shell (e.g. msys2, git bash, etc)?

I tried various things in the Windows 11 Sandbox and haven't been able to trigger the same issue. If there's no .cargo directory and no CARGO_HOME environment variable then it should do a new install. The only other thing would be to check the PATH environment variable for anything that looks like "cargo" or "rust" directories and remove them.

This is what I get when I tried (though the length means there's a bit of scrolling involved in real life):

output
Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  C:\Users\WDAGUtilityAccount\.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:

  C:\Users\WDAGUtilityAccount\.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  C:\Users\WDAGUtilityAccount\.cargo\bin

This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

@Djtpj
Copy link
Author

Djtpj commented Oct 25, 2022

I'm opening via double clicking in a third party file explorer program called Files.
I'm also using the Windows Terminal instead of the typical command prompt.

I double checked, and there are no environment variables with paths leading to a cargo related directory.

@ChrisDenton
Copy link
Member

Hm, the only other thing I can think of at the moment is to try opening powershell first and then running it from within that (or from within cmd.exe).

I'm not sure if that will help though.

@Djtpj
Copy link
Author

Djtpj commented Oct 25, 2022

That did the trick! I opened the installer in an admin powershell window and the installer started working normally. Thanks for your help. For some reason it didn't even occur to me that it could be an admin privs thing

@Djtpj Djtpj closed this as completed Oct 25, 2022
@rbtcollins
Copy link
Contributor

@Djtpj admin privileges shouldn't be needed. Could you try uninstalling as admin, then trying the install again but just from a non admin CMD.exe window?

@Djtpj
Copy link
Author

Djtpj commented Oct 26, 2022

So I tried from a non-admin CMD Windows Terminal window, and it was still spitting out the same stuff as I mentioned when I opened this issue.

I tried in a powershell window without admin privileges, and it worked just fine.

I also just tried using a non-admin command prompt window instead of Windows Terminal, and it worked from the terminal. It appears to be an issue with Windows Terminal? Or at least my Windows Terminal... What's weirder is that when I tested powershell without admin privs, I tested in Windows Terminal, and it worked just fine.

I've never had any issues like this with Windows Terminal before, so I'm a little confused...

@rbtcollins rbtcollins changed the title Rustup Installer Repeating Itself And Doing Nothing windows terminal + cmd + nonadmin user fails Oct 30, 2022
@rbtcollins rbtcollins reopened this Oct 30, 2022
@rbtcollins
Copy link
Contributor

So clearly some incompatibility. Its not clear whether thats coming from Windows Terminal, or rustup. Can you uninstall rustup, then reproduce the problem with:

  • verbose output (add -v to the command line)
  • RUST_BACKTRACE=1 set in the environment before you run rustup-init
  • RUSTUP_TRACE_DIR=c:\users\yourusername\somedirectoryyoumade

And also have procmon tracing all activity from processes called rustup-init.exe

That should give us enough telemetry to get some idea whats going on.

You might also open a ticket with Windows Terminal and see if they have any ideas

@Djtpj
Copy link
Author

Djtpj commented Oct 31, 2022

I'm not positive that this is useful information, however, when I went to open the installer to follow your instructions, I forgot that I had recently set command prompt back to my default. So I opened a command prompt window through windows terminal. This installation was completed successfully. I tested again with windows terminal without changing anything but my default terminal, and the install displayed the same text as when I opened this issue.

The -v flag does not appear to change anything, which may be an issue with how I'm executing the command. I've been using start rustup-init.exe, however, I'm not noticing a difference when I use start rustup-init.exe -v. I'm not sure that this is the correct placement though.

I set those variables in my home (and verified that they were recognized). No change in Terminal, and Command Prompt worked fine as per usual.

I'm not familiar with 'procmon'? I found a dedicated download for it and installed it however I'm not sure how to make productive use of it.

@ChrisDenton
Copy link
Member

From a discussion elsewhere it seems there's a problem with windows terminal when more than a screen's worth of text is printed immediately on startup. I don't know why.

One workaround might be to print a shorter "welcome" message before printing the full message. For example:

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

press enter to get started

@rbtcollins
Copy link
Contributor

I tried

"C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.16.10262.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe" Documents\src\rustup.rs\target\debug\rustup-init.exe

but a new terminal pops up with the expected text and the prompt for 1/2/3, and I'm able to cancel just fine

@ChrisDenton
Copy link
Member

This is a bug in Windows Terminal, tracked on their repository microsoft/terminal#14512. I wrote repo instructions here.

It's a (race?) problem on startup, so it's intermittent and can be workaround using some form of short pause before printing more than a screenful of output.

@taitep
Copy link

taitep commented Jul 11, 2023

had this issue, just run as admin.

@rbtcollins
Copy link
Contributor

Dup of #3043 we think

@taitep
Copy link

taitep commented Jul 31, 2023

Dup of #3043 we think

no

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

No branches or pull requests

4 participants