Closed as not planned
Description
Problem
The -Zcodegen-backend=<path>
flag[1] and the codegen-backend
spec in cargo.toml[2] are incompatible,
[1] https://doc.rust-lang.org/beta/unstable-book/compiler-flags/codegen-backend.html
[2] https://doc.rust-lang.org/cargo/reference/unstable.html#codegen-backend
Steps
Currently, I can do:
$ RUSTFLAGS='-Zcodegen-backend=./some/path/to/codegenerator.dylib' cargo test
to run some tests using that code generator (mac os). That works.
I tried adding the following to Cargo.toml:
[profile.test]
codegen-backend = "./some/path/to/codegenerator.dylib"
Now running cargo test
gives
$ cargo test
error: failed to parse manifest at `/some/path/Cargo.toml`
Caused by:
`profile.test.codegen-backend` setting of `./some/path/to/codegenerator.dylib` is not a valid backend name.
Possible Solution(s)
Cargo source code is restricting it here to alphanumeric and _
characters.
cargo/src/cargo/util/toml/mod.rs
Line 788 in 928b956
Is that test too restrictive?
Notes
No response
Version
cargo 1.72.0-nightly (f7b95e316 2023-05-30)
release: 1.72.0-nightly
commit-hash: f7b95e31642e09c2b6eabb18ed75007dda6677a0
commit-date: 2023-05-30
host: x86_64-apple-darwin
libgit2: 1.6.4 (sys:0.17.1 vendored)
libcurl: 7.88.1 (sys:0.4.61+curl-8.0.1 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1t 7 Feb 2023
os: Mac OS 13.4.0 [64-bit]