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

Apply two upstream CL to mkwinsyscall #278

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

helsaawy
Copy link
Contributor

Add two change lists that were added to golang.org/x/sys/windows/mkwinsyscall:

  1. support "." and "-" in DLL name
  2. write source to temp file if formatting fails

This change writes the unformatted Go source code to a temp file if
"format.Source" fails. Print the temp file path to the console to make
it easy to find. The source code is what causes formatting errors, and
it can be difficult to diagnose them without this context.

CL link: https://go-review.googlesource.com/c/sys/+/463216
commit: 4112509618ee88519f899be20efc6882496b57c8

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
This change adds "." and "-" support for DLL filenames in "//sys".

Supporting "." requires a change in how mkwinsyscall handles the
"= <filename>.<function>" syntax. Instead of assuming that only one "."
can appear in this string, now mkwinsyscall assumes that any additional
"." belongs to the filename.

Supporting "." also requires changing how Go identifiers are created for
each DLL. This change also allows mkwinsyscall to support "-". When
creating a Go identifier, "." and "-" in the DLL filename are replaced
with "_". Otherwise, mkwinsyscall would produce invalid Go code, causing
"format.Source" to fail.

CL link: https://go-review.googlesource.com/c/sys/+/463215
commit: 71da6904945ac440253cb5c132d64712f80ca497

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
@helsaawy helsaawy requested a review from a team as a code owner February 13, 2023 20:43
@helsaawy helsaawy merged commit 2a14e68 into microsoft:main Mar 3, 2023
@helsaawy helsaawy deleted the mkwin-update branch March 3, 2023 20:52
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.

2 participants