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

rustc: Tweak filenames encoded into metadata #54626

Merged
merged 1 commit into from Oct 26, 2018

Conversation

Projects
None yet
4 participants
@alexcrichton
Member

alexcrichton commented Sep 27, 2018

This commit is a fix for #54408 where on nightly right now whenever
generics are inlined the path name listed for the inlined function's
debuginfo is a relative path to the cwd, which surely doesn't exist!
Previously on beta/stable the debuginfo mentioned an absolute path which
still didn't exist, but more predictably didn't exist.

The change between stable/nightly is that nightly is now compiled with
--remap-path-prefix to give a deterministic prefix to all
rustc-generated paths in debuginfo. By using --remap-path-prefix the
previous logic would recognize that the cwd was remapped, causing the
original relative path name of the standard library to get emitted. If
--remap-path-prefix wasn't passed in then the logic would create an
absolute path name and then create a new source file entry.

The fix in this commit is to apply the "recreate the source file entry
with an absolute path" logic a bit more aggresively. If the source
file's name was remapped then we don't touch it, but otherwise we always
take the working dir (which may have been remapped) and then join it to
the file to ensure that we process all relative file names as well.

The end result is that the standard library should have an absolute path
for all file names in debuginfo (using our --remap-path-prefix
argument) as it does on stable after this patch.

Closes #54408

rustc: Tweak filenames encoded into metadata
This commit is a fix for #54408 where on nightly right now whenever
generics are inlined the path name listed for the inlined function's
debuginfo is a relative path to the cwd, which surely doesn't exist!
Previously on beta/stable the debuginfo mentioned an absolute path which
still didn't exist, but more predictably didn't exist.

The change between stable/nightly is that nightly is now compiled with
`--remap-path-prefix` to give a deterministic prefix to all
rustc-generated paths in debuginfo. By using `--remap-path-prefix` the
previous logic would recognize that the cwd was remapped, causing the
original relative path name of the standard library to get emitted. If
`--remap-path-prefix` *wasn't* passed in then the logic would create an
absolute path name and then create a new source file entry.

The fix in this commit is to apply the "recreate the source file entry
with an absolute path" logic a bit more aggresively. If the source
file's name was remapped then we don't touch it, but otherwise we always
take the working dir (which may have been remapped) and then join it to
the file to ensure that we process all relative file names as well.

The end result is that the standard library should have an absolute path
for all file names in debuginfo (using our `--remap-path-prefix`
argument) as it does on stable after this patch.

Closes #54408
@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Sep 27, 2018

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@michaelwoerister

This comment has been minimized.

Contributor

michaelwoerister commented Sep 29, 2018

Hm, this might regress for an existing use case (cc @jsgf). I'll take a closer look next week.
@alexcrichton, the solution proposed in #54408 (comment) wouldn't work here?

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Sep 29, 2018

Oh I do think it would work! It's not trivial though, unfortunately, getting it working with cargo and all. I figured that this version was more consistent with non-remapped paths, but it would break if the remap path prefix isn't absolute

@michaelwoerister

This comment has been minimized.

Contributor

michaelwoerister commented Oct 6, 2018

Ah sorry, I didn't manage to review this properly yet and I'll be on PTO for the next two weeks...

@michaelwoerister

This comment has been minimized.

Contributor

michaelwoerister commented Oct 23, 2018

OK, after looking at it more closely, I think this change is fine after all. I hope it doesn't break anything that I'm overlooking. Sorry for the delay.

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Oct 23, 2018

📌 Commit 63c471e has been approved by michaelwoerister

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 23, 2018

Rollup merge of rust-lang#54626 - alexcrichton:dwarf-generics, r=mich…
…aelwoerister

rustc: Tweak filenames encoded into metadata

This commit is a fix for rust-lang#54408 where on nightly right now whenever
generics are inlined the path name listed for the inlined function's
debuginfo is a relative path to the cwd, which surely doesn't exist!
Previously on beta/stable the debuginfo mentioned an absolute path which
still didn't exist, but more predictably didn't exist.

The change between stable/nightly is that nightly is now compiled with
`--remap-path-prefix` to give a deterministic prefix to all
rustc-generated paths in debuginfo. By using `--remap-path-prefix` the
previous logic would recognize that the cwd was remapped, causing the
original relative path name of the standard library to get emitted. If
`--remap-path-prefix` *wasn't* passed in then the logic would create an
absolute path name and then create a new source file entry.

The fix in this commit is to apply the "recreate the source file entry
with an absolute path" logic a bit more aggresively. If the source
file's name was remapped then we don't touch it, but otherwise we always
take the working dir (which may have been remapped) and then join it to
the file to ensure that we process all relative file names as well.

The end result is that the standard library should have an absolute path
for all file names in debuginfo (using our `--remap-path-prefix`
argument) as it does on stable after this patch.

Closes rust-lang#54408

bors added a commit that referenced this pull request Oct 24, 2018

Auto merge of #55295 - pietroalbini:rollup, r=pietroalbini
Rollup of 19 pull requests

Successful merges:

 - #54125 (Less conservative uninhabitedness check)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54965 (update tcp stream documentation)
 - #55150 (Do not allow moving out of thread local under ast borrowck)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55185 (path suggestions in Rust 2018 should point out the change in semantics )
 - #55225 (Move cg_llvm:🔙:linker to cg_utils)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #55247 (Clarified code example in char primitive doc)
 - #55251 (Fix a typo in the documentation of RangeInclusive)
 - #55253 (only issue "variant of the expected type" suggestion for enums)
 - #55254 (Correct trailing ellipsis in name_from_pat)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55269 (fix typos in various places)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55282 (Remove redundant clone)
 - #55285 (Do some copy editing on the release notes)
 - #55291 (Update stdsimd submodule)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Oct 24, 2018

Auto merge of #55295 - pietroalbini:rollup, r=pietroalbini
Rollup of 19 pull requests

Successful merges:

 - #54125 (Less conservative uninhabitedness check)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54965 (update tcp stream documentation)
 - #55150 (Do not allow moving out of thread local under ast borrowck)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55185 (path suggestions in Rust 2018 should point out the change in semantics )
 - #55225 (Move cg_llvm:🔙:linker to cg_utils)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #55247 (Clarified code example in char primitive doc)
 - #55251 (Fix a typo in the documentation of RangeInclusive)
 - #55253 (only issue "variant of the expected type" suggestion for enums)
 - #55254 (Correct trailing ellipsis in name_from_pat)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55269 (fix typos in various places)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55282 (Remove redundant clone)
 - #55285 (Do some copy editing on the release notes)
 - #55291 (Update stdsimd submodule)

Failed merges:

r? @ghost

kennytm added a commit to kennytm/rust that referenced this pull request Oct 24, 2018

Rollup merge of rust-lang#54626 - alexcrichton:dwarf-generics, r=mich…
…aelwoerister

rustc: Tweak filenames encoded into metadata

This commit is a fix for rust-lang#54408 where on nightly right now whenever
generics are inlined the path name listed for the inlined function's
debuginfo is a relative path to the cwd, which surely doesn't exist!
Previously on beta/stable the debuginfo mentioned an absolute path which
still didn't exist, but more predictably didn't exist.

The change between stable/nightly is that nightly is now compiled with
`--remap-path-prefix` to give a deterministic prefix to all
rustc-generated paths in debuginfo. By using `--remap-path-prefix` the
previous logic would recognize that the cwd was remapped, causing the
original relative path name of the standard library to get emitted. If
`--remap-path-prefix` *wasn't* passed in then the logic would create an
absolute path name and then create a new source file entry.

The fix in this commit is to apply the "recreate the source file entry
with an absolute path" logic a bit more aggresively. If the source
file's name was remapped then we don't touch it, but otherwise we always
take the working dir (which may have been remapped) and then join it to
the file to ensure that we process all relative file names as well.

