-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
A-CLIRelated to the main CLI and not a more specific subcommandRelated to the main CLI and not a more specific subcommandC-BugA bug in the programA bug in the programD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Description
CLI version
main (1219ee2)
also a problem on v0.1.0-alpha.2
Relevant system information
- Rust version
rustc 1.92.0-nightly (fa3155a64 2025-09-30) - Operating system
Arch Linux:6.16.8-arch3-1
Contents of global config.toml
# [target.'cfg(target_arch = "x86_64")']
# rustflags = ["-Ctarget-cpu=native"]
[target.'cfg(and(toolchain = stable, target_arch = "x86_64"))']
linker = "/usr/bin/clang"
rustflags = [
"-Ctarget-cpu=native",
# use mold *even on stable*
"-Clink-arg=--ld-path=/usr/bin/mold",
"-Clink-arg=-fuse-ld=mold" # see bevy's config_fast_builds.toml
]
[target.'cfg(and(toolchain = nightly, target_arch = "x86_64"))']
linker = "/usr/bin/clang"
rustflags = [
"-Ctarget-cpu=native",
# "-Clink-arg=--ld-path=/usr/bin/mold", # use "mold" linker
# "-Clink-arg=-fuse-ld=mold",
"-Clink-arg=--ld-path=/usr/bin/wild", # use "wild" linker
"-Zthreads=0", "-Zshare-generics=y" # use nightly-only stuffWhat you did
- Inititalize new
-t=2dbevy project - Tried building with the subcommand.
bevy b [-r]
What went wrong
-
What I expected
bevy_clistarts and finishes build (similarly tocargo build) -
What actually happened
It immediately fails with this message:
error: and(toolchain = nightly, target_arch = "x86_64")
^ expected one of `=`, `,`, `)` here
(note: yes the error message seems to crop out some of the code)
Additional information
- Note
It could be that my~/.cargo/config.tomlcannot be parsed properly (cfg stuff can be obscure and cargo/rust usually does not error even if that is the case).
If this is the case, I'd love to know why this only happens forbevy_cliand not cargo, as well as how I could avoid this problem in the future. Maybe the error message could be improved? - Workaround
Assuming I shouldn't just fix it (it may be impossible to correctly parse), a fix is to temporarily make my global (~/.cargo/)config.tomlinaccessible from cargo or the cli by renaming it (I renamed itconfig-2.toml).
This seems to makebevy bwork just likecargo b.
Simply trying to shadow the global config with the local./.cargo/config.toml(fromconfig_fast_builds.toml) was not enough. - Motivation for fix
It seems I don't really need to use the cli to build, but since it's a command and there is some useful metadata and helpers inside the tool (e.g.bevy b web), I'd like for it to work.
Metadata
Metadata
Assignees
Labels
A-CLIRelated to the main CLI and not a more specific subcommandRelated to the main CLI and not a more specific subcommandC-BugA bug in the programA bug in the programD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
