How to build Windos build in Ubuntu(Docker)

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderators: Committer, Committer

Post Reply
Message
Author
User avatar
Cjkjvfnby
AI Contributor
Posts: 460
Joined: Tue Jun 24, 2014 9:55 pm

How to build Windos build in Ubuntu(Docker)

#1 Post by Cjkjvfnby » Fri Mar 08, 2019 8:55 am

Hi, I am not friendly with C++ and freeorion build procedures. All I want is to build in one click, without installing SDK and other tools to my PC.

Docker looks like a solution for that: create an image, start a container, take your build.

As I know it is possible to build for the window from other operating systems but I need some instructions.

I will create a docker file and provide instructions to use and maintain it.

PS. I started using Docker in real life and soon will become a kind of expert :).
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Ophiuchus
Programmer
Posts: 970
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: How to build Windos build in Ubuntu(Docker)

#2 Post by Ophiuchus » Fri Mar 08, 2019 9:06 am

If I understand correctly you want to build freeorion for playing on windows.

And you want to build/cross-compile from linux?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

User avatar
adrian_broher
Programmer
Posts: 1082
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: How to build Windos build in Ubuntu(Docker)

#3 Post by adrian_broher » Fri Mar 08, 2019 11:52 am

As I know it is possible to build for the window from other operating systems but I need some instructions.
No, that's not possible with Docker. Docker provides process isolation, not virtualization. You share the kernel with the host system and that limits the available user space application. To cross-compile from linux to windows you need a cross compiler (eg. mingw) or you need the actual target plaform in some virtualized way.

I personally used VirtualBox with handcrafted build environments during FO development for developing on Windows and Mac and left that crap mostly alone as soon the project was working again.

Today I would go with Vagrant and use that to do an unattendend provisioning the Windows and Mac VMs for development.
I started using Docker in real life and soon will become a kind of expert :).
Yeah, nah.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Cjkjvfnby
AI Contributor
Posts: 460
Joined: Tue Jun 24, 2014 9:55 pm

Re: How to build Windos build in Ubuntu(Docker)

#4 Post by Cjkjvfnby » Fri Mar 08, 2019 12:13 pm

adrian_broher wrote:
Fri Mar 08, 2019 11:52 am
As I know it is possible to build for the window from other operating systems but I need some instructions.
No, that's not possible with Docker. Docker provides process isolation, not virtualization. You share the kernel with the host system and that limits the available user space application.
Docker for windows provides virtualization via VirtualBox. Same for Docker for Mac.
To cross-compile from linux to windows you need a cross compiler (eg. mingw) or you need the actual target plaform in some virtualized way.
mingw looks like a good direction

I personally used VirtualBox with handcrafted build environments during FO development for developing on Windows and Mac and left that crap mostly alone as soon the project was working again.

Today I would go with Vagrant and use that to do an unattendend provisioning the Windows and Mac VMs for development.
I opened Vargant page on the wiki: Docker Virtual Box both mentioned there :) Looks like both Docker and Vargant suitable for that task. I will try to understand who can do it better.

Did you have any progress with Vargant?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Cjkjvfnby
AI Contributor
Posts: 460
Joined: Tue Jun 24, 2014 9:55 pm

Re: How to build Windos build in Ubuntu(Docker)

#5 Post by Cjkjvfnby » Fri Mar 08, 2019 12:25 pm

Ophiuchus wrote:
Fri Mar 08, 2019 9:06 am
If I understand correctly you want to build freeorion for playing on windows.

And you want to build/cross-compile from Linux?
I have a Windows machine. I want to playdevelop the game on the machine I have.
I do an AI stuff on Python, installing CDK and Visual Studio is not in my plans.

I am familiar with Linux and I think I can create a Docker image that will do cross-compilation for me. adrian_broher already created base Docker image to build FreeOrion for linux: https://github.com/freeorion/freeorion- ... Dockerfile

But I am not familiar with cross-compilation and don't know which command I should run.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
adrian_broher
Programmer
Posts: 1082
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: How to build Windos build in Ubuntu(Docker)

#6 Post by adrian_broher » Fri Mar 08, 2019 1:00 pm

Cjkjvfnby wrote:
Fri Mar 08, 2019 12:13 pm
Docker for windows provides virtualization via VirtualBox. Same for Docker for Mac.
Docker runs within a Linux virtual machine on those platforms (neatly packaged and well hidden for the docker user), that's true. But there is no virtualization feature within Docker.
Cjkjvfnby wrote:
Fri Mar 08, 2019 12:13 pm
mingw looks like a good direction
I never have touched the topic of cross-compiling in any reasonable depth to be honest. The documentation I found is spotty so far. Maybe this article can give you some leads: https://metricpanda.com/rival-fortress- ... -platforms
I opened Vargant page on the wiki: Docker Virtual Box both mentioned there :) Looks like both Docker and Vargant suitable for that task. I will try to understand who can do it better.

Did you have any progress with Vargant?
Vagrant is a way do describe the setup of a Virtual Machine in ruby. As long as you can do installation and configuration in an unattended way you're good to go. I currently have an half-assed Vagrantfile, which does some basic configuration of a Win10 machine and installs VisualStudio 2017 with all the native development tools required (x86 and x64 toolchains, Windows SDK, actual VS editor, Git and CMake support for VS). However because Microsoft botchered up the corresponding Vagrant Box (prepackage virtual machine) you have to download and unzip the Virtual Machine manually before being able to import it into Vagrant.

So yeah, somewhat.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

Post Reply