Build and project bug fixes possibly related to Visual Studio 2017 compatibility#277
Closed
MathiasPius wants to merge 3 commits intoPistonDevelopers:masterfrom
MathiasPius:master
Closed
Build and project bug fixes possibly related to Visual Studio 2017 compatibility#277MathiasPius wants to merge 3 commits intoPistonDevelopers:masterfrom MathiasPius:master
MathiasPius wants to merge 3 commits intoPistonDevelopers:masterfrom
MathiasPius:master
Conversation
added 3 commits
May 6, 2017 12:32
Building Visual Rust projects would cause MSBuild to break when attempting to access members of a null message
…in32Exception The core FileSystem.ToShortPath function would throw an exception when the file whose path it was trying to shorten no longer existed, which happens when saving a file under Visual Studio 2017, and a temporary file is created and deleted before the FileSystemWatcher can shorten the path of it
If projects aren't explicitly marked dirty, loading existing projects would yield empty project structures in the solution explorer, and require the user to unload and reload the project in order to see the file structure.
Collaborator
|
Looks like I've accidentally duplicated some (but not all!) of the work here in #286 . Was this intentionally closed? |
Author
|
There seemed to be little interest in it, and it looked like there were a lot of other - bigger - efforts to achieve VS2017 compatibility so I figured my small changes would probably be irrelevant at best, or conflicting at worst. It looks like your PR is one such effort, so if you can get anything useful out of this one, help yourself :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've fixed a few issues I encountered whilst trying to build and use the latest version of Visual Rust.
When trying to build a project generated from the standard Rust Application template, MSBuild would crash, because the json-formatted feedback returned from the cargo build command didn't contain a .message component referenced in the LogRustcMessage function. I've chosen here to just exit the logging function early since there's no real message to log. I'm not sure if the information contained in the parent message object itself is perhaps relevant to the output window still.
When you open a file in a project and save it, the MsBuildFileSystemWatcher would produce an error, because Visual Studio 2017* briefly creates a temporary file in the project directory, and in the process of checking its relevance to the project, the MsBuildFileSystemWatcher would attempt to shorten the path of the file after the temporary file was already removed again. This causes the ToShortPath function to throw a Win32Exception that was not handled in the IsFileAllowed function. Since the file no longer exists, the accessibility of the file is a little irrelevant, so I just caught the error so the function returns false.