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

refactor: open62541 test_package #23745

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ErniGH
Copy link
Contributor

@ErniGH ErniGH commented Apr 24, 2024

Simplify the test_package in according to our policies:

  • Write the minimal test that tests the package (the compiler can find the correct includes, the static linker can resolve
    symbols, the runtime linker can resolve symbols).
  • Do not perform heavy logic in CI.
  • Remove binary blob - these have not been allowed anywhere in the repository for a while now, it's time to drop them where they exist

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

set(GENERATE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/src_generated/")
file(MAKE_DIRECTORY "${GENERATE_OUTPUT_DIR}")
include_directories("${GENERATE_OUTPUT_DIR}")
ua_generate_nodeset_and_datatypes(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is a little more special
What does it use to "generate"? I'm assuming it generates files from the csv and bsd files? in that case - we need to identify how they are generated - and attempt to replicate this in the test_package as well (like we did recently for protobuf)

UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_SERVER, "stopping server due to timer");
running = false;
}

int main(void) {
UA_Server *server = UA_Server_new();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a "delete" function that handles the pointer cleanup? If there is one, I would call it to free the pointer. I think OSs will free the resources upon process termination, but I would still do the minimal thing.

@conan-center-bot

This comment has been minimized.

@AbrilRBS AbrilRBS self-assigned this Apr 29, 2024
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 6 (3e09e60ecd416678c65c2ec1b2a6b1aa46039e2c):

  • open62541/1.3.8:
    Didn't run or was cancelled before finishing

  • open62541/1.0.6:
    Didn't run or was cancelled before finishing

  • open62541/1.3.9:
    Didn't run or was cancelled before finishing

  • open62541/1.2.6:
    CI failed to create some packages (All logs)

    Logs for packageID 75ef360a57ade25004dd5837d5c97cae478a69ec:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    open62541:shared=False
    
    [...]
    -----------------
    -- Using Conan toolchain: /home/conan/workspace/prod-v1/bsr/cci-957a6819/recipes/open62541/all/test_package/build/Release/generators/conan_toolchain.cmake
    -- The C compiler identification is GNU 11.4.0
    -- Check for working C compiler: /usr/local/bin/cc
    -- Check for working C compiler: /usr/local/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Conan: Target declared 'open62541::open62541'
    -- Conan: Including build module from '/home/conan/workspace/prod-v1/bsr/34641/abfcd/.conan/data/open62541/1.2.6/_/_/package/75ef360a57ade25004dd5837d5c97cae478a69ec/lib/cmake/open62541/open62541Macros.cmake'
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/conan/workspace/prod-v1/bsr/cci-957a6819/recipes/open62541/all/test_package/build/Release
    open62541/1.2.6 (test package): CMake command: cmake --build "/home/conan/workspace/prod-v1/bsr/cci-957a6819/recipes/open62541/all/test_package/build/Release" '--' '-j3'
    
    ----Running------
    > cmake --build "/home/conan/workspace/prod-v1/bsr/cci-957a6819/recipes/open62541/all/test_package/build/Release" '--' '-j3'
    -----------------
    Scanning dependencies of target test_package
    [ 50%] Building C object CMakeFiles/test_package.dir/test_package.c.o
    [100%] Linking C executable test_package
    CMakeFiles/test_package.dir/build.make:84: recipe for target 'test_package' failed
    CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/test_package.dir/all' failed
    Makefile:83: recipe for target 'all' failed
    lto1: fatal error: bytecode stream in file '/home/conan/workspace/prod-v1/bsr/34641/abfcd/.conan/data/open62541/1.2.6/_/_/package/75ef360a57ade25004dd5837d5c97cae478a69ec/lib/libopen62541.a' generated with LTO version 11.0 instead of the expected 11.3
    compilation terminated.
    lto-wrapper: fatal error: /usr/local/bin/cc returned 1 exit status
    compilation terminated.
    /opt/conan/binutils/bin/ld: error: lto-wrapper failed
    collect2: error: ld returned 1 exit status
    make[2]: *** [test_package] Error 1
    make[1]: *** [CMakeFiles/test_package.dir/all] Error 2
    make: *** [all] Error 2
    WARN: *** Conan 1 is legacy and on a deprecation path ***
    WARN: *** Please upgrade to Conan 2 ***
    open62541/1.2.6 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    open62541/1.2.6 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    ERROR: open62541/1.2.6 (test package): Error in build() method, line 23
    	cmake.build()
    	ConanException: Error 2 while executing cmake --build "/home/conan/workspace/prod-v1/bsr/cci-957a6819/recipes/open62541/all/test_package/build/Release" '--' '-j3'
    
  • open62541/1.1.6:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

See details:

Failure in build 5 (3e09e60ecd416678c65c2ec1b2a6b1aa46039e2c):

  • open62541/1.3.9:
    Didn't run or was cancelled before finishing

  • open62541/1.3.8:
    Didn't run or was cancelled before finishing

  • open62541/1.2.6:
    Didn't run or was cancelled before finishing

  • open62541/1.1.6:
    Didn't run or was cancelled before finishing

  • open62541/1.0.6:
    CI failed to create some packages (All logs)

    Logs for packageID 64a444ef0d65e12359f8d6d66c5cbad3a20fbf76:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.cppstd=17
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    
    [...]
    
    ======== Testing the package: Building ========
    open62541/1.0.6 (test package): Calling build()
    open62541/1.0.6 (test package): Running CMake.configure()
    open62541/1.0.6 (test package): RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/home/conan/workspace/prod-v2/bsr/cci-9283b378/recipes/open62541/all/test_package/build/gcc-11-x86_64-17-release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/conan/workspace/prod-v2/bsr/cci-9283b378/recipes/open62541/all/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/conan/workspace/prod-v2/bsr/cci-9283b378/recipes/open62541/all/test_package"
    -- Using Conan toolchain: /home/conan/workspace/prod-v2/bsr/cci-9283b378/recipes/open62541/all/test_package/build/gcc-11-x86_64-17-release/generators/conan_toolchain.cmake
    -- Conan toolchain: C++ Standard 17 with extensions OFF
    -- The C compiler identification is GNU 11.4.0
    -- Check for working C compiler: /usr/local/bin/cc
    -- Check for working C compiler: /usr/local/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Conan: Target declared 'open62541::open62541'
    -- Conan: Including build module from '/home/conan/workspace/prod-v2/bsr/31120/edafd/p/open66311bf93a2075/p/lib/cmake/open62541/open62541Macros.cmake'
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/conan/workspace/prod-v2/bsr/cci-9283b378/recipes/open62541/all/test_package/build/gcc-11-x86_64-17-release
    
    open62541/1.0.6 (test package): Running CMake.build()
    open62541/1.0.6 (test package): RUN: cmake --build "/home/conan/workspace/prod-v2/bsr/cci-9283b378/recipes/open62541/all/test_package/build/gcc-11-x86_64-17-release" -- -j3
    Scanning dependencies of target test_package
    [ 50%] Building C object CMakeFiles/test_package.dir/test_package.c.o
    [100%] Linking C executable test_package
    lto1: fatal error: bytecode stream in file '/home/conan/workspace/prod-v2/bsr/31120/edafd/p/open66311bf93a2075/p/lib/libopen62541.a' generated with LTO version 11.0 instead of the expected 11.3
    compilation terminated.
    lto-wrapper: fatal error: /usr/local/bin/cc returned 1 exit status
    compilation terminated.
    /opt/conan/binutils/bin/ld: error: lto-wrapper failed
    collect2: error: ld returned 1 exit status
    CMakeFiles/test_package.dir/build.make:84: recipe for target 'test_package' failed
    make[2]: *** [test_package] Error 1
    CMakeFiles/Makefile2:75: recipe for target 'CMakeFiles/test_package.dir/all' failed
    make[1]: *** [CMakeFiles/test_package.dir/all] Error 2
    Makefile:83: recipe for target 'all' failed
    make: *** [all] Error 2
    
    ERROR: open62541/1.0.6 (test package): Error in build() method, line 23
    	cmake.build()
    	ConanException: Error 2 while executing
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@AbrilRBS
Copy link
Member

The LTO errors I think go outside the scope of the test package changes, I'd focus on the rest of the PRs and we can take a look at it at some point later :)

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

Successfully merging this pull request may close these issues.

4 participants