Description
It's that time of the year again - almost 6 months since we bumped the minimum supported system LLVM to version 5 (#51899). Now that emscripten has been updated to LVM 6.0.1 (#55626 - thank you @nikic ) I wanted to bump the minimum supported version to 6.
However, there has been some controversy about the minimum supported LLVM version lagging too much behind the bundled one, resulting in a lot of frustration for both contributors, users, and packagers (https://internals.rust-lang.org/t/rust-vs-llvm/8604).
Supporting older versions is particularly problematic because:
- we "take our time" upstreaming our patches, which are often required for things to work properly
- rustc at best just
bugs!
on older LLVM versions when using some language features, at worst it silently compiles with incorrect codegen - distro packagers don't see tests failing because we/them silence them.
I don't know how aware are distro packagers of these issues. I know that @cuviper and @infinity0 are aware of them, e.g., when packaging for a distro often the testsuite has to "pass" but it only passes with system LLVMs because we basically silence all tests that do not pass.
That is, currently, even though we let Rust build silently with LLVM 5, many parts of the language / compiler are just unusable (SIMD, wasm, ...). This is currently also the case for LLVM 6, and even LLVM 7!
So I think it is worth to reconsider our stance on this. I personally think that we should come up with an enforceable policy about the minimum system LLVM version that we support, and that the policy has to be better than "the last 3 LLVM releases" to add any value. If we were to continuously support the last released LLVM version (version 7 right now), we could, slowly:
- try to get most of the tests working properly on the supported system LLVM,
- try to upstream most / all of our patches, provide workarounds in rustc for those that cannot be upstreamed.
Currently, because we support the last 4 LLVM releases, an upstreamed patch lets us remove code in rustc in ~2 - 2.5 years. If we were to only support the last LLVM version, that would be reduced to 6 months, making it significantly more profitable to upstream our patches. It might also make sense to keep workarounds around to keep things going if we know these only have to live for 6 months.
Also, it is unclear to me what's the value of shipping new Rust versions on distros using a 2 year old LLVM. Couldn't these distros just ship an older Rust version that's known to work with the distros LLVM version ? (by known I mean, where most tests pass instead of being silenced).
So what I'd like to know is:
- is it possible at all for stakeholders to move to LLVM 7 now ? If not, why not?
- what are the pros / cons of moving to LLVM now ?
- do you think that a policy of supporting the last LLVM version (7 right now) is feasible?
I think that moving to something like that would be first step. And once everything is working release-wise for everybody, we can consider strengthening this policy to try to keep all / most tests running for one full LLVM release, and to at least encourage workarounds in rustc for the last LLVM version.
So what do you think? In particular, what do distro packagers thing? I know that @cuviper mentioned that Fedora 28 still only has LLVM6 and that it is supported till June 2019, but by ~February 2019 Rust will be targeting LLVM9 already which is released in August 2019.