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

No documentation for minimal and maximal LLVM versions supported #131588

Open
dilyanpalauzov opened this issue Oct 12, 2024 · 10 comments
Open

No documentation for minimal and maximal LLVM versions supported #131588

dilyanpalauzov opened this issue Oct 12, 2024 · 10 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools

Comments

@dilyanpalauzov
Copy link

Location

Nowhere

Summary

When I build rustc with the local llvm, I want to know with what external LLVM versions will rustc work.

#122649 upgrades in March the minimum external LLVM version to 17.
#127513 updates in July LLVM to version 19.

But the above links do not touch the user-visible documentation. For me it is unclear, if I want to compile rust 1.82 later, if I can use LLVM 18, or I must use LLVM 19. I find no place, where this is documented.

  • Document the minimal and maximal versions for external LLVM supported by rustc.
@dilyanpalauzov dilyanpalauzov added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Oct 12, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 12, 2024
@the8472
Copy link
Member

the8472 commented Oct 12, 2024

https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html

Rust supports building against multiple LLVM versions:
Tip-of-tree for the current LLVM development branch is usually supported within a few days. PRs for such fixes are tagged with llvm-main.
The latest released major version is always supported.
The one or two preceding major versions are usually supported.

bootstrap should also be telling you if it's too old

panic!("\n\nbad LLVM version: {version}, need >=18\n\n")

@dilyanpalauzov
Copy link
Author

If I remember correctly, at least in the past this was the case, when rustc is asked to build itself with external LLVM, and something from that LLVM was not fine, the build process downloaded and rebuild that part. (linker, nm-wrapper, or alike - I do not recall what exactly). It should have aborted with hints how to build the external LLVM instead.

It is good that build_steps/llvm.rs aborts on too-old LLVM, but I want actually to read somewhere what LLVM version I need before starting the bootstrap process.

Considering the first paragraph, I have the feeling that if rustc thinks something in LLVM is not new-enough, it will not use that piece of external LLVM, but recompile it itself, despite being told to use external LLVM, and will not abort. So in fact rustc does not use external LLVM completely.

@DianQK
Copy link
Member

DianQK commented Oct 12, 2024

@dilyanpalauzov
Copy link
Author

The changelog for 1.79 says at https://github.com/rust-lang/rust/releases/tag/1.79.0 „Update the minimum external LLVM to 17“.

But for 1.80 and 1.81 there is no statement what minimal version the external LLVM must have.

@saethlin saethlin changed the title No documentation for minimal and maximal LLMV versions supported No documentation for minimal and maximal LLVM versions supported Oct 12, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 12, 2024
@workingjubilee
Copy link
Member

workingjubilee commented Oct 12, 2024

The required LLVM is going to be LLVM 18, actually. #130487

@dilyanpalauzov Why are you guessing instead of just using the latest LLVM release from that version's date of release? Or using the same version that rustc did for the last release?

@workingjubilee
Copy link
Member

workingjubilee commented Oct 12, 2024

The problem with the documentation is that if we document this and it becomes horribly out of date because people forgot to update it because we are all just using the LLVM we build with rustc, then you'll be back to where you were: you still don't know. Meanwhile, using rustc --version --verbose always works, and that has to be the version you can bootstrap the next withe.

@dilyanpalauzov
Copy link
Author

The “problem with the documentation” will not happen, if there is a process (template). I think it would be sufficient, if ./configure --help prints the supported versions (min and max) of the external LLVM and aborts, if external LLVM is requested, but versions do not match.

Why I do not use the latest LLVM? I am fan of this this idea, but immediately after a major (LLVM) release there might be bugs, which will be fixed in short. So I prefer to switch to the latest LLVM reasonable time after it is released.

@workingjubilee
Copy link
Member

@dilyanpalauzov We do prefer to automate process when possible.

Though, ./configure --help requires building bootstrap, doesn't it? If you think building bootstrap and then printing LLVM versions is fine, then this is probably easy.

@dilyanpalauzov
Copy link
Author

./configure --help requires building bootstrap, doesn't it?

No, it does not. x.py --help requires bootstrap.

@workingjubilee
Copy link
Member

Ah, then I don't know... we rarely update ./configure in an "on-purpose" manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

No branches or pull requests

6 participants