{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/57076","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/57076/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/57076/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/57076/events","html_url":"https://github.com/rust-lang/rust/issues/57076","id":393740519,"node_id":"MDU6SXNzdWUzOTM3NDA1MTk=","number":57076,"title":"[idea] Add an option put the metadata in a separate file","user":{"login":"bjorn3","id":17426603,"node_id":"MDQ6VXNlcjE3NDI2NjAz","avatar_url":"https://avatars1.githubusercontent.com/u/17426603?v=4","gravatar_id":"","url":"https://api.github.com/users/bjorn3","html_url":"https://github.com/bjorn3","followers_url":"https://api.github.com/users/bjorn3/followers","following_url":"https://api.github.com/users/bjorn3/following{/other_user}","gists_url":"https://api.github.com/users/bjorn3/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn3/subscriptions","organizations_url":"https://api.github.com/users/bjorn3/orgs","repos_url":"https://api.github.com/users/bjorn3/repos","events_url":"https://api.github.com/users/bjorn3/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn3/received_events","type":"User","site_admin":false},"labels":[{"id":13242248,"node_id":"MDU6TGFiZWwxMzI0MjI0OA==","url":"https://api.github.com/repos/rust-lang/rust/labels/A-metadata","name":"A-metadata","color":"f7e101","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-23T10:52:12Z","updated_at":"2018-12-28T13:21:34Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"# Detailed design\r\n\r\nWhen `-Zsplit-metadata` is passed to rustc, it will put the metadata normally inside a `rlib` or `dylib` in a separate `rmeta` file. The `rlib`/`dylib` will contain the SVH to prevent accidentally mixing the `rmeta` and `rlib`/`dylib` of different compilations.\r\n\r\n# Advantages\r\n\r\nThis would make the increase in size of #56987 easily fixable by deleting the `rlib` files, while keeping the `rmeta` files. Those are not necessary anyway, because `rustc_driver.so` already contains the code.\r\n\r\nThis will decrease `staticlib`, `dylib` and `cdylib` compilation time, because there is no need to copy all object files to a new archive to remove the `rust.metadata.bin` file from the `rlib`.\r\nhttps://github.com/rust-lang/rust/blob/6d9640b6f6275a4b59e2a59705e18807329b9300/src/librustc_codegen_llvm/back/link.rs#L1340-L1342\r\n\r\n# Disadvantages\r\n\r\nRustc and cargo get a bit more complex."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/450358383","html_url":"https://github.com/rust-lang/rust/issues/57076#issuecomment-450358383","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/57076","id":450358383,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDM1ODM4Mw==","user":{"login":"bjorn3","id":17426603,"node_id":"MDQ6VXNlcjE3NDI2NjAz","avatar_url":"https://avatars1.githubusercontent.com/u/17426603?v=4","gravatar_id":"","url":"https://api.github.com/users/bjorn3","html_url":"https://github.com/bjorn3","followers_url":"https://api.github.com/users/bjorn3/followers","following_url":"https://api.github.com/users/bjorn3/following{/other_user}","gists_url":"https://api.github.com/users/bjorn3/gists{/gist_id}","starred_url":"https://api.github.com/users/bjorn3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjorn3/subscriptions","organizations_url":"https://api.github.com/users/bjorn3/orgs","repos_url":"https://api.github.com/users/bjorn3/repos","events_url":"https://api.github.com/users/bjorn3/events{/privacy}","received_events_url":"https://api.github.com/users/bjorn3/received_events","type":"User","site_admin":false},"created_at":"2018-12-28T13:21:34Z","updated_at":"2018-12-28T13:21:34Z","author_association":"CONTRIBUTOR","body":"If this is accepted https://github.com/rust-lang/cargo/issues/4831 could be done without invoking rustc twice. Just let rustc print a message when the metadata file is emitted and allow it to read `.rmeta` files before the `.rlib` file is ready. When a crate is built which needs to run the linker (`dylib` or `bin`) either cargo or rustc could wait till all necessary `.rlib` files are generated."}}
{"actor":{"display_login":"bjorn3"}}