This change enables device runs on CI by building each test app on the helix instance it was deployed to. In past attempts, we looked at enhancing what takes place on the build machine via build tricks, compressing / cleaning up files early, etc and we could not overcome the need for excessively long timeouts and far more disk space.
The change also adopts the patterns established in the wasm test build, giving us the opportunity to support different scenario runs as well as workloads testing in the future.
* 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
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.
* 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]>
* Use property to indicate NetCoreApp min version
* Add NetCoreAppCurrent to S.Numerics.Tensors
* Add NetCoreAppCurrent to S.T.AccessControl
* Add NetCoreAppCurrent to System.Memory.Data
* Add NetCoreAppCurrent to S.Composition.* projects
* Add NetCoreAppCurrent to System.IO.Packaging
* Add NetCoreAppCurrent config to System.IO.Ports
Adding a NetCoreAppCurrent configuration to System.IO.Ports and
reducing package size, build times and platform specific assets by
using runtime checks on Unix derivates for the slightly diverging
SerialPort implementation.
Contributes to https://github.com/dotnet/runtime/issues/54012
* Add NetCoreAppCurrent to System.Data.OleDb
* Add NetCoreAppCurrent to M.W32.Registry.AccessControl
* Add NetCoreAppCurrent to S.Reflection.Context
* Add NetCoreAppCurrent to S.C.Composition.Registration
* Add NetCoreAppCurrent to S.Resources.Extensions
* Add NetCoreAppCurrent to S.N.H.WinHttpHandler
* 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
Upgrading the netcoreapp2.x and netcoreapp3.0 build configurations in
projects to netcoreapp3.1 and cleaning up conditions so that future
tfm upgrades require less project file changes.
Adding NETStandardError markers to prevent available netstandard2.0
assets being picked instead, same as already done for System.Speech
and others.
For more details please see the reasoning in the linked issue.
Contributes to #53282
* Remove NS1.x assets from build and packaging
These ten projects still built for netstandard1.x. This PR
trims out these assets from both the build which also results
in them not being packaged anymore as there is no harvesting
mechanism in the repository anymore.
Suppressing the package warnings for the intentionally dropped
assets and cleaning up conditions in the project file as well.
For more details please see the reasoning in the linked issue.
Contributes to https://github.com/dotnet/runtime/issues/53282
Since AOT'ing each test suite takes between 3-9 min, we need to shift the burden over to helix.
## This is done by:
1. building the test assemblies on the build machine
- the wasm part of the build is not executed on the build machine,
because it has the AOT build part
2. Zip up the test assembly+friends, *and* any bits required to run the wasm
app build for that on helix (eg. emsdk, wasm app targets, cross compiler etc)
3. Send all this to helix, and use a custom `aot-build.proj`
- which recreates all the build inputs for the `WasmBuildApp` target
using the paths for the assets on helix
- then we can run `WasmBuildApp` for the build, resulting in a wasm app
bundle.
4. Run the tests!
- We already have the bits required for building wasm apps on helix, supported
for `Wasm.Build.Tests`, which we can use here too.
## Trimming:
- Since, AOT can be so expensive, we use `EnableAggressiveTrimming=true`(EAT), but
that means that we could have issues due to trimming.
- And it can sometimes be unclear whether the build/test failures are due to trimming
or AOT.
- Because these builds+test runs are different from other builds, owing to the
"build partially on helix" step, a normal EAT build would not be the same as
- to help with testing this, we add two lanes to `runtime-staging`:
- `*_Mono_AOT`: builds AOT+EAT on helix
- `*_Mono_EAT`: builds EAT, on helix
- this is required because we want to run almost the same kinda
build: 1. build test assembly; *2. send to helix; 3. build wasm app;* 4. run tests
- This should effectively mean that we can see which errors might be due to EAT, and
which are clearly because of EAT+AOT.
Co-authored-by: Steve Pfister <[email protected]>
Co-authored-by: Marek Safar <[email protected]>
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
* Bounded channel can be created with drop delegate.
- Add additional CreateBounded overload with delegate parameter that will be called when item is being dropped from channel
- Added unit tests
* Fix typo in comment.
* Apply suggestions from code review
Co-authored-by: Stephen Toub <[email protected]>
* Call drop delegate outside of lock statement.
* Use overload of CreateBounded method instead of calling ctor directly.
* Code review suggestions refactor.
* Move Monitor.Enter before try and use local scoped parent variable everywhere.
* Drop delegate should not be called while sync lock is held.
Enqueuing of new item should be done while sync lock is being held.
Added additional tests.
* Rerun gitlab CI.
* Do not run deadlock test for bounded channels if platform do not support threading.
* Apply suggestions from code review
Co-authored-by: Ivan Benovic <[email protected]>
Co-authored-by: Stephen Toub <[email protected]>
* Reduce allocations in System.Threading.Channels for netstandard2.* and net461
System.Threading.Channels.AsyncOperation<TResult> is well optimized for .NET Core, but there are no optimizations for .NET Standard 2.0 and .NET Framework. They use the same code as .NET Standard 1.3.
* Remove execution flow suppression as redundant
* Rollback QueueUserWorkItem
* Revert "Compile System.Private.CoreLib with Crossgen2 by default (#44618)"
This reverts commit b79e4d3cd2.
* Add a change to ensure libraries are built/tested
Some help to remove allocation, some just help to avoid pulling in Tuple and likely increasing build size.
* Update src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs
Co-authored-by: Jeremy Barton <[email protected]>
* Use non-generic TaskCompletionSource where possible
* Apply suggestions from code review
Co-authored-by: Stephen Toub <[email protected]>
Co-authored-by: Stephen Toub <[email protected]>
* 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.
- 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)"
* Use static lambdas in System.Net.Http
This caught one bug that was causing an unexpected/undesirable closure.
* Use static lambdas in System.Private.CoreLib
* Use static lambdas in System.Net.WebSockets
* Use static lambdas in System.Threading.Channels
* Forward CancellationToken to methods that can take it
* Address suggestions
* address suggestions
* Revert using
* Make rule 2016 a warning in runtime
* Extra cases found
* Revert changes that should not pass a token, change rule to info to verify build and test CI results
* Pass CancellationToken.None to base.CreateContentReadStreamAsync, as in its default overload
* Address stack overflow in MultipartContent
* HostingAbstractionsHostExtensions address using
* Update nuget package version to latest, Info->Warning again, fix one more case.
* System.Diagnostics.ProcessWaitState.Unix token
* Remove two unnecessary tokens
* 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]>
* Adding generation of substitution files for trimming out resources when feature switch is present
* Adding support for CoreLib as well and fix issue with SR returning empty string
* Cache result of AppContext Switch lookup
* Fixing allConfigurations leg and addressing feedback
* Fixing thread safety issue by removing caching
* Addressing feedback
* Apply suggestions from code review
Co-authored-by: Jan Kotas <[email protected]>
* Addressing feedback and adding tests
* Fix typo
Co-authored-by: Jan Kotas <[email protected]>
This has three primary benefits:
1. In some cases, in particular for static fields where other static fields have non-default initialization, the C# compiler can't elide the default initialization, resulting in more IL.
2. It highlights places where the field is otherwise unused and can be deleted, but where the presence of the initialization was silencing the C# compiler's warnings about the unused field.
3. It increases consistency and decreases maintenance / code size / etc.
* Fix BoundedChannel race condition between writes and canceled reads
When BoundedChannelWriter has an item to be written, if there are readers waiting, it needs to try to transfer that item to a waiting reader. When it dequeues the next waiting reader, it needs to check to see if that reader has already been canceled, as that's the only way a reader in the queue might not be completable by the writer. Our current check, however, is flawed, in that we're assuming that the reader's IsCompleted will have synchronously transitioned to true as part of cancellation being requested; however, due to an implementation detail of the AsyncOperation that represents the reader, it might _asynchronously_ transition to true, in which case we have a race condition where we might see the reader as not having been canceled even though it has been, and that causes us to lose data by the writer trying to complete the reader with its data and failing to do so (this condition would assert in debug builds but isn't checked in release builds as it should never happen). The fix is simply changing the condition we check to factor in the right information.
* Add stress test for canceled reads
This fails quickly before the fix and succeeds after.
If:
- a BoundedChannel is opted-in to synchronous continuations via someone setting AllowSynchronousContinuations on its options when constructed, and
- if a read operation is performed when there's no data available and with a cancelable cancellation token, and
- if cancellation is requested concurrently with a write being performed that will satisfy that read...
then there's the potential for a deadlock. While holding a lock, the writer needs to unregister the cancellation for the reader's operation prior to trying to complete it, and needs to know that all cancellation-related work has quiesced before it proceeds to try to complete that reader. If the cancellation is currently in progress then, it waits for the cancellation callback to complete. However, if a synchronous continuation was used, then it's possible the user's synchronous continuation might call back into the bounded channel and perform an operation that might require taking that same lock. Deadlock.
The fix is to simply not try to use synchronous continuations with bounded channel when a cancelable token is employed.