Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Haiku: Build and test dotnet runtime - #1

#1
Open
trungnt2910 wants to merge 2440 commits into
jessicah:haiku-dotnet7jessicah/dotnet-runtime:haiku-dotnet7from
trungnt2910:haiku-dotnet7trungnt2910/dotnet-runtime:haiku-dotnet7Copy head branch name to clipboard
Open

Haiku: Build and test dotnet runtime#1
trungnt2910 wants to merge 2440 commits into
jessicah:haiku-dotnet7jessicah/dotnet-runtime:haiku-dotnet7from
trungnt2910:haiku-dotnet7trungnt2910/dotnet-runtime:haiku-dotnet7Copy head branch name to clipboard

Conversation

@trungnt2910

Copy link
Copy Markdown

Now all the targets mentioned here should compile.

@trungnt2910

Copy link
Copy Markdown
Author

Status update: PAL tests are running now, with errors.

I'll fix them one by one.

@trungnt2910 trungnt2910 changed the title build: Fix libs.native and clr.paltests builds Haiku: Build and test dotnet runtime May 21, 2022
@trungnt2910

Copy link
Copy Markdown
Author

image
Things are looking optimistic, only 9 out of nearly 700 tests are failing.

@trungnt2910

Copy link
Copy Markdown
Author

paltest_probememory_probememory_neg1 is currently blocked by this issue in Haiku.

Comment thread src/native/minipal/getexepath.h Outdated

@jessicah jessicah left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getexepath can be simplified.

@trungnt2910

Copy link
Copy Markdown
Author

paltest_probememory_probememory_neg1 is currently blocked by this issue in Haiku.

This patch to Haiku should fix paltest_probememory_probememory_neg1.

@trungnt2910

trungnt2910 commented May 24, 2022

Copy link
Copy Markdown
Author

Status update:
With Haiku's issue closed, now all PAL test failures are related to exception handling.

Currently trying to build LLVM's libunwind (From llvm-project 14.0.3 source code, using make unwind).

From what I read in the source code, as well as discussions in issues across the dotnet repo:

  • The CoreCLR supports using either HP libunwind or LLVM libunwind.
  • The build system supports building using either the libunwind bundled with the repo or the libunwind installed in the system.

So, if LLVM's libunwind somehow works on Haiku, we can install and use that library instead.

trungnt2910 referenced this pull request in trungnt2910/dotnet-runtime Jun 12, 2022
This adds support for EnC on arm64. A couple of notes on the
implementation compared to x64:
- On x64 we get the fixed stack size from unwind info. However, for the
  frames we set up on arm64 for EnC it is not possible to extract the
  frame size from there because their prologs generally look like

  stp fp, lr, [sp,#-16]!
  mov fp, sp
  sub sp, sp, dotnet#144

  with unwind codes like the following:

  set_fp; mov fp, sp

  save_fplr_x #1 (0x01); tp fp, lr, [sp, #-16]!

  As can be seen, it is not possible to get the fixed stack size from
  unwind info in this case. Instead we pass it through the GC info that
  already has a section for EnC data.

- On arm64 the JIT is required to place the PSPSym at the same offset
  from caller-SP for both the main function and for funclets. Due to
  this we try to allocate the PSPSym as early as possible in the main
  function and we must take some care in funclets.  However, this
  conflicts with the EnC frame header that the JIT uses to place values
  that must be preserved on EnC transitions. This is currently
  callee-saved registers and the MonitorAcquired boolean.

  Before this change we were allocating PSPSym above (before) the
  monitor acquired boolean, but we now have to allocate MonitorAcquired
  first, particularly because the size of the preserved header cannot
  change on EnC transitions, while the PSPSym can disappear or appear.
  This changes frame allocation slightly for synchronized functions.
trungnt2910 referenced this pull request in trungnt2910/dotnet-runtime Jun 12, 2022
These helpers are used to report names of things in warnings. The functional changes are:
* For method parameters, use the parameter name if available (and only if not fallback to the #1 notation)
* For property accessor methods, use the C# naming scheme, so for example Type.Property.get instead of Type.get_Property.

Both of these changes are in preparation to bring NativeAOT closer in behavior to ILLink and the trim analyzers.

For this I moved some of the helpers to the common shared code.

Some unrelated code cleanup as well.

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
@trungnt2910

trungnt2910 commented Jun 13, 2022

Copy link
Copy Markdown
Author

I seem to have found the cause of the exception handling problem:
For unwinding to work, binaries have to call a function named __register_frame_info during initialization (at least according to X512).

The paltests binary does not call the function, therefore unwinding won't work for all functions in this binary, breaking the functionality of unwinding. This ultimately makes C++ exceptions impossible to be caught.

Why this function is not called for this specific binary (and not other normal Haiku binaries) is currently under investigation.

wfurt and others added 15 commits August 16, 2022 12:36
* fold reference to SslContextHandle to prevent crashes

* Update src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
…815.4 (dotnet#74004)

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22412.4 -> To Version 7.0.100-1.22415.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#74019)

* Disable the ConnectCallback_UseNamedPipe_Success test for NativeAOT

* Attribute form
* eng/Versions.props

* Directory.Build.props

* src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props

* Apply suggestions from code review

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
…3955)

* [mono] Implement missing functionality for cctor invocation

* [mono] Re-enable test
* Optimized string.Replace(char, char) vector code path

* Optimized code pathes even further

* Do vectorized operation at the end of the string only once

When the remaining length is a multiple of the vector size, then the remainder is processed twice. This is redundant, and not needed.
This commit changes that, so that the remainder is processed only once when the remaining elements match.

* Don't use trick for collapsed epilogs

Cf. dotnet#67049 (comment)

* Handle remainder vectorized even if remainingLength <= Vector<ushort>.Count and added tests for this

* Introduce (internal) Vector.LoadUnsafe and Vector.StoreUnsafe and use it in string.Replace(char, char)

* Avoid Unsafe.As<char, ushort> reinterpret casts by introducing string.GetRawStringDataAsUshort() internal method

* Fixed copy/paste error (from local dev to repo)

* PR Feedback

* Fixed bug and added tests for this

* Make condition about lengthToExamine clearer as suggested
* Remove reflection from AppHostUpdateTests

* Address CR feedback

* Make template binary readonly for macOS
We can delay the string allocation until it's actually requested.
Fuzzlyn now supports a "known errors" list that will not be reported as
failing examples and will thus not cause the pipeline to fail. The list
can be specified either as a path to a file containing a JSON array of
error strings, or as a built-in list "dotnet/runtime" that is maintained
in Fuzzlyn itself. This PR hooks the support up on the runtime side.
Reference is not needed; was causing build issues for some platforms.

Fixes dotnet#73792
* [LoongArch64] amend the tests' building on LA64.

* Move the `-DTARGET_ARMARCH` and `-DTARGET_ARMARCH`
to the `Common/Platform/platformdefines.h`.
jessicah and others added 25 commits March 22, 2023 15:47
* "pal.h" includes both "pal_mstypes.h" and "pal_error.h",
  but does so in the correct order, such that size_t is
  defined properly.
* Previously, it would result in size_t being undefined due
  to how "pal_internal.h" redefines everything
* libroot provides libc, libm, libpthread, and libdl
The two functions added here, SystemNative_TeamInfo and SystemNative_NextAreaInfo, are
neither cross-platform nor used by unmanaged CoreCLR code, and therefore can be directly
called from managed C# code.

The previous configuration broke Linux builds.
While all Haiku binaries are linked to libroot by default,
the cross compile toolchain for Haiku has some bug in weak
symbol resolution that prevents __register_frame_info from being
called unless a library containing that symbol is explicitly
referenced during compile time.

This ensures that __register_frame_info is called and
unwind information is properly registered for C++ exception
handling.
Haiku does not support fchmod for sockets.
Haiku seems to have a problem reserving 256GiB of virtual memory.
Disable this feature for now until we can investigate on this.
- Cleaned up toolchain.cmake.
- Fix missing headers for System.Native.
- Properly locate Haiku's libunwind.
trungnt2910 referenced this pull request in trungnt2910/dotnet-runtime Mar 22, 2023
* Initial implementation for contract customization

fix build errors

Move converter rooting to DefaultJsonTypeInfoResolver so that it can be used standalone

Fix ConfigurationList.IsReadOnly

Minor refactorings (#1)

* Makes the following changes:

* Move singleton initialization for DefaultTypeInfoResolver behind a static property.
* Consolidate JsonSerializerContext & IJsonTypeInfoResolver values to a single field.
* Move reflection fallback logic away from JsonSerializerContext and into JsonSerializerOptions

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs

* remove testing of removed field

Simplify the JsonTypeInfo.CreateObject implemenetation (#2)

* Simplify the JsonTypeInfo.CreateObject implemenetation

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.cs

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.cs

Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>

Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>

Tests and fixes for JsonTypeInfoKind.None

TypeInfo type mismatch tests

Allow setting NumberHandling on JsonTypeInfoKind.None

test resolver returning wrong type of options

JsonTypeInfo/JsonPropertyInfo mutability tests

rename test file

Move default converter rooting responsibility behind DefaultJsonTypeInfoResolver (#3)

* Move default converter rooting responsibility behind DefaultJsonTypeInfoResolver

* address feedback

Add simple test for using JsonTypeInfo<T> with APIs directly taking it

fix and tests for untyped/typed CreateObject

uncomment test cases, remove todo

More tests and tiny fixes

Add a JsonTypeInfoResolver.Combine test for JsonSerializerContext (#4)

* Fix JsonTypeInfoResolver.Combine for JsonSerializerContext

* Break up failing test

Fix simple scenarios for combining contexts (#6)

* Fix simple scenarios for combining contexts

* feedback

JsonSerializerContext combine test with different camel casing

Remove unneeded virtual calls & branching when accessing Get & Set delegates (#7)

JsonPropertyInfo tests everything minus ShouldSerialize & NumberHandling

Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs

Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs

throw InvalidOperationException rather than ArgumentNullException for source gen when PropertyInfo.Name is assigned through JsonPropertyInfoValues

tests for duplicated property names and JsonPropertyInfo.NumberHandling

Add tests for NumberHandling and failing tests for ShouldSerialize

disable the failing test and add extra checks

disable remainder of the failing ShouldSerialize tests, fix working one

Fix ShouldSerialize and IgnoreCondition interop

Add failing tests for CreateObject + parametrized constructors

Fix CreateObject support for JsonConstructor types (#10)

* Fix CreateObject support for JsonConstructor types

* address feedback

Make contexts more combinator friendly (#9)

* Make contexts more combinator friendly

* remove converter cache

* redesign test to account for JsonConstructorAttribute

* Combine unit tests

* address feedback

* Add acceptance tests for DataContract attributes & Specified pattern (#11)

* Add private field serialization acceptance test (dotnet#13)

* tests, PR feedback (dotnet#14)

* PR feedback and extra tests

* Shorten class name, remove incorrect check (not true for polimorphic cases)

* Make parameter matching for custom properties map property Name with parameter (dotnet#16)

* Test static initialization with JsonTypeInfo (dotnet#17)

* Fix test failures and proper fix this time (dotnet#18)

* Fix test failures and proper fix this time

* reinstate ActiveIssueAttribute

* PR feedback and adjust couple of tests which don't set TypeInfoResolver

* fix IAsyncEnumerable tests

* Lock JsonSerializerOptions in JsonTypeInfo.EnsureConfigured()

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
trungnt2910 referenced this pull request in trungnt2910/dotnet-runtime Mar 22, 2023
E.g.,

Update LSRA "Allocating Registers" table description.

Dump nodes added during resolution, e.g.:
```
   BB29 bottom (BB08->BB08): move V25 from STK to rdi (Critical)
N001 (  1,  1) [001174] ----------z                 t1174 =    LCL_VAR   int    V25 cse4          rdi REG rdi
```

Dump more data in the LSRA block sequence data:
```
-BB03( 16   )
-BB04(  4   )
+BB03 ( 16   ) critical-in critical-out
+BB04 (  4   ) critical-out
```

When dumping various flow bitvectors, annotate the bitvectors better:
```
-BB25 in gen out
-0000000000000000
-0000000000000003 CSE #1.c
-0000000000000003 CSE #1.c
+BB25
+ in: 0000000000000000
+gen: 0000000000000003 CSE #1.c
+out: 0000000000000003 CSE #1.c
```

Dump hoisting bitvectors using the sorting number:
```
-  USEDEF  (5)={V04 V00 V01 V02 V03}
+  USEDEF  (5)={V00 V01 V02 V03 V04}
```

Also, fix various typos and formatting.
trungnt2910 referenced this pull request in trungnt2910/dotnet-runtime Jun 16, 2023
…tnet#87189)

This fixes a startup crash on Big Sur:

> error: * Assertion at /Users/runner/work/1/s/src/mono/mono/utils/mono-hwcap-arm64.c:35, condition `res == 0' not met

Because sysctl can't find some of these options:

    $ sysctl hw.optional.armv8_crc32
    hw.optional.armv8_crc32: 1
    $ sysctl hw.optional.arm.FEAT_RDM
    sysctl: unknown oid 'hw.optional.arm.FEAT_RDM'
    $ sysctl hw.optional.arm.FEAT_DotProd
    sysctl: unknown oid 'hw.optional.arm.FEAT_DotProd'
    $ sysctl hw.optional.arm.FEAT_SHA1
    sysctl: unknown oid 'hw.optional.arm.FEAT_SHA1'
    $ sysctl hw.optional.arm.FEAT_SHA256
    sysctl: unknown oid 'hw.optional.arm.FEAT_SHA256'
    $ sysctl hw.optional.arm.FEAT_AES
    sysctl: unknown oid 'hw.optional.arm.FEAT_AES'

Full stack trace:

* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
  * frame #0: 0x0000010ef37560 libmonosgen-2.0.dylib`monoeg_assertion_message
    frame #1: 0x0000010ef375cc libmonosgen-2.0.dylib`mono_assertion_message + 32
    frame #2: 0x0000010ef40d6c libmonosgen-2.0.dylib`mono_hwcap_arch_init + 544
    frame #3: 0x0000010ef54bd8 libmonosgen-2.0.dylib`mono_hwcap_init + 72
    frame #4: 0x0000010ee14dc0 libmonosgen-2.0.dylib`parse_optimizations + 52
    frame #5: 0x0000010edbed48 libmonosgen-2.0.dylib`mono_init
    frame #6: 0x0000010ee18968 libmonosgen-2.0.dylib`mono_jit_init_version
    frame #7: 0x0000010f48a300 libxamarin-dotnet-debug.dylib`xamarin_bridge_initialize + 216
    frame #8: 0x0000010f4900a4 libxamarin-dotnet-debug.dylib`xamarin_main + 376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.