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

Fix compilation of test_arch on arm64 #2978

Closed
wants to merge 1 commit into from
Closed

Fix compilation of test_arch on arm64 #2978

wants to merge 1 commit into from

Conversation

jeremyd2019
Copy link
Contributor

@jeremyd2019 jeremyd2019 commented Apr 8, 2024

KNONVOLATILE_CONTEXT_POINTERS is not defined on arm64, it is called KNONVOLATILE_CONTEXT_POINTERS_ARM64 there instead. Add a test covering that on ARM64 too.

@jeremyd2019
Copy link
Contributor Author

jeremyd2019 commented Apr 8, 2024

I found this while attempting to test all the -gnullvm arches, but it should also have failed to build for aarch64-pc-windows-msvc.

@riverar
Copy link
Collaborator

riverar commented Apr 8, 2024

There was no arm64 test, so this is less of a fix and more of an addition right?

@jeremyd2019
Copy link
Contributor Author

well, before cargo test -p test_arch would fail to build on arm64, due to:

error[E0432]: unresolved import `windows_sys::Win32::System::Diagnostics::Debug::KNONVOLATILE_CONTEXT_POINTERS`
    --> crates\tests\arch\tests\sys.rs:1:5
     |
1    | use windows_sys::Win32::System::Diagnostics::Debug::KNONVOLATILE_CONTEXT_POINTE...
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------
     |     |                                               |
     |     |                                               help: a similar name exists in the module: `KNONVOLATILE_CONTEXT_POINTERS_ARM64`
     |     no `KNONVOLATILE_CONTEXT_POINTERS` in `Win32::System::Diagnostics::Debug`
     |
note: found an item that was configured out
    --> C:\windows-rs\crates\libs\sys\src\Windows\Win32\System\Diagnostics\Debug\mod.rs:4145:12
     |
4145 | pub struct KNONVOLATILE_CONTEXT_POINTERS {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
    --> C:\windows-rs\crates\libs\sys\src\Windows\Win32\System\Diagnostics\Debug\mod.rs:4243:12
     |
4243 | pub struct KNONVOLATILE_CONTEXT_POINTERS {
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = note: the item is gated behind the `x86` feature

error[E0432]: unresolved import `windows::Win32::System::Diagnostics::Debug::KNONVOLATILE_CONTEXT_POINTERS`
     --> crates\tests\arch\tests\win.rs:1:5
      |
1     | use windows::Win32::System::Diagnostics::Debug::KNONVOLATILE_CONTEXT_POINTE...
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------
      |     |                                           |
      |     |                                           help: a similar name exists in the module: `KNONVOLATILE_CONTEXT_POINTERS_ARM64`
      |     no `KNONVOLATILE_CONTEXT_POINTERS` in `Win32::System::Diagnostics::Debug`
      |
note: found an item that was configured out
     --> C:\windows-rs\crates\libs\windows\src\Windows\Win32\System\Diagnostics\Debug\mod.rs:9877:12
      |
9877  | pub struct KNONVOLATILE_CONTEXT_POINTERS {
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
     --> C:\windows-rs\crates\libs\windows\src\Windows\Win32\System\Diagnostics\Debug\mod.rs:10070:12
      |
10070 | pub struct KNONVOLATILE_CONTEXT_POINTERS {
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      = note: the item is gated behind the `x86` feature

For more information about this error, try `rustc --explain E0432`.
error: could not compile `test_arch` (test "sys") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `test_arch` (test "win") due to 1 previous error

@jeremyd2019 jeremyd2019 changed the title Fix test_arch on arm64 Fix compilation of test_arch on arm64 Apr 8, 2024
KNONVOLATILE_CONTEXT_POINTERS is not defined on arm64, it is called
KNONVOLATILE_CONTEXT_POINTERS_ARM64 there instead.  Add a test covering
that on ARM64 too.
@jeremyd2019
Copy link
Contributor Author

jeremyd2019 commented Apr 8, 2024

on aarch64-pc-windows-gnullvm, the following tests fail to build:

  • sample_component_json_validator_winrt
  • sample_component_json_validator_winrt_client
  • test_arch
  • test_component
  • test_component_client
  • tool_msvc

test_arch works after applying this PR, the others appear to fail simply because MSVC and/or Windows SDK are not installed on my arm64 machine. Everything else tested in test.yml succeeds.

@kennykerr
Copy link
Collaborator

I was able to get aarch64-pc-windows-msvc to build everything with your changes. What you're missing is then just the MSVC/SDK build environment as the rest of those failures you're hitting are related to not having things like midlrt, lib, and cl in the path.

@kennykerr
Copy link
Collaborator

Closing this in favor of #3000 where I've been able to get basic Arm64 compilation coverage working.

@kennykerr kennykerr closed this Apr 17, 2024
@jeremyd2019 jeremyd2019 deleted the fix_test_arch_arm64 branch April 17, 2024 17:14
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