Commit Graph
37 Commits
Author SHA1 Message Date
Stephen Toub 0c4ee9e749 Use u8 in more places (#69995)
* Use u8 in more places

Primarily replacing Encoding.UTF8/ASCII.GetBytes("literal") with "literal"u8.ToArray()

* Address PR feedback (and fix some vars)
2022-06-07 13:42:23 -04:00
Adeel Mujahid 4141913109 Fix typos (#69011) 2022-05-07 11:55:53 -07:00
Viktor Hofer 24cabc6eb0 Update solution files to include missing deps (#68668) 2022-05-02 20:14:05 +02:00
Viktor HoferandJeremy Barton ba055bd94e Minimize the build graph by deleting unnecessary references (#68603)
* Minimize the build graph by deleting references

Minimizing projects' dependency graph. There are tons of unnecessary
Reference and ProjectReference items which aren't required anymore as
the referenced projects became full facade assemblies. Removing those
from a leaf's graph makes the graph smaller and therefore the project's
evaluation and build faster.

* Update src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj

Co-authored-by: Jeremy Barton <[email protected]>

* Update Versions.props

Co-authored-by: Jeremy Barton <[email protected]>
2022-04-28 15:04:26 +02:00
Viktor Hofer b54561a957 Fix VS complaining about missing projects in slns (continued) (#68543)
* Infra clean-up to simplify auto references

* Ref project file updates

* Src project file updates

* Test project file updates
2022-04-27 17:27:56 +02:00
Eric Erhardt 18be907176 Change Nullable to default to enable in libraries src and ref projects (#68102)
* Change the default Nullable to enabled for src projects

* Set Nullable=enable as the default for ref projects

* Fixup merge conflicts

* Disable nullable on shim projects and EventLog.Messages

* Set Nullable to blank on EventLog.Messages

This way no CodeAnalysis attributes are emitted into the assembly.
2022-04-25 11:15:37 -05:00
Stephen Toub 215b39abf9 Remove usage of !! from dotnet/runtime (#68178)
* Remove usage of !! from dotnet/runtime

- Use ArgumentNullException.ThrowIfNull instead where possible.  It's only usable for projects that only target .NET 6+, and it can't be used in places like this(...) or base(...).
- In other cases, if the project already has a ThrowHelper, augment it for null as needed and use that.
- For most of the extensions projects, add a ThrowHelper.ThrowIfNull that replicates ArgumentNullException.ThrowIfNull.
- For everything else, just use "throw new".

* Address PR feedback

* Address PR feedback

* Remove false positives from searches

* Address PR feedback
2022-04-21 13:25:52 -04:00
Viktor Hofer 3cec42fad2 Bring back direct dependencies on System.Runtime.CompilerServices.Unsafe for other tfms than net7.0 (#67385)
* Add dependency on Unsafe package

With the removal of the Unsafe package, a few projects regressed which
previously had a direct dependency on the latest version of Unsafe
(6.0.0) by now depending on the transitive Unsafe dependency of i.e.
System.Memory which is a very old version (4.5.*).

Fixing those projects to declare the direct dependency again.

* Cleanup
2022-04-01 07:49:32 +02:00
Elinor Fung a0635832f1 Rename DllImportGenerator project to LibraryImportGenerator (#66029) 2022-03-03 22:17:23 -08:00
Viktor Hofer febaf76743 Fix slngen.proj and update solution files (#65711)
* Fix slngen.proj

The SolutionName property is defined by the SDK and hence the condition was always true. Also the star (*) didn't expand when using the ValurOrDefault msbuild function. Fixing this by using a different name `SolutionNameOverride` and avoiding the ValueOrDefault msbuild function.

* Update solution files

Updating the solution files as those changed because of
microsoft/slngen@cb57e28 and apparently the solution files never were
updated.
2022-02-22 17:18:54 +01:00
WraithandVlad Brezae ddb22ef2ac Remove S.R.CS.Unsafe and Intrinsify Unsafe (#64861)
* private assemblies moved from Internal to System Runtime.CompilerServices

* reformat existing unsafe vm intrinsics

* implement Copy, CopyBlock, CopyBlockUnaligned, InitBlock, InitBlockUnaligned, Unbox, Add, Subtract, SubtractByteOffset

* remove System.Runtime.CompilerServices.Unsafe il project and replace with forward only cs project

* change all ilproj references to csproj

* remove nativeaot Unsafe

* add conditional package reference for S.R.CS.Unsafe on netcoreapp 6.0

* regenerate solutions

* mono interp

* [mono][interp] Implement Copy and Unbox intrinsics

* [mono][jit] Implement Copy and Unbox intrinsics

Co-authored-by: Vlad Brezae <[email protected]>
2022-02-19 21:50:14 -08:00
Stephen Toub 3ae87395f6 Initial roll out of !! (#64720)
* Bump version of C# compiler

This should be reverted when arcade brings in a new enough compiler.

* Fix a few new warnings from updating compiler

* Enable IDE0190 to employ parameter null checking

* Initial roll out of !!

* Fix more compiler warnings from upgrade, plus some test fixes / reverts

* Fix a few more tests

* Disable profiling test
2022-02-08 16:06:59 -05:00
Bar Arnon d34c0ff7c1 Add UnreachableException (#63922) 2022-01-26 02:58:21 -07:00
Jeremy Barton df5b118c6f Seed the unified System.Security.Cryptography.dll
* All of System.Security.Cryptography.Primitives has been moved
* AsymmericKeyExchangeFormatter moved from S.S.C.Algorithms
* This just starts the process to keep the infrastructure pieces separate from code layout pieces.
2021-11-01 22:30:26 -07: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 36b6247cc7 Update solution files for correct ordering of elements (#58655)
With the newest udpate of slngen, the order of elements (configuration, folders, etc.) is in sync with how Visual Studio arranges them.
Also the order is now deterministic.

Based on that, updating all solution files to have the correct ordering of elements. This change also unblocks adding CI protection for
making sure that solution files are up-to-date in regards to their dependencies as slngen is now generating the files deterministically.
2021-09-04 00:16:15 +02:00
Viktor Hofer 49c74eec15 Update changed solution files under src/libraries (#57483)
* Update slngen logic and remove unnecessary P2Ps

* Update changed soluion files under src/libraries

* Fix Platforms build

* Update comment in slngen.targets
2021-08-18 19:35:54 +02:00
Viktor HoferandSantiago Fernandez Madero 4d82932722 Automatically generate .NETStandard compat errors (#57057)
* Automatically generate .NETStandard compat errors

Before this change, a project had to explicitly add a
NETStandardCompatError item to declare that a given tfm range
shouldn't be supported when packaging.

Automate this logic so that projects don't need to specify the item
themselves anymore. Instead condition the NETStandardCompatError target
calcuation logic on the existence of both a .NETStandard and a
.NETCoreApp tfm.

* Update Directory.Build.targets

* Update packaging.targets

* Update eng/packaging.targets

Co-authored-by: Santiago Fernandez Madero <[email protected]>

Co-authored-by: Santiago Fernandez Madero <[email protected]>
2021-08-10 07:19:06 +02:00
Viktor Hofer 503ae5145a Replace all remaining pkgprojs with NuGet Pack task (#56712)
* Runtime specific and doc file packaging fixes

* Replace all remaining pkgprojs with NuGet Pack task

* Avoid NuGet/Home/issues/10368

* Update PackageValidation package to latest
2021-08-05 11:03:23 +02:00
Viktor Hofer a6b9a63f35 Update libraries solution and NuGet.config files (#56430)
* Update slngen and invocation

* Update NuGet.config files

* Update solution files with slngen
2021-07-28 18:44:17 +02:00
Stephen Toub dfd618dc64 Use interpolated strings in more places 2021-07-13 10:11:51 -04:00
Viktor HoferandBuyaa Namnan bbf96599d5 Don't reference the netstandard shim inside the shared framework (#53023)
* Don't reference ns.dll inside shared framework

The netstandard.dll shim shouldn't be referenced inside the shared
framework as it's a compat shim that shouldn't be required to compose
the shared framework.

This removes the necessity of a separate RefPath build and improves
incremental build times as only the few OOB projects that require the
shim would need to rebuild.

* Reference netstandard shim in OOBs that require it

There are a few OOB projects that require the netstandard.dll shim as
they intentionally reference projects that only expose a netstandard
configuration.

Co-authored-by: Buyaa Namnan <[email protected]>
2021-06-11 00:32:53 +02:00
Viktor Hofer 0377558d94 Include NetCoreAppCurrent configs in packages (#53439)
* Include NetCoreAppCurrent configs in packages

The NetCoreAppCurrent configurations were omitted from packages to avoid
ever growing packages. Now that we adhere to the support policy for
packages we don't need to exclude them anymore as the policy defines a
baseline for .NETCoreApp configurations.

This will remove an artificial difference when source building the
repository and also make it so that partner repositories which don't
depend on a transport package like windowsdesktop (winforms) receive
the very latest assets that are included in the shared framework as
well.

* Fix package validation for non exposed inbox libs
2021-06-08 23:36:01 +02:00
Stephen Toub 0817e748b7 Seal internal types in libraries (#50225) 2021-03-25 20:50:33 -04:00
Stephen Toub 48679143aa Seal private classes in libraries (#49969) 2021-03-23 06:14:55 -04:00
Stephen Toub 2b0e2785e5 Use [NotNullWhen(true)] in more places (#47598)
* Use [NotNullWhen(true)] in more places

Did a quick search/audit for methods that returned bool and took nullable object as the first input, and added [NotNullWhen(true)] where it was obviously correct.

* Address PR feedback
2021-01-30 06:09:28 -05:00
Viktor Hofer ceaa8ae8f7 Inline package descriptions and remove descriptions.json files across the repo (#46306)
* Support runtime package descriptions

* Update arcade Packaging pkg

* Inline pkg descriptions for coreclr

* Inline pkg descriptions for mono

* Inline pkg descriptions for installer

* Inline pkg descriptions for libraries
2020-12-22 16:07:56 +01:00
Viktor Hofer ed295782bf Add workflow to update solution files with SlnGen and update them initially (#44703)
* Add slngen infra

* Update all solution files
2020-11-17 18:23:30 +01:00
Aaron RobinsonandJan Kotas d1c0fa8243 Roslyn update response (#43056)
* Update function pointer syntax usage to official.

* Fix warnings with new Roslyn

Co-authored-by: Jan Kotas <[email protected]>
2020-10-06 13:11:35 -07:00
Viktor Hofer 2182936365 Add transitive CompilerServices.Unsafe dependency (#41616)
* Add transitive CompilerServices.Unsafe dependency

for System.Memory and System.Threading.Tasks.Extensions package
references. Adding the dependency as a P2P to prefer the live asset
over the prebuilt.
2020-09-07 22:18:28 +02:00
Jeremy Barton dc4715163f Add netcoreapp build of System.Formats.Asn1
This avoids the library causing a cyclic dependency in generating netstandard.dll.
The netcoreapp version is not included in the NuGet package,
following the pattern of
  * System.Text.Json
  * System.Collections.Immutable
  * System.Reflection.Metadata
2020-08-26 09:27:01 -07: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
Jose Perez RodriguezandEric StJohn b7c4cb71fe Add NetFramework Configurations to OOB packages (#39099)
* Porting new netfx configurations for packages

* Add Netfx configurations to Microsoft.Extensions and missing System packages

* Making sure net461 configurations build against targeting pack assembly versions

* Undo changes to add netfx configurations on reference projects that don't ship in their package

* Fix issue with M.E.FP.P package by removing NetStandard.Library metapackage dependency

* Fix issues with depending on higher version than the one available in net461

* Disable UTF8String verifyClosure on package

* Undo changes to Microsoft.XmlSerializer.Generator

* Update src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj

Co-authored-by: Eric StJohn <[email protected]>

Co-authored-by: Eric StJohn <[email protected]>
2020-07-14 21:59:55 -07:00
Alexander Köplinger 602b7b86ad WASM: Fix System.Formats.Asn1 tests (#39104)
Disable tests that rely on crypto APIs which don't work on WebAssembly right now which allows the test suite to pass: `Tests run: 3406, Errors: 0, Failures: 0, Skipped: 0. Time: 5.296689s`

Also enables a few test suites in tests.proj.
2020-07-11 02:20:10 +02:00
Stephen Toub 6072e4d3a7 Update license headers (#38793) 2020-07-08 09:23:11 -04:00
Jeremy Barton c152b8d997 Add int AsnWriter.Encode(Span) 2020-06-17 13:55:28 -07:00
Jeremy Barton b772f61807 Make System.Formats.Asn1 library public
* Move current ASN src and tests into new tree with no modifications

AsnReader partials are named AsnDecoder to better match the final name
for the core logic they contain.

* Make System.Formats.Asn1 package

* Apply changes from API review

Some additional tests were written to increase code coverage after the changes

* Move AsnReader consumers to public API
2020-06-08 21:33:48 -07:00