Skip to content

Commit

Permalink
Merge branch 'main' into fp-struct-info
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeksowi committed Jul 25, 2024
2 parents 823df8b + 4072e73 commit c209a55
Show file tree
Hide file tree
Showing 2,500 changed files with 119,267 additions and 96,972 deletions.
47 changes: 0 additions & 47 deletions .config/guardian/.gdnbaselines

This file was deleted.

11 changes: 9 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
ARG VARIANT="6.0-jammy"
FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT}

# Set up machine requirements to build the repo and the gh CLI
# Clang-16 up is required but Ubuntu 22.04 comes with clang-14 highest, so add clang-18 sources
RUN apt-get update \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - \
&& apt-get install software-properties-common -y \
&& add-apt-repository "deb http://apt.llvm.org/$(lsb_release -s -c)/ llvm-toolchain-$(lsb_release -s -c)-18 main" -y \
&& apt-get update \
&& apt-get install clang-18 -y

# Set up machine requirements to build the repo and the gh CLI
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
cmake \
llvm \
clang \
build-essential \
python3 \
curl \
Expand Down
11 changes: 9 additions & 2 deletions .devcontainer/wasm-multiThreaded/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
ARG VARIANT="6.0-jammy"
FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT}

# Set up machine requirements to build the repo and the gh CLI
# Clang-16 up is required but Ubuntu 22.04 comes with clang-14 highest, so add clang-18 sources
RUN apt-get update \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - \
&& apt-get install software-properties-common -y \
&& add-apt-repository "deb http://apt.llvm.org/$(lsb_release -s -c)/ llvm-toolchain-$(lsb_release -s -c)-18 main" -y \
&& apt-get update \
&& apt-get install clang-18 -y

# Set up machine requirements to build the repo and the gh CLI
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
cmake \
llvm \
clang \
build-essential \
python3 \
curl \
Expand Down
10 changes: 8 additions & 2 deletions .devcontainer/wasm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ ARG VARIANT="6.0-jammy"
FROM mcr.microsoft.com/devcontainers/dotnet:0-${VARIANT}

# Set up machine requirements to build the repo and the gh CLI
# Clang-16 up is required but Ubuntu 22.04 comes with clang-14 highest, so add clang-18 sources
RUN apt-get update \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - \
&& apt-get install software-properties-common -y \
&& add-apt-repository "deb http://apt.llvm.org/$(lsb_release -s -c)/ llvm-toolchain-$(lsb_release -s -c)-18 main" -y \
&& apt-get update \
&& apt-get install clang-18 -y

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
cmake \
llvm \
clang \
build-essential \
python3 \
curl \
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
<Features>strict;nullablePublicOnly</Features>
<TreatWarningsAsErrors Condition="'$(TreatWarningsAsErrors)' == ''">true</TreatWarningsAsErrors>
<!-- Warnings to always disable -->
<NoWarn>$(NoWarn),CS8969</NoWarn>
<NoWarn>$(NoWarn);CS8500;CS8969</NoWarn>
<!-- Always pass portable to override arcade sdk which uses embedded for local builds -->
<DebugType>portable</DebugType>
<KeepNativeSymbols Condition="'$(KeepNativeSymbols)' == '' and '$(DotNetBuildSourceOnly)' == 'true'">true</KeepNativeSymbols>
Expand Down
12 changes: 2 additions & 10 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,10 @@
<Error Text="The passed-in TargetOS property value '$(TargetOS)' must be lowercase." />
</Target>

<ItemDefinitionGroup>
<TargetPathWithTargetPlatformMoniker>
<IsReferenceAssemblyProject>$(IsReferenceAssemblyProject)</IsReferenceAssemblyProject>
</TargetPathWithTargetPlatformMoniker>
</ItemDefinitionGroup>

<Target Name="ValidateReferenceAssemblyProjectReferencesAndTargetFramework"
AfterTargets="ResolveReferences"
<Target Name="ValidateReferenceAssemblyProjectTargetFramework"
BeforeTargets="CoreCompile"
Condition="'$(IsReferenceAssemblyProject)' == 'true' and
'$(SkipValidateReferenceAssemblyProjectReferences)' != 'true'">
<Error Text="Reference assemblies must only reference other reference assemblies and '%(ReferencePath.ProjectReferenceOriginalItemSpec)' is not a reference assembly project and does not set 'ProduceReferenceAssembly'."
Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' and '%(ReferencePath.IsReferenceAssemblyProject)' != 'true' and '%(ReferencePath.ReferenceAssembly)' == ''" />
<Error Text="Reference assemblies must be TargetPlatform agnostic. $(MSBuildProjectName) incorrectly targets $(TargetFramework), platform: $(TargetPlatformIdentifier)."
Condition="'$(TargetPlatformIdentifier)' != ''" />
</Target>
Expand Down
32 changes: 0 additions & 32 deletions THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -66,38 +66,6 @@ shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.

License notice for Zlib
-----------------------

https://github.com/madler/zlib
https://zlib.net/zlib_license.html

/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.3.1, January 22nd, 2024

Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

Jean-loup Gailly Mark Adler
[email protected] [email protected]

*/

License notice for zlib-ng
-----------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/area-owners.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Note: Editing this file doesn't update the mapping used by `@msftbot` for area-s
| area-UWP | @tommcdon | @dotnet/area-uwp | UWP-specific issues including Microsoft.NETCore.UniversalWindowsPlatform and Microsoft.Net.UWPCoreRuntimeSdk |
| area-VM-coreclr | @mangod9 | @mangod9 | |
| area-VM-meta-mono | @steveisok | @lambdageek | |
| area-VM-reflection-mono | @mangod9 | @lambdageek | MonoVM-specific reflection and reflection-emit issues |
| area-VM-reflection-mono | @steveisok | @lambdageek | MonoVM-specific reflection and reflection-emit issues |
| area-VM-threading-mono | @mangod9 | @lambdageek | |
| area-Workloads | @lewing | @dotnet/net-sdk-workload-contributors | |

Expand Down
2 changes: 1 addition & 1 deletion docs/coding-guidelines/api-guidelines/nullability.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ However, for existing virtual APIs that do not have any such strong guarantee do
4. How common is it in the case of (3) for such invocations to then dereference the result rather than passing it off to something else that accepts a `T?`?

`Object.ToString` is arguably the most extreme case. Answering the above questions:
1. It is fairly easy in any reasonably-sized code base to find cases, intentional or otherwise, where `ToString` returns `null` in some cases (we've found examples in dotnet/corefx, dotnet/roslyn, NuGet/NuGet.Client, dotnet/aspnetcore, and so on). One of the most prevalent conditions for this are types that just return the value in a string field which may contain its default value of `null`, and in particular for structs where a ctor may not have even had a chance to run and validate an input. Guidance in the docs suggests that `ToString` shouldn't return `null` or `string.Empty`, but even the docs don't follow its own guidance.
1. It is fairly easy in any reasonably-sized code base to find cases, intentional or otherwise, where `ToString` returns `null` in some cases (we've found examples in dotnet/runtime, dotnet/roslyn, NuGet/NuGet.Client, dotnet/aspnetcore, and so on). One of the most prevalent conditions for this are types that just return the value in a string field which may contain its default value of `null`, and in particular for structs where a ctor may not have even had a chance to run and validate an input. Guidance in the docs suggests that `ToString` shouldn't return `null` or `string.Empty`, but even the docs don't follow its own guidance.
2. Thousands upon thousands of types we don't control override this method today.
3. It's common for helper routines to invoke via the base `object.ToString`, but many `ToString` uses are actually on derived types. This is particularly true when working in a code base that both defines a type and consumes its `ToString`.
4. Based on examination of several large code bases, we believe it to be relatively rare that the result of an `Object.ToString` call (made on the base) to be directly dereferenced. It's much more common to pass it to another method that accepts `string?`, such as `String.Concat`, `String.Format`, `Console.WriteLine`, logging utilities, and so on. And while we advocate that `ToString` results shouldn't be assumed to be in a particular machine-readable format and parsed, it's certainly the case that code bases do, such as using `Substring` on the result, but in such cases, the caller needs to understand the format of what's being rendered, which generally means they're working with a derived type rather than calling through the base `Object.ToString`.
Expand Down
Loading

0 comments on commit c209a55

Please sign in to comment.