Requirements for building all 3 releases


#1

Amidst all the build fun I have been having, I was wondering what exactly is needed for building the safe_browser on all three platforms? As a Linux user, it seems like there should be a process, but the platform specific commands in the readme:
yarn put-live-net-files-for-<windows|osx|linux>
…only appears to work on the platform you are actually running. Looking at the referenced document:


I see there is a powershell command for windows which appears to be intended for running on Windows.


#2

Hi Graham,

I’m trying to understand your question.
Are you asking about what dependencies are needed on different platforms, MS Visual Studio on Windows, for example?

Starting here, what problems are you running into?

Or are you asking about how to compile/cross-compile all three platform builds on one system?

I thought we previously had Windows-specific tips but now I can’t find them.

Would it be helpful if the readme were divided into platform-specific instructions?


#3

This specifically. Is it possible for me to compile a windows/osx binary on my linux computer to send to a less technical friend?

The issue:
$ yarn put-live-net-files-for-linux
yarn run v1.12.3
$ cp ./resources/crust.config node_modules/electron/dist/electron.crust.config && cp resources/log.toml node_modules/electron/dist/log.toml
Done in 0.11s.

$ yarn put-live-net-files-for-osx
yarn run v1.12.3
$ cp ./resources/crust.config node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron\ Helper.app/Contents/MacOS/Electron\ Helper.crust.config && cp resources/log.toml ./node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron\ Helper.app/Contents/log.toml
cp: cannot create regular file ‘node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper.crust.config’: No such file or directory
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


#4

These commands, put-live-net-files-for-<windows|linux|osx>, are solely for when you want to run electron without packaging it and connecting to live network using yarn prod-dev.
Don’t worry about those. Not important for what you want to accomplish.

You’ll need some extra tools to properly cross-compile for other platforms. You may be able to build for Windows, but for OSX you’ll most likely receive an error: Build for macOS is supported only on macOS.

You can try once you’ve run yarn, yarn rebuild, then run yarn package-win.

One method is to build for those platforms using virtual machines. My favorite option.

Another method would be to setup CI’s to build for you as we do on Travis and AppVeyor(although giving us trouble lately). If you go with this route, you’ll need to fork SAFE Browser, set up an account with Travis, create a personal access token on Github with public_repo access rights, in Travis settings create a secure environment variable called GITHUB_ACCESS_TOKEN as the key and the token as the value, according to the .travis.yml, then when you want to trigger a build, push a git tag to your forked repo, whereupon completion you’ll see packages in releases.


#5

Sadly not. Each system has unique dependencies needed for compilation/packaging.

We use Travis CI (which is free), as @hunterlester is suggesting.