seL4 / sel4-tutorials

Tutorials for working with seL4 and/or CAmkES.

Home Page:https://docs.sel4.systems/Tutorials

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sel4-tutorials building error, CMake Error: The source directory "xxxxx/projects/sel4-tutorials/settings.cmake" is a file, not a directory.

celestialtao opened this issue · comments

the issue I met is like this:

Tao@Bionic:~/workspace/sel4-tutorials-manifest/develop$ ./init --tut fault-handlers
loading initial cache file ../projects/sel4-tutorials/settings.cmake
-- Found capdl: /home/tao/workspace/sel4-tutorials-manifest/develop/projects/capdl
-- Found camkes-tool: /home/tao/workspace/sel4-tutorials-manifest/develop/projects/sel4-tutorials
CMake Error: The source directory "/home/tao/workspace/sel4-tutorials-manifest/develop/projects/sel4-tutorials/settings.cmake" is a file, not a directory.
Specify --help for usage, or press the help button on the CMake GUI.
Traceback (most recent call last):
File "./init", line 90, in
File "./init", line 79, in main
File "/home/tao/workspace/sel4-tutorials-manifest/develop/projects/sel4-tutorials/common.py", line 101, in init_directories
return _init_build_directory(config, initialised, build_directory, tute_directory, output, config_dict=config_dict)
File "/home/tao/workspace/sel4-tutorials-manifest/develop/projects/sel4-tutorials/common.py", line 69, in _init_build_directory
return sh.cmake(args + [tute_directory], _cwd=directory, _out=output, _err=output)
File "/home/tao/.local/lib/python3.6/site-packages/sh.py", line 1566, in call
return RunningCommand(cmd, call_args, stdin, stdout, stderr)
File "/home/tao/.local/lib/python3.6/site-packages/sh.py", line 822, in init
self.wait()
File "/home/tao/.local/lib/python3.6/site-packages/sh.py", line 879, in wait
self.handle_command_exit_code(exit_code)
File "/home/tao/.local/lib/python3.6/site-packages/sh.py", line 905, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:

RAN: /usr/bin/cmake -G Ninja -DTUT_BOARD=pc -DTUT_ARCH=x86_64 -DTUTORIAL_DIR=fault-handlers -C ../projects/sel4-tutorials/settings.cmake /home/tao/workspace/sel4-tutorials-manifest/develop/fault-handlers

STDOUT:

STDERR:

This issue could be solved by upgrading my cmake version from 3.13.0 to 3.21.3.

Thanks for posting the solution. Most of the CMake files have a minimum version requirement, which I thought should have triggered here with a more useful message. @kent-mcleod do you know why that would not have happened here?

It seems like the issue is caused by the first line of the fault-handler's source directory's CMakeLists.txt is include(${SEL4_TUTORIALS_DIR}/settings.cmake) which then can potentially change to a different CMakeLists.txt version via sel4_tutorials_regenerate_tutorial() then CMake gets confused about what to set the source directory at once project() is eventually called.