-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Make --crate-file-name
obey --crate-type
#13489
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
Conversation
I'm a little confused by this description, Here's what I get today:
This makes me think that What's the intended behavior you're looking for here? I wouldn't want |
Oh my. I am mistaken there. I was adding some debugging statements to the relevant code and when I tested it with both flags + attributes I thought I only saw the filenames from the attributes. I think I accidentally just used a flag for a crate type that was already specified by attribute. Sorry about that :( My intent is the same as issue #11573. I was motivated to attempt this because when writing a Makefile for a project, I noticed that after updating a library it began to build twice unnecessarily. A new |
I do agree that implementing #11573 would make makefiles a little easier, and would make compilation probably a little more intuitive. Fixing the bug would likely involve modifying Feel free to reopen if you're willing to take a stab at #11573 though! |
I have modified both You can see my changes here: I don't think that I can reopen this pull request myself, and it appears that GitHub is not registering the new commits to my branch here because this is closed. At your discretion, I can either update the original post for this pull request once reopened or create a new one. |
That looks good to me! Can you add a test for this change as well? You'd probably want to add a |
Before, normal compilation and the --crate-file-name flag would generate output based on both #![crate_type] attributes and --crate-type flags. Now, if one or more flag is specified by command line, only those will be used. Closes #11573.
@alexcrichton, |
Before, the `--crate-file-name` flag only checked crate attributes for possible crate types. Now, if any type is specified by one or more `--crate-type` flags, only the filenames for those types will be emitted, and any types specified by crate attributes will be ignored.
Before, the
--crate-file-name
flag only checked crate attributes forpossible crate types. Now, if any type is specified by one or more
--crate-type
flags, only the filenames for those types will beemitted, and any types specified by crate attributes will be ignored.