-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Change in behavior of include!
in doctests on nightly
#43153
Comments
This is a refactoring in preparation for ad-hoc join clauses. I'm imagining the API being roughly `lhs.inner_join(rhs.on(on_clause))`, which will mean we will have a struct containing the rhs and the on clause. The `JoinTo` impl for this struct will need to just destructure it and return those pieces, so this sets up the trait changes for all existing implementations. I had to bump clippy as part of this change, as it hits a rustc bug that was fixed on more recent nightlies. However, I couldn't bump to the *latest* clippy, as recent nightlies are broken for us due to rust-lang/rust#43153
This is a refactoring in preparation for ad-hoc join clauses. I'm imagining the API being roughly `lhs.inner_join(rhs.on(on_clause))`, which will mean we will have a struct containing the rhs and the on clause. The `JoinTo` impl for this struct will need to just destructure it and return those pieces, so this sets up the trait changes for all existing implementations. I had to bump clippy as part of this change, as it hits a rustc bug that was fixed on more recent nightlies. However, I couldn't bump to the *latest* clippy, as recent nightlies are broken for us due to rust-lang/rust#43153
Any chance I can get some eyes on this? It's going to become a regression in beta soon. |
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:
|
@sgrif Is there a chance you or someone else could provide a more minimal example? Preferably something that would work with straightforward |
@Mark-Simulacrum Here is a repo https://github.com/Eijebong/repro_rust_43153
EDIT: They're not passing on beta anymore. |
Thanks for getting a minimal repro @Eijebong |
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 looks like a similar symptom ("No such file or directory") to the warning I reported in #43371. |
Until rust-lang/rust#43153 is fixed, our builds are failing on beta.
@nrc would you be able to help out with investigation here? |
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. |
Nominated for prioritization and investigation. Seems bad. |
Observation, from the minimal test case, the error reported is |
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). |
Thanks for looking into it @nrc. Have a good weekend! ❤️ |
Until rust-lang/rust#43153 is fixed, our builds are failing on beta.
I am confused. Both the comment in the code I linked in the previous comment and the docs for |
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. |
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 |
If we have a defined story for what |
We discussed this at today's lang team meeting. Conclusion was that we should fix the behaviour of I'll do the implementation. |
👍 Just let me know when I can point at a nightly/beta release to fix our use in Diesel. 😄 |
Fix include! in doc tests By making the path relative to the current file. Fixes rust-lang#43153 [breaking-change] - if you use `include!` inside a doc test, you'll need to change the path to be relative to the current file rather than relative to the working directory.
Is the nightly out yet ? |
It's fixed, now waiting for it to be in a release :) thanks |
Uplift fix for include! in doc tests to beta Uplift #43782 to beta. Fixes #43153. r? @alexcrichton (approved by @rust-lang/dev-tools )
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. |
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 |
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.
The text was updated successfully, but these errors were encountered: