* Use u8 in more places
Primarily replacing Encoding.UTF8/ASCII.GetBytes("literal") with "literal"u8.ToArray()
* Address PR feedback (and fix some vars)
* ZipFile UnixCreateSetsPermissionsInExternalAttributes test fails on Apple OSes
There are scenarios where chmod succeeds, but the OS clears certain bits, like S_ISGID and S_ISUID. When this happens, the ZipFile tests fail because the .zip file doesn't contain the expected ExternalAttributes.
To fix this, read the file mode after calling chmod, and update the expected file mode so the tests still pass.
Fix#68293Fix#60581
* Fix the tests to expect the correct file name
Implement support for "Linux Bionic", a RID which builds a Linux runtime against an Android libc but without Android OS functions like JNI, Dalvik, Instrumentation, etc. This configuration has been requested by a team working on an IoT scenario.
* The new RID is linux-bionic-arm64/linux-bionic-x64.
* The build reuses the existing Android build dockerfiles and Helix queues
* Since we don't have JNI, we don't have Android Crypto - instead, use an Android build of OpenSSL. As an errata, it is incumbent upon the end user to supply this in their OS environment (we download one ad-hoc for testing purposes, which was compiled by Google)
* Some tests cannot be completed due to SELinux policies affecting the shell user executing tests via adb shell in the world-writable /data/local/tmp directory. We expect those tests would pass if they pass on Android, in a real-world IoT scenario with a custom OS (rather than recycling Google's OS images intended for phones)
Closes: #66027
* System.IO.Compression tests: add StreamTruncation_IsDetected
* System.IO.Compression: detect and throw on truncated streams
* account for edge case
* account for edge case in async version
* rename nonZeroInput to nonEmptyInput
* remove else to improve codegen
* run StreamTruncation_IsDetected for all three types of compression streams
* fixup test build and run
* add stream corruption test
* review feedback - cosmetics
* make BrotliStream detect truncation
* make StreamCorruption_IsDetected run for gzip only
other types of stream can't detect corruption properly
* skip byte corruption which results in correct decompression
* code style
* add zlib corruption test, no skipping needed
* clarify why we skip bytes in gzip test
* add and use truncated error data message
Co-authored-by: Marcin Krystianc <[email protected]>
* 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]>
* 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.
* 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
* Added test for extracting zip files with invalid characters in Windows
* Removed faulty test case
* Removed redundant test cases, Added contents of the InvalidWindowsFileNameChars.zip
* Replaced "+"s to Path.Combine for forming the test file path.
* Update src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Extract.cs
* Added code to use ValidFullName across several files
* Removed weird character
* Added Sanitization
* Fixed Typo
* Fixed wrong if statement
* Fixed wrong filename in test
* Added sanitization as a method
The tests added pass with this build
* Fixed tests that didn't pass
* Cleaned up code
* Removed unnecessary tests
* Change agnostic TFM back to Windows
* spacing
* Changed default target framework to Unix
* Defaulted framework to unix
* Removed Browser
* Update src/libraries/System.IO.Compression.ZipFile/tests/ZipFile.Create.cs
Co-authored-by: Viktor Hofer <[email protected]>
Co-authored-by: Dan Moseley <[email protected]>
Co-authored-by: Viktor Hofer <[email protected]>
* 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.
* 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.
* 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
* Add NetCoreAppCurrent rid agnostic tfm to libs
This change adds a NetCoreAppCurrent rid-less configuration which throws
a PNSE to the following libraries:
- System.Console
- System.IO.Compression.ZipFile
- System.IO.Compression
- System.IO.FileSystem.DriveInfo
- System.IO.MemoryMappedFiles
- System.Net.Http
- System.Net.Mail
- System.Net.NameResolution
- System.Net.Primitives
- System.Net.Requests
- System.Net.WebSockets
System.Private.Runtime.InteropServices.JavaScript is excluded from that
list as it doesn't have a contract and hence can't generate a PNSE
assembly. Also it's currently a private assembly.
These are the only libraries that were missing a RID agnostic tfm.
Adding rid-less configurations, even if they just throw PNSEs helps with:
- Platform enablement, i.e. a new "base" platforms like "Browser" usually
require libraries that are RID specific to support them. By offering a
RID agnostic PNSE tfm, projects can gradually support new platforms.
- Making it possible to have ProjectReferences between libraries, i.e.
imagine an microsoft.build.notargets / microsoft.build.traversal
project with a `$(NetCoreAppCurrent)-$(TargetOS)` tfm which P2Ps all
source projects. NuGet can't know that a $(NetCoreAppCurrent)-Linux
tfm can reference a project with a $(NetCoreAppCurrent)-Unix tfm and
will throw during restore, more precisely during the compatibility
check. Ideally NuGet or the SDK would support targeting platforms from
the runtime.json RID graph, including its compatiblity matrix but
that isn't the case today.
Even though the added tfms add to the build, I have other changes
in the pipeline which depend on this one which will make the build
noticeably faster.
* Use default impl for DriveInfo & ZipFile
- allow Module.config to have assets with buffer instead of url
- change sample to show how emscripten callbacks are triggered
- pass config into onConfigLoaded and made it async
- split asset download from copying it into memory
- moved startup sequence to configure_emscripten_startup and documented it there
- diagnostic_tracing as CLI parameter for tests
- throttle parallel download of assets
- move tests which fail on V8 to browser or nodeJS scenarios
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.
Update slngen tooling to latest stable version and solution files since
a lot changed since the last time they were updated:
- NET7 (removal of older TFMs)
- Source Generators
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.
* Compression.ZipFile support for Unix Permissions
When running on Unix, capture the file's permissions on ZipFile Create and write the captured file permissions on ZipFile Extract.
Fix#1548
Since we have shipped for 3 years with the current behavior, re-enabling the test so it ensures the current behavior going forward. Extracting .zip files with invalid file names throw an IOException with a message "The filename, directory name, or volume label syntax is incorrect.".
Contributes to #25099
In effort to assess the state of the iOS library tests, a number of tests will be skipped
Test suites that crash, hang, or have a significant number of failures (mostly 20+ failing unique test methods) are skipped on at the `tests.proj` level. Otherwise, `[ActiveIssue]` attributes have been attached to either the individual test methods that fail or the entire class if the whole test class fails. Any pre-existing `ActiveIssue` attribute associated with iOS had been reassessed to either remain or be closed.
A few test suites have been skipped because they fail with some form of `PlatformNotSupportedException`. `[SkipOnPlatform]` attributes are attached to the failing test methods.
All of the Issues can be tracked at https://github.com/dotnet/runtime/projects/48#column-9236436
The ActiveIssues and `tests.proj` exclusions have been tested on https://github.com/dotnet/runtime/pull/49917 as well.
-----------
This PR makes the following changes in the following files:
`src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj` - Removed `$(NetCoreAppCurrent)-iOS` from target frameworks as it is stated to currently only supported on Windows.
`src/libraries/tests.proj` - Update the test suites that need to be skipped at the project level, reducing the number and categorizing as a skip due to PNSE, a skip due to numerous failures, and a skip due to the suite crashing.
The remaining files changed are either:
`[ActiveIssue("<issue-url>", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]`
`[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS or tvOS.")]`
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Tammy Qiu <[email protected]>
- 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)"
Found that the emscripten VFS does not write user specified file attributes, so skip
part of ZipFile_Create.InvalidDates that expects this to be supported.
Co-authored-by: Steve Pfister <[email protected]>
* Add support to map test support files to wasm vfs in WasmAppBuilder
* PR Feedback
* Remove workaround for System.Reflection.Metadata.Tests
* Add BCL and BuildReference assets to VFS
* PR Feedback and fix more test projects
* Avoid potential null ref