Commit Graph

376 Commits

Author SHA1 Message Date
Benjamin Chen
3e7c66f6de Add toolchain override support on command line 2019-10-22 19:48:02 -04:00
Jon Gjengset
66fdf0f06a install: add --profile flag to override profile
Previously, the profile to use when installing a new toolchain had to be
set globally through `rustup set profile`, or at rustup-init time.
Sometimes this is inconvenient, because you only want to use a
particular profile when installing a specific toolchain. This patch
allows users to pass `--profile` to `rustup install` to override the
profile used for that one install.

Fixes #2004.
2019-10-20 11:10:42 -04:00
Benjamin Chen
0800f41d0c Update force_update param in install_from_dist calls in config.rs 2019-10-20 09:12:16 -04:00
Daniel Silverstone
a1fe74c9d4 Merge pull request #2046 from BeniCheni/clean-downloads-after-update
Delete content of downloads dir of user home in update subcommand
2019-10-18 21:30:18 +01:00
Benjamin Chen
0db473b1be Delete content of downloads & tmp dirs after full rustup update 2019-10-18 15:22:18 -04:00
Daniel Silverstone
82764b1b58 tests: Verify force-skipping a component doesn't mark it installed
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-16 09:50:39 +01:00
Daniel Silverstone
d8511f2325 Test that toolchain installs skip missing components on rustup install
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-15 21:40:19 +01:00
Daniel Silverstone
795b2231fb Test that skipping components when forcing installs works
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-15 21:09:52 +01:00
Daniel Silverstone
43d2278451 Support unavailable rls more completely in mock channels
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-15 21:09:32 +01:00
Daniel Silverstone
d07f284c38 tests: Add rls to complete profile in mock channels
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-15 21:07:28 +01:00
Julian Tescher
e3588b20aa Fix small typos 2019-10-12 15:15:34 -07:00
Yves Dorfsman
c50626e902 Adding ability to open doc on a specific topic 2019-10-06 10:18:28 -06:00
Daniel Silverstone
2ce2428f36 Merge pull request #2030 from BeniCheni/which-by-toolchain
Support --toolchain option to rustup which
2019-09-30 08:36:28 +02:00
Daniel Silverstone
fe4f5b5e8a Sort components to make tests stable
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-30 08:05:23 +02:00
Benjamin Chen
d0b5b8b22b Support --toolchain option to rustup which
Update code format by cargo fmt for cli-misc.rs

Test both windows and non-windows which() in cli-misc.rs
2019-09-30 00:32:45 -04:00
Daniel Silverstone
bdcf194702 Support installation with additional components and targets
Add support for "-c" and "-t" to `rustup toolchain install`
and to `rustup-init` itself.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-27 23:13:29 +02:00
Benjamin Chen
1844a92a75 Update notification for removing component
Use update_from_dist flag for Notification::RemovingOldComponent

Rename explicit_modify param in update fn of dist manifestitation

Rename implicit_modify param in update fn of dist manifestitation
2019-09-27 11:01:04 -04:00
Daniel Silverstone
8f1eb209a1 Clear a couple of new clippy lints
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-27 08:44:22 +02:00
PicoJr
280679c925 feat: --quiet option
--quiet disables progress output
tests: see `tests/cli-rustup.rs`
2019-09-25 20:36:08 +02:00
Lzu Tao
9a4c5d828c Remove useless vec![] 2019-09-25 12:41:06 +07:00
Lzu Tao
c8601d2434 Remove let unit value 2019-09-25 10:56:57 +07:00
Jon Gjengset
1b647884f6 Correctly handle update across missing nightlies
Fixes #2001.
2019-09-18 08:29:12 -04:00
Jon Gjengset
4e8bcf5ca5 Make it clearer what each Scenario enables 2019-09-17 14:17:21 -04:00
Jon Gjengset
461bcb1b69 Test that we skip missing nightlies 2019-09-17 10:45:31 -04:00
Jon Gjengset
67c73105a0 Update to most recent viable nightly
Previously, if the user had components installed on `nightly` which were
not available for the latest nightly, `rustup update` would not update
the user's nightly at all. With this patch, rustup will try
progressively older nightlies until it finds a nightly that supports all
the components the user has installed for their current nightly.

Fixes #1628.
Makes progress towards #1501.
Fixes the underlying issue in #1676.
2019-09-17 10:45:31 -04:00
Daniel Silverstone
0ec2dbe38e Merge pull request #1988 from BeniCheni/toolchain-list-verbose
Implement verbose option for "rustup toolchain list"
2019-09-17 14:30:58 +01:00
Benjamin Chen
5406e6f60c Implement verbose option for rustup toolchain list
Update verbose option for toolchain list

Correct toolchain list tests w. verbose option

Update syntax based on clippy

Simplify toolchain_list fn in rustup_mode.rs

Correct typo in list subcommand
2019-09-16 10:53:58 -04:00
Andy McCaffrey
540ccc66e2 Adding tests to cli-exact suite for rustup check command 2019-09-12 20:27:51 +02:00
Nick Cameron
ec6d1afcbe Installation profiles (#1673)
* Add profile argument to rustup install

* Address some warnings

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Review changes

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2019-09-12 09:10:04 +12:00
Daniel Silverstone
ee9a64b7d2 clitools: Clean up tests once run
This reduces the waste in the target/ directory which could otherwise
run a system out of disk space.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-01 22:21:59 +01:00
Lzu Tao
c104e3b6b9 Replace tempdir with tempfile 2019-07-29 11:10:32 +12:00
Fisher Darling
eef4211aa7 Display RUSTUP_HOME in rustup show and rustup show home 2019-07-28 13:01:06 +01:00
Fisher Darling
579599591a Add test for rustup show home. Fixed other test cases. 2019-07-28 13:01:06 +01:00
Daniel Silverstone
82c92eb77b cli-v2: Test that unavailable targets are not listed
Verify that targets which are not available are not listed
when we look for targets in a toolchain.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-07-02 22:48:07 +01:00
Daniel Silverstone
17e46e0b3f Merge pull request #1910 from lzutao/env-debug-test-locally
Add RUSTUP_BACKTRACE env to enable tests backtrace
2019-07-02 11:59:27 +01:00
Charlie Saunders
188c2b1af8 Fix formatting. 2019-06-30 22:23:02 -04:00
Charlie Saunders
f9b862423d Add test for read-only rc profiles. 2019-06-30 22:21:31 -04:00
Lzu Tao
2060866577 Add RUSTUP_BACKTRACE env to enable tests backtrace 2019-06-30 16:33:25 +07:00
Daniel Silverstone
b25438d9a7 clitools: Hopefully mitigate unexpected test failures
In order to mitigate the test failures we were seeing where we
ran out of hard links on NTFS filesystems, copy the rustup binary
into place in the test environment, rather than hard-linking
the one which was built.  In order to do this safely, we use
an RwLock to ensure we can't be forking in other tests while
one test is copying a binary into place.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-30 09:26:58 +01:00
Daniel Silverstone
80e21a991f mock_bin_src.rs: Localise import of std::fs::File
The import of std::fs::File was only used in the windows
codepath, so localise its use to remove unused import warnings
otherwise issued in the tests.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-30 09:19:14 +01:00
Lzu Tao
0724f2d860 Switch to std::fs::read_to_string 2019-06-21 19:34:52 +07:00
Daniel Silverstone
136e0c47bc Merge pull request #1896 from kinnison/kinnison/snappy
A variety of fixes, and detection of snappy et al.
2019-06-15 20:08:18 +01:00
Daniel Silverstone
252a2f8e2e update: Set default toolchain on fresh installation
When Rustup is fresh-installed with no toolchain, or if the
user deletes the default toolchain setting in the toml, then
the first time we *Install* a new toolchain, set it as the default.

This removes the surprising effect of:

rustup-init --default-toolchain none
...
rustup toolchain install stable
...
cargo build
=> no toolchain set.

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-06-15 18:38:04 +01:00
Robert Collins
b146976e20 Eliminate post-install directory-walk
This was only needed because we were not controlling the permissions
accurately during unpack, which can now be corrected.
2019-06-07 11:20:10 +12:00
Lzu Tao
bd844a13cd Fix override_set_unset_with_path 2019-06-06 01:10:30 +07:00
Robert Collins
dde38d2b12 Bug #1870 UI component
When we spin retrying a rename, show a UI notification.

Rather raw but much better than silently doing nothing for an extended
period.
2019-06-03 20:25:43 +12:00
Robert Collins
b3325f95fe Move (some) notification type cast to sender
The sender can be parameterised with a type parameter allowing
write-once handlers that can handle any Notification type within
their enum hierarchy as long as From is present, unlike the receiver
(because the receiver is passed as a parameter to the function that
will be doing the callback.)

Less adapters, less closures, less headaches when introducing UI
interactions to currently UI-interactionless codepaths.
2019-06-03 10:09:34 +12:00
Daniel Silverstone
a12ece30d9 clitools: Remove RUST_BACKTRACE from environment during tests
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-05-26 21:21:20 +01:00
gnzlbg
b5832b10e4 Error if all is combined with other targets 2019-05-24 11:27:46 +02:00
gnzlbg
bea09a334c Add support for rustup target add all to install all available targets.
Closes #1653 .
2019-05-23 12:06:36 +02:00