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

Introduce something about rmeta and metadata in general #468

Closed
crlf0710 opened this issue Oct 16, 2019 · 7 comments · Fixed by #1044
Closed

Introduce something about rmeta and metadata in general #468

crlf0710 opened this issue Oct 16, 2019 · 7 comments · Fixed by #1044
Labels
E-help-wanted Call for participation: extra help is wanted

Comments

@crlf0710
Copy link
Member

No description provided.

@mark-i-m
Copy link
Member

@crlf0710 I don't actually know anything about rmeta or metadata. Who even is the expert? Is there at least a code snippet you can point us to?

@crlf0710
Copy link
Member Author

@mark-i-m Sure, there's the crate src/librustc_metadata in tree. For the experts part, i guess @eddyb @petrochenkov can say a lot on this topic.

@eddyb
Copy link
Member

eddyb commented Nov 13, 2019

Btw, this is one of those areas I'd prefer refactoring into irrelevance - see rust-lang/rust#65407.

@crlf0710
Copy link
Member Author

@eddyb i believe metadata is the key to rust-lang/rust#65427, do you think this issue is worth resolving before the refactoring you mentioned, or are they orthogonal?

@eddyb
Copy link
Member

eddyb commented Nov 15, 2019

I think they're unrelated, talk to Cargo people (e.g. @alexcrichton and @ehuss) about how pipelining works for cargo build and how it relies on .rmetas for almost the entire build (except bin/staticlib/cdylib crates, which need linking and therefore .rlibs).

But also, even without reusing the .rmetas, you could make Cargo use the same incremental directory between cargo check and cargo build and that "should just work".

EDIT: oh, I found rust-lang/cargo#3501 (comment) - is the "metadata is different" part of that what you meant? It's technically true, but not for metadata reasons, but "does this crate need codegen and therefore information about codegen'd monomorphizations?" reasons.

@crlf0710
Copy link
Member Author

@eddyb ok thanks!

Is it possible when you have time to give some brief introduction (in text, audio or whatever form) about the current status (or if the current status is not ideal, a sketch of new design) of crate metadata storage on disk and the metadata embedded into final rlib/dylib files. I'm eager to learn more about this, and it will be good include it as part of rustc-guide.

@camelid camelid added the E-help-wanted Call for participation: extra help is wanted label Jan 4, 2021
@ehuss
Copy link
Contributor

ehuss commented Jan 29, 2021

I went ahead and wrote something up in #1044 on this. I realize things change over time, but I think a little information is useful. If anyone following this issue can give it a read, please let me know if anything is missing you'd like to see (or if you notice anything wrong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-help-wanted Call for participation: extra help is wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants