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

offline installer should include rust-src #136268

Open
NewUserHa opened this issue Jan 29, 2025 · 6 comments
Open

offline installer should include rust-src #136268

NewUserHa opened this issue Jan 29, 2025 · 6 comments
Labels
C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. O-windows Operating system: Windows T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@NewUserHa
Copy link

I tried this code:

<code>

I expected to see this happen: explanation

Instead, this happened: explanation

Meta

rustc --version --verbose:

<version>
Backtrace

<backtrace>

offline installer should include rust-src by default, to avoid to let user manually to download the 2MB file and put into a specific correct folder.

I downloaded rust-1.84.0-x86_64-pc-windows-gnu.msi to avoid to install 7GB msvc c++ compiler and linker, but the language-server rust-analyzer refused to work because of lacking rust-src in the offline installation.
the resolution is to manually download https://static.rust-lang.org/dist/rust-src-1.84.0.tar.gz. found from rust-lang/rust-analyzer#4172 (comment) which is not in installation part in the rust documentation.
and finally need to construct the correct folder path.

Therefore, the offline installers should include the 2MB content by default to prevent the users run into a trap

@NewUserHa NewUserHa added the C-bug Category: This is a bug. label Jan 29, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 29, 2025
@ChrisDenton
Copy link
Member

ChrisDenton commented Jan 29, 2025

You don't have to install msvc when using rustup, that only happens if you select the option to do so. Just select the third option when it asks. Or install the tools rustc needs before installing rustup.

@NewUserHa
Copy link
Author

the third option that rustup shows is still msvc version:

This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>

the 2) Customize installation doesn't prompt anything to input, or an option for gnu version to selection.

Or install the tools rustc needs before installing rustup.

there is no method provided in documention to "install the tools rustc needs before installing rustup."

@NewUserHa
Copy link
Author

after installation the GNU version is only 300MB larger than MSVC version, it would be better to combine two installers into one installer.
(the sizes of the two installers have only difference of 50MB)

@ChrisDenton
Copy link
Member

If you do a custom install, you can type x86_64-pc-windows-gnu:

rustup
Current installation options:


   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>2

I'm going to ask you the value of each of these installation options.
You may simply press the Enter key to leave unchanged.

Default host triple? [x86_64-pc-windows-msvc]
x86_64-pc-windows-gnu

Default toolchain? (stable/beta/nightly/none) [stable]


Profile (which tools and data to install)? (minimal/default/complete) [default]


Modify PATH variable? (Y/n)



Current installation options:


   default host triple: x86_64-pc-windows-gnu
     default toolchain: stable
               profile: default
  modify PATH variable: yes

1) Proceed with selected options (default - just press enter)
2) Customize installation
3) Cancel installation
>

@NewUserHa
Copy link
Author

NewUserHa commented Jan 30, 2025

but the GNU version is already installed, and the rustup-init asked about it, after inputted "yes", the rustup-init also doesn't say will overwrite it or will install to a different folder than the offline installer's.

the rustup-init would be better to list the available options to input when at that step of prompt of installation

@lolbinarycat lolbinarycat added O-windows Operating system: Windows T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jan 30, 2025
@workingjubilee
Copy link
Member

is this a rustc issue or a rustup issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. O-windows Operating system: Windows T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants