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

--crate-type didn't overwrite target.kind in json message output #10389

Closed
csmoe opened this issue Feb 14, 2022 · 1 comment · Fixed by #10388
Closed

--crate-type didn't overwrite target.kind in json message output #10389

csmoe opened this issue Feb 14, 2022 · 1 comment · Fixed by #10388
Labels
C-bug Category: bug

Comments

@csmoe
Copy link
Member

csmoe commented Feb 14, 2022

Problem

From #10083 The --crate-type from cli should take higher priority than the crate-type specified in Cargo.toml, but it does not changed the json message output as expected.

Steps

copy and paste this shell into your terminal:

cargo new --lib crate-type && \ 
cd crate-type && \
printf '[lib]\ncrate-type = [ "cdylib", "rlib" ]' >> Cargo.toml && \
cargo rustc -Zunstable-options --crate-type=cdylib --message-format=json

output

{"reason":"compiler-artifact","package_id":"crate-type 0.1.0 (path+file:///Users/mac/repo/lark/crate-type)","manifest_path":"/Users/mac/repo/lark/crate-type/Cargo.toml","target":{"kind":["cdylib","rlib"],"crate_types":["cdylib","rlib"],"name":"crate-type","src_path":"/Users/mac/repo/lark/crate-type/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["/Users/mac/repo/lark/crate-type/target/debug/libcrate_type.dylib"],"executable":null,"fresh":false}

As you can see, target.kind is still ["cdylib","rlib"].

Possible Solution(s)

No response

Notes

No response

Version

No response

@csmoe csmoe added the C-bug Category: bug label Feb 14, 2022
@weihanglo
Copy link
Member

Could you try #10388? I feel like it should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants