rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.13k stars 882 forks source link

chocolatey installer #912

Open ctaggart opened 7 years ago

ctaggart commented 7 years ago

There is already another general issue titled Consider packaging rustup & this request is specific to chocolatey. It would be great to be able to do:

choco install rustup

It is currently possible to install the rust gnu package with the rust package, but that is not what I want. I want to manage rust with rustup.

I should be able to create the package pretty easily. I just need the URL to download a specific version of rust-init.exe so that the script can validate the checksum.

ctaggart commented 7 years ago

So just like in appveyor.yml, where it has:

curl -sSf -o rustup-init.exe https://win.rustup.rs/

It should be great if there was an optional version parameter, so that something like this would work?

curl -sSf -o rustup-init.exe https://win.rustup.rs/?version=1.0.0

Not as important, but is there a way to get or download the sha256 that I see?

ctaggart commented 7 years ago

I took a crack at it and published a prerelease. Code is here https://github.com/ctaggart/rustup.rs. We'll need to test on a fresh Windows, but this should install Visual C++ & then Rust targeting VC.

choco install vcbuildtools
choco install rustup -version 1.0.0-beta1 -pre

https://chocolatey.org/packages/rustup/

ctaggart commented 7 years ago

Chocolatey's automated testing failed, which is pretty cool. Here is the output. https://gist.github.com/choco-bot/c87cef0bfe95885db32a3cf614667d46#file-install-txt-L281-L289

Looks like it times out, waiting for the prompt. I'll pass the -y flag in to allow the silent install.

PS C:\Users\c> C:\Users\c\Downloads\rustup-init.exe --help
rustup-init 1.0.0 (17b6d21 2016-12-15)
The installer for rustup

USAGE:
    rustup-init.exe [FLAGS] [OPTIONS]

FLAGS:
    -v, --verbose           Enable verbose output
    -y                      Disable confirmation prompt.
        --no-modify-path    Don't configure the PATH environment variable
    -h, --help              Prints help information
    -V, --version           Prints version information

OPTIONS:
        --default-host <default-host>              Choose a default host triple
        --default-toolchain <default-toolchain>    Choose a default toolchain to install
PS C:\Users\c>
ctaggart commented 7 years ago

beta2 failed the Chocolatey automated tests. It timed out after the default of 45 minutes. It is working fine on both of my laptops:

C:\WINDOWS\system32>choco install rustup --version 1.0.0-beta2
Chocolatey v0.10.3
Installing the following packages:
rustup
By installing you accept licenses for the packages.

rustup v1.0.0-beta2 - Possibly broken
rustup package files install completed. Performing other installation steps.
Downloading rustup-init
  from 'https://win.rustup.rs/?version=1.0.0'
Progress: 100% - Completed download of C:\Users\c\AppData\Local\Temp\chocolatey\rustup\1.0.0-beta2\rustup-init.exe (7.21 MB).
Download of rustup-init.exe (7.21 MB) completed.
Hashes match.
Installing rustup-init...
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: default toolchain set to 'stable'
rustup-init has been installed.
Only an exit code of non-zero will fail the package by default. Set
 `--failonstderr` if you want error messages to also fail a script. See
 `choco -h` for details.
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 The install of rustup was successful.
  Software installed as 'EXE', install location is likely default.

Chocolatey installed 1/1 packages. 0 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

You use Chocolatey? You are amazing! Are you ready to take the next
 step and look even smarter with more awesome features?
 https://chocolatey.org/compare
ctaggart commented 7 years ago

I uninstalled Visual C++ Build Tools and tried again. It looks to be prompting, even though I told it not to with a -y.

C:\WINDOWS\system32>"C:\Users\c\AppData\Local\Temp\chocolatey\rustup\1.0.0-beta2\rustup-init.exe" -y

Rust Visual C++ prerequisites

Rust requires the Microsoft C++ build tools for Visual Studio 2013 or later,
but they don't seem to be installed.

The easiest way to acquire the build tools is by installing Microsoft Visual
C++ Build Tools 2015 which provides just the Visual C++ build tools:

  http://landinghub.visualstudio.com/visual-cpp-build-tools

Alternately, you can install Visual Studio 2015 or Visual Studio 2013 and
during install select the "C++ tools":

  https://www.visualstudio.com/downloads/

