{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/38322","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/38322/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/38322/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/38322/events","html_url":"https://github.com/rust-lang/rust/issues/38322","id":195051895,"number":38322,"title":"Allow remapping source path prefixes in debug output","user":{"login":"jmesmon","id":103437,"avatar_url":"https://avatars.githubusercontent.com/u/103437?v=3","gravatar_id":"","url":"https://api.github.com/users/jmesmon","html_url":"https://github.com/jmesmon","followers_url":"https://api.github.com/users/jmesmon/followers","following_url":"https://api.github.com/users/jmesmon/following{/other_user}","gists_url":"https://api.github.com/users/jmesmon/gists{/gist_id}","starred_url":"https://api.github.com/users/jmesmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmesmon/subscriptions","organizations_url":"https://api.github.com/users/jmesmon/orgs","repos_url":"https://api.github.com/users/jmesmon/repos","events_url":"https://api.github.com/users/jmesmon/events{/privacy}","received_events_url":"https://api.github.com/users/jmesmon/received_events","type":"User","site_admin":false},"labels":[{"id":203130,"url":"https://api.github.com/repos/rust-lang/rust/labels/A-debuginfo","name":"A-debuginfo","color":"d7e102","default":false},{"id":234902,"url":"https://api.github.com/repos/rust-lang/rust/labels/I-enhancement","name":"I-enhancement","color":"e10c02","default":false},{"id":211668098,"url":"https://api.github.com/repos/rust-lang/rust/labels/T-tools","name":"T-tools","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-12T18:40:43Z","updated_at":"2016-12-12T21:52:47Z","closed_at":null,"body":"In gcc & clang, the flag `-fdebug-prefix-map=old=new` allows changing the prefix of source files referred to in debug information.\r\n\r\nRelated to  #34902, this allows one to avoid having the particular source directory that a file was built in affect the output object/executable/library contents.\r\n\r\nIt also allows source-level debugging to work in cases where the source code is installed by the debug packages to a location that differs from where it was built (debian & OpenEmbedded, at least, take advantage of this).\r\n\r\nAs an alternate, the program `debugedit` allows modifying the files after generation to adjust the paths (as far as I can tell, Fedora uses this, and potentially other rpm based distros)."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/266564496","html_url":"https://github.com/rust-lang/rust/issues/38322#issuecomment-266564496","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/38322","id":266564496,"user":{"login":"infinity0","id":78398,"avatar_url":"https://avatars.githubusercontent.com/u/78398?v=3","gravatar_id":"","url":"https://api.github.com/users/infinity0","html_url":"https://github.com/infinity0","followers_url":"https://api.github.com/users/infinity0/followers","following_url":"https://api.github.com/users/infinity0/following{/other_user}","gists_url":"https://api.github.com/users/infinity0/gists{/gist_id}","starred_url":"https://api.github.com/users/infinity0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinity0/subscriptions","organizations_url":"https://api.github.com/users/infinity0/orgs","repos_url":"https://api.github.com/users/infinity0/repos","events_url":"https://api.github.com/users/infinity0/events{/privacy}","received_events_url":"https://api.github.com/users/infinity0/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T21:52:47Z","updated_at":"2016-12-12T21:52:47Z","body":"A `-C` flag is good, but sometimes we have seen that certain buildsystems or individual projects like to save compiler flags (i.e. `-fdebug-prefix-map=<PATH>=.`) into other parts of the overall build output, thereby making it depend on the build path, even if rustc itself supports this `-C` flag. But it's reasonable to assume that compiler flags will affect the output, and save this somewhere else for auditing.\r\n\r\nBecause of this, we recently submitted [some patches](https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00182.html) to GCC to also support the same behaviour as `debug-prefix-map`, except via an environment variable that explicitly should not be saved to any build output. The patches are still pending, but I haven't yet received any significant negative comments on it, and I'll be pinging GCC again soon about it. It would be good if rustc could also support this same environment variable in the future.\r\n\r\nActually, I didn't know about `debugedit` before, thanks for bringing that up! It might allow us to normalise files outside of GCC or independently of any other compiler, I will have to look into that."}}
{"actor":{"display_login":"infinity0"}}