rlenferink commented on PR #820:
URL: https://github.com/apache/celix/pull/820#issuecomment-3865054846

   Good idea to simplify this! The current setup is not as easy as it should be 
for new (or existing) contributors.
   
   I tested this on Fedora 43 with rootless podman and CLion 2025.3.
   
   The first attempt on running this branch the container build fails with the 
following failure:
   
   ```txt
   Unpacking gh (2.86.0) ...
   Setting up gh (2.86.0) ...
   /tmp/jb-devcontainer-features/ghcr.io-devcontainers-features-github-cli-1
   COMMIT jb-devcontainer-apache_celix_dev_container
   --> 9b5711e397e2
   Successfully tagged 
localhost/jb-devcontainer-apache_celix_dev_container:latest
   9b5711e397e252880285297a87cf831cb4cdf8a43c888bd8f1edc846315ae3ee
   Creating container…
   Container Id: 
82f761ec4ae509cbd02c45d1a0acac202e271389a6e64c921c02d10c5d70ba09
   Container name: '/youthful_gould'
   Starting container '/youthful_gould'
   Status 500: Status 500: {"cause":"no matching entries in passwd 
file","message":"unable to find user celixdev: no matching entries in passwd 
file","response":500}
   ```
   
   It seems that the user `celixdev` cannot be found. After a quick check this 
seems to be correct, since the `celixdev` user [is created in the `conan-build` 
stage](https://github.com/apache/celix/blob/feature/819-simplify-devcontainer-setup/.devcontainer/Containerfile#L47)
 and [not in the `conan-dev` 
stage](https://github.com/apache/celix/blob/feature/819-simplify-devcontainer-setup/.devcontainer/Containerfile#L62-L68).
   
   This might be an accidental error, so I tried changes the conan-dev stage to 
inherit from the conan-build stage instead by applying the following patch:
   
   ```patch
   diff --git a/.devcontainer/Containerfile b/.devcontainer/Containerfile
   index 21b3f8bfb..c4dc6c953 100644
   --- a/.devcontainer/Containerfile
   +++ b/.devcontainer/Containerfile
   @@ -59,10 +59,12 @@ RUN pipx install conan && \
        sed -i 's/^build_type=.*/build_type=Release/' 
/home/${USERNAME}/.conan2/profiles/release && \
        sed -i 's/^build_type=.*/build_type=Debug/' 
/home/${USERNAME}/.conan2/profiles/debug
    
   -FROM base as conan-dev
   +FROM conan-build as conan-dev
    
   +USER root
    RUN DEBIAN_FRONTEND="noninteractive" apt-get update && \
        DEBIAN_FRONTEND="noninteractive" apt-get install -y 
--no-install-recommends \
        gnupg2 dos2unix locales-all ssh rsync tar tzdata sudo vim 
cmake-curses-gui gdb \
        wget curl && \
   -    apt-get clean \
   +    apt-get clean
   +USER ${USERNAME}
   ```
   
   With that change CLion succesfully opens the celix project using the 
devcontainer approach.
   
   After selecting the `conan-debug` profile, the project its auto-completion 
works and can successfully build, with a few warnings given:
   
   ```
   ====================[ Build | all | conan-debug 
]===============================
   
/.jbdevcontainer/JetBrains/RemoteDev/dist/05b70c3c26068_CLion-2025.3.2/bin/cmake/linux/x64/bin/cmake
 --build /IdeaProjects/celix-container/build --target all -j 18
   [421/1164] Linking CXX executable libs/utils/gtest/test_utilsd
   /usr/bin/ld: warning: 
libs/utils/gtest/CMakeFiles/test_utils.dir/__/__/__/embed_zip_linux.s.o: 
missing .note.GNU-stack section implies executable stack
   /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a 
future version of the linker
   [811/1164] Linking C shared library 
examples/celix-examples/services_example_c/libdynamic_consumer_exampled.so.1.0.0
   /usr/bin/ld: warning: 
examples/celix-examples/services_example_c/CMakeFiles/dynamic_consumer_example.dir/src/dynamic_consumer_example.c.o:
 requires executable stack (because the .note.GNU-stack section is executable)
   [1164/1164] Linking CXX executable 
deploy/ReadmeCxxExamplesContainer/ReadmeCxxExamplesContainerd
   
   Build finished
   ```
   
   Are these warnings expected?
   
   Running `All CTest` results in the following:
   
   ```
   The following tests FAILED:
         12 - test_framework (Failed)
         13 - test_framework_with_ei (Failed)
         14 - test_framework_with_curl_ei (Failed)
         15 - http_websocket_tests (Failed)
         16 - test_log_helper (Failed)
         17 - test_log_admin (Failed)
         18 - test_syslog_writer (Failed)
         19 - test_shell (Failed)
         20 - test_cxx_shell (Failed)
         21 - test_shell_tui (Failed)
         22 - run_unit_test_rsa_common (Failed)
         23 - test_rsa_utils (Failed)
         24 - test_rsa_utils_ei (Failed)
         25 - run_test_rsa_dfi_utils (Failed)
         26 - run_integration_test_discovery_zeroconf (Failed)
         27 - run_unit_test_discovery_zeroconf (Failed)
         28 - run_test_tm_scoped (Failed)
         29 - run_unit_test_tm (Failed)
         30 - run_unit_test_tm_with_error_injection (Failed)
         31 - run_test_rsa_dfi (Failed)
         32 - run_integration_test_rsa_json_rpc (Failed)
         33 - run_unit_test_rsa_json_rpc (Failed)
         35 - run_integration_test_rsa_shm (Failed)
         36 - run_unit_test_rsa_shm (Failed)
         37 - test_cxx_remote_service_admin (Failed)
         38 - test_cxx_rsa_configured_discovery (Failed)
   Errors while running CTest
         39 - test_cxx_remote_services_integration (Failed)
         40 - test_components_ready (Failed)
         41 - test_components_ready_with_ei (Failed)
   Output from these tests are in: 
/IdeaProjects/celix-container/build/Testing/Temporary/LastTest.log
         42 - run_integration_test_event_admin (Failed)
         43 - run_unit_test_event_admin (Failed)
   Use "--rerun-failed --output-on-failure" to re-run the failed cases 
verbosely.
         44 - run_unit_test_event_admin_with_error_injection (Failed)
         45 - run_integration_test_event_admin_remote_provider_mqtt (Failed)
         46 - run_unit_test_event_admin_remote_provider_mqtt (Failed)
         47 - 
run_unit_test_event_admin_remote_provider_mqtt_with_error_injection (Failed)
   Process finished with exit code 8
   ```
   
   Quickly scanning through the test output, it seems that every failing test 
fails with the following output:
   
   ```
   12: Test command: 
/IdeaProjects/celix-container/build/libs/framework/gtest/test_frameworkd
   12: Working Directory: 
/IdeaProjects/celix-container/build/libs/framework/gtest
   12: Test timeout computed to be: 10000000
   12: 
/IdeaProjects/celix-container/build/libs/framework/gtest/test_frameworkd: 
/lib/x86_64-linux-gnu/libcrypto.so.3: version `OPENSSL_3.4.0' not found 
(required by /home/celixdev/.conan2/p/b/libcu09ad2ef619b4f/p/lib/libcurl.so.4)
   12: 
/IdeaProjects/celix-container/build/libs/framework/gtest/test_frameworkd: 
/lib/x86_64-linux-gnu/libssl.so.3: version `OPENSSL_3.2.0' not found (required 
by /home/celixdev/.conan2/p/b/libcu09ad2ef619b4f/p/lib/libcurl.so.4)
   Failed
   ```
   
   (the same is true when running the `ctest --output-on-failure --test-dir 
build` command in a terminal within CLion)
   
   More info:
   
   ```bash
   celixdev@ac8cda07f34b:/IdeaProjects/celix-container$ ldd 
build/bundles/event_admin/remote_provider/remote_provider_mqtt/gtest/unit_test_event_admin_remote_provider_mqtt_with_error_injectiond
   
build/bundles/event_admin/remote_provider/remote_provider_mqtt/gtest/unit_test_event_admin_remote_provider_mqtt_with_error_injectiond:
 /lib/x86_64-linux-gnu/libcrypto.so.3: version `OPENSSL_3.4.0' not found 
(required by /home/celixdev/.conan2/p/b/libcu09ad2ef619b4f/p/lib/libcurl.so.4)
   
build/bundles/event_admin/remote_provider/remote_provider_mqtt/gtest/unit_test_event_admin_remote_provider_mqtt_with_error_injectiond:
 /lib/x86_64-linux-gnu/libssl.so.3: version `OPENSSL_3.2.0' not found (required 
by /home/celixdev/.conan2/p/b/libcu09ad2ef619b4f/p/lib/libcurl.so.4)
           linux-vdso.so.1 (0x00007f8756a90000)
           libasan.so.8 => /lib/x86_64-linux-gnu/libasan.so.8 
(0x00007f875592f000)
           libmosquitto.so.1 => 
/home/celixdev/.conan2/p/b/mosqubd83ff621e16a/p/lib/libmosquitto.so.1 
(0x00007f8756a64000)
           libjansson.so.4 => 
/home/celixdev/.conan2/p/b/janss374a24077760d/p/lib/libjansson.so.4 
(0x00007f8756a4e000)
           libuuid.so.1 => 
/home/celixdev/.conan2/p/b/util-c892553d99b97/p/lib/libuuid.so.1 
(0x00007f8756a40000)
           libcelix_frameworkd.so.3 => 
/IdeaProjects/celix-container/build/libs/framework/libcelix_frameworkd.so.3 
(0x00007f87557dd000)
           libcelix_utilsd.so.3 => 
/IdeaProjects/celix-container/build/libs/utils/libcelix_utilsd.so.3 
(0x00007f8755715000)
           libuv.so.1 => 
/home/celixdev/.conan2/p/b/libuvf16e0e2de2b3a/p/lib/libuv.so.1 
(0x00007f87569f9000)
           libgtest_maind.so => 
/home/celixdev/.conan2/p/b/gtest69153696c0e82/p/lib/libgtest_maind.so 
(0x00007f87569f4000)
           libgtestd.so => 
/home/celixdev/.conan2/p/b/gtest69153696c0e82/p/lib/libgtestd.so 
(0x00007f875561c000)
           libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 
(0x00007f875539e000)
           libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f87552b5000)
           libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x00007f87569c4000)
           libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f87550a3000)
           libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007f8754ff9000)
           libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 
(0x00007f8754ae5000)
           /lib64/ld-linux-x86-64.so.2 (0x00007f8756a92000)
           libcurl.so.4 => 
/home/celixdev/.conan2/p/b/libcu09ad2ef619b4f/p/lib/libcurl.so.4 
(0x00007f875492c000)
           libzip.so.5 => 
/home/celixdev/.conan2/p/b/libzi76a9c0f1ba7ae/p/lib/libzip.so.5 
(0x00007f8754600000)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to