Skip to content
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

feat: option to download vc/ucrt debug binaries #148

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

superewald
Copy link

@superewald superewald commented Dec 20, 2024

This PR adds the opportunity to download and splat the VCR and UCRT debug binaries (eg vcruntime140d.dll) by adding the --include-debug-runtime cli argument.

This is useful for testing/debugging debug builds on linux hosts as the debug runtime dlls are not included in wine.

Note

This is my first time coding in rust, I tried to stick to best practices but it would be good to review the changes carefully for code style and performance.

output

The binaries are placed inside <splat-output-dir>/vcrd/<vcr-version>/bin/<arch>.

Running xwin --manifest-version 16 --include-debug-runtime splat creates splat/vcrd/14.29.30157/bin/x86_64 with the debug runtime binaries inside it.

The complete list of included binaries can be found in the updated deterministic__verify_deterministic.snap.

Note

I updated the snapshots for deterministic and compile tests, however I skipped updating the snapshots for compile_minimized because they seem to be outdated on the main branch.

(Implements #81)


for pkg in manifest.packages {
packages.insert(pkg.id.clone(), pkg);
Copy link
Author

Choose a reason for hiding this comment

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

manifest.packages contains lots of packages which have the same id, the vc debug runtime packages are one example. To prevent overriding packages in the packages map the key needs to be slightly modified for those. I decided to simply append the count of duplicate packages to the key, this doesn't conflict with the current behavior and allows to grab all the packages.

@@ -454,6 +454,7 @@ pub(crate) fn minimize(
SectionKind::SdkLib => (&sdk_lib_prefix, &mut map.sdk.libs),
SectionKind::CrtHeader => (&crt_hdr_prefix, &mut map.crt.headers),
SectionKind::CrtLib => (&crt_lib_prefix, &mut map.crt.libs),
SectionKind::VcrDebug => (&roots.vcrd, &mut map.vcrd.libs),
Copy link
Author

Choose a reason for hiding this comment

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

I'm very uncertain how to handle this as the vcr shouldn't be part of the minimize logic at all. Is there a way to "skip" this ?

@superewald superewald changed the title feat: option to download vc debug dlls feat: option to download vc/ucrt debug binaries Dec 23, 2024
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.

1 participant