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

Failure to install on Windows #2203

Open
jebrosen opened this issue Jan 16, 2020 · 12 comments
Open

Failure to install on Windows #2203

jebrosen opened this issue Jan 16, 2020 · 12 comments
Labels
bug O-windows Windows related

Comments

@jebrosen
Copy link

jebrosen commented Jan 16, 2020

Problem

Rocket's Windows CI (Azure Pipelines) started failing between 27 and 4 days ago. We run this command:

curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain $(rust_version)

And the output looks like this:

========================== Starting Command Output ===========================
"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "d:\a\_temp\8545808c-7a04-4daf-ad75-cd45a608d93d.cmd""
info: profile set to 'default'
info: default host triple is i686-pc-windows-msvc
error: toolchain 'stable' is not installed
error: caused by: not a directory: 'C:\Users\VssAdministrator\.rustup\toolchains\stable-i686-pc-windows-msvc'
##[error]Cmd.exe exited with code '1'.
Finishing: Install Rust (nightly)

In a previous successful run, this was the output:

========================== Starting Command Output ===========================
"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\60e92b2b-f745-49cf-b841-7987dd621bcc.cmd""
info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
info: updating existing rustup installation

Steps

I have not attempted to reproduce this yet. I'll try locally first, but I would not be surprised if there's some kind of caching going on from a previous installation that will make reproduction difficult.

Analysis

Two things about this seem really odd to me: i686 (maybe related to #2179?) and stable when the requested version was nightly. I don't know if it's trying to find the stable toolchain before or during a self-update, assuming it is trying to do one.

Any hints before I go and try this on bare metal?

@jebrosen jebrosen added the bug label Jan 16, 2020
@jebrosen
Copy link
Author

Update: I tried this on my machine today and got something normal-looking:

PS C:\Users\jeb\Downloads> '.\rustup-init.exe' -y --default-toolchain nightly
info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
info: updating existing rustup installation

(...)

@kinnison
Copy link
Contributor

IIRC Azure's setup is very odd and breaks rustup quite badly because of how they do layering for preinstalled stuff. I've had fewer issues with github actions, so perhaps they fixed things in there?

anderejd added a commit to geiger-rs/cargo-geiger that referenced this issue Jan 20, 2020
Reverted experiments, seems like others are having the same problem. 
rust-lang/rustup#2203
https://github.com/anderejd/cargo-geiger/issues/86
@nikodemus
Copy link

FYI: I had this on a personal project as well. Adding explicit host triple made it work again:

--default-host x86_64-pc-windows-msvc 

@jebrosen
Copy link
Author

That flag seems to have worked for us, as well.

Is there any chance the host detection changed in 1.21 either for better or worse that could be making this necessary?

Alternatively, I wonder if the builders were changed in some way (e.g. from 32-bit to 64-bit) without clearing any caches.

@anderejd
Copy link

@nikodemus Thank you! Your solution works for me as well.

@rbtcollins
Copy link
Contributor

is your curl an x86-64 curl?

@johnterickson
Copy link

Are you running from a “script” block or “bash” block?

@nikodemus
Copy link

This is what I have now (which works, with the explicit --default-host.)

  - script: |
      curl -sSf -o rustup-init.exe https://win.rustup.rs
      rustup-init.exe -y --profile minimal --default-host x86_64-pc-windows-msvc --default-toolchain stable
      echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
    displayName: Windows install rust
    condition: eq( variables['Agent.OS'], 'Windows_NT' )

@johnterickson
Copy link

What’s weird about this is how it ever worked 😄

From all I have read it should have always been downloading and installing the 32-bit version... 🤔

As of this, the right thing should be happening:
#2179 (comment)

@jebrosen
Copy link
Author

jebrosen commented Feb 8, 2020

We do this in a script block.

curl --version just says "Windows", but where reports that curl is: C:\Windows\System32\curl.exe (🤨) or possibly C:\Program Files\Git\mingw64\bin\curl.exe.

7z l C:\Windows\System32\curl.exe | findstr CPU gives me:

C:\Program Files\Git\mingw64\bin\curl.exe
CPU = x64

So it seems likely it's a 64-bit curl.

@kinnison
Copy link
Contributor

If you're using win.rustup.rs then it will always download a 32 bit installer which should pick an installer which matches your platform but may incorrectly select a 32bit one instead. In CI it's recommended to install with explicit host triples or perhaps even to set it in a separate action and then install the toolchain. That protects you against changes in the underlying infrastructure more effectively.

Rantanen added a commit to Rantanen/intercom that referenced this issue Feb 29, 2020
chmln added a commit to chmln/rust-azure-pipelines that referenced this issue Mar 29, 2020
xoac pushed a commit to xoac/rust-azure-pipelines that referenced this issue Mar 30, 2020
jonhoo added a commit to crate-ci/azure-pipelines that referenced this issue Mar 30, 2020
jonhoo added a commit to crate-ci/azure-pipelines that referenced this issue Mar 30, 2020
jonhoo added a commit to crate-ci/azure-pipelines that referenced this issue Mar 30, 2020
@workingjubilee
Copy link
Member

@rustbot label: +O-windows

@rustbot rustbot added the O-windows Windows related label Apr 29, 2021
Inovker0416 added a commit to Inovker0416/azure_pipeline that referenced this issue Feb 5, 2024
Inovker0416 added a commit to Inovker0416/azure_pipeline that referenced this issue Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug O-windows Windows related
Projects
None yet
Development

No branches or pull requests

8 participants