Skip to content

Commit

Permalink
Change netcoreapp5.0 to net5.0 (dotnet#35176)
Browse files Browse the repository at this point in the history
* Change netcoreapp5.0 to net5.0

* Remove tfm downgrades

* Rename S.R.CS.Unsfae include folder
  • Loading branch information
ViktorHofer committed May 6, 2020
1 parent f4acc94 commit 000046f
Show file tree
Hide file tree
Showing 120 changed files with 359 additions and 375 deletions.
4 changes: 2 additions & 2 deletions docs/coding-guidelines/adding-api-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ the implementation without compat concerns in future releases.

### Determine target framework

`netcoreapp5.0` is the target framework version currently under development and the new apis
should be added to `netcoreapp5.0`. [More Information on TargetFrameworks](https://docs.microsoft.com/en-us/dotnet/standard/frameworks)
`net5.0` is the target framework version currently under development and the new apis
should be added to `net5.0`. [More Information on TargetFrameworks](https://docs.microsoft.com/en-us/dotnet/standard/frameworks)

## Making the changes in repo

Expand Down
6 changes: 3 additions & 3 deletions docs/coding-guidelines/project-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Below is a list of all the various options we pivot the project builds on:
## Individual build properties
The following are the properties associated with each build pivot

- `$(BuildTargetFramework) -> netstandard2.1 | netcoreapp5.0 | net472`
- `$(BuildTargetFramework) -> netstandard2.1 | net5.0 | net472`
- `$(TargetOS) -> Windows | Linux | OSX | FreeBSD | [defaults to running OS when empty]`
- `$(Configuration) -> Release | [defaults to Debug when empty]`
- `$(TargetArchitecture) - x86 | x64 | arm | arm64 | [defaults to x64 when empty]`
Expand Down Expand Up @@ -82,7 +82,7 @@ When we have a project that has a `netstandard2.0` target framework that means t
A full or individual project build is centered around BuildTargetFramework, TargetOS, Configuration and TargetArchitecture.

1. `$(BuildTargetFramework), $(TargetOS), $(Configuration), $(TargetArchitecture)` can individually be passed in to change the default values.
2. If nothing is passed to the build then we will default value of these properties from the environment. Example: `netcoreapp5.0-[TargetOS Running On]-Debug-x64`.
2. If nothing is passed to the build then we will default value of these properties from the environment. Example: `net5.0-[TargetOS Running On]-Debug-x64`.
3. While Building an individual project from the VS, we build the project for all latest netcoreapp target frameworks.

We also have `RuntimeOS` which can be passed to customize the specific OS and version needed for native package builds as well as package restoration. If not passed it will default based on the OS you are running on.
Expand Down Expand Up @@ -121,7 +121,7 @@ The output for the ref project build will be a flat targeting pack folder in the
## src
In the src directory for a library there should be only **one** `.csproj` file that contains any information necessary to build the library in various target frameworks. All supported target frameworks should be listed in the `TargetFrameworks` property.

All libraries should use `<Reference Include="..." />` for all their project references. That will cause them to be resolved against a targeting pack (i.e. `bin\ref\netcoreapp5.0` or `\bin\ref\netstanard2.0`) based on the project target framework. There should not be any direct project references to other libraries. The only exception to that rule right now is for partial facades which directly reference System.Private.CoreLib and thus need to directly reference other partial facades to avoid type conflicts.
All libraries should use `<Reference Include="..." />` for all their project references. That will cause them to be resolved against a targeting pack (i.e. `bin\ref\net5.0` or `\bin\ref\netstanard2.0`) based on the project target framework. There should not be any direct project references to other libraries. The only exception to that rule right now is for partial facades which directly reference System.Private.CoreLib and thus need to directly reference other partial facades to avoid type conflicts.
<BR>//**CONSIDER**: just using Reference and use a reference to System.Private.CoreLib as a trigger to turn the other References into a ProjectReference automatically. That will allow us to have consistency where all projects just use Reference.

### src output
Expand Down
12 changes: 6 additions & 6 deletions docs/design/coreclr/jit/viewing-jit-dumps.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The first thing to do is setup the .NET Core app we want to dump. Here are the s

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp5.0</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

Expand Down Expand Up @@ -58,17 +58,17 @@ The first thing to do is setup the .NET Core app we want to dump. Here are the s
}
```

* After you've finished editing the code, run `dotnet restore` and `dotnet publish -c Release`. This should drop all of the binaries needed to run your app in `bin/Release/netcoreapp5.0/<rid>/publish`.
* After you've finished editing the code, run `dotnet restore` and `dotnet publish -c Release`. This should drop all of the binaries needed to run your app in `bin/Release/net5.0/<rid>/publish`.
* Overwrite the CLR dlls with the ones you've built locally. If you're a fan of the command line, here are some shell commands for doing this:

```shell
# Windows
robocopy /e <runtime-repo path>\artifacts\bin\coreclr\Windows_NT.<arch>.Release <app root>\bin\Release\netcoreapp5.0\<rid>\publish > NUL
copy /y <runtime-repo path>\artifacts\bin\coreclr\Windows_NT.<arch>.Debug\clrjit.dll <app root>\bin\Release\netcoreapp5.0\<rid>\publish > NUL
robocopy /e <runtime-repo path>\artifacts\bin\coreclr\Windows_NT.<arch>.Release <app root>\bin\Release\net5.0\<rid>\publish > NUL
copy /y <runtime-repo path>\artifacts\bin\coreclr\Windows_NT.<arch>.Debug\clrjit.dll <app root>\bin\Release\net5.0\<rid>\publish > NUL

# Unix
cp -rT <runtime-repo path>/artifacts/bin/coreclr/<OS>.<arch>.Release <app root>/bin/Release/netcoreapp5.0/<rid>/publish
cp <runtime-repo path>/artifacts/bin/coreclr/<OS>.<arch>.Debug/libclrjit.so <app root>/bin/Release/netcoreapp5.0/<rid>/publish
cp -rT <runtime-repo path>/artifacts/bin/coreclr/<OS>.<arch>.Release <app root>/bin/Release/net5.0/<rid>/publish
cp <runtime-repo path>/artifacts/bin/coreclr/<OS>.<arch>.Debug/libclrjit.so <app root>/bin/Release/net5.0/<rid>/publish
```

* Set the configuration knobs you need (see below) and run your published app. The info you want should be dumped to stdout.
Expand Down
10 changes: 5 additions & 5 deletions docs/project/dogfooding.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ This is the default case for applications - running against an installed .NET ru
```XML
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Ensure that the target framework is correct e.g. 'netcoreapp5.0' -->
<TargetFramework>netcoreapp5.0</TargetFramework>
<!-- Ensure that the target framework is correct e.g. 'net5.0' -->
<TargetFramework>net5.0</TargetFramework>
<!-- modify version in this line with one reported by `dotnet --info` under ".NET runtimes installed" -> Microsoft.NETCore.App -->
<RuntimeFrameworkVersion>5.0.0-preview.1.20120.5</RuntimeFrameworkVersion>
</PropertyGroup>
Expand All @@ -140,8 +140,8 @@ make it self-contained by adding a RuntimeIdentifier (RID).
```XML
<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- Ensure that the target framework is correct e.g. 'netcoreapp5.0' -->
<TargetFramework>netcoreapp5.0</TargetFramework>
<!-- Ensure that the target framework is correct e.g. 'net5.0' -->
<TargetFramework>net5.0</TargetFramework>
<!-- modify build in this line with version reported by `dotnet --info` as above under ".NET runtimes installed" -> Microsoft.NETCore.App -->
<!-- moreover, this can be any valid Microsoft.NETCore.App package version from https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json -->
<RuntimeFrameworkVersion>5.0.0-preview.1.20120.5</RuntimeFrameworkVersion>
Expand All @@ -152,7 +152,7 @@ make it self-contained by adding a RuntimeIdentifier (RID).
```
$ dotnet restore
$ dotnet publish
$ bin\Debug\netcoreapp5.0\win-x64\publish\App.exe
$ bin\Debug\net5.0\win-x64\publish\App.exe
```

## More Advanced Scenario - Using your local CoreFx build
Expand Down
4 changes: 2 additions & 2 deletions docs/workflow/building/libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The libraries build has two logical components, the native build which produces

The build settings (BuildTargetFramework, TargetOS, Configuration, Architecture) are generally defaulted based on where you are building (i.e. which OS or which architecture) but we have a few shortcuts for the individual properties that can be passed to the build scripts:

- `-framework|-f` identifies the target framework for the build. Possible values include `netcoreapp5.0` (currently the latest .NET Core version) or `net472`. (msbuild property `BuildTargetFramework`)
- `-framework|-f` identifies the target framework for the build. Possible values include `net5.0` (currently the latest .NET version) or `net472`. (msbuild property `BuildTargetFramework`)
- `-os` identifies the OS for the build. It defaults to the OS you are running on but possible values include `Windows_NT`, `Unix`, `Linux`, or `OSX`. (msbuild property `TargetOS`)
- `-configuration|-c Debug|Release` controls the optimization level the compilers use for the build. It defaults to `Debug`. (msbuild property `Configuration`)
- `-arch` identifies the architecture for the build. It defaults to `x64` but possible values include `x64`, `x86`, `arm`, or `arm64`. (msbuild property `TargetArchitecture`)
Expand All @@ -98,7 +98,7 @@ By default the `build` script only builds the product libraries and none of the

- Building for different target frameworks (restore and build are implicit again as no action is passed in)
```bash
./build.sh -subset libs -framework netcoreapp5.0
./build.sh -subset libs -framework net5.0
./build.sh -subset libs -framework net472
```

Expand Down
4 changes: 2 additions & 2 deletions docs/workflow/building/libraries/code-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ This runs the tests and generates the full code coverage report. The resulting i

You can also build and test with code coverage for a particular test project rather than for the whole repo with the `/p:Coverage=true` property:

dotnet test -f netcoreapp5.0 /p:Coverage=true
dotnet test -f net5.0 /p:Coverage=true

The results for this one library will then be available in this index.htm file, where $(OutDir) is the directory where the binaries were generated.

$(OutDir)\report\index.htm

For example, to build, test, and get code coverage results for the System.Diagnostics.Debug library, from the root of the repo one can do:

dotnet test src\libraries\System.Diagnostics.Debug -f netcoreapp5.0 /p:Coverage=true
dotnet test src\libraries\System.Diagnostics.Debug -f net5.0 /p:Coverage=true

And then once the run completes:

Expand Down
8 changes: 4 additions & 4 deletions docs/workflow/building/libraries/cross-building.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ You can also build just managed code with:

$ ./build.sh --arch arm /p:BuildNative=false

The output is at `artifacts/bin/[BuildSettings]` where `BuildSettings` looks something like `netcoreapp5.0-<TargetOS>-Debug-<Architecture>`. Ex: `artifacts/bin/netcoreapp5.0-Linux-Debug-x64`. For more details on the build configurations see [project-guidelines](/docs/coding-guidelines/project-guidelines.md)
The output is at `artifacts/bin/[BuildSettings]` where `BuildSettings` looks something like `net5.0-<TargetOS>-Debug-<Architecture>`. Ex: `artifacts/bin/net5.0-Linux-Debug-x64`. For more details on the build configurations see [project-guidelines](/docs/coding-guidelines/project-guidelines.md)

Building corefx for Linux ARM Emulator
=======================================
Expand Down Expand Up @@ -118,14 +118,14 @@ When building for a new architecture you will need to build the native pieces se
Example building for armel
```
src/Native/build-native.sh armel
--> Output goes to artifacts/bin/runtime/netcoreapp5.0-Linux-Debug-armel
--> Output goes to artifacts/bin/runtime/net5.0-Linux-Debug-armel
build /p:TargetArchitecture=x64 /p:BuildNative=false
--> Output goes to artifacts/bin/runtime/netcoreapp5.0-Linux-Debug-x64
--> Output goes to artifacts/bin/runtime/net5.0-Linux-Debug-x64
```

The reason you need to build the managed portion for x64 is because it depends on runtime packages for the new architecture which don't exist yet so we use another existing architecture such as x64 as a proxy for building the managed binaries.

Similar if you want to try and run tests you will have to copy the managed assemblies from the proxy directory (i.e. `netcoreapp5.0-Linux-Debug-x64`) to the new architecture directory (i.e `netcoreapp5.0-Linux-Debug-armel`) and run code via another host such as corerun because dotnet is at a higher level and most likely doesn't exist for the new architecture yet.
Similar if you want to try and run tests you will have to copy the managed assemblies from the proxy directory (i.e. `net5.0-Linux-Debug-x64`) to the new architecture directory (i.e `net5.0-Linux-Debug-armel`) and run code via another host such as corerun because dotnet is at a higher level and most likely doesn't exist for the new architecture yet.

Once all the necessary builds are setup and packages are published the splitting of the build and manual creation of the runtime should no longer be necessary.
2 changes: 1 addition & 1 deletion docs/workflow/testing/libraries/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dotnet build /t:Test /p:Outerloop=true

#### Running tests on a different target framework

Each test project can potentially have multiple target frameworks. There are some tests that might be OS-specific, or might be testing an API that is available only on some target frameworks, so the `TargetFrameworks` property specifies the valid target frameworks. By default we will build and run only the default build target framework which is `netcoreapp5.0`. The rest of the `TargetFrameworks` will need to be built and ran by specifying the `BuildTargetFramework` option, e.g.:
Each test project can potentially have multiple target frameworks. There are some tests that might be OS-specific, or might be testing an API that is available only on some target frameworks, so the `TargetFrameworks` property specifies the valid target frameworks. By default we will build and run only the default build target framework which is `net5.0`. The rest of the `TargetFrameworks` will need to be built and ran by specifying the `BuildTargetFramework` option, e.g.:
```cmd
dotnet build src\libraries\System.Runtime\tests\System.Runtime.Tests.csproj /p:BuildTargetFramework=net472
```
Expand Down
2 changes: 1 addition & 1 deletion eng/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PropertyGroup>
<NETCoreAppCurrentVersion>5.0</NETCoreAppCurrentVersion>
<NetCoreAppCurrentTargetFrameworkMoniker>.NETCoreApp,Version=v$(NETCoreAppCurrentVersion)</NetCoreAppCurrentTargetFrameworkMoniker>
<NetCoreAppCurrent>netcoreapp$(NETCoreAppCurrentVersion)</NetCoreAppCurrent>
<NetCoreAppCurrent>net$(NETCoreAppCurrentVersion)</NetCoreAppCurrent>
<NetFrameworkCurrent>net472</NetFrameworkCurrent>
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<!-- Max version of NETCoreApp, used by test projects. -->
<NETCoreAppMaximumVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppMaximumVersion>
<NETCoreAppFrameworkVersion>$(MajorVersion).$(MinorVersion)</NETCoreAppFrameworkVersion>
<NETCoreAppFramework>netcoreapp$(NETCoreAppFrameworkVersion)</NETCoreAppFramework>
<NETCoreAppFramework>net$(NETCoreAppFrameworkVersion)</NETCoreAppFramework>
<!--
The NETStandard.Library targeting pack uses this patch version, which does not match the
runtime's. After publishing a new version of the NETStandard targeting pack in a servicing
Expand Down
4 changes: 2 additions & 2 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Get-Help() {
Write-Host ""

Write-Host "Libraries settings:"
Write-Host " -framework Build framework: netcoreapp5.0 or net472 (short: -f)"
Write-Host " -framework Build framework: net5.0 or net472 (short: -f)"
Write-Host " -coverage Collect code coverage when testing"
Write-Host " -testscope Scope tests, allowed values: innerloop, outerloop, all"
Write-Host " -testnobuild Skip building tests when invoking -test"
Expand Down Expand Up @@ -84,7 +84,7 @@ if ($vs) {
$archTestHost = if ($arch) { $arch } else { "x64" }

# This tells .NET Core to use the same dotnet.exe that build scripts use
$env:DOTNET_ROOT="$PSScriptRoot\..\artifacts\bin\testhost\netcoreapp5.0-Windows_NT-$configuration-$archTestHost";
$env:DOTNET_ROOT="$PSScriptRoot\..\artifacts\bin\testhost\net5.0-Windows_NT-$configuration-$archTestHost";
$env:DEVPATH="$PSScriptRoot\..\artifacts\bin\testhost\net472-Windows_NT-$configuration-$archTestHost";
}

Expand Down
2 changes: 1 addition & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ usage()
echo ""

echo "Libraries settings:"
echo " --framework Build framework: netcoreapp5.0 or net472 (short: -f)"
echo " --framework Build framework: net5.0 or net472 (short: -f)"
echo " --coverage Collect code coverage when testing"
echo " --testscope Test scope, allowed values: innerloop, outerloop, all"
echo " --testnobuild Skip building tests when invoking -test"
Expand Down
2 changes: 1 addition & 1 deletion eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN ./src/coreclr/build.sh -release -skiptests -clang9 && \
FROM $SDK_BASE_IMAGE as target

ARG TESTHOST_LOCATION=/repo/artifacts/bin/testhost
ARG TFM=netcoreapp5.0
ARG TFM=net5.0
ARG OS=Linux
ARG ARCH=x64
ARG CONFIGURATION=Release
Expand Down
2 changes: 1 addition & 1 deletion eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.0.100-nanoserver-1809
FROM $SDK_BASE_IMAGE as target

ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"
ARG TFM=netcoreapp5.0
ARG TFM=net5.0
ARG OS=Windows_NT
ARG ARCH=x64
ARG CONFIGURATION=Release
Expand Down
2 changes: 1 addition & 1 deletion eng/docker/libraries-sdk.linux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN ./build.sh -ci -subset clr+libs -runtimeconfiguration release -c $CONFIGURAT
FROM $SDK_BASE_IMAGE as target

ARG TESTHOST_LOCATION=/repo/artifacts/bin/testhost
ARG TFM=netcoreapp5.0
ARG TFM=net5.0
ARG OS=Linux
ARG ARCH=x64
ARG CONFIGURATION=Release
Expand Down
2 changes: 1 addition & 1 deletion eng/docker/libraries-sdk.windows.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.0.100-nanoserver-1809
FROM $SDK_BASE_IMAGE as target

ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"
ARG TFM=netcoreapp5.0
ARG TFM=net5.0
ARG OS=Windows_NT
ARG ARCH=x64
ARG CONFIGURATION=Release
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/coreclr/templates/perf-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
osGroup: ''
osSubgroup: ''
container: ''
framework: netcoreapp5.0 # Specify the appropriate framework when running release branches (ie netcoreapp3.0 for release/3.0)
framework: net5.0 # Specify the appropriate framework when running release branches (ie netcoreapp3.0 for release/3.0)
liveLibrariesBuildConfig: ''
variables: {}
pool: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<OutputType>Library</OutputType>
<AssemblyName>ILCompiler.ReadyToRun</AssemblyName>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TargetFramework Condition="'$(BuildingInsideVisualStudio)' == 'true'">netcoreapp3.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>READYTORUN;$(DefineConstants)</DefineConstants>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/tools/crossgen2/crossgen2/crossgen2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TargetFramework Condition="'$(BuildingInsideVisualStudio)' == 'true'">netcoreapp3.0</TargetFramework>
<NoWarn>8002,NU1701</NoWarn>
<Platforms>x64;x86</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/tools/dotnet-pgo/dotnet-pgo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<AssemblyName>dotnet-pgo</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TargetFramework Condition="'$(BuildingInsideVisualStudio)' == 'true'">netcoreapp3.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>8.0</LangVersion>
<OutputPath>$(BinDir)/dotnet-pgo</OutputPath>
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/tools/r2rdump/R2RDump.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<AssemblyKey>Open</AssemblyKey>
<IsDotNetFrameworkProductAssembly>true</IsDotNetFrameworkProductAssembly>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TargetFramework Condition="'$(BuildingInsideVisualStudio)' == 'true'">netcoreapp3.0</TargetFramework>
<CLSCompliant>false</CLSCompliant>
<NoWarn>8002,NU1701</NoWarn>
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
Expand Down
Loading

0 comments on commit 000046f

Please sign in to comment.