1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 11:37:04 +09:00
Commit graph

39 commits

Author SHA1 Message Date
Jan Kotas
99e94ce55d
Replace net8 with net9 under docs (#104189)
Fixes #104088
2024-06-29 07:44:01 -04:00
Viktor Hofer
07ae197db5
Use analyzers from targeting pack for NetCoreAppCurrent (#87726)
* Use analyzers from targeting pack for NetCoreAppCurrent

Fixes that analyzer failures didn't show-up in #74897

Add analyzers to the frameworklist that OOB projects in src/libraries
use, and only auto ProjectReference the analyzers in generators.targets
when not using the analyzers from the targeting pack.

Also move the generator projects related code into a separate file.

Continuation of https://github.com/dotnet/runtime/pull/75093

* Fix project build

* Add missing reference to Regex tests

* Add missing generators for netfx build

* Fix paht in test project

* Fix typo

* Disable runtime marshalling for SharedTypes.csproj

* Disable runtime marshalling for NativeExports.csproj
2023-06-19 23:27:38 +02:00
Tom Deseyn
21fb96b6ee
Try to untangle the rid calculation. (#82832)
* Try to untangle the rid calculation.

* Ignore __portableOS.

* Add back musl detection.

* Try fix AnyOS tests.

* Try fix coreclr linux_musl_arm64 job.

* src/tests/build.proj: use PackageRID for restore.

* Use RuntimeOS as an override for _packageOS.

* Remove (probably) out-dated override for non-portable ToolsRID.

* CI cross-builds for linux-musl use linux.

* Add missing arch to rid.

* Try simplified ToolsRID.

* Update comments.

* Rename OutputRid to OutputRID.

* Tweak comment.

* Move TargetsLinux{Bionic,Musl} with the other Targets properties.

* Don't use RuntimeOS for PackageRID for CrossBuilds.

* Move RuntimeOS condition to ToolsRID assignment.

* Clean up a few things.

* Fix broken Condition.

* Try fix the linux-bionic build.

* Try fix the linux-bionic build, part II.

* Try fix the linux-bionic build, part III.

* Fix PackageRID.

* Use RuntimeOS as _packageOS override.

* Remove RuntimeOS.

* Fix '-os linux-musl' mapping.

* Clean up .

* Rename __PortableOS to __PortableTargetOS.

* Extend comments.

* Extend OutputRID comment too.

* build.sh: include linux-bionic, linux-musl in usage.

* SourceBuild.props: no need to pass RuntimeOS. Only set ToolsOS, PackageOS when RuntimeOS is not empty.

* Fix comment.

* linux-bionic doesn't get built on linux-bionic.

* Unconditionally assign TargetsLinuxBionic/TargetsLinuxMusl.

* Remove SkipInferTargetOSName.
2023-04-21 10:02:07 +02:00
Viktor Hofer
2ca7cf7140
Lowercase TargetOS (#80164)
Follow-up on #32451
Follow-up on #80074

In #43651, the "Windows" OS name was lowercased to achieve target frameworks with RIDs in them. At that time, the original plan was to lowercase all TargetOS values but that had to be cut because of resources. This PR finishes that and updates build systems, YML, markdowns and managed components.

To not break existing developer workflows, the passed-in -os value is automatically lower-cased in the script entry points and validated in the msbuild entry point.
2023-01-11 17:58:32 +01:00
Viktor Hofer
212fb54730
Use shipping runtime.json for RID targeting (#80074)
* Use shipping runtime.json for RID targeting

- Use the shipping runtime.json file to target RIDs when building
  instead of the custom OSGroups.json which only contained a subset of
  the available rids.
- To facilitate that, lower-case the existing platforms in the target
  frameworks strings which is the expected format anyway by the SDK and
  msbuild. This will eventually make it possible to bring some of the
  custom build infrastructure back into the SDK.
- Remove a few outdated code pieces and update docs.
2023-01-02 21:42:52 +01:00
Eirik Tsarpalis
97a51ccdb1
Add nullable reference type annotations to System.Text.Json source gen (#79613)
* Add nullability annotaitons to sourcegen components.

* Move sourcegen testing from Roslyn4.0 to Roslyn4.4.

* Fix accessibility modifiers

* Allow source generators to multi-target

* Binplace only netstandard2.0 compiled source generators

* Use live NetCoreAppCurrent tfm

* Update Directory.Build.targets

* Pick correct analyzer asset for consumption

* Fix build

* Revert "Move sourcegen testing from Roslyn4.0 to Roslyn4.4."

This reverts commit fe7857066040ddf0ef632c135e83e49b097c28f7.

* Make analyzer P2Ps choose the right asset

* PR feedback

* Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs

* Make source generator target an LKG

* Update project-guidelines.md

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2022-12-16 18:44:06 +00:00
Viktor Hofer
49dc7ba85c
Update convention on how to ref and pack analyzers (#78845)
d3af4921f3 made it possible to reference
and package an analyzer via the same msbuild item by setting custom
metadata.

While reviewing other places that could use the AnalyzerReference item,
I realized that using this custom item doesn't provide much value and
creates an artificial difference to the rest of the stack and our customers
[as we don't adhere to our own documentation](https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/#hello-world-source-generator-edition).

Instead, IMHO it makes much more sense to keep using a
`ProjectReference` item with the documented set of required metadata, to
reference an analyzer and just define an additional custom metadata to
support packaging the analyzer: `PackAsAnalyzer`.
The reason for that is that the additional metadata explains how the
reference works (no assembly output reference, added as an Analyzer
output item) vs. the `AnalyzerReference` which is a repo custom item
that doesn't tell you that behind the scenes it actually gets converted
to a `ProjectReference` with the same metadata as if you would declare
that yourself as a P2P.

To summarize the change:

1. Consume an analyzer
```xml
<!-- Before -->
<AnalyzerReference Include="..." />
<!-- After -->
<ProjectReference Include="..." ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
```

2. Pack an analyzer and consume it
```xml
<!-- Before -->
<AnalyzerReference Include="..." Pack="true" />
<!-- After -->
<ProjectReference Include="..." ReferenceOutputAssembly="false" OutputItemType="Analyzer" PackAsAnalyzer="true" />
```

3. Pack an analyzer without consuming it
```xml
<!-- Before -->
<AnalyzerReference Include="..." Pack="true" ReferenceAnalyzer="false" />
<!-- After -->
<ProjectReference Include="..." ReferenceOutputAssembly="false" PackAsAnalyzer="true" />
```
2022-11-25 17:06:25 +01:00
Jan Kotas
32ac664fca
Replace net7 with net8 in dogfooding and workflow docs (#75453) 2022-09-12 20:40:44 -07:00
Viktor Hofer
d3af4921f3
Define convention to consume and/or package analyzers (#69069)
* Define convention to include analyzers in ref pack

Fixes https://github.com/dotnet/runtime/issues/61321

Until now we required source libraries to define ProjectReferences when
an analyzer should be part of the shared framework. That strategy causes
analyzer projects to leak into the ProjectReference closure and by that
into a solution file.

As an example:
When another library references the source library that references the
analyzer, the analyzer is part of the dependency closure even though it
might not be required.

This change makes it possible to define the shared framework analyzer
projects in the NetCoreAppLibrary.props file for both the .NETCoreApp,
and the AspNetCoreApp shared framework.

Out-of-band projects which ship analyzers inside their produced package,
continue to reference the analyzers via the `AnalyzerProject` item.

* Use AnalyzerReference consistently

* Don't reference analyzer when its packaged

* Fix P2P reference

* Fix multi target roslyn component target condition
2022-05-12 09:22:26 +02:00
Viktor Hofer
9ebe0efa48 sfx+oob split, shim project refactoring, P2Ps
Split the build of shared framework and out-of-band projects so that
it's possible to just build the shard framework projects, which was
requested by the CLR teams. In the next infrastructure rollout, the
current "libs.ref+libs.src" subsets should be removed. Generate the
targeting pack with an incomplete (without shims) frameworklist as part
of the "libs.sfx" subset.

Build the shim projects after the shared framework and oob projects and
re-generate the targeting pack's frameworklist to include the shims.

Refactor the shims so that they aren't grouped anymore by generated &
manual. Instead group them by "ref" and "src" same as other libraries
in the tree which allows to reference the source project shims and read
from the ReferenceAssembly metadata.

Use ProjectReferences in traversal projects and shim projects instead
of named references that point to binplace directories (see graph below)
This allows to build parts of the product dynamically, i.e. the shim
projects, apicompat.proj, sfx.proj and oob.proj.
2022-02-24 12:32:04 +01:00
Viktor Hofer
20e8f905d0
Don't use Targets* helper properties in libs (#64500)
* Don't use Targets* helper properties in libs projs

This change makes it possible to migrate 200+ (ref+src) projects to use
TargetFramework instead of TargetFrameworks which avoids the additional
outer build evaluation and invocation which ultimately makes the overall
build faster.

Targets* properties (i.e. TargetsWindows, TargetsAnyOS, TargetsUnix,
etc.) rely on the TargetFramework property which usually are set
inside a project. The TargetFramework property is only
available before a project specifies it if it's explicitly set in a props
file or if the project is cross-targeting and the outer-build dispatches
into the inner-build. During the dispatch, the TargetFramework property
is passed in as a global property.

Until now that behavior wasn't a problem because every libraries project
cross-targeted (by setting the TargetFrameworks property) even though
many only include a single TargetFramework (i.e. NetCoreAppCurrent).

To allow projects to use the TargetFramework property instead of
TargetFrameworks, the Targets* helper properties can't be calculated
anymore early in a props file as the TargetFramework property isn't set
at that time.

In general, the guidance by the SDK/msbuild team is to not read from the
TargetFramework property before the project sets it
(in a property group). That effectively means that the TargetFramework
property shouldn't be used in props files at all.

Therefore these helper properties can't be used anymore for property
conditions and I'm replacing their usage with TargetPlatformIdentifier
comparisons for both properties and items.
In nearly all cases, the Targets* helper properties can be replaced with
TargetPlatformIdentifier checks on items and in the few cases where
TargetsUnix or TargetsLinux marks multiple tfms as compatible, the exact
tfms must be used instead for the TargetPlatformIdentifier comparison.

Whenever a project needs to condition properties on the platform, I'm
first setting the TargetPlatformIdentifier the same way the SDK sets it
so that the SDK later doesn't need to set it again to avoid the
additional expensive msbuild function call.

* Use TargetFramework singular to avoid outer builds

Use TargetFramework instead of TargetFrameworks property whenever a
projects only targets a single target framework. This avoid unnecessary
outer builds and evaluations and makes the build faster.
2022-02-12 13:07:16 +01:00
Andy Gocke
83f8df4e78
Revert "Enable System.Text.Json tests on netfx (#63803)" (#64108)
This reverts commit 34794bc5f2.
2022-01-21 13:32:37 -08:00
Krzysztof Wicher
34794bc5f2
Enable System.Text.Json tests on netfx (#63803)
* Enable System.Text.Json tests on netfx

* use NETFRAMEWORK define

* disable another two test cases after rebase

* disable last test case which repros only on CI for me

* add p2p only on netfx
2022-01-19 13:45:01 +01:00
Viktor Hofer
331823f404
Simplify .NETFramework tfms (#58558)
* Simplfy .NETFramework tfms

Libraries which target .NET Framework usually have rid agnostic tfms,
i.e. net461. If the library targets netstandard2.0-windows as well,
the .NET Framework tfm must be rid specific, as rid specific
.NET Framework apps would otherwise pick the .NETStandard asset over
the .NETFramework one (based on the RID compatibility rules)

There is yet another reason that requires .NETFramework tfms to be RID
specific, which is when a project P2Ps other projects which are
rid-specific. Without the RID specific .NETFramework tfm, a compatible
.NETStandard asset would be picked instead.

NuGet doesn't support setting a TargetPlatform in the TargetFramework
alias when targeting .NETFramework or .NETStandard. Any such tfms in
dotnet/runtime are currently leveraging a hack that strips the
TargetPlatform / TargetFrameworkSuffix away during restore and packaging
(as NuGet Pack uses the project.assets.json file).

As NuGet will likely never support RID specific .NETFramework tfm
aliases, the distinction between a RID specific and a RID agnostic
.NETFramework tfm is unnecessary.

Remove all "TargetFrameworkSuffixes" / TargetPlatforms / RIDs
(whatever you would like to call them) from .NETFramework tfms and let
the packaging targets handle the cases where a RID specific asset is
required in the package.

Explictly don't set TargetsWindows to true for .NETFramework builds as
the Targets* properties are infered from the platform / suffix and
many projects make the assumption that net461
(without the "-windows" part) doesn't set TargetsWindows=true.

Fixes https://github.com/dotnet/runtime/issues/58495

* Warn on .NETFramework duplicate runtime assets

* Ignore .NEtFramework non Windows and non empty RIDs

Also cleaning up the packaging.targets file and removing
the ExcludeFromPackage option which isn't needed anymore as
target frameworks aren't excluded from packages produced in
dotnet/runtime anymore.
2021-09-10 09:50:11 +02:00
Viktor Hofer
67354a2fb4
Upgrade to net7.0 and remove target frameworks (#58011)
* Remove EOL tfms and upgrade to net7.0

* Make linker tests net7 aware

Make installer tests run on net7.0

Don't attempt to use live apphost

Fix payloads

Regenerate test files

Fix package testing
2021-09-08 22:04:23 +02:00
Viktor Hofer
22cee85aa0
Clean-up pkgproj leftovers in libs and apply fixes (#56899)
* Clean-up pkgproj leftovers in libs and apply fixes

Remove any pkgproj infrastructure that was only used by src/libraries
(which is the majority). Delete the packageindex *YAY*.
Update the documentation that covered the packageindex and the pkgprojs.

Avoid any incremental builds during packaging by removing
libraries-packages.proj and use src.proj for packaging instead. Make use
of the `GeneratePackageOnBuild` property to build package during the
allconfigurations without requiring a different entry target.

Fix the addition of the DocumentationFile during packaging when
`GeneratePackageOnBuid` is used by hooking onto the
`DocumentationProjectOutputGroup` that NuGet uses and replacing the
generated documentation file with the one that comes via the
intellisense package.
Also introduce a property to choose the generated documentation file
over the one from the intellisense package:
<UseIntellisenseDocumentationFile>false</UseIntellisenseDocumentationFile>

Removing a few leftover PackageDescription properties from the projects'
Directory.Build.props file.

Cleaning up properties in Directory.Build.props & Directory.Build.targets
files.

* Actually run packaging during the allconfigurations build

* Update docs

* make runtime specific pkgs non packable

* io.ports native pkg fixes
2021-08-06 12:01:36 +02:00
Aaron Robinson
c28b1897ae
Guidance on source generator projects (#54082)
* Guidance on source generator projects
2021-06-14 21:36:08 -07:00
Eric Erhardt
99f4062f8e
Add documentation on ILLink files (#50302)
* Add documentation on ILLink files

* Add link to ILLink-files from project-guidelines
2021-03-28 16:52:37 -05:00
Viktor Hofer
3553284bea
Rename mention to master branch to main (#48824) 2021-03-01 10:09:31 +01:00
Anirudh Agnihotry
891e8d4d4f
move netcore platforms and targets to csproj (#46474) 2021-01-04 15:45:22 -08:00
Anirudh Agnihotry
b37f10a504
Changing Windows_NT -> Windows for enabling TargetPlatformMoniker feature of the sdk for platform specific tfms. (#43651)
* eng change

* coreclr change

* libraries change

* tests change

* installer & mono change

* py files changed

* .md change

* .yml change

* remove redundant targetos property

* Windows_NT -> windows after ninja change

* fixing runtime build failure
2020-11-02 14:25:58 -08:00
Viktor Hofer
b7f809d7e3
Update docs for packaging and other nits (#40134)
* Update docs for packaging and other nits
2020-07-30 15:29:30 +02:00
Viktor Hofer
809a06f451
Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
2020-07-23 17:20:26 +02:00
Larry Ewing
03b1ea75f3 Fix typo 2020-06-17 17:49:53 -05:00
Jeremy Koritzinsky
f62e93416a
Remove built-in WinRT support from the runtime (#36715) 2020-05-29 17:37:12 -07:00
Viktor Hofer
2cda9035cb
Use TargetFramework conditions consistently in libraries (#35956)
* Use TargetFramework condition consistently in libs

* Add docs section to describe the guideline

* Update Microsoft.Extensions.DependencyInjection.csproj

* Outline TargetFramework DesingTimeBuild issue

* Update Microsoft.Extensions.DependencyInjection.csproj
2020-05-11 11:00:11 -07:00
Viktor Hofer
000046f6c8
Change netcoreapp5.0 to net5.0 (#35176)
* Change netcoreapp5.0 to net5.0

* Remove tfm downgrades

* Rename S.R.CS.Unsfae include folder
2020-05-06 13:53:21 +02:00
Viktor Hofer
42183b1b86
Enable restore for ref and src projects in libs (#33553)
- Use RestoreUseStaticGraphEvaluation which improves no-op restore by 10-15x down to 10-20 seconds.
- .builds msbuild files renamed to .proj as RestoreUseStaticGraphEvaluation throws for non .proj files without an env var set.
- Introducing subsets for libraries and mono and replacing -buildtests switch which was only working for libraries in favor of the subset switch -subset tests which works consistently.
- Fixing the Microsoft.DotNet.CodeAnalysis analyzer which wasn't running and adding missing exclusions.
- Separating restore and build phases in different parts in the repo (ie for installer.tasks) as generated props and targets need to be imported which requires a reevaluation in the build phase.
- Fix eng/docker/build-docker-sdk.ps1 by using the official build entrypoints (cc @alnikola)
- Remove a few depprojs in favor of project restore (faster restore :))
- Fix root code coverage measurement not working correctly
- Traversal support instead of dir.traversal.targets or manual build target defines.
- Introduce a root Build.proj entrypoint which is responsible for building and restoring the repository. This is necessary to enable the new NuGet fast restore which works best and fastest with a single entrypoint.
- Avoid binclashes in libraries and between libraries and installer (netstandard.depproj vs netstandard.csproj)
- Upgrading the SDK to 5.0 latest
- Code cleanup
2020-04-06 11:54:10 +02:00
Jan Kotas
19c7f5a704
Rename ArchGroup -> TargetArchitecture (#34260)
Most places use TargetArchitecture already. These two properties seems to be always set to the same value.
2020-03-29 17:20:20 -07:00
Viktor Hofer
73268c790b
Revert "Enable restore for ref and src projects in libraries (#33242)" (#33437)
This reverts commit 981cc64bc4.
2020-03-10 21:33:27 +01:00
Viktor Hofer
981cc64bc4
Enable restore for ref and src projects in libraries (#33242)
* Enable restore for projects in libraries

Enabling project restore for ref and src projects

* Remove winrt.depproj

* Remove tools.depproj

* Enable upfront restore

* Fix casing of PInvokeAnalyzerException file

* Remove harvestPackages.depproj and refactoring

Removing havestPackages.depproj in favor of a target that is hooked
into Arcade's repo restore phase in Tools.props.

Additionally moving common properties that are used both in Arcade and
the repo inside Configurations.props. Before they were scattered around
multiple places (Versions.props, Subsets.props).

* Set ilasm/ildasm RID for restore

* Sequence restore into steps out of upfront restore

* Fix docker entrypoints by using build.cmd/sh
2020-03-10 13:48:20 +01:00
Anirudh Agnihotry
fef9ca70f6
Replacing OSGroup with TargetOS for coreclr, libraries and installer (#32833)
* Remove OSGroup from coreclr and corefx

* remove from installer

* fixing coreclr tests

* Some documentation changes

Co-Authored-By: Viktor Hofer <viktor.hofer@microsoft.com>

* moving buildos calculation to config.props

* BuildOS -> TargetOS

* remove osgroup suffix

* removing comment and correcting typo

* dotnet msbuild -> dotnet build at relevant places in docs

* moving more properties to configuration.props

* refactoring properties

* moving TargetArchitecture property to loveBuildd.Targets

* adding configuration.props to signing

* Fix installer build

* BuildOS -> Target os and removing slash

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2020-03-05 07:51:06 -08:00
Anirudh Agnihotry
86a086377b
updating docs and removing BuildConfiguration and ConfigurationGroup (#32062)
* build config and update docs

* remove configurationGroup and update docs

* addressing feedback

* viktor comments
2020-02-20 14:39:38 -08:00
Santiago Fernandez Madero
0515878d1e
Remove workarounds in build scripts for netcoreapp and netfx versionless (#1841)
* Remove workarounds in build scripts for netcoreapp and netfx versionless

* Don't pass down netcoreapp in yml builds

* PR Feedback and condition passing -framework arg when not empty in yml files

* Condition TargetGroup global property in helix.yml

* PR Feedback to not use targetgroup for allconfigurations in sendtohelix

* Change from PackageTesting to BuildAllConfigurations
2020-01-27 12:13:14 -08:00
Youssef Victor
8f2404db61 corefx => runtime (#2068)
* corefx => runtime

* Update adding-api-guidelines.md

* Update adding-api-guidelines.md
2020-01-24 09:30:18 -08:00
Santiago Fernandez Madero
6b101e01c3 Remove workarounds in build scripts for netcoreapp and netfx versionless 2020-01-16 15:21:43 -08:00
Dan Moseley
9900dfb4b2
Organize some markdowns and fix links (#1159)
* Move files into hierarchy

* fix more links

* Fix botr and features links

* Remove bad apostrophe

* spelling

* Apply suggestions from code review

Co-Authored-By: Youssef Victor <31348972+Youssef1313@users.noreply.github.com>

* Update docs/coding-guidelines/package-projects.md

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>

Co-authored-by: Youssef Victor <31348972+Youssef1313@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2019-12-26 15:22:57 -08:00
Roman Marusyk
00813dfd30 Update links (#537) 2019-12-06 10:22:40 +01:00
Viktor Hofer
a71a3249a9
Consolidate docs (#251)
* Consolidate sub-repo docs
2019-11-25 23:52:43 +01:00
Renamed from docs/libraries/coding-guidelines/project-guidelines.md (Browse further)