Install the C++ build tools before proceeding.

If you will be targetting the GNU ABI or otherwise know what you are doing then
it is fine to continue installation without the build tools, but otherwise,
install the C++ build tools before proceeding.

Continue? (Y/n)
ferventcoder commented 7 years ago

Highly likely you have an unknown dependency you don't see until you try to run your install against a system like the test environment which doesn't have anything more than the stock ISO install of Windows 2012 R2 on it.

ctaggart commented 7 years ago

@ferventcoder, that is correct. It is prompting when Visual C++ Build Tools is not installed. It shouldn't be doing that when -y is passed, so I logged bug #916.

ferventcoder commented 7 years ago

Ah, didn't see the timing of that :)

Diggsey commented 7 years ago

@ctaggart Great work on this, sorry I didn't reply sooner.

I'm not sure what the plan is here for rustup, whether we want to bring more different packaging scenarios into the release process, or whether it will stay separate. @brson ?

chriskrycho commented 7 years ago

What work needs to be done on this and how can I help? Came looking after I saw someone ask on Twitter for a one-liner to install rustup.

shaleh commented 6 years ago

Yes please. I have some chocolatey scripts so I can go from fresh VM to writing code with minimal hassle. rustup support would be welcomed.

mcandre commented 6 years ago

Error, the checksum for rustup-init.exe has changed, causing the Chocolatey recipe to fail. On my machine, the new sha256 checksum is b33a82c54199a427172fec8957760ae7c9a7b7a13b0814bdddb4438e7f88e801.

vors commented 6 years ago

To avoid the checksum problem, I think it makes sense to bundle the rustup-init.exe inside the choco package instead of downloading it from the web. Or getting the sha from the web as well (less secure). In case it lags behind, you will possibly get the older version, which could be then self-updated with rustup update.

ferventcoder commented 6 years ago

I think it makes sense to bundle the rustup-init.exe inside the choco package instead of downloading it from the web. Or getting the sha from the web as well (less secure).

Bundling would be the only option available between these two. Getting checksum at runtime circumvents the security measure - thus it won't pass moderation.

ctaggart commented 6 years ago

Bundling sounds like a great option. Is this something someone else can pick up? This is not something I have time for right now.

vors commented 6 years ago

@ctaggart I can try. Do you mind giving me package management permissions on choco https://chocolatey.org/profiles/vors ?

ctaggart commented 6 years ago

@vors Done

SRGOM commented 6 years ago

Please include multi rust in place of rust up. I'd I remember correctly 6 months back that was the tool recommended officially

ctaggart commented 6 years ago

@SRGOM No, it is the opposite. https://github.com/brson/multirust https://www.rust-lang.org/en-US/install.html

vors commented 6 years ago

Great!

Repo: https://github.com/vors/choco-rustup @ctaggart I reused your paket template, but converted it to nuspec to avoid additional dependency on paket.

I published the rustup.1.11.0-beta1.nupkg Please try it out with

choco install rustup -pre

If everything works, I will publish the package without -beta1 prefix.

tcr commented 6 years ago

@vors I tried this out and it worked perfectly on my Windows 10 machine.

It didn't seem to affect anything, but I ran choco install visualstudio2017-workload-vctools instead of choco install vcbuildtools as mentioned above.

CGMossa commented 5 years ago

I also tried it, and it works fine.

Although I did not use either visualstudio2017-workload-vctools nor vcbuildtools, but installed those without chocolatey.

But rustup was installed just fine, and contained the newest version of itself, etc..

vors commented 5 years ago

Oh sorry, totally dropped the ball on it. Looks like we should publish

rbtcollins commented 5 years ago

@vors please do

vors commented 5 years ago

Published, awaiting choco automated test / review

vors commented 5 years ago

@ferventcoder I fixed the package so it passes the tests, can you stamp it?

ferventcoder commented 5 years ago

@vors The community moderators will take a look and move that if they haven't already.

majkinetor commented 5 years ago

They haven't already as reviewed - package is not good enough to be published and requires maintainer to fix it.

vors commented 5 years ago

I don't have a windows machine and energy to take another iteration on it at the moment. Please, continue to use choco install rustup -pre for the time being.

exarkun commented 4 years ago

Apparently the checksum has changed again, breaking the choco package.

Error - hashes do not match. Actual value was '9F9E33FA4759075EC60E4DA13798D1D66A4C2F43C5500E08714399313409DCF5'.
ERROR: Checksum for 'C:\Users\appveyor\AppData\Local\Temp\1\chocolatey\rustup.install\1.19.0\rustup-init.exe' did not meet 'E325B428A0FF9132B59EC586E85B1DB4EAA66ACC13B3DAF8090520D2E7694388' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
kinnison commented 4 years ago

That's a pretty old rustup too.

majkinetor commented 4 years ago

Chocolatey package should contain it, this is bad community package. Then checksum wont fail.

On Jan 7 2020, at 5:54 pm, Daniel Silverstone notifications@github.com wrote:

That's a pretty old rustup too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://link.getmailspring.com/link/2FB74FE0-93CE-41AB-8187-275EE7798047@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2Frust-lang%2Frustup%2Fissues%2F912%3Femail_source%3Dnotifications%26email_token%3DAAAU6BZPGKYKB7BFYBNXVFLQ4SXVLA5CNFSM4C3WDXG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIJQ65I%23issuecomment-571674485&recipient=cmVwbHkrQUFBVTZCNzVCQVRSUjNNNkRCQ1g3NjU0RUhWRkxFVkJOSEhBWFlUQ0VJQHJlcGx5LmdpdGh1Yi5jb20%3D), or unsubscribe (https://link.getmailspring.com/link/2FB74FE0-93CE-41AB-8187-275EE7798047@getmailspring.com/1?redirect=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAAU6B4QCYLRBEQ37LX6PNTQ4SXVLANCNFSM4C3WDXGQ&recipient=cmVwbHkrQUFBVTZCNzVCQVRSUjNNNkRCQ1g3NjU0RUhWRkxFVkJOSEhBWFlUQ0VJQHJlcGx5LmdpdGh1Yi5jb20%3D).

exarkun commented 4 years ago

Sorry I just noticed this is the "rustup" issue tracker and my error comes from trying to install "rustup.install" which I guess is something different

majkinetor commented 4 years ago

No, thats the same thing. Install means it uses windows installer, there are also portable packages.

rbtcollins commented 4 years ago

@vors how can we help? Can we scale this in the community somehow?

lokinmodar commented 4 years ago

Having problems with rustup.install in chocolatey (installing or upgrading) "rustup-init.exe' did not meet '9F9E33FA4759075EC60E4DA13798D1D66A4C2F43C5500E08714399313409DCF5' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary."

kinnison commented 4 years ago

Sounds like whoever is looking after the chocolatey package isn't keeping it up to date.

vors commented 4 years ago

Hey, I don’t have any windows machines at the moment and it’s unlikely that I would have access to any in the near future. Sorry my effort didn’t result in the good choco package.

mcandre commented 3 years ago

Possible to turn off the checksum requirement? I realize that is difficult to do, but for such a transient artifact it would be nice to automatically follow upstream changes, rather than waiting for humans to manually catch up every day.

On Tue, Jul 21, 2020, 9:39 PM Sergei Vorobev notifications@github.com wrote:

Hey, I don’t have any windows machines at the moment and it’s unlikely that I would have access to any in the near future. Sorry my effort didn’t result in the good choco package.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rust-lang/rustup/issues/912#issuecomment-662207906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABJRCVOZFV4FGQOORK3ZTR4ZGNPANCNFSM4C3WDXGQ .

workingjubilee commented 3 years ago

@rustbot label: +O-windows

rami3l commented 3 months ago

We do have a page for Rustup on choco now, but looks like it's extremely outdated: https://community.chocolatey.org/packages/rustup.install

SeanFarrow commented 1 month ago

I'd really like to help out with this.

What needs to be done to make this package pass testing?

rami3l commented 1 month ago

I'd really like to help out with this.

What needs to be done to make this package pass testing?

@SeanFarrow Thanks for your interest in this! However the maintainance of that package on choco (by @camilohe) is a community effort and is not affiliated with the Rustup team in any way, so I suggest getting in touch with them to see whether we can have a new maintainer/collaborator on https://github.com/camilohe/rustup.install.