The end result is that the standard library should have an absolute path
for all file names in debuginfo (using our `--remap-path-prefix`
argument) as it does on stable after this patch.

Closes rust-lang#54408

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55320 - kennytm:rollup, r=kennytm
Rollup of 22 pull requests

Successful merges:

 - #53507 (Add doc for impl From for Waker)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54965 (update tcp stream documentation)
 - #54977 (Accept `Option<Box<$t:ty>>` in macro argument)
 - #55138 (in which unused-parens suggestions heed what the user actually wrote)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55225 (Move cg_llvm:🔙:linker to cg_utils)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #55247 (Clarified code example in char primitive doc)
 - #55251 (Fix a typo in the documentation of RangeInclusive)
 - #55253 (only issue "variant of the expected type" suggestion for enums)
 - #55254 (Correct trailing ellipsis in name_from_pat)
 - #55257 (Allow extern statics with an extern type)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55269 (fix typos in various places)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55282 (Remove redundant clone)
 - #55285 (Do some copy editing on the release notes)
 - #55291 (Update stdsimd submodule)
 - #55303 (Update compiler-builtins submodule)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55320 - kennytm:rollup, r=kennytm
Rollup of 28 pull requests

Successful merges:

 - #53507 (Add doc for impl From for Waker)
 - #53931 (Gradually expanding libstd's keyword documentation)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54921 (Add line numbers option to rustdoc)
 - #54965 (update tcp stream documentation)
 - #54977 (Accept `Option<Box<$t:ty>>` in macro argument)
 - #55138 (in which unused-parens suggestions heed what the user actually wrote)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type)
 - #55200 (Documents `From` implementations for `Stdio`)
 - #55225 (Move cg_llvm:🔙:linker to cg_utils)
 - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437)
 - #55247 (Clarified code example in char primitive doc)
 - #55251 (Fix a typo in the documentation of RangeInclusive)
 - #55253 (only issue "variant of the expected type" suggestion for enums)
 - #55254 (Correct trailing ellipsis in name_from_pat)
 - #55257 (Allow extern statics with an extern type)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55269 (fix typos in various places)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55282 (Remove redundant clone)
 - #55285 (Do some copy editing on the release notes)
 - #55291 (Update stdsimd submodule)
 - #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs)
 - #55303 (Update compiler-builtins submodule)
 - #55306 (Regression test for #54478.)
 - #55328 (Fix doc for new copysign functions)

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 25, 2018

Rollup merge of rust-lang#54626 - alexcrichton:dwarf-generics, r=mich…
…aelwoerister

rustc: Tweak filenames encoded into metadata

This commit is a fix for rust-lang#54408 where on nightly right now whenever
generics are inlined the path name listed for the inlined function's
debuginfo is a relative path to the cwd, which surely doesn't exist!
Previously on beta/stable the debuginfo mentioned an absolute path which
still didn't exist, but more predictably didn't exist.

The change between stable/nightly is that nightly is now compiled with
`--remap-path-prefix` to give a deterministic prefix to all
rustc-generated paths in debuginfo. By using `--remap-path-prefix` the
previous logic would recognize that the cwd was remapped, causing the
original relative path name of the standard library to get emitted. If
`--remap-path-prefix` *wasn't* passed in then the logic would create an
absolute path name and then create a new source file entry.

The fix in this commit is to apply the "recreate the source file entry
with an absolute path" logic a bit more aggresively. If the source
file's name was remapped then we don't touch it, but otherwise we always
take the working dir (which may have been remapped) and then join it to
the file to ensure that we process all relative file names as well.

The end result is that the standard library should have an absolute path
for all file names in debuginfo (using our `--remap-path-prefix`
argument) as it does on stable after this patch.

Closes rust-lang#54408

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55357 - pietroalbini:rollup, r=pietroalbini
Rollup of 15 pull requests

