Skip to content

[Build]: Automated build for testing no threads (#641) doesn't do the job well #652

@VzdornovNA88

Description

@VzdornovNA88

So, as promised, I started playing with this PR (#641 ) and immediately discovered several problems that I hadn't seen when the PR was under review.

Problems :

  1. My suggestion was to use include(CheckIncludeFileCXX) to check support for the standard threading model, but I didn't take into account that some toolchains actually provide sources, it's just that support for a specific function is blocked at the preprocessor level (for example, gcc 10.2.1, I don't think anything will change in the future while clang does not provide such sources for arm), as for the unification of the building for different toolchains, this method is not correct and does not do the right job, I want to note here , what I don't pass on when building '-DCAN_STACK_DISABLE_THREADS=ON"' is actually what the source check was supposed to do, which was actually supposed to be named as "checking support for the standard C++ threading model".

  2. And one more thing (I don't know if this is a problem), based on the semantics of what was done, that is, stubs for standard library files were added, in them we detect a compilation error using the preprocessor and say that we prohibit the inclusion of sources that relate to the threading model if it is disabled in the library and then #include was added to all the resulting targets, but at the same time, the paths to the stubs were not taken into account in the cmake files of such targets, and they were taken into account for the isobus library itself, but not for the examples.This leads to the fact that we do not get the desired error at the beginning of a long list of errors when trying to build such an example.

Environment and build command :

I work in vscode, so here I will provide the output data and user arguments for cmake : (The toolchain file for arm none eabi toolchains is used below, which you can find in #647 )

Ubuntu 20.04

[build] /usr/bin/stm32-gcc-cmake-tool-chain/eabi/bin/arm-none-eabi-g++ --sysroot=/usr/bin/stm32-gcc-cmake-tool-chain/eabi/bin/../arm-none-eabi -DCAN_PORT_MAXIMUM_VALUE=4 -DCAN_STACK_DISABLE_THREADS -DISOBUS_UNKNOWN_AVAILABLE -I../examples/diagnostic_protocol -I../isobus/include -I../hardware_integration/include -I../utility/include -specs=nosys.specs -mcpu=cortex-m7 -march=armv7e-m -mfpu=neon -mfloat-abi=hard -mthumb -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fno-threadsafe-statics -g3 -O2 -DNDEBUG -Wall -Wextra -MD -MT examples/diagnostic_protocol/CMakeFiles/DiagnosticProtocolExample.dir/main.cpp.obj -MF examples/diagnostic_protocol/CMakeFiles/DiagnosticProtocolExample.dir/main.cpp.obj.d -o examples/diagnostic_protocol/CMakeFiles/DiagnosticProtocolExample.dir/main.cpp.obj -c ../examples/diagnostic_protocol/main.cpp [build] In file included from ../examples/diagnostic_protocol/main.cpp:10:

{
"cmake.configureArgs": [
"-DCMAKE_TOOLCHAIN_FILE=/home/vzdornovna/yocto_work/current_projects/AgIsoStack-plus-plus/cmake/arm-none-eabi.cmake",
"-DARM_TOOLCHAIN_PATH=/home/vzdornovna/yocto_work/current_projects/toolchains/arm-none-eabi/LLVMEmbeddedToolchainForArm-13.0.0",
"-DARM_CPU_ARCH=cortex-m7-neon",
// "-DCAN_STACK_DISABLE_THREADS=ON"
"-DBUILD_EXAMPLES=ON"
// "-DBUILD_TESTING=ON"
],
}

to repeat, you can just take #647 for yourself, previously it took care of disabling the threading model itself, but now that we are seriously fixing this feature in main, I disabled this functionality in #647 and now it is completely consistent with the behavior of main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingLooking into this issue / need more info

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions