Increase file descriptor limit in native AOT executables#118995
Increase file descriptor limit in native AOT executables#118995MichalStrehovsky merged 3 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates file descriptor limit handling across .NET runtime components by moving the descriptor limit increase functionality from individual runtime implementations into the shared minipal library. This ensures consistent behavior across CoreCLR, Mono, and Native AOT executables.
Key changes:
- Creates a unified
minipal_increase_descriptor_limit()function in the minipal library - Removes duplicate descriptor limit code from CoreCLR PAL and Mono runtime
- Adds descriptor limit increase functionality to Native AOT bootstrap
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/native/minipal/descriptorlimit.h |
New header defining the minipal descriptor limit API |
src/native/minipal/descriptorlimit.c |
New implementation of descriptor limit increase functionality |
src/native/minipal/minipalconfig.h.in |
Adds HAVE_RESOURCE_H configuration check |
src/native/minipal/configure.cmake |
Adds sys/resource.h availability check |
src/native/minipal/CMakeLists.txt |
Includes new descriptor limit source and disables functionality on problematic platforms |
src/mono/mono/mini/driver.c |
Replaces local descriptor limit function with minipal version |
src/mono/CMakeLists.txt |
Removes redundant DONT_SET_RLIMIT_NOFILE definition |
src/coreclr/pal/src/init/pal.cpp |
Replaces local descriptor limit function with minipal version |
src/coreclr/pal/src/CMakeLists.txt |
Removes redundant DONT_SET_RLIMIT_NOFILE definition |
src/coreclr/nativeaot/Bootstrap/main.cpp |
Adds descriptor limit increase call to Native AOT bootstrap |
|
Unfortunately we don't run WASI builds on PRs anymore and (I think) this broke the build. I filled #119100 |
Sorry about that, I expected this to cover it: runtime/src/native/minipal/descriptorlimit.c Lines 16 to 18 in 1d6c600 But looks like we don't define TARGET_WASM there? Do we need TARGET_WASI instead? (I don't see that one defined in the failing clang command line either though). |
|
@SingleAccretion volunteered to fix it here #116390 (comment) |
Sorry for the trouble. Should be an easy fix for someone who knows the right ifdef to gate against. |
@pavelsavara Is there a reason? It would be ok to run a WASI build in the CI to catch trivial build breaks like this (single flavor, build only, PRs only - no official builds). We do the same for number of other community supported platforms. |
The setup we had in Net9 was much broader, library unit tests, workload testing, native builds, there is also our own build of LLVM and ideally WASI-SDK to flow, wasmtime installations to helix ... we didn't have bandwidth to maintain it in Net10.
Yes, we are discussing that with @lewing, perhaps I disabled too much of the above ? |
Fixes #82719
Cc @dotnet/ilc-contrib