Status-react: Windows desktop builds

Created on 11 Sep 2018  Â·  14Comments  Â·  Source: status-im/status-react

User Story

As a windows user, I want to use status desktop on windows.

Description

10% of Status contributors, and potentially >50% of general users have windows as their OS.

Related

https://github.com/status-im/status-react/issues/4352

devops

Most helpful comment

Posted new build at http://bit.ly/desktop-win10-894738a2 with "nightly" .env settings

Google Docs

All 14 comments

If there's anything I can do to help here, let me know. It's been the platform for 90% of my developer career, after all.

From Slack:

If we're going to find a way to embed JavaScript engine (Node.JS or continue with JavaScriptCore), this will completely remove needs of separate ubuntu_server process (the creation process of which is not automated).

Since I've already built react-native-desktop and status-react on Windows before (very old codebase), it will be possible to copy already pre-built ubuntu_server executable just from there to save time on this which will be finally removed.

Qt's MinGW based toolchain was used on Windows (mainly, because to support MSVC we need to tweak react-native-desktop to start export methods from the native library (MSVC doesn't export all interface signatures by default, as gcc, for example, does) )

lack of MSVC support also doesn't allow us to use Qt's WebEngine module based on Chromium

ideally, in theory, we don't need Node.JS or JavaScriptCore, because Qt has Chromium's based WebEngine. Probably, it might sense to do following fundamental things for react-native-desktop:

  1. Add support of MSVC and build with it. In this case we will able to use WebEngine module on WIndows as well (it's used for others platforms already)
  2. Get rid of ubuntu_server, but embedding of JavaScript engine inside react-native-desktop. It makes a lot sense to try to figure out how is it possible to use WebEngine modile from Qt. If it doesn't work, then investigate embedding of Node.JS, and, finally, we can stop with integration of JavaScriptCore engine (mobile react-native uses it for iOS and Android, so, why not to use it for Desktop as well, + it's mostly already supported by react-native-desktop and worked fine on Linux)

Based on outcomes from above 2 things, the way how we build status-react on Windows will change:

  • Will we use MinGW or MSVC?
  • Will we use Qt's WebKit or WebEngine?
  • Will we able to embed some JS engine, finally, get rid of ubuntu_server and how sources of selected web engine will be built for CI ( both WebKit and Chromium have huge codebase and long lasting complex build processes )

Approach being taken:

  • [x] Adapt CMake files to cross-compile;
  • [x] Cross-compile Windows Qt version using mingw64;
  • [x] Nice to have: build our own mingw64 using Conan instead of relying on a random one fetched with apt-get;
  • [ ] Nice to have: move logic to run deployqt from bash file to CMake project (in progress);

If we start needing to cross-compile a lot, a tool like https://conan.io/ would greatly simplify things and help with standardization, instead of relying on fiddly ad-hoc scripts.

This is affecting me, using Status inside Virtual Box in the meanwhile.

Some notes from the last desktop meeting:

What are next steps?:

  • Biggest hurdles have been overcome (OpenGL, building QtWebKit on Linux, problem linking react-native-keychain). Had to switch from crosstool-ng to MXE so that we can build QtWebKit on Linux;
  • We know we can show UI and not just a blank screen (tested);
  • Seems like only issue remaining is that realm is not being started;
  • Hoping to fix realm issue today with Max’s help;
  • After that we need to rebase on develop and productize/clean up build scripts.
  • Max will continue progress

Was able to build ubuntu-server on my machine with an increased log level, and I see an encouraging entry that I hadn't seen before:

ubuntu-server err:  "-- buffer length(concat): 9272546\n-- Packet length: 9272542"
ubuntu-server std:  "outerRealmConstructor: function"
ubuntu-server err:  "-- Data received from RN Client: state = start"
ubuntu-server err:  "-- chunk length: 37\n-- buffer length(original): 0\n-- buffer length(concat): 37\n-- New Packet: length=33"
ubuntu-server std:  "DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :init/app-started"
ubuntu-server err:  "-- Data received from RN Client: state = start"
ubuntu-server err:  "-- chunk length: 220\n-- buffer length(original): 0\n-- buffer length(concat): 220\n-- New Packet: length=86\n-- New Packet: length=126"
ubuntu-server std:  "Running application \"StatusIm\" with appParams: {\"initialProps\":{},\"rootTag\":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON"
ubuntu-server err:  "-- Data received from RN Client: state = start\n-- chunk length: 460\n-- buffer length(original): 0\n-- buffer length(concat): 460\n-- New Packet: length=150\n-- New Packet: length=150\n-- New Packet: length=148"

Notice the DEBUG [status-im.utils.handlers:37] - Handling re-frame event: :init/app-started. So it looks like the CLJS code is running, but for some reason the log ends there, nothing else comes up. In a regular log, the next entry should be ubuntu-server std: "DEBUG [status-im.utils.keychain.core:133] - initializing realm encryption key...", so maybe the keychain module is still giving problems after all. I'd suggest disabling that functionality temporarily to see if we get to the sign in screen.

yup, that worked!

imagem

@3esmit you can try this build from latest sources: http://bit.ly/desktop-win10

Google Drive is a free way to keep your files backed up and easy to reach from any phone, tablet, or computer. Start with 15GB of Google storage – free.

Seems like it works..
image

Kudos @PombeirP this is quite a breakthrough!

I'll leave this PR here for you and @jakubgs to put the icing on the cake when you get back. :)

https://github.com/status-im/status-im.github.io/pull/5

@PombeirP Does this version includes testfairy?

@3esmit I think this is determined by the .env file located together with the StatusIm.exe, and from what I see it is disabled.

Posted new build at http://bit.ly/desktop-win10-894738a2 with "nightly" .env settings

Google Docs
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakubgs picture jakubgs  Â·  174Comments

churik picture churik  Â·  54Comments

flexsurfer picture flexsurfer  Â·  42Comments

jakubgs picture jakubgs  Â·  54Comments

hesterbruikman picture hesterbruikman  Â·  41Comments