Skip to content

Build and project bug fixes possibly related to Visual Studio 2017 compatibility #277

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions VisualRust.Build/Rustc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ public static void LogRustcMessage(RustcMessageJson msg, string rootPath, TaskLo
// todo all other fields
// todo mb help key word is code.explanation

// cargo build json messages don't always contain a message component
if (msg == null)
return;

var type = msg.GetLevelAsEnum();
var primarySpan = msg.GetPrimarySpan();
var code = msg.GetErrorCodeAsString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.IO.Abstractions;
using NotifyFilters = System.IO.NotifyFilters;
using IOException = System.IO.IOException;
using Win32Exception = System.ComponentModel.Win32Exception;
using ErrorEventArgs = System.IO.ErrorEventArgs;

#if VS14
Expand Down Expand Up @@ -222,10 +223,14 @@ private static bool IsFileAllowed(string rootDirectory, string fullPath,
shortRelativePath = null;
if (fullPath.StartsWithIgnoreCase(rootDirectory)) {
relativePath = PathHelper.MakeRelative(rootDirectory, fullPath);
try {
try
{
shortRelativePath = fileSystem.ToShortRelativePath(fullPath, rootDirectory);
return !string.IsNullOrEmpty(shortRelativePath) && filter.IsFileAllowed(relativePath, fileSystem.FileInfo.FromFileName(fullPath).Attributes);
} catch (IOException) { } catch (UnauthorizedAccessException) { } // File isn't allowed if it isn't accessible
}
catch (IOException) { }
catch (UnauthorizedAccessException) { } // File isn't allowed if it isn't accessible
catch (Win32Exception) { } // ToShortPath can throw a Win32Exception if the file doesn't exist anymore, which isn't exceptional
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ private async Task ReevaluateLoadedConfiguredProjects(CancellationToken cancella
foreach (var configuredProject in _unconfiguredProject.LoadedConfiguredProjects) {
try {
var jsproj = await access.GetProjectAsync(configuredProject, cancellationToken);
jsproj.MarkDirty();
jsproj.ReevaluateIfNecessary();
} catch (Exception ex) {
System.Diagnostics.Debug.Fail("We were unable to mark a configuration as dirty" + ex.Message, ex.StackTrace);
Expand Down