winapi-rs icon indicating copy to clipboard operation
winapi-rs copied to clipboard

Allow arm64ec

Open ahqsoftwares opened this issue 11 months ago • 5 comments

error[E0432]: unresolved import `um::winnt::PCONTEXT`
  --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b5[57](https://github.com/leadlang/lead/actions/runs/12964307737/job/36162865000#step:11:58)f\winapi-0.3.9\src\um\minwinbase.rs:21:52
   |
21 |     CHAR, EXCEPTION_RECORD, HANDLE, LPSTR, LPWSTR, PCONTEXT, PRTL_CRITICAL_SECTION,
   |                                                    ^^^^^^^^ no `PCONTEXT` in `um::winnt`

error[E0432]: unresolved import `um::winnt::CONTEXT`
  --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\processthreadsapi.rs:15:5
   |
15 |     CONTEXT, HANDLE, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PAPCFUNC, PHANDLE, PPROCESSOR_NUMBER,
   |     ^^^^^^^ no `CONTEXT` in `um::winnt`

error[E0432]: unresolved import `um::winnt::PCONTEXT`
  --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winbase.rs:35:[59](https://github.com/leadlang/lead/actions/runs/12964307737/job/36162865000#step:11:60)
   |
35 |     LPOSVERSIONINFOEXW, LPSTR, LPWSTR, MAXLONG, PBOOLEAN, PCONTEXT, PCWSTR, PFIRMWARE_TYPE,
   |                                                           ^^^^^^^^ no `PCONTEXT` in `um::winnt`

error[E0412]: cannot find type `CONTEXT` in this scope
   --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:205:25
    |
205 |     ContextRecord: *mut CONTEXT,
    |                         ^^^^^^^ not found in this scope

error[E0412]: cannot find type `PCONTEXT` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:16[60](https://github.com/leadlang/lead/actions/runs/12964307737/job/36162865000#step:11:61):20
     |
1660 |     ContextRecord: PCONTEXT,
     |                    ^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PCONTEXT` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:7194:24
     |
7194 |         ContextRecord: PCONTEXT,
     |                        ^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PRUNTIME_FUNCTION` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:7206:24
     |
7206 |         FunctionTable: PRUNTIME_FUNCTION,
     |                        ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PRUNTIME_FUNCTION` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:[72](https://github.com/leadlang/lead/actions/runs/12964307737/job/36162865000#step:11:73)11:24
     |
7211 |         FunctionTable: PRUNTIME_FUNCTION,
     |                        ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PGET_RUNTIME_FUNCTION_CALLBACK` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:7217:19
     |
7217 |         Callback: PGET_RUNTIME_FUNCTION_CALLBACK,
     |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PRUNTIME_FUNCTION` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:7223:24
     |
7223 |         FunctionTable: PRUNTIME_FUNCTION,
     |                        ^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PUNWIND_HISTORY_TABLE` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:7239:23
     |
7239 |         HistoryTable: PUNWIND_HISTORY_TABLE,
     |                       ^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `PRUNTIME_FUNCTION` in this scope
    --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winapi-0.3.9\src\um\winnt.rs:7240:10
     |
7240 |     ) -> PRUNTIME_FUNCTION;
     |          ^^^^^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0412, E0432.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `winapi` (lib) due to 12 previous errors
warning: build failed, waiting for other jobs to finish...

thread 'main' panicked at src\main.rs:[75](https://github.com/leadlang/lead/actions/runs/12964307737/job/36162865000#step:11:76):7:
Failed to build
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\release\pack.exe` (exit code: 101)

ahqsoftwares avatar Jan 25 '25 11:01 ahqsoftwares

What exactly is the arm64ec architecture? Is it identical to one of the existing architectures or does it have differences? The headers have some architecture specific definitions, and it's not a simple case of "allowing" a new architecture, as the appropriate architecture specific definitions have to be added for each architecture for every type that requires them.

retep998 avatar Jan 25 '25 13:01 retep998

What exactly is the arm64ec architecture? Is it identical to one of the existing architectures or does it have differences? The headers have some architecture specific definitions, and it's not a simple case of "allowing" a new architecture, as the appropriate architecture specific definitions have to be added for each architecture for every type that requires them.

Actually, its a blend of arm64 and x86_64. Its more in the aarch64 part that allows loading x86_64. Quite sure its the same as arm64X

ahqsoftwares avatar Jan 25 '25 13:01 ahqsoftwares

This is what I've understood by now from this article https://learn.microsoft.com/en-us/windows/arm/arm64ec

More like an x86_64 binary that is arm64 ?

Its not at all arm64 though

ahqsoftwares avatar Jan 25 '25 13:01 ahqsoftwares

So it's using arm64 instructions and registers, but still following the x64 ABI for calling conventions and such for compatibility within the same process... very weird.

retep998 avatar Jan 25 '25 23:01 retep998

So it's using arm64 instructions and registers, but still following the x64 ABI for calling conventions and such for compatibility within the same process... very weird.

Yeah, it's so weird that I cannot even build arm64ec cdylib from GH actions. Turns out Microsoft themselves are figuring out how to build arm64ec cdylib in github actions

You could add it as a lower priority

ahqsoftwares avatar Jan 26 '25 03:01 ahqsoftwares