Merge branch 'main' into PassCrossCompile
This commit is contained in:
commit
7fd5ad40bd
48 changed files with 362 additions and 242 deletions
|
@ -1,7 +1,7 @@
|
|||
// Container contains checked-out source code only
|
||||
{
|
||||
"name": "Default",
|
||||
"image": "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-36",
|
||||
"image": "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39",
|
||||
"hostRequirements": {
|
||||
// A completely source built .NET is >64 GB with all the repos/artifacts
|
||||
"storage": "128gb"
|
||||
|
@ -19,4 +19,4 @@
|
|||
}
|
||||
},
|
||||
"onCreateCommand": ".devcontainer/init.sh"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Container contains a pre-built SDK
|
||||
{
|
||||
"name": "Pre-built .NET SDK",
|
||||
"image": "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-36",
|
||||
"image": "mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39",
|
||||
"hostRequirements": {
|
||||
// A completely source built .NET is >64 GB with all the repos/artifacts
|
||||
"storage": "128gb"
|
||||
|
@ -19,4 +19,4 @@
|
|||
}
|
||||
},
|
||||
"onCreateCommand": ".devcontainer/prebuilt-sdk/init.sh"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,7 @@ trigger:
|
|||
pr: none
|
||||
|
||||
stages:
|
||||
- ${{ if ne(variables['Build.Reason'], 'Schedule') }}:
|
||||
- template: templates/stages/vmr-scan.yml
|
||||
- template: templates/stages/vmr-scan.yml
|
||||
|
||||
- template: /src/installer/eng/pipelines/templates/stages/vmr-build.yml
|
||||
parameters:
|
||||
|
|
|
@ -347,7 +347,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
|
|||
using var peReader = new PEReader(stream);
|
||||
|
||||
MetadataReader reader = peReader.GetMetadataReader();
|
||||
return reader.CustomAttributes.Select(attrHandle => reader.GetCustomAttribute(attrHandle))
|
||||
return reader.CustomAttributes
|
||||
.Select(attrHandle => reader.GetCustomAttribute(attrHandle))
|
||||
.Any(attr => IsAttributeSbrp(reader, attr));
|
||||
}
|
||||
|
||||
|
@ -357,13 +358,23 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
|
|||
|
||||
if (attr.Constructor.Kind == HandleKind.MemberReference)
|
||||
{
|
||||
MemberReference mref = reader.GetMemberReference((MemberReferenceHandle)attr.Constructor);
|
||||
|
||||
var mref = reader.GetMemberReference((MemberReferenceHandle)attr.Constructor);
|
||||
if (mref.Parent.Kind == HandleKind.TypeReference)
|
||||
{
|
||||
TypeReference tref = reader.GetTypeReference((TypeReferenceHandle)mref.Parent);
|
||||
var tref = reader.GetTypeReference((TypeReferenceHandle)mref.Parent);
|
||||
attributeType = $"{reader.GetString(tref.Namespace)}.{reader.GetString(tref.Name)}";
|
||||
}
|
||||
else if (mref.Parent.Kind == HandleKind.TypeDefinition)
|
||||
{
|
||||
var tdef = reader.GetTypeDefinition((TypeDefinitionHandle)mref.Parent);
|
||||
attributeType = $"{reader.GetString(tdef.Namespace)}.{reader.GetString(tdef.Name)}";
|
||||
}
|
||||
}
|
||||
else if (attr.Constructor.Kind == HandleKind.MethodDefinition)
|
||||
{
|
||||
var mdef = reader.GetMethodDefinition((MethodDefinitionHandle)attr.Constructor);
|
||||
var tdef = reader.GetTypeDefinition(mdef.GetDeclaringType());
|
||||
attributeType = $"{reader.GetString(tdef.Namespace)}.{reader.GetString(tdef.Name)}";
|
||||
}
|
||||
|
||||
if (attributeType == SbrpAttributeType)
|
||||
|
@ -371,7 +382,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
|
|||
var decodedValue = attr.DecodeValue(DummyAttributeTypeProvider.Instance);
|
||||
try
|
||||
{
|
||||
return decodedValue.FixedArguments[0].Value.ToString() == "source" && decodedValue.FixedArguments[1].Value.ToString() == "source-build-reference-packages";
|
||||
return decodedValue.FixedArguments[0].Value?.ToString() == "source" && decodedValue.FixedArguments[1].Value?.ToString() == "source-build-reference-packages";
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -7,28 +7,31 @@ using System.Reflection;
|
|||
using System.Reflection.Metadata;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection
|
||||
{
|
||||
|
||||
// An empty ICustomAttributeTypeProvider implementation is necessary to read metadata attribute values.
|
||||
internal class DummyAttributeTypeProvider : ICustomAttributeTypeProvider<Type>
|
||||
internal class DummyAttributeTypeProvider : ICustomAttributeTypeProvider<Type?>
|
||||
{
|
||||
public static readonly DummyAttributeTypeProvider Instance = new();
|
||||
|
||||
public Type GetPrimitiveType(PrimitiveTypeCode typeCode) => default(Type);
|
||||
public Type? GetPrimitiveType(PrimitiveTypeCode typeCode) => default(Type);
|
||||
|
||||
public Type GetSystemType() => default(Type);
|
||||
public Type? GetSystemType() => default(Type);
|
||||
|
||||
public Type GetSZArrayType(Type elementType) => default(Type);
|
||||
public Type? GetSZArrayType(Type? elementType) => default(Type);
|
||||
|
||||
public Type GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => default(Type);
|
||||
public Type? GetTypeFromDefinition(MetadataReader reader, TypeDefinitionHandle handle, byte rawTypeKind) => default(Type);
|
||||
|
||||
public Type GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => default(Type);
|
||||
public Type? GetTypeFromReference(MetadataReader reader, TypeReferenceHandle handle, byte rawTypeKind) => default(Type);
|
||||
|
||||
public Type GetTypeFromSerializedName(string name) => default(Type);
|
||||
public Type? GetTypeFromSerializedName(string name) => default(Type);
|
||||
|
||||
public PrimitiveTypeCode GetUnderlyingEnumType(Type type) => default(PrimitiveTypeCode);
|
||||
public PrimitiveTypeCode GetUnderlyingEnumType(Type? type) => default(PrimitiveTypeCode);
|
||||
|
||||
public bool IsSystemType(Type type) => default(bool);
|
||||
public bool IsSystemType(Type? type) => default(bool);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
<BuildCommandArgs>$(BuildCommandArgs) $(FlagParameterPrefix)nodereuse $(ArcadeFalseBoolBuildArg)</BuildCommandArgs>
|
||||
<BuildCommandArgs>$(BuildCommandArgs) $(FlagParameterPrefix)warnAsError $(ArcadeFalseBoolBuildArg)</BuildCommandArgs>
|
||||
<BuildCommandArgs>$(BuildCommandArgs) $(OutputVersionArgs)</BuildCommandArgs>
|
||||
<BuildCommandArgs>$(BuildCommandArgs) /p:DotNetCoreSdkDir=$(DotNetCliToolDir)</BuildCommandArgs>
|
||||
<BuildCommand>$(StandardSourceBuildCommand) $(BuildCommandArgs)</BuildCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -36,10 +36,9 @@ public class BasicScenarioTests : SdkTests
|
|||
// R2R is not supported on Mono (see https://github.com/dotnet/runtime/issues/88419#issuecomment-1623762676)
|
||||
DotNetActions.Build | DotNetActions.Run | (DotNetHelper.ShouldPublishComplex() ? DotNetActions.None : DotNetActions.PublishComplex) | (helper.IsMonoRuntime ? DotNetActions.None : DotNetActions.PublishR2R));
|
||||
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.ClassLib, DotNetActions.Build | DotNetActions.Publish);
|
||||
// TODO: Uncomment when test templates are updated to net9.0: https://github.com/dotnet/source-build/issues/3668
|
||||
// yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.XUnit, DotNetActions.Test);
|
||||
// yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.NUnit, DotNetActions.Test);
|
||||
// yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.MSTest, DotNetActions.Test);
|
||||
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.XUnit, DotNetActions.Test);
|
||||
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.NUnit, DotNetActions.Test);
|
||||
yield return new(nameof(BasicScenarioTests), language, DotNetTemplate.MSTest, DotNetActions.Test);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,12 +166,23 @@ public class LicenseScanTests : TestBase
|
|||
string baselineName = $"Licenses.{_targetRepo}.json";
|
||||
|
||||
string baselinePath = BaselineHelper.GetBaselineFilePath(baselineName, BaselineSubDir);
|
||||
if (!File.Exists(baselinePath))
|
||||
string expectedFilePath = Path.Combine(LogsDirectory, baselineName);
|
||||
if (File.Exists(baselinePath))
|
||||
{
|
||||
Assert.Fail($"No license baseline file exists for repo '{_targetRepo}'. Expected file: {baselinePath}");
|
||||
File.Copy(baselinePath, expectedFilePath, overwrite: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If there is no license baseline, generate a default empty one.
|
||||
ScancodeResults defaultResults = new();
|
||||
string defaultResultsJson = JsonSerializer.Serialize(defaultResults, options);
|
||||
File.WriteAllText(expectedFilePath, defaultResultsJson);
|
||||
}
|
||||
|
||||
BaselineHelper.CompareBaselineContents(baselineName, json, OutputHelper, Config.WarnOnLicenseScanDiffs, BaselineSubDir);
|
||||
string actualFilePath = Path.Combine(TestBase.LogsDirectory, $"Updated{baselineName}");
|
||||
File.WriteAllText(actualFilePath, json);
|
||||
|
||||
BaselineHelper.CompareFiles(expectedFilePath, actualFilePath, OutputHelper, Config.WarnOnLicenseScanDiffs);
|
||||
}
|
||||
|
||||
private LicenseExclusion ParseLicenseExclusion(string rawExclusion)
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"files": []
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue