Commit Graph
947 Commits
Author SHA1 Message Date
Vladimir Sadov 2cf4826634 Moved AssemblyName helpers to managed (part 2) (#63915)
* implement GetAssemblyName via dynamic call to MetadataReader

* A few more file-locking tests.

* fix #28153

* no need for version when getting MetadataReader

* rename the argument to match AssemblyName

* perf tweaks

* use memory-mapped file to read metadata

* adjust tests for the new implementation

* use "bufferSize: 1" when stream is going to be mapped.

* null-conditional operator.

* do Dispose before re-throwing

* get rid of the platform-specific/native stuff

* remove assemblyname.hpp

* remove `VerifyIsAssembly()`

* PR feedback

* put back gStdMngIEnumerableFuncs and the others
2022-01-26 14:51:07 -08:00
Bar Arnon d34c0ff7c1 Add UnreachableException (#63922) 2022-01-26 02:58:21 -07:00
Roman Marusyk bdc0d1a409 Fix formatting of resource string where excess arguments are passed (#63824)
* Fix formatting of resource string where excess arguments are passed. #63607

* Fix BuildCharExceptionArgs and ECCurve.Validate

* Fix CA2208

* Fix CA2208. Remove paramName becaus it is in error message

* Code review fixes

* Code review fixes
2022-01-25 16:08:51 -07:00
David Wrighton 352a6b8d0d Add alignment to mapped field stream (#63305)
* Align MappeFieldDataStream at 8 byte boundary

* Add test to verify that the mapped field rva data blob is aligned to ManagedPEBuilder.MappedFieldDataAlignment

* Only align when the mapped field data is of size not equal to 0
2022-01-23 14:25:26 -08:00
Eric StJohn 1d751ba856 Update XUnit to 2.4.2-pre.22 (#63948)
* Update to Xunit build 2.4.2-pre.13

Also pick up latest pre-release of analyzers

* Disambiguate calls to Assert.Equals(double,double,int)

Xunit added a new Assert overload that caused a lot of ambiguous calls.
https://github.com/xunit/xunit/issues/2393

Workaround by casting to double.

* Fix new instances of xUnit2000 diagnostic

* Workaround xUnit2002 issue with implicit cast

Works around https://github.com/xunit/xunit/issues/2395

* Disable xUnit2014 diagnostic

This diagnostic forces the use of Assert.ThrowsAsync for any async method,
however in our case we may want to test that a method will throw
synchronously to avoid regressing that behavior by moving to the async
portion of the method.

* Use AssertExtensions to test for null ArgumentException.ParamName

Workaround https://github.com/xunit/xunit/issues/2396

* Update to Xunit 2.4.2-pre.22

* Fix another ArugmentException.ParamName == null assert
2022-01-20 10:35:50 -08:00
MSDN.WhiteKnight 3956126d55 Fix typo in SRM package description (#63782) 2022-01-14 10:33:03 -05:00
Marek Safar 6de7147b92 Enable IDE0059 analyzer: Unnecessary assignment of a value (#63340) 2022-01-12 18:10:45 +01:00
c49c65df80 [LoongArch64] Port libraries directory (#62888)
Co-authored-by: qiaopengcheng <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
2022-01-07 08:24:34 -08:00
Theodore Tsirpanis 6845361b97 Make ControlFlowBuilder.Clear public. (#62811) 2021-12-15 14:13:05 -08:00
Santiago Fernandez Madero f7544966e9 Update previous netcoreapp version to run API Compat against 6.0 ref pack (#61437) 2021-12-04 10:28:33 -06:00
Buyaa Namnan eeb79b33d2 Lock MemeoryMappedFile CreateViewAccesssor call (#62288) 2021-12-02 14:18:41 -08:00
e10532af7e Obsolete thumbtacked AssemblyName properties (#59522)
* Obsolete thumbtacked AssemblyName properties

Fix #59061

* Ignore obsoletion

* Fix pragma

* Merge the AssemblyName member obsoletions into a single diagnostic id

* Fix pragma to use updated diagnostic id

* Suppress SYSLIB0037 in reflection tests

* Suppress SYSLIB0037 warnings

Co-authored-by: Jeff Handley <[email protected]>
Co-authored-by: Jeff Handley <[email protected]>
2021-11-15 17:06:46 -08:00
Elinor Fung 2da44f3262 Use DllImportGenerator in System.Diagnostics.PerformanceCounter (#61389) 2021-11-11 08:18:30 -08:00
Michal Strehovský b6657214f4 Remove sorting requirement for interface lists (#60541)
Fixes #60454.
2021-11-08 13:55:37 -08:00
Steve Pfister 8c6aeea1d8 Bring up full library test CI runs on iOS / tvOS devices (#59503)
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.
2021-11-02 07:43:15 -04:00
Theodore Tsirpanis db9c3f1aeb Remove legacy light-up code from System.Reflection.Metadata et.al. (#56587)
* Remove legacy light-up code for the pointer-based Encoding.GetString.

* Remove legacy light-up code for the memory-mapped file block code.

* Remove FileStreamLightUp.IsFileStream and the need for it.

* Address PR feedback.

* Use hardware-accelerated population count where available.

* Remove a try/finally with an empty try where CERs are not supported.

* Use named arguments when constructing a memory-mapped file.
2021-09-16 08:48:06 +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 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
Tomáš Matoušek 2a02896735 Use native allocator instead of pinning when decompressing embedded PDB (#56336) 2021-07-27 15:16:59 -07: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
Viktor Hofer c95aa3f48a Remove NS1.x assets from building and packaging (#53283)
* 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
2021-05-26 21:51:12 +02:00
hrrrrustic 57c3a8558e System.Reflection.* missed Equals nullable annotations (#52162)
* add NotNullWhen attribute
2021-05-22 13:54:40 -07:00
Ankit Jain d36313d3da [wasm][aot] Update disabled tests to track new fixes on main (#52396)
* [wasm][aot] System.Runtime.Tests failing with a different issue now

The earlier one (https://github.com/dotnet/runtime/issues/51960) was
fixed.
New: https://github.com/dotnet/runtime/issues/52393

* Enable Common.Tests test tracked in https://github.com/dotnet/runtime/issues/50955, already fixed on main

* [wasm] System.Reflection.Tests - update to track change from crash to a

.. test failure.
Issue: https://github.com/dotnet/runtime/issues/51673

* Re-enable System.Collections.Tests, issue: https://github.com/dotnet/runtime/issues/51037

* Disable Microsoft.Extensions.Logging.Generators, and System.IO.Pipelines

Issue: https://github.com/dotnet/runtime/issues/52384
Issue: https://github.com/dotnet/runtime/issues/50959

* Enable two System.Reflection.Metadata* tests

Issue: https://github.com/dotnet/runtime/issues/51958

* Fix path for Microsoft.Extensions.Logging.Generators.Tests
2021-05-06 19:39:37 -05:00
Ankit Jain f372f6b5fd [wasm][tests] Fix test failures due to trimming (#51697)
- Both EAT, and AOT builds are completely green now.
- Number of tests for EAT goes from 147 -> 185
- Number of tests for AOT goes from 147 -> 174 (the difference is because of aot only failures)
- Test run on a regular wasm build runs 206 libraries
2021-04-28 15:19:10 -04:00
Ankit JainandLarry Ewing fa7c6a93a8 [wasm][aot] Disable failing AOT tests, to get a green build (#51724)
Co-authored-by: Larry Ewing <[email protected]>
2021-04-27 01:55:45 -04:00
Tomáš Matoušek 22dc92037b Fix disposal of MetadataProvider on failure to read Embedded PDB (#51288) 2021-04-14 20:56:59 -07:00
Alexander Köplinger bc9f00c226 Cleanup PlatformSpecific/SkipOnMono attributes that skip a platform (#50907)
We have a bunch of test assemblies that don't make sense on some platforms, e.g. Browser.
Right now we're skipping them via `[SkipOnMono("reason", TestPlatforms.Browser)]` but there's nothing that inherently ties this to Mono other than the current implementation.

The more generic `SkipOnPlatform` attribute can be used instead.
We can also use it in places where we do `[PlatformSpecific(~TestPlatforms....)]` to avoid the double inversion.
2021-04-09 13:20:18 +02:00
Stephen Toub 0c793920f6 Clean up string formatting in a variety of places (#50267)
Mostly just replacing string.Format calls with equivalent interpolated string uses.  In some cases, I replaced lots of string creations with a StringBuilder or equivalent.
2021-04-04 23:16:23 -04:00
Adam Sitnik bce310d872 ensure MetadataReader fast path works with every FileStream on every OS (#50367) 2021-03-31 08:53:52 +02:00
Stephen Toub 0817e748b7 Seal internal types in libraries (#50225) 2021-03-25 20:50:33 -04:00
Michal Strehovský f690d59f4e Don't remove trailing \0 in custom attributes (#50088)
As the comment says - this behavior goes against the spec. Fixes #49756.
2021-03-23 08:19:58 -07:00
Stephen Toub 48679143aa Seal private classes in libraries (#49969) 2021-03-23 06:14:55 -04:00
Ulrich Weigand ce9dd6b0ec Big-endian fix: System.Reflection.Metadata BlobBuilder/BlobWriter (#49812)
* BlobBuilder: do not use Encoding.Unicode.GetBytes but simple
  byte-swaps on big-endian systems (fixes a semantic difference
  to little-endian code w.r.t. surrogate char handling)

* BlobWriter: add big-endian WriteUTF16 code path like BlobBuilder
2021-03-19 07:55:37 -07:00
Ulrich Weigand c37395208c Big-endian fix: GUID handling (#49813)
* Fix Utf8Formatter.Guid on big-endian systems
  (first three fields are stored in native byte order, not always
  little-endian)

* Use Guid constructor in BlobContentId.FromHash to remove
  endian-dependent code accessing the structure directly
2021-03-19 13:00:15 +01:00
Ulrich Weigand 8ad1d7d665 Big-endian fix: PEBuilder.CalculateChecksum (#49816)
* Always use little-endian encoding to compute checksum
2021-03-19 06:46:08 -04:00
Marek Safar aeaa103edd Better windows only guard which can be removed by linker (#48594)
Also, remove superfluous test poking into an internal state to mimic
non-Windows test environment
2021-03-17 07:20:52 -04:00
Ulrich Weigand 66e665ffe8 Big-endian test case fixes: System.Reflection (#49693)
* Fix endian assumptions in tests operating on PE headers / IL metadata
  (this is always encoded in little-endian byte order)

* Fix expected result for BlobReader test (always little-endian)

* Fix expected results for GUID tests
2021-03-16 20:33:19 -04:00
Viktor Hofer 3553284bea Rename mention to master branch to main (#48824) 2021-03-01 10:09:31 +01: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
hrrrrustic eebeb86924 Make DebugDirectoryBuilder.AddCodeViewEntry public (#43267) 2020-10-22 21:27:00 -07:00
Eric StJohn 731eaf3545 Renable AddMethodBody tests (#41613) 2020-08-31 13:58:16 -07:00
Stephen Toub e7204f5d6f Use T? for unconstrained nullable types (#40197)
* Temporarily upgrade compiler version for T? support

* Use T? for unconstrained nullable types
2020-08-07 11:25:42 -04:00
Steve Pfister d575f10471 [Wasm] Ensure monovm_initialize is called on startup and address other startup items (#39446)
This PR addresses:

- Calling monovm_initialize matches how other mono platforms init themselves (Fixes https://github.com/dotnet/runtime/issues/39074)
- Set the entry assembly (Fixes https://github.com/dotnet/runtime/issues/38994)
- Make sure the assembly location is set to empty for assemblies that are loaded from memory (Fixes https://github.com/dotnet/runtime/issues/39650)
2020-08-07 09:30:15 -04:00