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

headers-git: error with winrt headers due to absence of fully qualified data types #21645

Closed
2 of 7 tasks
ReenigneArcher opened this issue Aug 13, 2024 · 11 comments · Fixed by #21649
Closed
2 of 7 tasks

Comments

@ReenigneArcher
Copy link
Contributor

Description / Steps to reproduce the issue

Since 2c84210 was merged, getting build failures. i.e. undeclared variables.

Same issue with the following commits, which I believe were an attempt to fix this:

References:

Expected behavior

Everything is properly defined.

Actual behavior

In file included from D:/a/_temp/msys64/ucrt64/include/windows.ui.composition.h:1380,
                 from D:/a/_temp/msys64/ucrt64/include/windows.graphics.capture.interop.h:41,
                 from D:/a/Sunshine/Sunshine/src/platform/windows/display_wgc.cpp:12:
D:/a/_temp/msys64/ucrt64/include/windows.ui.core.h:1605: error: field 'AdjustedPoint' has incomplete type 'ABI::Windows::UI::Core::Point'
 1605 |                     struct Point AdjustedPoint;
D:/a/_temp/msys64/ucrt64/include/windows.ui.core.h:1605: note: forward declaration of 'struct ABI::Windows::UI::Core::Point'
D:/a/_temp/msys64/ucrt64/include/windows.ui.core.h:2762: error: use of enum 'VirtualKey' without previous declaration
 2762 |                         enum VirtualKey key,
D:/a/_temp/msys64/ucrt64/include/windows.ui.core.h:2766: error: use of enum 'VirtualKey' without previous declaration
 2766 |                         enum VirtualKey key,
D:/a/_temp/msys64/ucrt64/include/windows.ui.core.h:4608: error: use of enum 'VirtualKey' without previous declaration
 4608 |                         enum VirtualKey *value) = 0;
D:/a/_temp/msys64/ucrt64/include/windows.ui.core.h:4879: error: use of enum 'VirtualKeyModifiers' without previous declaration
 4879 |                         enum VirtualKeyModifiers *value) = 0;
In file included from D:/a/_temp/msys64/ucrt64/include/windows.graphics.capture.interop.h:42:
D:/a/_temp/msys64/ucrt64/include/windows.graphics.capture.h:905: error: use of enum 'DirectXPixelFormat' without previous declaration
  905 |                         enum DirectXPixelFormat pixel_format,
D:/a/_temp/msys64/ucrt64/include/windows.graphics.capture.h:1103: error: use of enum 'DirectXPixelFormat' without previous declaration
 1103 |                         enum DirectXPixelFormat pixel_format,
D:/a/_temp/msys64/ucrt64/include/windows.graphics.capture.h:1239: error: use of enum 'DirectXPixelFormat' without previous declaration
 1239 |                         enum DirectXPixelFormat pixel_format,

Verification

Windows Version

Windows Server 2022 GitHub runner

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Are you willing to submit a PR?

No response

@Biswa96
Copy link
Member

Biswa96 commented Aug 13, 2024

The actual issue is in widl program which generates header file from IDLs. See this upstream report https://bugs.winehq.org/show_bug.cgi?id=55347. We can workaround the issue with couple of sed commands.

@ReenigneArcher
Copy link
Contributor Author

@Biswa96 thank you for that info. Let me know if you need me to test any artifacts or anything.

@Biswa96
Copy link
Member

Biswa96 commented Aug 14, 2024

I can not compile Sunshine from that PR.

In file included from Sunshine/src/platform/windows/display_base.cpp:15:
Sunshine/src/platform/windows/display.h:15:10: fatal error: 'winrt/Windows.Graphics.Capture.h' file not found
   15 | #include <winrt/Windows.Graphics.Capture.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@ReenigneArcher
Copy link
Contributor Author

Instructions for master branch are here: https://docs.lizardbyte.dev/projects/sunshine/en/master/md_docs_2building.html#windows-5

Note: that curl needs to be rolled back due to #21028 This is how we do that in CI: https://github.com/LizardByte/Sunshine/blob/299672795c5ef923e5a000d6e11f9421e3a43fb5/.github/workflows/CI.yml#L1011-L1030

Also note, it's not just that PR that's broken but all builds, so you can just use our master branch.

@Biswa96
Copy link
Member

Biswa96 commented Aug 14, 2024

Also note, it's not just that PR that's broken but all builds, so you can just use our master branch.

Please let us know if there is any further issue with msys2 ASAP.

BTW, it would be helpful if there is an cmake option in Sunshine to toggle building the web ui. npm is hard requirement but it is not required in this case.

@ReenigneArcher
Copy link
Contributor Author

Just tried but I think it's still downloading an old version. mingw-w64-ucrt-x86_64-headers-git-12.0.0.r235.g7a6c241e4-1-any downloading...

I will try again in a little while.

BTW, it would be helpful if there is an cmake option in Sunshine to toggle building the web ui. npm is hard requirement but it is not required in this case.

That probably never comes up because the web ui is required to run Sunshine. Only in dev does it get mentioned, but people just build specific targets, not disable it entirely. I can make make an option to disable it though.

@Biswa96
Copy link
Member

Biswa96 commented Aug 14, 2024

Just tried but I think it's still downloading an old version.

It's in the queue https://packages.msys2.org/queue

@Biswa96 Biswa96 changed the title headers-git package build failures headers-git: error with winrt headers due to absence of fully qualified data types Aug 14, 2024
@ReenigneArcher
Copy link
Contributor Author

@Biswa96 the build is improved, but still getting a couple of errors with the -2 package.

FAILED: CMakeFiles/sunshine.dir/src/platform/windows/display_wgc.cpp.obj 
D:\a\_temp\msys64\ucrt64\bin\c++.exe -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_NO_LIB -DBOOST_FILESYSTEM_NO_LIB -DBOOST_LOCALE_NO_LIB -DBOOST_LOG_NO_LIB -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_NO_LIB -DCURL_STATICLIB -DMINIUPNP_STATICLIB -DNDEBUG -DSUNSHINE_ASSETS_DIR=\"assets\" -DSUNSHINE_PLATFORM=\"windows\" -DSUNSHINE_TRAY=1 -DUSE_BOOST_REGEX -ID:/a/Sunshine/Sunshine/build -ID:/a/Sunshine/Sunshine -isystem D:/a/Sunshine/Sunshine/third-party/nvapi-open-source-sdk -isystem D:/a/Sunshine/Sunshine/third-party/ViGEmClient/include -isystem D:/a/Sunshine/Sunshine/third-party/nv-codec-headers/include -isystem D:/a/Sunshine/Sunshine/third-party -isystem D:/a/Sunshine/Sunshine/third-party/moonlight-common-c/enet/include -isystem D:/a/Sunshine/Sunshine/third-party/nanors -isystem D:/a/Sunshine/Sunshine/third-party/nanors/deps/obl -isystem D:/a/Sunshine/Sunshine/third-party/build-deps/ffmpeg/Windows-AMD64/include -O2 -g -DNDEBUG -std=gnu++20 -Wall -Wno-sign-compare -Wno-maybe-uninitialized -Werr
In file included from D:/a/_temp/msys64/ucrt64/include/windows.graphics.capture.interop.h:41,
                 from D:/a/Sunshine/Sunshine/src/platform/windows/display_wgc.cpp:12:
D:/a/_temp/msys64/ucrt64/include/windows.ui.composition.h:4922: error: use of enum 'DirectXPixelFormat' without previous declaration
 4922 |                         enum DirectXPixelFormat *value) = 0;
D:/a/_temp/msys64/ucrt64/include/windows.ui.composition.h:5707: error: use of enum 'DirectXPixelFormat' without previous declaration
 5707 |                         enum DirectXPixelFormat format,

@Biswa96
Copy link
Member

Biswa96 commented Aug 15, 2024

d8d00b2 should fix it.

@ReenigneArcher
Copy link
Contributor Author

Confirming this is resolved. Thank you!

@Biswa96
Copy link
Member

Biswa96 commented Sep 20, 2024

The issue has been fixed in upstream wine project https://gitlab.winehq.org/wine/wine/-/merge_requests/6496. It'll take some time to reach this project via mingw-w64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants