1

I installed Rust at home with no issues. Behind a company proxy I couldn't run rustup-init, so I installed 1.18 stable with an installer.

On every Rust command (e.g. cargo). I get the notification "error: no default toolchain configured". The only related question I found was this one, but the answer isn't very helpful. Knowing it is a proxy issue is useful, but I can't find an answer how to configure the proxy so that this works.

kmdreko
  • 42,554
  • 6
  • 57
  • 106
CodeMonkey
  • 4,067
  • 1
  • 31
  • 43
  • 1
    I have the same issue behind the corporate network of my company. The proxy blocks all network actions that cargo wants to perform. I usually build using rustc. But that might not be an option for you. I sometimes also use a personal hotspot from my phone to get around it. – Noel Widmer Jul 05 '17 at 11:43
  • @NoelWidmer I found it was not related to the proxy at all. Although I still can't use cargo, at least the basic rust compiler works and cargo has different errors. – CodeMonkey Jul 05 '17 at 11:54

1 Answers1

0

I found an answer to why I'm getting this error message:

The Rust installer put two locations on my path:

  • C:\Users\<USERNAME>\.cargo\bin
  • C:\Users\<USERNAME>\AppData\Local\Programs\Rust\bin

The first one seems to have dummy .exes (which for some reason are 4.62MB) and the second one contains cargo and rustc.

I don't know why these dummy .exes exist, but if I take them off the path I can compile simple Rust programs.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
CodeMonkey
  • 4,067
  • 1
  • 31
  • 43
  • 1
    *I don't know why these dummy .exes exist* — that's how the actual version multiplexing works. Without them, you won't be able to install new toolchain versions with `rustup install another-version` or any of the other features. – Shepmaster Jul 05 '17 at 13:26
  • Ok that does make some sense, but having them on the path before the actually installed version seems like making things complicated. There should be a hint what should be done next to the error, because Google isn't helpful right now. – CodeMonkey Jul 05 '17 at 13:41
  • *seems like making things complicated* — it's the **only** way for it to work. They *have* to be first so that they can intercept calls to `rustc` or `cargo` and then delegate the call to the correct version of the intended tool. To fix "error: no default toolchain configured", you need to configure a default toolchain. That's usually done with `rustup default stable` or whatever version is preferred. – Shepmaster Jul 05 '17 at 13:44
  • @Shepmaster that's a bug then if you didn't use or have rustup, but instead used the installer (as I mentioned I couldn't get rustup to run with the proxy). So I think for non-rustup installs this is a bug. – CodeMonkey Jul 05 '17 at 14:30
  • Potentially... It appears you were able to install rustup itself (which is what added the shim executables) and then not able to install a toolchain. Do you have a `rustup` binary? That would be pretty solid proof. – Shepmaster Jul 05 '17 at 14:32
  • @Shepmaster only the fake one. Maybe the rustup-init starts copying files before being able to download anything. – CodeMonkey Jul 05 '17 at 14:34
  • What "fake" one? There is only one `rustup` binary. – Shepmaster Jul 05 '17 at 14:34
  • Nvm, everything else is fake in that folder, except the rustup executable. – CodeMonkey Jul 05 '17 at 14:36