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

edition support #79

Closed
mfarrugi opened this issue Dec 7, 2018 · 4 comments
Closed

edition support #79

mfarrugi opened this issue Dec 7, 2018 · 4 comments

Comments

@mfarrugi
Copy link
Collaborator

mfarrugi commented Dec 7, 2018

bazelbuild/rules_rust#157

without rules_rust changes, raze can emit --edition 2018 as needed

@acmcarther
Copy link
Member

I think we need to take this information from the individual crates. We can't assume that an arbitrary crate is 2018 compatible.

@vitalyd
Copy link
Contributor

vitalyd commented Dec 11, 2018

@acmcarther (or anyone else, really), how involved is adding --edition support? Naively, I'd imagine this shouldn't be too bad: propagate cargo manifest's edition value, if present, to the generated BUILD file. I suppose while bazelbuild/rules_rust#157 is still open, raze can add the edition as a rustc_flags argument.

Is that accurate? If so, any idea when the support might be added? Sorry, I'm not entirely sure how this project is maintained.

Thanks

@acmcarther
Copy link
Member

Sorry for the delay on this. I haven't been able to set aside much time recently to hash this out.

Edition is a new field in SerializedTarget. This field is supposed to be one to one with our metadata::Target .

This field ought to be automatically populated by the cargo metadata codepath (CargoSubcommandMetadataFetcher), but will need to be added to the internals-using codepath (CargoInternalsMetadataFetcher): the target section is here:

targets.push(Target {
name: target.name().to_owned(),
kind: util::kind_to_kinds(target.kind()),
crate_types: crate_types,
src_path: target.src_path().display().to_string(),
});
}

... I would have liked to add where this information is available in the resolved package, but I don't have any more time this morning to look into this.

If you're interested in implementing it, I would be very happy to review a pull request. Else, you're unfortunately beholden to my flakiness. I'll make a concerted effort to work on this item soon given its relevance in the recently released 1.31.0

@mfarrugi
Copy link
Collaborator Author

And with pacman82/atoi-rs@5863397#diff-80398c5faae3c069e4e6aa2ed11b28c0 I've run into this as a problem :)

For now it sufficed to pin the dep to the previous version.

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

No branches or pull requests

3 participants