Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
5 changes: 3 additions & 2 deletions documentation/wiki/ChangeWaves.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ A wave of features is set to "rotate out" (i.e. become standard functionality) t
### 17.8
- [[RAR] Don't do I/O on SDK-provided references](https://github.com/dotnet/msbuild/pull/8688)
- [Delete destination file before copy](https://github.com/dotnet/msbuild/pull/8685)
- [New serialization approach for transferring build exceptions between processes](https://github.com/dotnet/msbuild/pull/8779)
- [Moving from SHA1 to SHA256 for Hash task](https://github.com/dotnet/msbuild/pull/8812)
- [Deprecating custom derived BuildEventArgs](https://github.com/dotnet/msbuild/pull/8917) - feature can be opted out only if [BinaryFormatter](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter) is allowed at runtime by editing `MSBuild.runtimeconfig.json`


### 17.6
- [Parse invalid property under target](https://github.com/dotnet/msbuild/pull/8190)
Expand Down Expand Up @@ -68,4 +69,4 @@ A wave of features is set to "rotate out" (i.e. become standard functionality) t
- [Optimized immutable files up to date checks](https://github.com/dotnet/msbuild/pull/6974)
- [Add Microsoft.IO.Redist for directory enumeration](https://github.com/dotnet/msbuild/pull/6771)
- [Process-wide caching of ToolsetConfigurationSection](https://github.com/dotnet/msbuild/pull/6832)
- [Normalize RAR output paths](https://github.com/dotnet/msbuild/pull/6533)
- [Normalize RAR output paths](https://github.com/dotnet/msbuild/pull/6533)
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<VersionPrefix>17.8.0</VersionPrefix>
<VersionPrefix>17.8.1</VersionPrefix><DotNetFinalVersionKind>release</DotNetFinalVersionKind>
<PackageValidationBaselineVersion>17.7.0</PackageValidationBaselineVersion>
<AssemblyVersion>15.1.0.0</AssemblyVersion>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
Expand Down
3 changes: 2 additions & 1 deletion src/Build/BackEnd/Node/OutOfProcNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ private void SendPacket(INodePacket packet)
#if RUNTIME_TYPE_NETCORE
if (packet is LogMessagePacketBase logMessage
&& logMessage.EventType == LoggingEventType.CustomEvent
&& ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_8)
&&
(ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_8) || !Traits.Instance.EscapeHatches.IsBinaryFormatterSerializationAllowed)
&& Traits.Instance.EscapeHatches.EnableWarningOnCustomBuildEvent)
{
BuildEventArgs buildEvent = logMessage.NodeBuildEvent.Value.Value;
Expand Down
4 changes: 2 additions & 2 deletions src/Build/Instance/TaskFactories/TaskHostTask.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
Expand Down Expand Up @@ -436,7 +436,7 @@ private void HandlePacket(INodePacket packet, out bool taskFinished)
private void HandleTaskHostTaskComplete(TaskHostTaskComplete taskHostTaskComplete)
{
#if FEATURE_REPORTFILEACCESSES
if (taskHostTaskComplete.FileAccessData.Count > 0)
if (taskHostTaskComplete.FileAccessData?.Count > 0)
{
IFileAccessManager fileAccessManager = ((IFileAccessManager)_buildComponentHost.GetComponent(BuildComponentType.FileAccessManager));
foreach (FileAccessData fileAccessData in taskHostTaskComplete.FileAccessData)
Expand Down
12 changes: 0 additions & 12 deletions src/Framework/BinaryTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,6 @@ public void TranslateDotNet<T>(ref T value)

public void TranslateException(ref Exception value)
{
if (!ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_8))
{
TranslateDotNet<Exception>(ref value);
return;
}

if (!TranslateNullable(value))
{
return;
Expand Down Expand Up @@ -1291,12 +1285,6 @@ public void TranslateDotNet<T>(ref T value)

public void TranslateException(ref Exception value)
{
if (!ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_8))
{
TranslateDotNet<Exception>(ref value);
return;
}

if (!TranslateNullable(value))
{
return;
Expand Down
26 changes: 26 additions & 0 deletions src/Framework/Traits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ internal class EscapeHatches
/// </summary>
public readonly bool AlwaysDoImmutableFilesUpToDateCheck = Environment.GetEnvironmentVariable("MSBUILDDONOTCACHEMODIFICATIONTIME") == "1";

/// <summary>
/// When copying over an existing file, copy directly into the existing file rather than deleting and recreating.
/// </summary>
public readonly bool CopyWithoutDelete = Environment.GetEnvironmentVariable("MSBUILDCOPYWITHOUTDELETE") == "1";

/// <summary>
/// Emit events for project imports.
/// </summary>
Expand Down Expand Up @@ -395,6 +400,27 @@ public bool EnableWarningOnCustomBuildEvent
}
}

private bool? _isBinaryFormatterSerializationAllowed;
public bool IsBinaryFormatterSerializationAllowed
{
get
{
if (!_isBinaryFormatterSerializationAllowed.HasValue)
{
#if RUNTIME_TYPE_NETCORE
AppContext.TryGetSwitch("System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization",
out bool enabled);
_isBinaryFormatterSerializationAllowed = enabled;
#else
_isBinaryFormatterSerializationAllowed = true;
#endif
}

return _isBinaryFormatterSerializationAllowed.Value;
}
}


private static bool? ParseNullableBoolFromEnvironmentVariable(string environmentVariable)
{
var value = Environment.GetEnvironmentVariable(environmentVariable);
Expand Down
5 changes: 4 additions & 1 deletion src/Shared/TaskHostTaskComplete.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
Expand Down Expand Up @@ -245,6 +245,9 @@ public void Translate(ITranslator translator)
translator.TranslateDictionary(ref _buildProcessEnvironment, StringComparer.OrdinalIgnoreCase);
#if FEATURE_REPORTFILEACCESSES
translator.Translate(ref _fileAccessData);
#else
bool hasFileAccessData = false;
translator.Translate(ref hasFileAccessData);
#endif
}

Expand Down
5 changes: 4 additions & 1 deletion src/Tasks/Copy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ private void LogAlwaysRetryDiagnosticFromResources(string messageResourceName, p
MakeFileWriteable(destinationFileState, true);
}

if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_8) && destinationFileState.FileExists && !destinationFileState.IsReadOnly)
if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_8) &&
Traits.Instance.EscapeHatches.CopyWithoutDelete != true &&
destinationFileState.FileExists &&
!destinationFileState.IsReadOnly)
{
FileUtilities.DeleteNoThrow(destinationFileState.Name);
}
Expand Down