seL4 / seL4-CAmkES-L4v-dockerfiles

Dockerfiles defining the dependencies required to build seL4, CAmkES, and L4v.
13 stars 40 forks source link

Python 2 dependencies are missing #3

Closed tompreston closed 6 years ago

tompreston commented 6 years ago

Hi, I'm using the user container to build seL4 Tutorial 1 but I get the following unexpected error:

tpreston@in-container:/host$ mkdir build_hello_1

tpreston@in-container:/host$ cd build_hello_1/

tpreston@in-container:/host/build_hello_1$ ../init --plat pc99 --tut hello-1
The following files do not require modifications but are copied to provide context:
        hello-1/src/util.c
The following files need to be modified to complete the tutorial
        hello-1/src/main.c
-- Configuring done
-- Generating done
-- Build files have been written to: /host/build_hello_1

tpreston@in-container:/host/build_hello_1$ ninja
[2/148] Generate invocation header gen_headers/arch/api/sel4_invocation.h
FAILED: kernel/gen_headers/arch/api/sel4_invocation.h
cd /host/build_hello_1/kernel && rm -f gen_headers/arch/api/sel4_invocation.h && python /h
Traceback (most recent call last):
  File "/host/kernel/tools/invocation_header_gen.py", line 21, in <module>
    import tempita
ImportError: No module named tempita
[3/148] Generate invocation header gen_headers/arch/api/invocation.h
FAILED: kernel/gen_headers/arch/api/invocation.h
cd /host/build_hello_1/kernel && rm -f gen_headers/arch/api/invocation.h && python /host/h
Traceback (most recent call last):
  File "/host/kernel/tools/invocation_header_gen.py", line 21, in <module>
    import tempita
ImportError: No module named tempita
[5/148] Generate invocation header gen_headers/api/invocation.h
FAILED: kernel/gen_headers/api/invocation.h
cd /host/build_hello_1/kernel && rm -f gen_headers/api/invocation.h && python /host/kerneh
Traceback (most recent call last):
  File "/host/kernel/tools/invocation_header_gen.py", line 21, in <module>
    import tempita
ImportError: No module named tempita
[6/148] Generate syscall invocations
FAILED: kernel/gen_headers/arch/api/syscall.h
cd /host/build_hello_1/kernel && /host/kernel/tools/xmllint.sh --noout --schema /host/kerh
Traceback (most recent call last):
  File "/host/kernel/tools/syscall_header_gen.py", line 22, in <module>
    import tempita
ImportError: No module named tempita
[7/148] Concatenating C files
ninja: build stopped: subcommand failed.

Because python-tempita is only installed for Python 3:

tpreston@in-container:/host/build_hello_1$ python3 -c "import tempita"

tpreston@in-container:/host/build_hello_1$ python -c "import tempita"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named tempita

tpreston@in-container:/host/build_hello_1$ find ~/.local/lib/ -name tempita
/home/tpreston/.local/lib/python3.6/site-packages/tempita

So I have to manually install it for Python 2 like so:

mkdir ~/.local/lib/python2.7/site-packages
python ./kernel/tools/python-deps/setup.py install --prefix=~/.local

Where in the Dockerfile is the correct place to install this? Presumably this should be done at the same time python-tempita is installed for Python 3.

kent-mcleod commented 6 years ago

Hi Thomas, Tempita used to be provided by https://pypi.org/project/sel4-deps/0.1.2/#history installed in the docker here: https://github.com/SEL4PROJ/seL4-CAmkES-L4v-dockerfiles/blob/master/sel4.dockerfile#L94

We recently updated the kernel build scripts to use jinja2 instead of tempita and updated the corresponding packages. However because the docker images aren't versioned with the kernel releases, the docker that you are using is effectively too new. An easy fix for you would be to use the nightly set of the tutorials which you could check out with repo init -u https://github.com/SEL4PROJ/sel4-tutorials-manifest.

There is an issue here though, which is that the docker images aren't versioned alongside the seL4 releases which we should probably start doing.

tompreston commented 6 years ago

Okay that fixed it! I'm now using sel4-tutorials-manifest master. Thank you @kent-mcleod.

I'll leave this open until the other issue is fixed, although happy for you to close this and raise it somewhere else.