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

Making docs optional again #998

Closed
3 tasks
MJDSys opened this issue Mar 20, 2017 · 69 comments
Closed
3 tasks

Making docs optional again #998

MJDSys opened this issue Mar 20, 2017 · 69 comments

Comments

@MJDSys
Copy link

MJDSys commented Mar 20, 2017

See as docs are required again due to #903, can we track what's necessary to make them optional again here? As one of my laptops doesn't have space for the docs (16G disk :( ), I'd be interested in helping fix the relevant issues. The two mentioned issues I've seen are:

Are there any others? And if you prefer to track this information elsewhere, please close this bug and point me in the right direction!

@vks
Copy link

vks commented Mar 22, 2017

Another problem are network file systems. For me it takes minutes to install the docs, the rest finishes almost instantly.

@pravic
Copy link

pravic commented Mar 22, 2017

I'd prefer to leave docs as optional since I use the online version only and don't want to waste disk space or increase rustup update time.

@brson
Copy link
Contributor

brson commented Mar 23, 2017

The major missing feature is that the manifest format needs to be extended to understand optional features: #1006.

@Boscop
Copy link

Boscop commented Jun 26, 2017

Yes, please make docs optional again! We work a lot with Raspberry Pis where space is very limited!

@wagenet
Copy link

wagenet commented Sep 13, 2018

This would certainly be nice for CI.

@Boscop
Copy link

Boscop commented Sep 14, 2018

And when updating a nightly or when different projects use different nightlies (with a rust-toolchain file) it always takes a long time to install/update them, it would be much faster without the docs.

@pravic
Copy link

pravic commented Sep 14, 2018

The major missing feature is that the manifest format needs to be extended to understand optional features

Is it still? Because now we have plenty of optional components in rustup (rust-std-*, rust-src, clippy-preview, etc).

The problem is (among others) that $toolchain/share/doc contains nearly 15000 files which is a big pressure on disk during toolchain updates - on Windows it takes a really significant amount of time to install rust-docs.

From #903:

It seems that most people are comforted knowing docs are available by default, so I want to turn them back on, then add some more options to remove them.