Successful merges:

 - #54490 (Rewrite the `UnconditionalRecursion` lint to use MIR)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #54965 (update tcp stream documentation)
 - #55010 (Add template parameter debuginfo to generic types)
 - #55150 (Do not allow moving out of thread local under ast borrowck)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55221 (Don't emit cannot move errors twice in migrate mode)
 - #55238 (Remove the `alloc_jemalloc` crate)
 - #55244 (Don't rerun MIR passes when inlining)
 - #55257 (Allow extern statics with an extern type)
 - #55269 (fix typos in various places)
 - #55301 (List allowed tokens after macro fragments)
 - #55325 (Fix link to macros chapter)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55357 - pietroalbini:rollup, r=pietroalbini
Rollup of 15 pull requests

Successful merges:

 - #54490 (Rewrite the `UnconditionalRecursion` lint to use MIR)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #54965 (update tcp stream documentation)
 - #55010 (Add template parameter debuginfo to generic types)
 - #55150 (Do not allow moving out of thread local under ast borrowck)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55221 (Don't emit cannot move errors twice in migrate mode)
 - #55238 (Remove the `alloc_jemalloc` crate)
 - #55244 (Don't rerun MIR passes when inlining)
 - #55257 (Allow extern statics with an extern type)
 - #55269 (fix typos in various places)
 - #55301 (List allowed tokens after macro fragments)
 - #55325 (Fix link to macros chapter)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Oct 25, 2018

Auto merge of #55357 - pietroalbini:rollup, r=pietroalbini
Rollup of 15 pull requests

Successful merges:

 - #54490 (Rewrite the `UnconditionalRecursion` lint to use MIR)
 - #54626 (rustc: Tweak filenames encoded into metadata)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #54965 (update tcp stream documentation)
 - #55010 (Add template parameter debuginfo to generic types)
 - #55150 (Do not allow moving out of thread local under ast borrowck)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55221 (Don't emit cannot move errors twice in migrate mode)
 - #55238 (Remove the `alloc_jemalloc` crate)
 - #55244 (Don't rerun MIR passes when inlining)
 - #55257 (Allow extern statics with an extern type)
 - #55269 (fix typos in various places)
 - #55301 (List allowed tokens after macro fragments)
 - #55325 (Fix link to macros chapter)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Contributor

bors commented Oct 26, 2018

⌛️ Testing commit 63c471e with merge bf962e2...

bors added a commit that referenced this pull request Oct 26, 2018

Auto merge of #54626 - alexcrichton:dwarf-generics, r=michaelwoerister
rustc: Tweak filenames encoded into metadata

This commit is a fix for #54408 where on nightly right now whenever
generics are inlined the path name listed for the inlined function's
debuginfo is a relative path to the cwd, which surely doesn't exist!
Previously on beta/stable the debuginfo mentioned an absolute path which
still didn't exist, but more predictably didn't exist.

The change between stable/nightly is that nightly is now compiled with
`--remap-path-prefix` to give a deterministic prefix to all
rustc-generated paths in debuginfo. By using `--remap-path-prefix` the
previous logic would recognize that the cwd was remapped, causing the
original relative path name of the standard library to get emitted. If
`--remap-path-prefix` *wasn't* passed in then the logic would create an
absolute path name and then create a new source file entry.

The fix in this commit is to apply the "recreate the source file entry
with an absolute path" logic a bit more aggresively. If the source
file's name was remapped then we don't touch it, but otherwise we always
take the working dir (which may have been remapped) and then join it to
the file to ensure that we process all relative file names as well.

The end result is that the standard library should have an absolute path
for all file names in debuginfo (using our `--remap-path-prefix`
argument) as it does on stable after this patch.

Closes #54408
@bors

This comment has been minimized.

Contributor

bors commented Oct 26, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: michaelwoerister
Pushing bf962e2 to master...

@bors bors merged commit 63c471e into rust-lang:master Oct 26, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@alexcrichton alexcrichton deleted the alexcrichton:dwarf-generics branch Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment