I have this in my config.toml
targets = "X86"
but while x.py runs cmake, I saw
````
-- Constructing LLVMBuild project information
-- Linker detection: LLD
-- Found Git: /usr/bin/git (found version "2.28.0")
-- Targeting X86
-- Targeting AVR
Traceback (most recent call last):
File "
IndexError: list index out of range
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
PYTHON_EXECUTABLE
WITH_POLLY
````
Making me wonder if there is something that always causes AVR to be activated (by mistake?)
repo @ e82584a77d019bd5ee4254b5870270b1493763a6
Seems like error in https://github.com/rust-lang/rust/pull/69478
https://github.com/rust-lang/rust/pull/69478/files#diff-9a46b13a265be2ded97369dddf5037f5R147 probably should have been left empty, otherwise this comment is not valid:
# LLVM experimental targets to build support for. These targets are specified in
# the same format as above, but since these targets are experimental, they are
# not built by default
cc @dylanmckay
Yeah, I was looking into native.rs and it seems that when no experimental targets are activated, AVR is enabled. I'll push a patch in a few minutes.
This is not an issue with AVR specifically, all experimental targets were always built by default, similarly to how all regular targets are built by default.
So you always had to use
targets = "X86"
experimental-targets = ""
rather than just
targets = "X86"
to disable targets except for x86.
That seems counterintuitive to me.
The default according to config.toml.example is indeed #experimental-targets = "AVR" but since it is commented out it makes it look like it's not building that.
I agree that it's counterintuitive, but not building AVR by default will silently disable // needs-llvm-components: avr tests on CI, for example.
Perhaps the better default would be to drop experimental targets only if the targets field was specified explicitly.
What about disabling experimental-targets by default but explicitly enabling AVR on the fastest CI test job?
Hm, I think the comment is probably misleading, but I don't personally see why this is counterintuitive - everything in config.toml.example is commented out, since it's intended to just provide defaults at a point in time. Since many people copy it in its entirety, if they weren't mostly commented we would find it harder to update defaults (and have them actually take effect).
On this case, maybe we can merge AVR into the targets list? Rustbuild could manually separate it out into experimental targets for LLVM, but I feel like from a rustc perspective there's no significant difference between experimental and regular targets.
I am personally a bit hesitant to modify local configurations in a way that diverges from CI to prevent painful debugging as much as possible - do we have some idea how much time cutting LLVM targets saves?
AVR is no longer an experimental target since LLVM 11.
Most helpful comment
AVR is no longer an experimental target since LLVM 11.