I am fine with default (though I really doubt that those who really need docs can't install them as a component), but let's make them as opt-out, so rustup would remember during the next update that rust-docs doesn't need to be downloaded.

@Boscop
Copy link

Boscop commented Sep 14, 2018

I can confirm that it takes a long time to install the docs on windows, and I'm dealing with multiple nightlies for different projects (with rust-toolchain files)..

But I'd prefer if the docs were opt-in, because most people only use the online docs. An internet connection is required to be able to use Rust anyway..

@Arnavion
Copy link

The major missing feature is that the manifest format needs to be extended to understand optional features

Is it still? Because now we have plenty of optional components in rustup (rust-std-*, rust-src, clippy-preview, etc).

@pravic The issue is that the manifest does not have a way express opt-out components, only opt-in.

@shepmaster
Copy link
Member

The playground docker images are also about 300MB larger than they need to be because of the docs (which I'm working on removing at the moment).

@Geobert
Copy link

Geobert commented Sep 19, 2018

Installation of docs makes rustup hang at the end of the install process: #1464

@pronebird
Copy link

It takes ages for us to install Rust on Travis/Windows. Any progress on sorting this out? Really delays builds by 10 minutes or more which is impossible to work in productive way without wasting 2 hours on CI each day.

@nrc
Copy link
Member

nrc commented Oct 24, 2018

I have a plan for profiles which will address this. I hope to implement in the next few weeks

@johnthagen
Copy link
Contributor

@nrc I'm sure this is nothing new to you, but wanted to provide another data point. Building a "Hello World" executable on Travis CI takes 8x longer on Windows. The vast majority of the time is spent installing rust-docs.

https://travis-ci.org/johnthagen/min-sized-rust/builds/465623377

travis-win

The profile work will have a great impact on CI. ❤️

@Kampfkarren
Copy link

@nrc What's the status on that? rust-docs takes minutes to install when I never use them.

@thedavidmeister
Copy link

@brson @nrc is there anything i can do to help progress this?

@ashthespy
Copy link

@kinnison Any way the community could help? If there are smaller sub tasks, I don't mind trying my hand at it.

@kinnison
Copy link
Contributor

kinnison commented Apr 2, 2019

There is a draft PR at #1673 which needs updating against the reorganisation of the codebase and such. I'm not sure how much more work will be needed after that, though @nrc will hopefully have something to say on what his plans are.

@ice1000
Copy link

ice1000 commented Apr 12, 2019

I am very looking forward to see an update on this issue.

@bestia-dev
Copy link
Contributor

"rustup docs" can be smart: if there is offline docs use it else go online.
The existing required "docs component" could be for online use.
A new optional "DocsOffline component" could be for offline docs.
Does it make sense?

@DoumanAsh
Copy link

DoumanAsh commented Apr 20, 2019

Until there is no way to opt-out of docs, they should not be installed by default

error: component 'rust-docs' for target 'x86_64-pc-windows-msvc' is required for toolchain 'nightly-x86_64-pc-windows-msvc' and cannot be removed

This is especially making me happy

@softprops
Copy link

I'm fine with docs by default as long as there is a way to opt out for use cases where they are not needed.

@thedavidmeister
Copy link

we moved to azure + appveyor "enterprise" and built images containing rust already installed

it was the only way to avoid timeouts

it's not cheap tho

@ashthespy
Copy link

There is hope!
image

@softprops
Copy link

Is there a place where I can read up on profiles. I've only found this open pull without a description #1673

@kinnison
Copy link
Contributor

kinnison commented May 7, 2019

Currently there's not anything concrete to read about, sorry, no.

@ashthespy
Copy link

@softprops
Maybe this gives you a starting point?

let profiles = &[
                ("minimal", vec!["rustc", "cargo", "rust-std"]),
                ("default", vec!["rustc", "cargo", "rust-std", "rust-docs"]),
                (
                    "complete",
                    vec!["rustc", "cargo", "rust-std", "rust-docs", "rust-src"],
                ),
            ];

@nrc
Copy link
Member

nrc commented May 22, 2019

Is there a place where I can read up on profiles. I've only found this open pull without a description

You can see the initial design discussion at https://internals.rust-lang.org/t/pre-rfc-improve-access-to-rustup-components/8318

@softprops
Copy link

Thanks @ashthespy. I'll follow this issue's progress.

For context I'm interested in slimming down the docker builder image for aws lambda softprops/lambda-rust#1. I really just need to cargo build tool chain. The bundled docs artifacts aren't useful in this context and yet they aren't currently possible to opt out of. This minimal profile looks great!

@shepmaster
Copy link
Member

@kinnison is this issue addressed by the minimal profile now?

@shepmaster
Copy link
Member

This appears to do what I want and not include the docs!

curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain "${channel}"
info: downloading installer
info: profile set to 'minimal'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2019-09-26, rust version 1.38.0 (625451e37 2019-09-23)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'

❤️

@vks
Copy link

vks commented Oct 15, 2019

It is also possible again to remove the rust-docs component (independently of the chosen profile).

@shepmaster
Copy link
Member

@vks yup, I was very happy to do

for tc in 1.0.0 1.2.0 1.4.0 1.5.0 1.12.1 1.14.0 1.15.1 1.16.0 1.17.0 1.18.0 1.19.0 1.20.0 1.21.0 1.22.1 1.23.0 1.24.1 1.25.0 1.26.2 1.27.2 1.28.0 1.29.2 1.30.1 1.31.0 1.31.1 1.32.0 1.34.0 1.35.0; do
    rustup component remove --toolchain $tc rust-docs
done

Note that this doesn't work for very old releases (like 1.0.0), which predate the concept of components. However, I'll take the savings for the versions which do!

@kinnison
Copy link
Contributor

I believe this is now covered so I'm going to close the issue. Thanks all for your patience.

@leodotcloud
Copy link

Leaving a trail for those who are looking to do this with the offline installer:

export RUST_VERSION=1.60.0 && \
    export TMP_RUST_DIR=/tmp/rust && \
    mkdir -p "${TMP_RUST_DIR}" && \
    cd "${TMP_RUST_DIR}" && \
    curl -sLf "https://static.rust-lang.org/dist/rust-${RUST_VERSION}-x86_64-unknown-linux-gnu.tar.gz" |  \
      tar xvzf - -C "${TMP_RUST_DIR}" --strip-components=1 --exclude=rust-docs && \
    ./install.sh --without=rust-docs && \
    cd /tmp && rm -rf "${TMP_RUST_DIR}"

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

No branches or pull requests