Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
cf920d44
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf920d44
编写于
12月 15, 2016
作者:
J
Jared Parsons
提交者:
GitHub
12月 15, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15915 from jaredpar/fix-server
Check for assembly resolution errors in bootstrap build
上级
27d3b9d6
c61c8426
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
38 addition
and
2 deletion
+38
-2
build/Targets/Imports.targets
build/Targets/Imports.targets
+1
-1
src/Compilers/Core/MSBuildTask/AssemblyResolution.cs
src/Compilers/Core/MSBuildTask/AssemblyResolution.cs
+5
-0
src/Compilers/Core/MSBuildTask/ValidateBootstrap.cs
src/Compilers/Core/MSBuildTask/ValidateBootstrap.cs
+30
-0
src/Compilers/Core/MSBuildTask/project.json
src/Compilers/Core/MSBuildTask/project.json
+2
-1
未找到文件。
build/Targets/Imports.targets
浏览文件 @
cf920d44
...
...
@@ -353,7 +353,7 @@
Condition="!Exists('$(ToolsetCompilerPropsFilePath)')" />
</Target>
<Target Name="CheckBootstrapState" Condition="'$(BootstrapBuildPath)' != ''"
Before
Targets="CoreCompile">
<Target Name="CheckBootstrapState" Condition="'$(BootstrapBuildPath)' != ''"
After
Targets="CoreCompile">
<ValidateBootstrap BootstrapPath="$(BootstrapBuildPath)" />
</Target>
...
...
src/Compilers/Core/MSBuildTask/AssemblyResolution.cs
浏览文件 @
cf920d44
...
...
@@ -54,10 +54,15 @@ private static bool TryRedirect(AssemblyName name)
return
TryRedirect
(
name
,
s_b03f5f7f11d50a3a
,
4
,
0
,
2
,
0
);
case
"System.Diagnostics.StackTrace"
:
case
"System.Security.AccessControl"
:
return
TryRedirect
(
name
,
s_b03f5f7f11d50a3a
,
4
,
0
,
3
,
0
);
}
#if DEBUG || BOOTSTRAP
ValidateBootstrap
.
AddFailedLoad
(
name
);
#endif
return
false
;
}
...
...
src/Compilers/Core/MSBuildTask/ValidateBootstrap.cs
浏览文件 @
cf920d44
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using
Microsoft.Build.Utilities
;
using
System.Collections.Concurrent
;
using
System.IO
;
using
System.Linq
;
using
System.Reflection
;
using
System
;
...
...
@@ -15,6 +17,8 @@ namespace Microsoft.CodeAnalysis.BuildTasks
/// </summary>
public
sealed
class
ValidateBootstrap
:
Task
{
private
static
readonly
ConcurrentDictionary
<
AssemblyName
,
byte
>
s_failedLoadSet
=
new
ConcurrentDictionary
<
AssemblyName
,
byte
>();
private
string
_bootstrapPath
;
public
string
BootstrapPath
...
...
@@ -26,6 +30,7 @@ public string BootstrapPath
public
ValidateBootstrap
()
{
}
public
override
bool
Execute
()
...
...
@@ -54,6 +59,16 @@ public override bool Execute()
}
}
var
failedLoads
=
s_failedLoadSet
.
Keys
.
ToList
();
if
(
failedLoads
.
Count
>
0
)
{
foreach
(
var
name
in
failedLoads
.
OrderBy
(
x
=>
x
.
Name
))
{
Log
.
LogError
(
$"Assembly resolution failed for
{
name
}
"
);
allGood
=
false
;
}
}
return
allGood
;
}
...
...
@@ -74,6 +89,21 @@ private static string NormalizePath(string path)
}
private
string
GetDirectory
(
Assembly
assembly
)
=>
Path
.
GetDirectoryName
(
Utilities
.
GetLocation
(
assembly
));
internal
static
void
AddFailedLoad
(
AssemblyName
name
)
{
switch
(
name
.
Name
)
{
case
"System"
:
case
"System.Core"
:
case
"Microsoft.Build.Tasks.CodeAnalysis.resources"
:
// These are failures are expected by design.
break
;
default
:
s_failedLoadSet
.
TryAdd
(
name
,
0
);
break
;
}
}
}
#endif
}
src/Compilers/Core/MSBuildTask/project.json
浏览文件 @
cf920d44
...
...
@@ -7,6 +7,7 @@
"Microsoft.Win32.Primitives"
:
"4.3.0"
,
"System.AppContext"
:
"4.3.0"
,
"System.Console"
:
"4.3.0"
,
"System.Collections.Concurrent"
:
"4.3.0"
,
"System.Diagnostics.Process"
:
"4.3.0"
,
"System.Diagnostics.Tools"
:
"4.3.0"
,
"System.IO.FileSystem"
:
"4.3.0"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录