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
runtime: avoid functions forbidden on Windows 10 UWP #21805
Comments
What are the replacement functions that provide this functionality on Windows 10 UWP?
I don't think Go is supported on Windows 10 UWP platform. What is that you are building for Windows 10 UWP? Alex |
Hello @alexbrainman ,
I believe, some functions doesn't have replacement, since UWP doesn't support console output and maybe some others limitations also. Possibly good reading why Go should support UWP platform can be the announcement of UWP support for Qt(C++) framework with some explanations why it was done: Basically, UWP apps can be placed in Windows 10 Store and distributed to any kind of device with Windows 10 ( package should has multiple builds for x86, x64 and arm platforms, but only x64 can be supported too ).
On Windows it's possible to build static library with CGO using MSYS2/MinGW-w64 toolchain and link static library to MinGW DLL to be P/Invoked from UWP application. Ideally, CGO should support msvc compiler toolchain to eliminate some difficulties to support UWP platform, but because MinGW already is supported and it's possible to bring MinGW DLL with exported C-functions to UWP, it might be not so much additional work to support UWP platform. I'm trying to consume the go module to Windows 10 UWP platform, which is already used cross-platform for iOS and Android. The main benefit of UWP platform is that UWP port of react-native library already exists + Windows 10 Store publishing will be available for final application. Thanks |
|
@Maxris thank you for explaining. Unfortunately I have no plan to work on this. So, if you are interested, you have to do it yourself. I am happy to answer any questions you have along the way. Alex |
@alexbrainman thank you! I've started looking into this, so definitely will have some questions soon... |
Hello @alexbrainman , |
I assume you mean a new If you intend your work to be added back to the main Go distribution, please discuss it on the golang-dev mailing list. If this really needs a new |
@Maxris what Ian said. It is a big job. Alex PS: See related (but, probably, not relevant today) https://groups.google.com/d/topic/golang-dev/ZfmKRl5V6kw/discussion |
Thank you @ianlancetaylor @alexbrainman ! |
Just to be clear, it can not be a new But I would hope that it can be done without changing either |
Okay, @ianlancetaylor thanks! |
Just wanted to say that I am also interested in building UWP apps in Go. @Maxris have you been able to get something running yes? |
@tfriedel6 , not yet, but still planning to work on this. Sample project might be used as starting point to bring dll built with MinGW to UWP platform. As suggested above, some discussion should be started. |
Can anyone tell me the status of this ? About a week ago Microsoft finally stabilised their winrt c/c++ runtime so that you don't need to use their weird cx API. So does this mean a new golang GIOS is not needed and I can use golang on Windows 10 and call the winrt runtime now ? |
@rsc could you comment on this please ? It's really important that golang is not locked out of Windows 10 desktops for me. Especially the new appx and windows store |
This 2019 post says the venerable win32 API is now has "full support" in their windows store: https://news.xbox.com/en-us/2019/05/30/microsoft-approach-to-pc-gaming Look for "Supporting Win32 Games on Windows 10". Is this issue still relevant? |
What version of Go are you using (
go version
)?go version go1.9 windows/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Created static library with func defined in Go and exported to be used in C++
Command line:
go build -buildmode=c-archive puregodll.go
Linked
puregodll.a
static library generated on previous step into the shared MinGW dll library.Command line:
It produces
goDLL.dll
as result.Running script to adjust binary PE header of produced
goDLL.dll
to be compatible with Windows 10 UWP platform (it expectsappcontainer
bit set in PE header)Created Windows 10 UWP project with latest Visual Studio 2017 and P/Invoke
goDLL.dll
to call func initially defined inpuregodll.go
Run Windows Store Certification Kit for
Supported APIs Test
on generated Windows Store appx bundle and getting list of forbidden API calls, it seems, used in go-runtime:What did you expect to see?
I expect to have a way for go runtime to not use API calls which are forbidden on Windows 10 UWP platform
The text was updated successfully, but these errors were encountered: