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

Add targets in Windows OneCore target for making building libraries for Windows Store apps easier. #8917

Closed
wants to merge 9 commits into from

Conversation

MouriNaruto
Copy link
Contributor

@MouriNaruto MouriNaruto commented May 11, 2019

It is based on the effort of #7729.

I have merged the changes mentioned by #7729 (comment) and adapt them to the new codebase because of #8622.

New targets which I have added

  • VC-WIN32-UWP
  • VC-WIN64A-UWP
  • VC-WIN32-ARM-UWP
  • VC-WIN64-ARM-UWP

Usage example

perl Configure VC-WIN64A-UWP no-asm no-uplink
nmake build_libs

File list in the build folder

E:\Projects\openssl\build>dir
 Volume in drive E is Workspace
 Volume Serial Number is 488C-764C

 Directory of E:\Projects\openssl\build

2019/05/12  05:05    <DIR>          .
2019/05/12  05:05    <DIR>          ..
2019/05/12  05:05    <DIR>          apps
2019/05/12  04:57           610,074 configdata.pm
2019/05/12  05:03    <DIR>          crypto
2019/05/12  04:57    <DIR>          doc
2019/05/12  04:57    <DIR>          engines
2019/05/12  05:05    <DIR>          fuzz
2019/05/12  04:57    <DIR>          include
2019/05/12  05:01         3,001,856 libcrypto-3.dll
2019/05/12  05:01         9,302,736 libcrypto-3.ilk
2019/05/12  05:01         9,973,760 libcrypto-3.pdb
2019/05/12  05:01               932 libcrypto-shlib-libcrypto.res
2019/05/12  05:01           111,773 libcrypto.def
2019/05/12  05:01           598,444 libcrypto.exp
2019/05/12  05:01         1,004,258 libcrypto.lib
2019/05/12  05:01             1,186 libcrypto.rc
2019/05/12  05:04        17,444,478 libcrypto_static.lib
2019/05/12  05:05           677,376 libssl-3.dll
2019/05/12  05:05         3,223,792 libssl-3.ilk
2019/05/12  05:05         2,355,200 libssl-3.pdb
2019/05/12  05:04               924 libssl-shlib-libssl.res
2019/05/12  05:05            14,119 libssl.def
2019/05/12  05:05            72,033 libssl.exp
2019/05/12  05:05           119,622 libssl.lib
2019/05/12  05:04             1,180 libssl.rc
2019/05/12  05:05         3,529,178 libssl_static.lib
2019/05/12  04:57         1,430,429 makefile
2019/05/12  05:05         1,093,632 ossl_static.pdb
2019/05/12  04:57    <DIR>          providers
2019/05/12  05:05    <DIR>          ssl
2019/05/12  05:05    <DIR>          test
2019/05/12  04:57    <DIR>          tools
2019/05/12  04:57    <DIR>          util
              21 File(s)     54,566,982 bytes
              13 Dir(s)  25,465,364,480 bytes free

Kenji Mouri

… libraries for Windows Store apps.)

CLA: trivial
Configure Outdated Show resolved Hide resolved
@levitte
Copy link
Member

levitte commented May 12, 2019

I'm much more positive than I was in #7729, for various reasons... I've learned some along the way, and the idea of this change has grown on me. I'm sorry for having tested your patience in the process.

@levitte
Copy link
Member

levitte commented May 12, 2019

Side thing: I wonder if Appveyor has what's needed to support UWP. We might want to consider adding a build that tries that. I would say that's for another PR, though.

@levitte levitte self-assigned this May 12, 2019
@MouriNaruto
Copy link
Contributor Author

Side thing: I wonder if Appveyor has what's needed to support UWP. We might want to consider adding a build that tries that. I would say that's for another PR, though.

My UWP app project uses AppVeyor. It uses Visual Studio 2017 or 2019 image.

When I build FFmpeg lib for UWP, I have written these code and hope it helps you.

@setlocal EnableDelayedExpansion
@echo off

set VisualStudioInstallerFolder="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
if %PROCESSOR_ARCHITECTURE%==x86 set VisualStudioInstallerFolder="%ProgramFiles%\Microsoft Visual Studio\Installer"

pushd %VisualStudioInstallerFolder%
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
  set VisualStudioInstallDir=%%i
)
popd

if %1==x86 set VisualStudioToolKitType=x86
if %1==x64 set VisualStudioToolKitType=x86_amd64
if %1==ARM set VisualStudioToolKitType=x86_arm
if %1==ARM64  set VisualStudioToolKitType=x86_arm64

call "%VisualStudioInstallDir%\VC\Auxiliary\Build\vcvarsall.bat" %VisualStudioToolKitType% uwp

Kenji Mouri

@levitte
Copy link
Member

levitte commented May 12, 2019

I like what I see. However, I'd like to do a verification build, and I can't for about a week, so I hope you don't mind 'til then for a final approval from me.

Of course, this doesn't stop anyone else from @openssl to look and review...

@MouriNaruto
Copy link
Contributor Author

I like what I see. However, I'd like to do a verification build, and I can't for about a week, so I hope you don't mind 'til then for a final approval from me.
Of course, this doesn't stop anyone else from @openssl to look and review...

Got it. I am looking forward to hearing from you.

Kenji Mouri

@illera88
Copy link

@levitte any update on this?

Thanks

@MouriNaruto
Copy link
Contributor Author

Any news? @levitte

@levitte
Copy link
Member

levitte commented Jun 1, 2019

Thanks for the reminder.

Incidently, I stumbled on this earlier this morning, and am trying to decide if that makes this effort futile or not. Any comments on that?

@MouriNaruto
Copy link
Contributor Author

MouriNaruto commented Jun 1, 2019

@levitte
I don't think this PR is useless. It can also help developers even the UWP app dead.

Everyone knows, Microsoft provide a way to use Windows Runtime XAML called XAML Island. It may be the future of the Windows application development.
We also know, there are some apps uses or will use XAML Island. For example, the Windows Terminal app which is open source from Microsoft.

If you read the source code of the Windows Terminal app, you will know it has two parts: Win32 app (in the form of exe) and UWP app (in the form of dll but renamed by exe). Win32 exe uses XAML Island to load the UWP dll.

In general, if we want to develop a app which uses Windows Runtime XAML today. We still need to create an UWP app project. (Because there is no XAML designer for non UWP C++ projects today. If we don't create an UWP app project, you will get an experience when you use WPF with the C++/CLI. It's more troublesome than writing a Win32 GUI app.)

If I want to use the Windows Runtime XAML with the XAML Island for developing an app with modern app experience (touch and pen device), I need to write two parts. If I can use the OpenSSL in the uwp part smoothly and integrate with Windows Runtime sockets easily, I won't choose the XAML Island.

I'm sure that when more developers touch the XAML Island, they'll agree with me.

So Microsoft has been forcing developers to touch the UWP app development. (In Linus way: "F**k you, Microsoft.")

I am not good at English but I hope you can know my meaning.

Thanks.

Kenji Mouri.

@MouriNaruto
Copy link
Contributor Author

MouriNaruto commented Jun 1, 2019

@jdm
Copy link

jdm commented Jun 1, 2019

UWP is still important for upcoming platforms like the HoloLens 2, where it is a hard requirement.

@illera88
Copy link

illera88 commented Jun 2, 2019

@levitte it's taking more time just to have this debate than what it would take you to review the changes and run those tests you mentioned 20 days ago...

Can you please do it and we can the rest of us use it for other projects?

There are a lot of projects that are waiting on this.

Thanks

@levitte
Copy link
Member

levitte commented Jun 3, 2019

There's a non-technical problem with this PR. It's been marked as "trivial", and while I understand that it's technically a fairly trivial thing, the "trivial" marker isn't about how easy or hard the work was, but about copyright, and what can pass as non-copyrightable. I very much doubt that this work can be seen as such.

@openssl/omc, second opinion, please?

@levitte
Copy link
Member

levitte commented Jun 3, 2019

The solution to the triviality problem is, of course, to submit a signed CLA

@illera88
Copy link

illera88 commented Jun 3, 2019 via email

@levitte
Copy link
Member

levitte commented Jun 3, 2019

This is the first time that you bring this problem up.

I hadn't noticed that detail before, sorry.

Either is trivial or not, please say so and it will be treated as necessary.

This is a matter that I do not want to decide alone, so I'm asking for the help from my OMC colleagues.
However, a CLA is the ultimate solution regardless of that judgement (i.e. a signed CLA trumps any triviality marker), and it's up to @MouriNaruto to decide to submit one or not, not us.

@t-j-h
Copy link
Member

t-j-h commented Jun 3, 2019

It is a straight forward change - but @levitte is correct - this is non-trivial - so it needs a CLA in place.

@levitte
Copy link
Member

levitte commented Jun 3, 2019

I would suggest writing something in NOTES.WIN regarding the conditions for building for UWP, and most specifically that no-asm and no-uplink must be given.

@MouriNaruto
Copy link
Contributor Author

@levitte @t-j-h
I have submitted a signed Corporate Contributor License Agreement (CCLA) to legal@opensslfoundation.org.

It's my first time to contribute source code to a famous project like this.

I don't care the copyright and hope it is merged ASAP because I wonder to help more people which have the same experience. So I added the "trivial" marker because I want to pass the CLA check.

But I still signed a CLA because I hope it will be easier for me to contribute to the repository of this project in the future.

I am very happy to hear that.

Thank you.

Kenji Mouri

@mattcaswell
Copy link
Member

mattcaswell commented Jun 3, 2019

CLA has been received.

@MouriNaruto
Copy link
Contributor Author

I would suggest writing something in NOTES.WIN regarding the conditions for building for UWP, and most specifically that no-asm and no-uplink must be given.

I have added some special notes. @levitte

Thank you.

Kenji Mouri

@illera88
Copy link

illera88 commented Jun 6, 2019

Thanks @MouriNaruto !

@levitte can you merge it now?

@MouriNaruto
Copy link
Contributor Author

MouriNaruto commented Jun 7, 2019

@levitte I have updated the source code and need your help.

#8917 (comment)

Thank you.

NOTES.WIN Show resolved Hide resolved
Configurations/50-win-onecore.conf Outdated Show resolved Hide resolved
@levitte levitte added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Jun 7, 2019
@HLXEasy
Copy link

HLXEasy commented Jun 9, 2019

Interesting discussion here. Next steps?

@illera88
Copy link

I think it's ready to be merged. @levitte or @mattcaswell can you please merge?

@mattcaswell
Copy link
Member

I squashed these commits and made a trivial edit to remove some trailing whitespace. I also removed the "CLA: trivial" line from the commit message (sine we decided it wasn't trivial and a CLA was later submitted).

Pushed to master. Thanks all!

levitte pushed a commit that referenced this pull request Jun 10, 2019
… libraries for Windows Store apps.)

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #8917)
@MouriNaruto
Copy link
Contributor Author

Thanks all! I am very excited about that.

Kenji Mouri

@MouriNaruto
Copy link
Contributor Author

@levitte @mattcaswell Here is the next talk about the UWP support. (#9125)

fcharlie added a commit to fcharlie/vcpkg that referenced this pull request Sep 12, 2019
jdm pushed a commit to servo/openssl that referenced this pull request Sep 18, 2019
… libraries for Windows Store apps.)

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from openssl#8917)
Paxxi pushed a commit to Paxxi/openssl that referenced this pull request Dec 20, 2019
… libraries for Windows Store apps.)

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from openssl#8917)
vicroms added a commit to microsoft/vcpkg that referenced this pull request Jan 13, 2020
)

* [ports] Update openssl-unix to 1.1.1c

* [ports] Update openssl-unix to 1.1.1d

* [ports] openssl-unix platform 'AMD64' is called 'x86_64' on Linux

* [ports] fix openssl platform

* [ports] openssl-windows update openssl to 1.1.1d

* [ports] Fix openssl post build

* [ports] openssl add EnableUWPSupport.patch

Reference:
openssl/openssl#8917
openssl/openssl#9440

* [ports] openssl-uwp update openssl to 1.1.1d

* Updated support for OpenSSL v1.1

With OpenSSL v1.1 we need an additional flag for ACE

* update to 12.0 and change to vcpkg_configure_make

* remove msys line

* remove custom cmakelists

* use --without-readline on linux

* Update CONTROL

Fix version

* fix portfile

* add all possible libpq features

* create vcpkg_get_build_depends

* create vcpkg_read_dependent_port_info

* add vcpkg_write_port_info

* fix a few bugs

* libpq first succesful x86 build with core features.
(files still must be moved)

* always write the variable

* Fix separate make and install execution error issue.

* trigger CI system.

* add openssl and win_bison win_flex patch

* add configuration dependent patches

* add bonjour as a dependency on macosx

* apply patches and configure features

* more patches to fix the windows build

* more install fixes

* remove unnecessary code

* bit of code cleanup

* remove unrelated files

* remove unrelated function call. function was removed with last commit

* removed hardcoded platform

* fix patch

* build only the interface libraries and nothing more

* forgot to remove tool ecpg from install

* seperate minimal install patch from normal install patch and introduce client feature

* fix x86 Platform variable being x86 and not Win32 as required by the generated project

* make linux build work

* make more linux work

* openssl return version number directly without calling openssl
(should probably be done differently)

* fix some more path and platform identification

* comments to reduce install. currently libpq installs static and shared libraries and some tools on linux

* patch arm

* fix platform detection logic

* make libpq osx buildable

* Rename debug import library after build.
(So that we don't affect external CMake users.)

* revert debug naming and install a wrapper instead.

* fix gdal regression due to name change

* fix cutelyst regression due to qt5-base wrapper
(why was it not using the target in the first place?)

* correct wrapper install path

* correct the arm patch.

* trying to fix static gdal build

* gdal still needs more work

* update version of openssl in libpq openssl patch

* nmap fix openssl

* qt5 fix openssl

* gdal fix openssl

* librtmp migrate to openssl 1.1.1

* fail in patch since what is intended is not going to work in openssl 1.1.1

* fix static yara build

* freedtds deactivate openssl feature until freetds decides to upgrade to 1.1

* fix libwebsockets cmakelists

* fix the patch so that the generated targets also include crypt32

* xmlsec add threads dependency

* bump control since I am unable to reproduce the regression

* add pthread to openssl detection logic

* fix freetds linkage missing crypt32 and fix the cmake checks.

* fix the openssl wrapper to add the threads library

* fix libmysql regression

* add threads to openssl libraries.

* upgrade libssh to 0.9

* fix nmap regression

* fix mosquitto regression

* fix openssl wrapper to make libarchive work

* fix quickfix

* changed patch a bit

* improve freetds patch

* fix case in librtmp

* update control

* bump control

* fix case

* make jasper a dependency of qt5-imageformats to fix flaky CI build.

* add jasper libraries explicitly

* jasper depends on freeglut so add it as a dependency. turbo_jpeg is also a dependency but that should already be handled in qt5-base

* more glut names

* bump control for macosx ci retry

* fix slikenet regression

* fix linebreak in qt5-base

* update baseline

* Update ci.baseline.txt

those ports are not supported on UWP

* [libevent] add dependency on libevent[threads] to openssl feature

* [pdal,freerdp] Update CI baseline to fail

* fix static pdal build

* fix freerdp on linux

* trying to revert some changes

* revert changes in build make

* revert x264 version bump

Co-authored-by: Force Charlie <6904176+fcharlie@users.noreply.github.com>
Co-authored-by: Johnny Willemsen <jwillemsen@remedy.nl>
Co-authored-by: Lennart Trunk <lennart.trunk@outlook.de>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: Victor Romero <romerosanchezv@gmail.com>
KOConchobhair pushed a commit to KOConchobhair/vcpkg-registry that referenced this pull request Jun 27, 2023
…566)

* [ports] Update openssl-unix to 1.1.1c

* [ports] Update openssl-unix to 1.1.1d

* [ports] openssl-unix platform 'AMD64' is called 'x86_64' on Linux

* [ports] fix openssl platform

* [ports] openssl-windows update openssl to 1.1.1d

* [ports] Fix openssl post build

* [ports] openssl add EnableUWPSupport.patch

Reference:
openssl/openssl#8917
openssl/openssl#9440

* [ports] openssl-uwp update openssl to 1.1.1d

* Updated support for OpenSSL v1.1

With OpenSSL v1.1 we need an additional flag for ACE

* update to 12.0 and change to vcpkg_configure_make

* remove msys line

* remove custom cmakelists

* use --without-readline on linux

* Update CONTROL

Fix version

* fix portfile

* add all possible libpq features

* create vcpkg_get_build_depends

* create vcpkg_read_dependent_port_info

* add vcpkg_write_port_info

* fix a few bugs

* libpq first succesful x86 build with core features.
(files still must be moved)

* always write the variable

* Fix separate make and install execution error issue.

* trigger CI system.

* add openssl and win_bison win_flex patch

* add configuration dependent patches

* add bonjour as a dependency on macosx

* apply patches and configure features

* more patches to fix the windows build

* more install fixes

* remove unnecessary code

* bit of code cleanup

* remove unrelated files

* remove unrelated function call. function was removed with last commit

* removed hardcoded platform

* fix patch

* build only the interface libraries and nothing more

* forgot to remove tool ecpg from install

* seperate minimal install patch from normal install patch and introduce client feature

* fix x86 Platform variable being x86 and not Win32 as required by the generated project

* make linux build work

* make more linux work

* openssl return version number directly without calling openssl
(should probably be done differently)

* fix some more path and platform identification

* comments to reduce install. currently libpq installs static and shared libraries and some tools on linux

* patch arm

* fix platform detection logic

* make libpq osx buildable

* Rename debug import library after build.
(So that we don't affect external CMake users.)

* revert debug naming and install a wrapper instead.

* fix gdal regression due to name change

* fix cutelyst regression due to qt5-base wrapper
(why was it not using the target in the first place?)

* correct wrapper install path

* correct the arm patch.

* trying to fix static gdal build

* gdal still needs more work

* update version of openssl in libpq openssl patch

* nmap fix openssl

* qt5 fix openssl

* gdal fix openssl

* librtmp migrate to openssl 1.1.1

* fail in patch since what is intended is not going to work in openssl 1.1.1

* fix static yara build

* freedtds deactivate openssl feature until freetds decides to upgrade to 1.1

* fix libwebsockets cmakelists

* fix the patch so that the generated targets also include crypt32

* xmlsec add threads dependency

* bump control since I am unable to reproduce the regression

* add pthread to openssl detection logic

* fix freetds linkage missing crypt32 and fix the cmake checks.

* fix the openssl wrapper to add the threads library

* fix libmysql regression

* add threads to openssl libraries.

* upgrade libssh to 0.9

* fix nmap regression

* fix mosquitto regression

* fix openssl wrapper to make libarchive work

* fix quickfix

* changed patch a bit

* improve freetds patch

* fix case in librtmp

* update control

* bump control

* fix case

* make jasper a dependency of qt5-imageformats to fix flaky CI build.

* add jasper libraries explicitly

* jasper depends on freeglut so add it as a dependency. turbo_jpeg is also a dependency but that should already be handled in qt5-base

* more glut names

* bump control for macosx ci retry

* fix slikenet regression

* fix linebreak in qt5-base

* update baseline

* Update ci.baseline.txt

those ports are not supported on UWP

* [libevent] add dependency on libevent[threads] to openssl feature

* [pdal,freerdp] Update CI baseline to fail

* fix static pdal build

* fix freerdp on linux

* trying to revert some changes

* revert changes in build make

* revert x264 version bump

Co-authored-by: Force Charlie <6904176+fcharlie@users.noreply.github.com>
Co-authored-by: Johnny Willemsen <jwillemsen@remedy.nl>
Co-authored-by: Lennart Trunk <lennart.trunk@outlook.de>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: Victor Romero <romerosanchezv@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants