Skip to content

Commit

Permalink
exclude deps.json from BootstrapNetCorePatch, return _NuGetRuntimeDep…
Browse files Browse the repository at this point in the history
…endencies and fix redundant equality build failure
  • Loading branch information
YuliiaKovalova committed Jun 26, 2024
1 parent c02b3fd commit 0fee63d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions eng/BootStrapMsBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,15 @@
<Target Name="BootstrapNetCorePatch" AfterTargets="BootstrapNetCore">

<ItemGroup>
<!-- *.deps.json are excluded because they will cause the conflicts on an attempt to build solution with the bootstraped bits. -->
<FreshlyBuiltNetBinaries Include="$(OutDir)**\*.*" Exclude="$(OutDir)**\*.deps.json" />
</ItemGroup>

<!-- The copying of these dependencies is required by bootstrap\**\sdk\**\NuGet.RestoreEx.targets. Otherwise NuGet.Build.Tasks.dll can not be found. -->
<Copy SourceFiles="@(_NuGetRuntimeDependencies)"
DestinationFolder="$(BootstrapDestination)"
SkipUnchangedFiles="true" />

<Copy SourceFiles="@(FreshlyBuiltNetBinaries)"
DestinationFiles="@(FreshlyBuiltNetBinaries->'$(InstallDir)sdk\$(NetVersion)\%(RecursiveDir)%(Filename)%(Extension)')" />

Expand Down
8 changes: 6 additions & 2 deletions eng/cibuild_bootstrapped_msbuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ try {

if ($msbuildEngine -eq 'vs')
{
$buildToolPath = Join-Path $bootstrapRoot "net472\MSBuild\Current\Bin\MSBuild.exe"
$buildToolPath = Join-Path $bootstrapRoot "net472\sdk\Current\Bin\MSBuild.exe"
$buildToolCommand = "";
$buildToolFramework = "net472"
}
else
{
$buildToolPath = Join-Path $bootstrapRoot "net8.0\dotnet.exe"
$buildToolCommand = Join-Path $bootstrapRoot "net8.0\sdk\8.0.302\MSBuild.dll";

# Must be consistent with the version in BootStrapMsBuild.props
$netVersion="8.0.302"
$buildToolCommand = Join-Path $bootstrapRoot "net8.0\sdk" $netVersion "MSBuild.dll";

$buildToolFramework = "net8.0"
}

Expand Down
4 changes: 3 additions & 1 deletion eng/cibuild_bootstrapped_msbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ then
fi

bootstrapRoot="$Stage1Dir/bin/bootstrap"
# Must be consistent with the version in BootStrapMsBuild.props
netVersion="8.0.302"

if [ $host_type = "core" ]
then
_InitializeBuildTool="$bootstrapRoot/net8.0/dotnet"
_InitializeBuildToolCommand="$bootstrapRoot/net8.0/sdk/8.0.302/MSBuild.dll"
_InitializeBuildToolCommand="$bootstrapRoot/net8.0/sdk/$netVersion/MSBuild.dll"
_InitializeBuildToolFramework="net8.0"
else
echo "Unsupported hostType ($host_type)"
Expand Down
2 changes: 1 addition & 1 deletion src/MSBuild.Bootstrap/MSBuild.Bootstrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ProjectReference Include="..\Framework\Microsoft.Build.Framework.csproj" />
<ProjectReference Include="..\Tasks\Microsoft.Build.Tasks.csproj" />
<ProjectReference Include="..\Utilities\Microsoft.Build.Utilities.csproj" />
<ProjectReference Condition="$(TargetFramework) != '$(FullFrameworkTFM)'" Include="..\MSBuild.Bootstrap.Utils\MSBuild.Bootstrap.Utils.csproj" />
<ProjectReference Include="..\MSBuild.Bootstrap.Utils\MSBuild.Bootstrap.Utils.csproj" />
</ItemGroup>
<ItemGroup>
<!-- This file is needed so the dotnet CLI knows how to map preview SDK versions to tfms (because tfms do not have preview information on them) -->
Expand Down
2 changes: 1 addition & 1 deletion src/MSBuild/XMake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ string[] args
commandLineSwitches.IsParameterizedSwitchSet(CommandLineSwitches.ParameterizedSwitch.NodeMode) ||
commandLineSwitches[CommandLineSwitches.ParameterlessSwitch.Version] ||
FileUtilities.IsBinaryLogFilename(projectFile) ||
ProcessNodeReuseSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.NodeReuse]) == false ||
!ProcessNodeReuseSwitch(commandLineSwitches[CommandLineSwitches.ParameterizedSwitch.NodeReuse]) ||
IsInteractiveBuild(commandLineSwitches))
{
canRunServer = false;
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/BootstrapperUtil/BootstrapperBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ private bool AddVerificationInformation(XmlNode packageFileNode, string fileSour
// If the public key in the file doesn't match the public key on disk, issue a build warning
// Skip this check if the public key attribute is "0", as this means we're expecting the public key
// comparison to be skipped at install time because the file is signed by an MS trusted cert.
if (publicKeyAttribute.Value.Equals("0", StringComparison.OrdinalIgnoreCase) == false &&
if (!publicKeyAttribute.Value.Equals("0", StringComparison.OrdinalIgnoreCase) &&
publicKey?.Equals(publicKeyAttribute.Value, StringComparison.OrdinalIgnoreCase) == false)
{
results?.AddMessage(BuildMessage.CreateMessage(BuildMessageSeverity.Warning, "GenerateBootstrapper.DifferingPublicKeys", PUBLICKEY_ATTRIBUTE, builder.Name, fileSource));
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/Copy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private void LogAlwaysRetryDiagnosticFromResources(string messageResourceName, p
}

if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_8) &&
Traits.Instance.EscapeHatches.CopyWithoutDelete != true &&
!Traits.Instance.EscapeHatches.CopyWithoutDelete &&
destinationFileState.FileExists &&
!destinationFileState.IsReadOnly)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Tasks/ManifestUtil/TrustInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ private void ReadTrustInfo(string xml)
// Partial trust is not supported on .NET Core.
// Fail if loaded manifest does not specify full-trust.
// It can happen if manifest is manually modifed.
if (unrestrictedAttribute == null || (false == Boolean.Parse(unrestrictedAttribute.Value)))
if (unrestrictedAttribute == null || (!Boolean.Parse(unrestrictedAttribute.Value)))
{
throw new ArgumentException("Partial trust is not supported.");
}
Expand Down

0 comments on commit 0fee63d

Please sign in to comment.