- Posts: 1885
Docker containers for building deviation
- hexfet
- Away
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Assuming that works, I think I'm willing to say this is the official way to build Deviation going forward.
Please Log in or Create an account to join the conversation.
- silpstream
- Offline
- Posts: 244
Tested all builds (except x9d related ones) on OS X 10.10.5 against my forked git repository. Everything even the emulators work great. Nothing (not even permissions or owners) needed changing and worked on the first pass.
Great stuff PB! Thanks so much for this!
On a side note: it doesn't go back to the gui after building. This is intended, right?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Thanks everyone for your help validating this. I'll start working on a proper cheatsheet documenting this process
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
www.deviationtx.com/wiki/development/docker
And I have changed the repo README to reflect the now recommended build procedure
If anyone finds any issues please let me know (or even better just fix them yourself)
Please Log in or Create an account to join the conversation.
- TheSFReader
- Offline
- Posts: 64
Please Log in or Create an account to join the conversation.
- HappyHarry
- Offline
- Posts: 1136
Please Log in or Create an account to join the conversation.
- silpstream
- Offline
- Posts: 244
Please Log in or Create an account to join the conversation.
- hexfet
- Away
- Posts: 1885
1) Is it possible to support building deviation-manual? I'm not sure what's necessary - make currently fails right away since virtualenv is not installed.
2) Would be nice to be able to make the container a build server - send it a make command and it runs it. Currently using it to build while developing means switching to the container for building, then back to native for editing and debug. I ended up installing the build environment locally. Likely in the category of "PR welcome"
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
2) I agree this would be helpful. As a developer, I found that the interactive mode is too slow. I really need to be able to run '<some command> <make options>' for this to be efficient. You can pass env variables to docker when creating containers, but you can't change them when doing a 'docker start'. There is a cludgey solution of saving the command to the shared file system and then parsing that on startup, but it is pretty nasty. I'd like to find a solution to this one.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
You need to run 'docker start' at least once in order to fetch the latest script. This is only useful if using an external git volume, and cannot be used if you didn't mount git during the 'docker create' step.
in the deviation git repo is a script called 'dmake'. If you call this (I recommend adding it to your path) instead of 'make' it will launch the build using the docker image.
For instance 'dmake devo10' will use docker to build the devo10 image. Note that the resulting dfu is not copied to the results directory. Doing so would be complicated, but it should be sitting in the src dir of your git repo, so all is not lost. This feature is only intended for developers in a hope to make the docker image useful for development. Note that this does not do any of the initialization that is done through the gui. So if any software installation is needed, you must do that using the docker gui 1st (for instance to setup the windows emu env).
This is all very un-docker-like, but why bother having guidelines if I can't flaunt them?
Please Log in or Create an account to join the conversation.
- Richard96816
- Offline
- Posts: 208
Please Log in or Create an account to join the conversation.
- HappyHarry
- Offline
- Posts: 1136
here's the output for emu_devo7e
phil@ubuntu:~$ dmake emu_devo7e
Skipping update of build.py
+ Compiling 'target/common/emu/fltk.cpp'
target/common/emu/fltk.cpp:28:19: fatal error: FL/Fl.H: No such file or directory
#include <FL/Fl.H>
^
compilation terminated.
make: *** [objs/emu_devo7e/fltk.o] Error 1
phil@ubuntu:~$
and the same for emu_devo10
phil@ubuntu:~$ dmake emu_devo10
Skipping update of build.py
SNIP
+ Compiling 'target/common/emu/fltk.cpp'
target/common/emu/fltk.cpp:28:19: fatal error: FL/Fl.H: No such file or directory
#include <FL/Fl.H>
^
compilation terminated.
make: *** [objs/emu_devo10/fltk.o] Error 1
phil@ubuntu:~$
it's the same if you try emuzips
phil@ubuntu:~/git/deviation$ dmake emuzips
Skipping update of build.py
SNIP
+ Compiling 'target/common/emu/fltk.cpp'
target/common/emu/fltk.cpp:28:19: fatal error: FL/Fl.H: No such file or directory
#include <FL/Fl.H>
^
compilation terminated.
make[1]: *** [objs/emu_devo6/fltk.o] Error 1
make: *** [zip_emu_devo6] Error 2
i'm probably doing something wrong though lol
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
It can be done by going into the shell and doing 'sudo apt-get install libfltk1.3-dev' (this is mentioned in this thread above)
I'll add that sometime soon (since I use the capability myself).
If you were actually looking to build the windows emulator (whcih does run fine in Wine by the way), you instead want:
'make win_emu_devo7e' or 'make zip_win_emu_devo7e'
Please Log in or Create an account to join the conversation.
- HappyHarry
- Offline
- Posts: 1136
Please Log in or Create an account to join the conversation.
- hexfet
- Away
- Posts: 1885
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
From the shell:
sudo /root/build.py --linux-prereq
then you can use 'dmake emu_devo7e'
I've also added the ability to build the manual through the docker image.
From the shell:
sudo /root/build.py --manual-prereq
You must clone the repo into the same top-level dir you used for deviation (so if you used ~/git/deviation, you would use ~/git/deviation-manual). you do not need to re-create the image since we mount the '~/git' dir
then you can then do:
dmake TARGET=devo10 pdf
If you've previously built the manual locally, make sure to do 'make clean' first. Also both of the 'sudo' commands above will need to download a significant amount of stuff so be prepared for that.
Note also that I've updated the 'dmake' script so that (a) you can move it to someplace other than the deviation git dir, and (b) it can build other repos (like the manual). The manual doe not have its own copy of dmake.
Edit: Also, dmake now requires you to be in the same dir as the Makefile (just like normal 'make')
Lastly, I have not added ether the linux-emu or the manual builds to the gui yet. I'll get there eventually.
I have now added the manual build instructions to the docker wiki page.
Please Log in or Create an account to join the conversation.
- FDR
- Offline
Please Log in or Create an account to join the conversation.
- HappyHarry
- Offline
- Posts: 1136
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Docker containers for building deviation