Skip to content

[8.2.0] Always run Turbine native image with a UTF-8 code page on Windows #6

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

Open
wants to merge 1 commit into
base: release-8.2.0
Choose a base branch
from

Conversation

arvi18
Copy link

@arvi18 arvi18 commented Apr 15, 2025

We are building Turbine native images with a UTF-8 code page and need to match the runtime code page for UTF-8 paths to be handled properly. This change splits the existing tool for patching the app manifest of the embedded JDK into separate tools for reading and writing app manifests. The write tool is then used to add a manifest to the turbine binary.

Closes bazelbuild#25444.

PiperOrigin-RevId: 735457536
Change-Id: Id6395435cc350772e1225ecb80fa32a74f6ae0e3

Commit bazelbuild@0ede723

We are building Turbine native images with a UTF-8 code page and need to match the runtime code page for UTF-8 paths to be handled properly. This change splits the existing tool for patching the app manifest of the embedded JDK into separate tools for reading and writing app manifests. The write tool is then used to add a manifest to the turbine binary.

Closes bazelbuild#25444.

PiperOrigin-RevId: 735457536
Change-Id: Id6395435cc350772e1225ecb80fa32a74f6ae0e3
@arvi18
Copy link
Author

arvi18 commented Apr 15, 2025

@hvadehra Could you please take a look at the presubmit errors? Thanks!

@arvi18
Copy link
Author

arvi18 commented Apr 15, 2025

@fmeum

@visz11
Copy link
Collaborator

visz11 commented Jul 20, 2025

/refacto-test

Copy link

refacto-test bot commented Jul 20, 2025

Refacto is reviewing this PR. Please wait for the review comments to be posted.

return 1;
}
DWORD manifest_len = SizeofResource(exe, manifest_resource);

Copy link

Choose a reason for hiding this comment

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

Resource Management: The code doesn't check return values for UnlockResource and FreeResource calls, which could lead to resource leaks in error conditions. While these Windows API functions typically don't fail when properly initialized, it's best practice to add error handling:

// Add error checking for resource release
if (!UnlockResource(manifest_handle)) {
  fwprintf(stderr, L"Warning: Failed to unlock resource: %d\n", GetLastError());
}
if (!FreeResource(manifest_handle)) {
  fwprintf(stderr, L"Warning: Failed to free resource: %d\n", GetLastError());
}

@visz11
Copy link
Collaborator

visz11 commented Aug 9, 2025

/refacto-test

Copy link

refacto-test bot commented Aug 9, 2025

Refacto is reviewing this PR. Please wait for the review comments to be posted.

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.

3 participants