Skip to content

x/sys/windows: mkwinsyscall isn't diagnosable if format.Source fails #57925

@dagood

Description

@dagood

I'm working on the x/sys/windows main branch (6e4d1c53), and tried to add a new syscall, but mkwinsyscall failed because of a Go syntax error in the generated code:

44:8: expected ';', found '-' (and 10 more errors)

However, there is no file with a line 44, so I can't see what it's referring to, or the additional errors. format.Source(buf.Bytes()) fails, and the generated source is only in memory at that point, so it is lost.

Expected result

When mkwinsyscall hits a formatting error, it should write the pre-formatted source to a temporary file so the error can be diagnosed.

Background

The error I hit in this case was a - in the DLL name, and fixing that is tracked over here:

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.OS-Windowscompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions