-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host with coreclr linked in #36847
Host with coreclr linked in #36847
Conversation
Tagging subscribers to this area: @ViktorHofer |
d72a5f2
to
405d3c4
Compare
The superhost doc says due to some debugging issues there won't be a single static lib for coreclr on windows. For anyone not wanting to debug will there be a way to achieve this functionality? |
@swaroop-sridhar would know better if there are other issues besides debugging on Windows. |
c04de73
to
2dfb8c9
Compare
…one coreclr, we do not need EMBEDDED_RUNTIME marker.
Rebased onto most recent master. |
|
||
// Getting nullptr as name indicates redirection to current library | ||
if (libraryNameOrPath == nullptr) | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, if those libs get linked into the shared coreclr statically too, we won't need any changes here.
@@ -56,8 +56,91 @@ if (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_AR | |||
target_link_libraries(singlefilehost Advapi32.lib shell32.lib) | |||
endif() | |||
|
|||
# Path like: artifacts/bin/coreclr/Windows_NT.x64.Release/lib or | |||
# /root/runtime/artifacts/transport/coreclr/lib | |||
set(CORECLR_STATIC_LIB_LOCATION "$ENV{__CoreClrArtifacts}lib") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit - can we have the env var without the trailing slash for the sake of consistency with cmake variables for paths (e.g. the CMAKE_CURRENT_SOURCE_DIR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I am not adding this trailing slash. It gets here all the way from msbuild CoreCLRArtifactsPath
I would rather keep it as is. I mean - rather than detecting and trimming the trailing slash, if present, before exporting in .cmd/.sh
We probably have the same thing for other variables that come from msbuild and just add trailing slashes on concat.
I assume duplicate path separators are ignored on Unix as well as on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@jkotas - any more comments on this? |
Except this, I do not have anything else to add. Do we have an idea about the impact on local builds and official build times? |
@jkotas thanks. I will measure and get actual numbers. (time and size diffs) |
On my devbox, the native part of the build (src/coreclr/build-native.cmd) is about 8% slower than the one without this change. |
==== Windows build times, shortest from 3 tries Measuring Release here. Debug build is dominated by crossgen postbuild step and thus much less impacted. build clr -c Release master: superhost: ==== Linux build times, shortest from 2 tries I use MUSL containerized build. It generally feels a bit faster and container makes comparing cleaner. ./build.sh -s clr -c Release /p:RuntimeOS=Linux-musl master: superhost: ==== File size for coreclr_static library Windows: 273 Mb Debug is ~20% larger ==== Lab transfers of artifacts (adds roughly 80Mb in either Windows or Linux case) Baseline (random recent CI run without changes) Win artifact zip: 181.231MB === on Linux the numbers are comparable, but the relative diff is smaller, since baseline is larger due to PAL related artifacts. Baseline: Linux artifact zip: 278.990MB |
How I see the data above: === time: The change has a fairly small impact on build time. A lot of effort in this PR went into partitioning coreclr intermediates to minimize duplication while building embedded/standalone flavors of JIT, VM and coreclr. It looks like these efforts paid off. == size: The size of coreclr_static static library is 273Mb onWindows, 398 Mb Linux. That adds ~80 Mb of compressed artifact transfer in the lab, which in turn adds 5 sec of transfer time to the pipeline that consumes the artifact. == my thoughts: Overall – I think It would be interesting to try explore whether it is possible to optimize the size of the artifact. This would most likely imply building singlefilehost as a part of coreclr, one way or another. Either via System.Globalization approach or by separating hosting from packaging and moving to coreclr partition. I think this should be a separate change. One reason is that it will be an additive improvement, primarily just reducing the intermediate size. Most of the changes of this PR were to minimize duplication and then dealing with consequences of the build partitioning (and platform quirks that were exposed). Most of that will still be needed. Even if singlefilehost is built as a part of coreclr, we do not want to build the same stuff 2-4 times. Another reason is that, IMO, there is a good chance that the change will be more complex than expected. I would prefer having experience with embedding native libs before embarking on doing the same with singlefilehost. |
logged an issue to follow up on building singlfilehost as a part of coreclr build ( #38489 ) |
Thanks to everybody!!! |
Add PAL_GetApplicationGroupId() that returns null for Linux.
Related to: #37119
This change results in singlefilehost to embed coreclr and JIT code.
Notes:
this is not yet enabled on Windows.
Native libraries like
System.IO.Compression.Native.a
are not linked in as a part of this change. Will be done separately.