Skip to content
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

Replace hardcoded forward slash with path::MAIN_SEPARATOR #40620

Merged
merged 1 commit into from
Mar 31, 2017

Conversation

laumann
Copy link
Contributor

@laumann laumann commented Mar 17, 2017

Fixes #40149

@rust-highfive
Copy link
Collaborator

r? @BurntSushi

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

@BurntSushi
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 18, 2017

📌 Commit cb4f536 has been approved by BurntSushi

@BurntSushi
Copy link
Member

@laumann Thanks!

@laumann
Copy link
Contributor Author

laumann commented Mar 18, 2017

@BurntSushi Thank you :-)

Also came across https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser.rs#L5307 - can it be fixed here or is it too late?

@BurntSushi
Copy link
Member

@bors r-

@BurntSushi
Copy link
Member

@laumann Probably not a good idea to add commits after a PR has been r+'d. I think it will rightyfully cause the PR to fail to merge.

The new changes look OK. Could you please squash them down to a single commit please?

@laumann
Copy link
Contributor Author

laumann commented Mar 18, 2017

@BurntSushi OK, can I fix it here, or should I open a new PR?

@BurntSushi
Copy link
Member

@laumann You can fix it here by squashing your branch locally (probably with a rebase) and then force pushing.

@laumann
Copy link
Contributor Author

laumann commented Mar 18, 2017

OK, no problem, thanks :-)

@laumann laumann force-pushed the slash-in-diagnostics-path branch 3 times, most recently from 5e39f5e to eca493c Compare March 19, 2017 06:57
@laumann
Copy link
Contributor Author

laumann commented Mar 19, 2017

Rebased. Something went wrong with https://travis-ci.org/rust-lang/rust/jobs/212496260, but I can't really tell what.

@bors
Copy link
Contributor

bors commented Mar 19, 2017

☔ The latest upstream changes (presumably #40346) made this pull request unmergeable. Please resolve the merge conflicts.

@BurntSushi
Copy link
Member

@laumann You need to merge changes from master back into this PR because someone else has made changes since submitting your PR that conflict with your changes.

You can do this by checking out your master branch and re-syncing it with master on rust-lang/rust, usually with git pull origin master --ff-only (assuming origin points to rust-lang/rust and not your fork). Then checkout your PR branch, git checkout slash-in-diagnostics-path, and rebase it on to master.

@laumann
Copy link
Contributor Author

laumann commented Mar 19, 2017

@BurntSushi Rebased.

@BurntSushi
Copy link
Member

@laumann Thanks!

@BurntSushi
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 19, 2017

📌 Commit 4f0141b has been approved by BurntSushi

@frewsxcv
Copy link
Member

I think this is causing a test failure on Windows:

https://ci.appveyor.com/project/rust-lang/rust/build/1.0.2460/job/kfyqxp0uxi22y3lk

@bors r-

@laumann
Copy link
Contributor Author

laumann commented Mar 20, 2017

@frewsxcv You are right - it looks like test/parse-fail/mod_file_not_exists.rs which makes sense :-) I'll get it fixed!

Why is that test in parse-fail and not compile-fail?

@laumann
Copy link
Contributor Author

laumann commented Mar 20, 2017

It seems the issue can be fixed several ways, but which one would be preferred?

  1. Duplicate the test in parse-fail/mod_file_not_exists_windows.rs and add:
// ignore-gnu
// ignore-android
// ignore-bitrig
// ignore-macos
// ignore-dragonfly
// ignore-freebsd
// ignore-haiku
// ignore-ios
// ignore-linux
// ignore-netbsd
// ignore-openbsd
// ignore-solaris
// ignore-emscripten

and add ignore-windows to parse-fail/mod_file_not_exists.rs

  1. Convert the test to a run-make test (suggested by @jseyfried), to make it easier to switch on OS

But I'm wondering what the preferred approach is...

I tried fiddling with #[cfg(windows)] and something like:

#[cfg(windows)]
mod not_a_real_file; //[windows]~ ERROR file not found for module `not_a_real_file`
//[windows]~^ HELP name the file either not_a_real_file.rs or not_a_real_file\mod.rs inside the directory

#[cfg(not(windows))]
mod not_a_real_file; //[not(windows)]~ ERROR file not found for module `not_a_real_file`
//[not(windows)]~^ HELP name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory


fn main() {
    assert_eq!(mod_file_aux::bar(), 10);
}

But that trick didn't work :-)

@laumann
Copy link
Contributor Author

laumann commented Mar 20, 2017

@BurntSushi Should I prefer to amend the existing commit, or should I just add new ones (to fix the test)?

@BurntSushi
Copy link
Member

@laumann Amend the existing commit. We shouldn't have broken commits. :-)

@laumann
Copy link
Contributor Author

laumann commented Mar 21, 2017

@BurntSushi The build failed, but I can't really tell why - is there some way to try again?

@BurntSushi
Copy link
Member

@laumann I kicked it.

@laumann
Copy link
Contributor Author

laumann commented Mar 21, 2017

@BurntSushi Yay! Thanks :-)

@laumann
Copy link
Contributor Author

laumann commented Mar 28, 2017

@frewsxcv It should be fixed now, not sure if I need to do anything else.

@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// ignore-windows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem OK to ignore this test on Windows.

@alexcrichton What should we do here? This PR is changing a few places to use the native path separator when printing file paths, so I assume this test is failing because the error messages don't compare equal. Is there a way to do conditional testing based on platform?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now see that there is another test in this PR, mod_file_not_exist_windows.rs, which essentially does this. But it's done by exhausting every non-Windows platform. Is that the right way to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BurntSushi I considered different approaches - this could maybe be turned into a run-make test instead.

I went for this solution, because I looked at src/test/codegen/dllimports/main.rs (and others) that do windows-specific things by exhausting the other options.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precedence is good enough for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :-)

Ah, of course, you have to r+ it! I was wondering why it wasn't being tested again...

@BurntSushi
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 28, 2017

📌 Commit 25130da has been approved by BurntSushi

@bors
Copy link
Contributor

bors commented Mar 29, 2017

🔒 Merge conflict

@laumann
Copy link
Contributor Author

laumann commented Mar 30, 2017

@BurntSushi Should I rebase again?

@BurntSushi
Copy link
Member

Yup. Looks like something else got merged that conflicts with this, so you'll need to rebase to resolve conflicts.

@laumann
Copy link
Contributor Author

laumann commented Mar 30, 2017

Will do

@laumann
Copy link
Contributor Author

laumann commented Mar 30, 2017

Seems to be good now. 🤞

@BurntSushi
Copy link
Member

@bors retry

@alexcrichton
Copy link
Member

@bors: r=BurntSushi

@bors
Copy link
Contributor

bors commented Mar 30, 2017

📌 Commit b376386 has been approved by BurntSushi

@bors
Copy link
Contributor

bors commented Mar 31, 2017

⌛ Testing commit b376386 with merge 474f7a9...

bors added a commit that referenced this pull request Mar 31, 2017
Replace hardcoded forward slash with path::MAIN_SEPARATOR

Fixes #40149
@bors
Copy link
Contributor

bors commented Mar 31, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: BurntSushi
Pushing 474f7a9 to master...

@bors bors merged commit b376386 into rust-lang:master Mar 31, 2017
@laumann laumann deleted the slash-in-diagnostics-path branch March 31, 2017 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants