Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project import using Make fails prematurely #2604

Open
GallopingTurtle opened this issue Sep 23, 2024 · 0 comments
Open

Project import using Make fails prematurely #2604

GallopingTurtle opened this issue Sep 23, 2024 · 0 comments

Comments

@GallopingTurtle
Copy link

Describe the bug
When cloning cFS and after configuring the Makefile/CMake files, CLion is unable to properly import the project.

Clion runs the command make --just-print --print-directory --keep-going all which typically errors out, but now does so before anything useful happens.

To Reproduce
Steps to reproduce the behavior:

  1. Clone cFS on or after f378320af1d9a1b2399dabfde5f6b22af3b1416b
  2. Copy cfe/cmake/Makefile.sample to the project root as well as cfe/cmake/sample_defs
  3. run make prep then make --just-print --print-directory --keep-going all
  4. Observe how quickly the makefile errors out
  5. Switch to a commit before f378320af1d9a1b2399dabfde5f6b22af3b1416b
  6. make distclean && make prep and make --just-print --print-directory --keep-going all
  7. Observe how much more information is provided (this is sufficient for CLion to detect the project correctly)

Expected behavior
At the end of this import process, CLion should be able to provide code sense and other features.

System observed on:

  • OS: Ubuntu 22.04
  • cFS hash: f378320af1d9a1b2399dabfde5f6b22af3b1416b (last known working hash: 0befc9779e348b8af9d403a7f6d858a5474bc907)
  • cFE hash: dab2f42e9d54b187e6d18140d7c961cd88c2b6d1 (last known working hash: b524c691ecfde656b29b513c84be9aaafc96c453)

It would seem that the offending commit stems from #2587

Additional context
The logs provided by CLion are as follows:

