Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upChange in behavior of `include!` in doctests on nightly #43153
Comments
sgrif
added a commit
to diesel-rs/diesel
that referenced
this issue
Jul 13, 2017
Fiedzia
added a commit
to Fiedzia/diesel
that referenced
this issue
Jul 18, 2017
This comment has been minimized.
This comment has been minimized.
|
Any chance I can get some eyes on this? It's going to become a regression in beta soon. |
This comment has been minimized.
This comment has been minimized.
|
I tried bisecting but ran in some issues with rust not being able to compile anything that had a proc_macro in it after the first iteration.
EDIT:
|
This comment has been minimized.
This comment has been minimized.
|
@sgrif Is there a chance you or someone else could provide a more minimal example? Preferably something that would work with straightforward |
This comment has been minimized.
This comment has been minimized.
|
@Mark-Simulacrum Here is a repo https://github.com/Eijebong/repro_rust_43153
EDIT: They're not passing on beta anymore. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for getting a minimal repro @Eijebong |
Mark-Simulacrum
added
regression-from-stable-to-beta
and removed
regression-from-stable-to-nightly
labels
Jul 18, 2017
This comment has been minimized.
This comment has been minimized.
|
Bisection shows 4d526e0 - #40939, cc @jseyfried, @alexcrichton -- I'm not sure if this bisection is entirely accurate, but it does seem potentially related.... I'm going to attempt to look into fixing, but don't count on me. |
This comment has been minimized.
This comment has been minimized.
|
This looks like a similar symptom ("No such file or directory") to the warning I reported in #43371. |
sgrif
added a commit
to diesel-rs/diesel
that referenced
this issue
Jul 23, 2017
This comment has been minimized.
This comment has been minimized.
|
@nrc would you be able to help out with investigation here? |
This comment has been minimized.
This comment has been minimized.
|
I can try. I don't think it is the same as #43371 (I'll comment over there about the cause, and it doesn't explain this), though it might well be the same PR that regressed things here. |
Mark-Simulacrum
added
I-nominated
P-high
T-compiler
labels
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
|
Nominated for prioritization and investigation. Seems bad. |
alexcrichton
assigned
nrc
Jul 27, 2017
nikomatsakis
removed
the
I-nominated
label
Jul 27, 2017
Mark-Simulacrum
added
the
C-bug
label
Jul 28, 2017
This comment has been minimized.
This comment has been minimized.
|
Observation, from the minimal test case, the error reported is |
This comment has been minimized.
This comment has been minimized.
|
I think what is happening here is that rust/src/libsyntax/ext/source_util.rs Line 185 in 5dfcd85 include or an include inside some other macro expansion, we calculate the relative path differently because the span for the nested include is different.
I don't know how to fix this - its 6pm on Friday and I just worked out the problem. If it is easy for someone to take a look at over the weekend, that would be awesome. Otherwise I'll come up with a fix on Monday (I have no idea whether this will be easy or hard to fix). |
This comment has been minimized.
This comment has been minimized.
|
Thanks for looking into it @nrc. Have a good weekend! |
Fiedzia
added a commit
to Fiedzia/diesel
that referenced
this issue
Jul 31, 2017
This comment has been minimized.
This comment has been minimized.
|
I am confused. Both the comment in the code I linked in the previous comment and the docs for |
This comment has been minimized.
This comment has been minimized.
|
I've always just gone with "whatever worked". Certainly the behavior seems to be working directory, which cargo should always be enforcing is the manifest directory. Relative to the current file would definitely be problematic if it's ever used from inside a macro. |
nrc
added
I-nominated
T-lang
labels
Aug 1, 2017
This comment has been minimized.
This comment has been minimized.
|
Nominating for lang team discussion. This was a breaking change, but I think it is also a bug fix. I'm not sure if we should revert to the old behaviour and then warning cycle, or leave it as is, or revert to the old behaviour and leave there. So, nominating for lang team discussion. Problem summaryNote that this only affects For a 'normal' I see three solutions:
Implementation noteThe implementation takes the path from a span, does a |
This comment has been minimized.
This comment has been minimized.
|
If we have a defined story for what |
nrc
removed
the
I-nominated
label
Aug 3, 2017
This comment has been minimized.
This comment has been minimized.
|
We discussed this at today's lang team meeting. Conclusion was that we should fix the behaviour of I'll do the implementation. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Aug 13, 2017
bors
closed this
in
#43782
Aug 13, 2017
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Is the nightly out yet ? |
This comment has been minimized.
This comment has been minimized.
|
It's fixed, now waiting for it to be in a release :) thanks |
bors
added a commit
that referenced
this issue
Aug 18, 2017
bors
added a commit
that referenced
this issue
Aug 19, 2017
bors
added a commit
that referenced
this issue
Aug 19, 2017
This comment has been minimized.
This comment has been minimized.
briansmith
commented
Aug 28, 2017
|
This broke ring's build. I need to remove the "src/" prefix on beta & nightly Rust but I need to keep it for stable Rust. How should one accomplish this? That is, for a project affected by this change, how do we write code that bridges the change in behavior (without adding additional dependencies)? Also, this needs to be in the release notes. |
This comment has been minimized.
This comment has been minimized.
|
Sorry for the breakage. We assumed that since the original issue did not cause problems, neither would the fix. It should indeed be in the release notes. This patch was uplifted to beta, so the easiest option is to just wait a week and then all channels will need the fixed version. If you don't want to wait then mark the examples with |
sgrif commentedJul 10, 2017
I haven't had a chance to create a minimal repro case, but I'm seeing these in Diesel's builds: https://travis-ci.org/diesel-rs/diesel/jobs/252088111#L824. The issue only occurs on nightly, and it seems to only affect doctests which are more than 2 directories deep.