Docker containers for building deviation
- mwm
- Topic Author
- Offline
Being at the end of a slow DSL line makes downloading docker images painful enough that doing it just to check out something I don't expect to use isn't a priority. I'll do it at some point after things have settled down.
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I've done the build on Windows now (using the VM) and it is quite smooth, and seems no slower than when I built though MingW (though that is subjective).
So if developers or users don't want to use the recommended build environment, that is ok, but I expect to shutdown all build issues with 'you didn't use the docker image'.
Note that I'm not there yet. This is still in a pioneering stage right now.
Please Log in or Create an account to join the conversation.
- TheSFReader
- Offline
- Posts: 64
The "standard" build (with no local git version) builds correctly, however, with my "local" repository, I have the following errors :
Building zip_devo7e zip_win_emu_devo7e
Preparing for ARM build
Preparing for Windows build
/usr/bin/env: perl : No such file or directory
/usr/bin/env: python : No such file or directory
make[1]: *** [include/libopencm3/efm32/efm32g/irq.json.cleanhdr] Error 127
make: *** [distclean] Error 2
What would be the best way to correct that ? install perl and python on the PC ? (I don't think so), or correct in some way the container ?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
if you like, you can attach the result of 'docker inspect deviation_build' (but please look at the result to make sure there is no personal info in there)
Please Log in or Create an account to join the conversation.
- TheSFReader
- Offline
- Posts: 64
Last lines were (starting from a "fresh" container
/usr/bin/install -c -d /root/portaudio-w32/lib/pkgconfig
/usr/bin/install -c -m 644 portaudio-2.0.pc /root/portaudio-w32/lib/pkgconfig/portaudio-2.0.pc
------------------------------------------------------------
PortAudio was successfully installed.
On some systems (e.g. Linux) you should run 'ldconfig' now
to make the shared object available. You may also need to
modify your LD_LIBRARY_PATH environment variable to include
the directory /root/portaudio-w32/lib
------------------------------------------------------------
make install-recursive
make[1]: Entering directory `/root/src/portaudio'
if test -n "" ; then for dir in ""; do make -C $dir install; done ; fi
make[1]: Leaving directory `/root/src/portaudio'
/usr/bin/env: perl : No such file or directory
/usr/bin/env: python : No such file or directory
make[1]: *** [include/libopencm3/efm32/efm32g/irq.json.cleanhdr] Error 127
make: *** [distclean] Error 2
As for the inspection, what values are considered personal ? (There are a few hashes or IDs, which I don't know if they are...)
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
The errors you see don't make much sense. I wonder if this is a cr/lf issue (the scripts have a '^M' when you downloaded onto windows and in unix that messes up the execution). can you press the 'shell' button and try to execute:
/usr/bin/env perl
and
/usr/bin/env python
and make sure both give you an interactive prompt?
(you can usually use CTRL-D to exit the interactive prompt you get)
I'll try to test it on Windows when I get home. I hadn't tested using a mounted get repo previously
Please Log in or Create an account to join the conversation.
- TheSFReader
- Offline
- Posts: 64
However, once the "build" has started and failed, while perl command keeps working, the python one is KO
Please Log in or Create an account to join the conversation.
- mwm
- Topic Author
- Offline
Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.
My remotely piloted vehicle ("drone") is a yacht.
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.
- hexfet
- Online
- Posts: 1885
Is it possible to make the build and shell run as the user that started the container instead of root?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I figured linux emulators wouldn't be too common so I didn't include them, but I could add support to auto-setup the build env quite eaisly.
Please Log in or Create an account to join the conversation.
- TheSFReader
- Offline
- Posts: 64
Just to let you know, I've tried and "Dos2Unix" all files before launching a build and as PB thought, it built correctly. So now it leaves us to find which ones need to be either fixed, or specifically stored/used with "unix" line ending forced.
(Beginning to converge, utils and src/libopencm3 directories for now) (but not sufficient)
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I just added a .gitattributes file to the repo. can you pull the latest changes (in windows) and see if that fixes the issue in the image?
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
------------------------------------------------------------
PortAudio was successfully installed.
On some systems (e.g. Linux) you should run 'ldconfig' now
to make the shared object available. You may also need to
modify your LD_LIBRARY_PATH environment variable to include
the directory /root/portaudio-w32/lib
------------------------------------------------------------
make install-recursive
make[1]: Entering directory `/root/src/portaudio'
if test -n "" ; then for dir in ""; do make -C $dir install; done ; fi
make[1]: Leaving directory `/root/src/portaudio'
: No such file or directory
make[1]: *** [include/libopencm3/efm32/efm32g/irq.json.cleanhdr] Error 127
make: *** [distclean] Error 2
phil@Anubis-Desk MINGW64 ~
any idea what's up?
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
In windows (NOT in the Docker image!)
go into your git/deviation driectory and remove everything but the .git directory
run:
git pull
git checkout
now try to build in docker and see how it goes.
to verify that things are wokring, you should be able to drop to a shell in the docker image and do:
file /git/deviation/src/libopencm3/scripts/irq2nvic_h
/git/deviation/src/libopencm3/scripts/irq2nvic_h: Python script, ASCII text executable
file /git/deviation/utils/dfu.py
/git/deviation/utils/dfu.py: Python script, ASCII text executable
file /git/deviation/README
/git/deviation/README: ASCII text, with CRLF line terminators
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
docker rm deviation_build
docker pull deviationtx/deviation-docker
Then follow the instructions for 'docker run ...' here:
www.deviationtx.com/forum/7-development/...ding-deviation#46833
or
www.deviationtx.com/forum/7-development/...ding-deviation#46759
This should be the last time I need to update the docker image, I hope.
The big change here is that the build process will no longer run as 'root' but instead as a user called 'docker' This user should have the same userid/groupid as the user who owns the git repository. This should make things work much more smoothly when using a mounted git repo on Linux/Mac (though Mac is still untested). I did a bunch of experimentation with Windows builds too, and they all work for me now, so I'd like any feedback on that as well. I also included the gcc cross compiler in the image since it seems to take a long time to download for me, and I was sic of constantly re-fetching it. I left the windows libs as fetch on demand for now since they don't take as long, and many users may never need to build them.
Please Log in or Create an account to join the conversation.
- TheSFReader
- Offline
- Posts: 64
Thanks
Please Log in or Create an account to join the conversation.
- hexfet
- Online
- Posts: 1885
uilding zip_devo10 zip_devo12 zip_devo6 zip_devo7e zip_devo8 zip_devof12e zip_devof4 zip_devof7
Preparing for ARM build
GENHDR include/libopencm3/lpc17xx/irq.json
Traceback (most recent call last):
File "./scripts/irq2nvic_h", line 174, in <module>
main()
File "./scripts/irq2nvic_h", line 171, in main
convert(open(infile), open(nvic_h, 'w'), open(vector_nvic_c, 'w'), open(cmsis, 'w'))
IOError: [Errno 13] Permission denied: './include/libopencmsis/lpc17xx/irqhandlers.h'
make[2]: *** [include/libopencm3/lpc17xx/irq.json.genhdr] Error 1
make[1]: *** [libopencm3/lib/libopencm3_stm32f1.a] Error 2
make: *** [zip_devo10] Error 2
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
ls -l /git/deviation/src/libopencm3/scripts/irq2nvic_h
ls -l /git/deviation/src/libopencm3/include/libopencmsis/lpc17xx/irqhandlers.h
ls -lad /git/deviation/src/libopencm3/include/libopencmsis/lpc17xx
file /git/deviation/src/libopencm3/scripts/irq2nvic_h
sudo rm -rf /git/deviation/*;cd /git/deviation; git checkout master
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Docker containers for building deviation