make --just-print --print-directory --keep-going all
make: Entering directory 'cFS'
/usr/bin/make --no-print-directory -C "build" mission-all
/usr/bin/cmake -ScFS/cfe -BcFS/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make -s -f CMakeFiles/Makefile2 mission-all
/usr/bin/cmake -ScFS/cfe -BcFS/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start cFS/build/CMakeFiles 9
/usr/bin/make -s -f CMakeFiles/Makefile2 CMakeFiles/mission-all.dir/all
/usr/bin/make -s -f tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/build.make tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/depend
cd cFS/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" cFS/cfe cFS/tools/elf2cfetbl cFS/build cFS/build/tools/elf2cfetbl cFS/build/tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/DependInfo.cmake --color=
/usr/bin/make -s -f tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/build.make tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/build
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/CMakeFiles --progress-num=13 "Building C object tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/elf2cfetbl.c.o"
cd cFS/build/tools/elf2cfetbl && /usr/bin/cc -D_XOPEN_SOURCE=600 -IcFS/build/inc -IcFS/cfe/modules/core_api/fsw/inc -IcFS/osal/src/os/inc -IcFS/psp/fsw/inc -g -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Wcast-align -Werror -MD -MT tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/elf2cfetbl.c.o -MF CMakeFiles/elf2cfetbl.dir/elf2cfetbl.c.o.d -o CMakeFiles/elf2cfetbl.dir/elf2cfetbl.c.o -c cFS/tools/elf2cfetbl/elf2cfetbl.c
/usr/bin/cmake -E cmake_echo_color --switch= --green --bold --progress-dir=cFS/build/CMakeFiles --progress-num=14 "Linking C executable elf2cfetbl"
cd cFS/build/tools/elf2cfetbl && /usr/bin/cmake -E cmake_link_script CMakeFiles/elf2cfetbl.dir/link.txt --verbose=
/usr/bin/cmake -E cmake_echo_color --switch= --progress-dir=cFS/build/CMakeFiles --progress-num=13,14 "Built target elf2cfetbl"
/usr/bin/make -s -f CMakeFiles/cfe-build-env.dir/build.make CMakeFiles/cfe-build-env.dir/depend
cd cFS/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" cFS/cfe cFS/cfe cFS/build cFS/build cFS/build/CMakeFiles/cfe-build-env.dir/DependInfo.cmake --color=
/usr/bin/make -s -f CMakeFiles/cfe-build-env.dir/build.make CMakeFiles/cfe-build-env.dir/build
cd cFS/cfe && /usr/bin/cmake -D BIN=cFS/build -P cFS/cfe/cmake/generate_build_env.cmake
/usr/bin/cmake -E cmake_echo_color --switch= --progress-dir=cFS/build/CMakeFiles --progress-num= "Built target cfe-build-env"
/usr/bin/make -s -f CMakeFiles/cfe-module-version.dir/build.make CMakeFiles/cfe-module-version.dir/depend
cd cFS/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" cFS/cfe cFS/cfe cFS/build cFS/build cFS/build/CMakeFiles/cfe-module-version.dir/DependInfo.cmake --color=
/usr/bin/make -s -f CMakeFiles/cfe-module-version.dir/build.make CMakeFiles/cfe-module-version.dir/build
cd cFS/cfe && /usr/bin/cmake -D BIN=cFS/build -P cFS/cfe/cmake/generate_git_module_version.cmake
/usr/bin/cmake -E cmake_echo_color --switch= --progress-dir=cFS/build/CMakeFiles --progress-num= "Built target cfe-module-version"
/usr/bin/make -s -f CMakeFiles/mission-version.dir/build.make CMakeFiles/mission-version.dir/depend
cd cFS/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" cFS/cfe cFS/cfe cFS/build cFS/build cFS/build/CMakeFiles/mission-version.dir/DependInfo.cmake --color=
/usr/bin/make -s -f CMakeFiles/mission-version.dir/build.make CMakeFiles/mission-version.dir/build
/usr/bin/cmake -E cmake_echo_color --switch= --progress-dir=cFS/build/CMakeFiles --progress-num= "Built target mission-version"
/usr/bin/make -s -f cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/build.make cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/depend
cd cFS/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" cFS/cfe cFS/cfe/modules/config/tool cFS/build cFS/build/cfeconfig_platformdata_tool cFS/build/cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/DependInfo.cmake --color=
/usr/bin/make -s -f cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/build.make cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/build
make[4]: *** No rule to make target 'cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/cfeconfig_platformdata_table.c.o', needed by 'cfeconfig_platformdata_tool/cfeconfig_platformdata_tool'.
make[3]: *** [CMakeFiles/Makefile2:726: cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:232: CMakeFiles/mission-all.dir/rule] Error 2
make[1]: *** [Makefile:179: mission-all] Error 2
make: *** [Makefile:119: all] Error 2
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/CMakeFiles --progress-num=3 "Building C object cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/cfeconfig_platformdata_table.c.o"
cd cFS/build/cfeconfig_platformdata_tool && /usr/bin/cc -DMAP_ENTRY_LIST=CFECONFIG_PLATFORMDATA_i686_linux_gnu_default_cpu1 -D_XOPEN_SOURCE=600 -IcFS/build/inc -IcFS/cfe/modules/config/tool/../fsw/inc -IcFS/build/i686-linux-gnu/default_cpu1/inc -g -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Wcast-align -Werror -MD -MT cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/cfeconfig_platformdata_table.c.o -MF CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/cfeconfig_platformdata_table.c.o.d -o CMakeFiles/cfeconfig_platformdata_i686_linux_gnu_default_cpu1.dir/cfeconfig_platformdata_table.c.o -c cFS/cfe/modules/config/tool/cfeconfig_platformdata_table.c
/usr/bin/cmake -E cmake_echo_color --switch= --progress-dir=cFS/build/CMakeFiles --progress-num=3 "Built target cfeconfig_platformdata_i686_linux_gnu_default_cpu1"
/usr/bin/make -s -f cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/build.make cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/depend
cd cFS/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" cFS/cfe cFS/cfe/modules/config/tool cFS/build cFS/build/cfeconfig_platformdata_tool cFS/build/cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/DependInfo.cmake --color=
/usr/bin/make -s -f cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/build.make cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/build
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/CMakeFiles --progress-num=4 "Building C object cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/cfeconfig_platformdata_tool.c.o"
cd cFS/build/cfeconfig_platformdata_tool && /usr/bin/cc -D_XOPEN_SOURCE=600 -IcFS/build/inc -IcFS/cfe/modules/config/tool/../fsw/inc -IcFS/cfe/modules/config/tool -g -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Wcast-align -Werror -MD -MT cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/cfeconfig_platformdata_tool.c.o -MF CMakeFiles/cfeconfig_platformdata_tool.dir/cfeconfig_platformdata_tool.c.o.d -o CMakeFiles/cfeconfig_platformdata_tool.dir/cfeconfig_platformdata_tool.c.o -c cFS/cfe/modules/config/tool/cfeconfig_platformdata_tool.c
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/CMakeFiles --progress-num=5 "Building C object cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_configid_nametable.c.o"
cd cFS/build/cfeconfig_platformdata_tool && /usr/bin/cc -D_XOPEN_SOURCE=600 -IcFS/build/inc -IcFS/cfe/modules/config/tool/../fsw/inc -IcFS/cfe/modules/config/tool -g -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Wcast-align -Werror -MD -MT cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_configid_nametable.c.o -MF CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_configid_nametable.c.o.d -o CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_configid_nametable.c.o -c cFS/build/src/cfe_configid_nametable.c
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/CMakeFiles --progress-num=6 "Building C object cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_platform_list.c.o"
cd cFS/build/cfeconfig_platformdata_tool && /usr/bin/cc -D_XOPEN_SOURCE=600 -IcFS/build/inc -IcFS/cfe/modules/config/tool/../fsw/inc -IcFS/cfe/modules/config/tool -g -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Wcast-align -Werror -MD -MT cfeconfig_platformdata_tool/CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_platform_list.c.o -MF CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_platform_list.c.o.d -o CMakeFiles/cfeconfig_platformdata_tool.dir/__/src/cfe_platform_list.c.o -c cFS/build/src/cfe_platform_list.c
make: Leaving directory 'cFS'

It is interesting of note that

make prep
make
make install

still works as intended.

You will also notice between offending and non offending commits a block in the output of the make containing:

make -s -f apps/ci_lab/CMakeFiles/ci_lab.dir/build.make apps/ci_lab/CMakeFiles/ci_lab.dir/depend
cd cFS/build/i686-linux-gnu/default_cpu1 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" cFS/cfe cFS/apps/ci_lab cFS/build/i686-linux-gnu/default_cpu1 cFS/build/i686-linux-gnu/default_cpu1/apps/ci_lab cFS/build/i686-linux-gnu/default_cpu1/apps/ci_lab/CMakeFiles/ci_lab.dir/DependInfo.cmake --color=
make -s -f apps/ci_lab/CMakeFiles/ci_lab.dir/build.make apps/ci_lab/CMakeFiles/ci_lab.dir/build
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/i686-linux-gnu/default_cpu1/CMakeFiles --progress-num= "Building C object apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_app.c.o"
cd cFS/build/i686-linux-gnu/default_cpu1/apps/ci_lab && /usr/bin/gcc -D_LINUX_OS_ -D_POSIX_OS_ -D_XOPEN_SOURCE=600 -Dci_lab_EXPORTS -IcFS/build/inc -IcFS/build/i686-linux-gnu/default_cpu1/inc -IcFS/apps/ci_lab/fsw/inc -IcFS/cfe/modules/core_api/fsw/inc -IcFS/cfe/modules/es/fsw/inc -IcFS/cfe/modules/evs/fsw/inc -IcFS/cfe/modules/fs/fsw/inc -IcFS/cfe/modules/sb/fsw/inc -IcFS/cfe/modules/tbl/fsw/inc -IcFS/cfe/modules/time/fsw/inc -IcFS/osal/src/os/inc -IcFS/build/i686-linux-gnu/default_cpu1/osal/inc -IcFS/psp/fsw/inc -IcFS/psp/fsw/modules/iodriver/inc -IcFS/cfe/modules/msg/fsw/inc -IcFS/cfe/modules/resourceid/fsw/inc -g -fPIC -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Werror -Wno-format-truncation -Wno-stringop-truncation -MD -MT apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_app.c.o -MF CMakeFiles/ci_lab.dir/fsw/src/ci_lab_app.c.o.d -o CMakeFiles/ci_lab.dir/fsw/src/ci_lab_app.c.o -c cFS/apps/ci_lab/fsw/src/ci_lab_app.c
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/i686-linux-gnu/default_cpu1/CMakeFiles --progress-num= "Building C object apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_cmds.c.o"
cd cFS/build/i686-linux-gnu/default_cpu1/apps/ci_lab && /usr/bin/gcc -D_LINUX_OS_ -D_POSIX_OS_ -D_XOPEN_SOURCE=600 -Dci_lab_EXPORTS -IcFS/build/inc -IcFS/build/i686-linux-gnu/default_cpu1/inc -IcFS/apps/ci_lab/fsw/inc -IcFS/cfe/modules/core_api/fsw/inc -IcFS/cfe/modules/es/fsw/inc -IcFS/cfe/modules/evs/fsw/inc -IcFS/cfe/modules/fs/fsw/inc -IcFS/cfe/modules/sb/fsw/inc -IcFS/cfe/modules/tbl/fsw/inc -IcFS/cfe/modules/time/fsw/inc -IcFS/osal/src/os/inc -IcFS/build/i686-linux-gnu/default_cpu1/osal/inc -IcFS/psp/fsw/inc -IcFS/psp/fsw/modules/iodriver/inc -IcFS/cfe/modules/msg/fsw/inc -IcFS/cfe/modules/resourceid/fsw/inc -g -fPIC -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Werror -Wno-format-truncation -Wno-stringop-truncation -MD -MT apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_cmds.c.o -MF CMakeFiles/ci_lab.dir/fsw/src/ci_lab_cmds.c.o.d -o CMakeFiles/ci_lab.dir/fsw/src/ci_lab_cmds.c.o -c cFS/apps/ci_lab/fsw/src/ci_lab_cmds.c
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/i686-linux-gnu/default_cpu1/CMakeFiles --progress-num=2 "Building C object apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_dispatch.c.o"
cd cFS/build/i686-linux-gnu/default_cpu1/apps/ci_lab && /usr/bin/gcc -D_LINUX_OS_ -D_POSIX_OS_ -D_XOPEN_SOURCE=600 -Dci_lab_EXPORTS -IcFS/build/inc -IcFS/build/i686-linux-gnu/default_cpu1/inc -IcFS/apps/ci_lab/fsw/inc -IcFS/cfe/modules/core_api/fsw/inc -IcFS/cfe/modules/es/fsw/inc -IcFS/cfe/modules/evs/fsw/inc -IcFS/cfe/modules/fs/fsw/inc -IcFS/cfe/modules/sb/fsw/inc -IcFS/cfe/modules/tbl/fsw/inc -IcFS/cfe/modules/time/fsw/inc -IcFS/osal/src/os/inc -IcFS/build/i686-linux-gnu/default_cpu1/osal/inc -IcFS/psp/fsw/inc -IcFS/psp/fsw/modules/iodriver/inc -IcFS/cfe/modules/msg/fsw/inc -IcFS/cfe/modules/resourceid/fsw/inc -g -fPIC -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Werror -Wno-format-truncation -Wno-stringop-truncation -MD -MT apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_dispatch.c.o -MF CMakeFiles/ci_lab.dir/fsw/src/ci_lab_dispatch.c.o.d -o CMakeFiles/ci_lab.dir/fsw/src/ci_lab_dispatch.c.o -c cFS/apps/ci_lab/fsw/src/ci_lab_dispatch.c
/usr/bin/cmake -E cmake_echo_color --switch= --green --progress-dir=cFS/build/i686-linux-gnu/default_cpu1/CMakeFiles --progress-num= "Building C object apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_passthru_decode.c.o"
cd cFS/build/i686-linux-gnu/default_cpu1/apps/ci_lab && /usr/bin/gcc -D_LINUX_OS_ -D_POSIX_OS_ -D_XOPEN_SOURCE=600 -Dci_lab_EXPORTS -IcFS/build/inc -IcFS/build/i686-linux-gnu/default_cpu1/inc -IcFS/apps/ci_lab/fsw/inc -IcFS/cfe/modules/core_api/fsw/inc -IcFS/cfe/modules/es/fsw/inc -IcFS/cfe/modules/evs/fsw/inc -IcFS/cfe/modules/fs/fsw/inc -IcFS/cfe/modules/sb/fsw/inc -IcFS/cfe/modules/tbl/fsw/inc -IcFS/cfe/modules/time/fsw/inc -IcFS/osal/src/os/inc -IcFS/build/i686-linux-gnu/default_cpu1/osal/inc -IcFS/psp/fsw/inc -IcFS/psp/fsw/modules/iodriver/inc -IcFS/cfe/modules/msg/fsw/inc -IcFS/cfe/modules/resourceid/fsw/inc -g -fPIC -std=c99 -pedantic -Wall -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -Werror -Wno-format-truncation -Wno-stringop-truncation -MD -MT apps/ci_lab/CMakeFiles/ci_lab.dir/fsw/src/ci_lab_passthru_decode.c.o -MF CMakeFiles/ci_lab.dir/fsw/src/ci_lab_passthru_decode.c.o.d -o CMakeFiles/ci_lab.dir/fsw/src/ci_lab_passthru_decode.c.o -c cFS/apps/ci_lab/fsw/src/ci_lab_passthru_decode.c
/usr/bin/cmake -E cmake_echo_color --switch= --green --bold --progress-dir=cFS/build/i686-linux-gnu/default_cpu1/CMakeFiles --progress-num= "Linking C shared module ci_lab.so"
cd cFS/build/i686-linux-gnu/default_cpu1/apps/ci_lab && /usr/bin/cmake -E cmake_link_script CMakeFiles/ci_lab.dir/link.txt --verbose=
/usr/bin/cmake -E cmake_echo_color --switch= --progress-dir=cFS/build/i686-linux-gnu/default_cpu1/CMakeFiles --progress-num=2 "Built target ci_lab"

which (including lines prior) gives CLion the information it needs to understand how ci_lab is built. Without it CLion is clueless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant