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

FixedPositionContainer fails to compile on QNX QCC #2084

Closed
gpalmer-latai opened this issue Nov 10, 2023 · 12 comments · Fixed by #2085
Closed

FixedPositionContainer fails to compile on QNX QCC #2084

gpalmer-latai opened this issue Nov 10, 2023 · 12 comments · Fixed by #2085
Assignees
Labels
bug Something isn't working

Comments

@gpalmer-latai
Copy link

gpalmer-latai commented Nov 10, 2023

Required information

I just pulled the latest master and after building a project using Iceoryx for QNX, I encounter this error:

In file included from external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.hpp:24,
                 from external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.hpp:36,
                 from external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/mempool_introspection.hpp:22,
                 from external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/roudi.hpp:24,
                 from external/iceoryx/iceoryx_posh/source/roudi/application/iceoryx_roudi_app.cpp:21:
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp: In instantiation of 'class iox::FixedPositionContainer<iox::popo::SubscriberPortData, 1024>::IteratorBase<(iox::FixedPositionContainer<iox::popo::SubscriberPortData, 1024>::IterMutability)0>':
external/iceoryx/iceoryx_posh/include/iceoryx_posh/roudi/port_pool.inl:38:49:   required from here
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:46:15: error: template parameter 'iox::FixedPositionContainer<T, CAPACITY>::IterMutability <anonymous>'
     template <IterMutability>
               ^~~~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:198:22: error: redeclared here as 'iox::FixedPositionContainer<iox::popo::SubscriberPortData, 1024>::IterMutability <anonymous>'
         friend class IteratorBase;
                      ^~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp: In instantiation of 'class iox::FixedPositionContainer<iox::popo::PublisherPortData, 512>::IteratorBase<(iox::FixedPositionContainer<iox::popo::PublisherPortData, 512>::IterMutability)0>':
external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.inl:33:39:   required from here
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:46:15: error: template parameter 'iox::FixedPositionContainer<T, CAPACITY>::IterMutability <anonymous>'
     template <IterMutability>
               ^~~~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:198:22: error: redeclared here as 'iox::FixedPositionContainer<iox::popo::PublisherPortData, 512>::IterMutability <anonymous>'
         friend class IteratorBase;

This most likely relates to #2044

Also note - everything compiles and runs fine on Linux GCC X86/Arm.

Operating system:
QNX 7.10 virtual machine.

However the compilation happens through some licensed worker somewhere (Bazel magic). It compiles for X86_64

Compiler version:
qcc -V8.3.0,gcc_ntox86_64_cxx

Eclipse iceoryx version:
Current master as of time of writing, more or less

Observed result or behaviour:
Libraries that depend on iceoryx fail to compile. I haven't narrowed it down too much which specific iceoryx targets fail - at the very least iceoryx_dust as indicated by the error trace provided above.

Expected result or behaviour:
Iceoryx continues to compile on qcc

Conditions where it occurred / Performed steps:
Compile something that depends transitively on the FixedPositionContainer, with qcc.

@elBoberido elBoberido added the bug Something isn't working label Nov 10, 2023
@elBoberido elBoberido self-assigned this Nov 10, 2023
@elBoberido
Copy link
Member

Since we don't have a CI for QNX it occasionally happens to break on master. For the release it is tested by one of our users with a QNX license. For the master branch we rely on the gcc8 build on Ubuntu 20.04 but it is v8.4 since v8.3 is not available. With Cirrus CI we are now able to test on Arch Linux and I will try to create a docker image with 8.3 and check if I can reproduce the error.

In the meantime, could you check if https://github.com/elBoberido/iceoryx/tree/try-fix-qnx fixes the QNX build.

cc @dkroenke @mossmaurice

@gpalmer-latai
Copy link
Author

Yep, I figured. CI is tricky with the licenses and such.

I'm out for lunch at the moment but I'll be able to try your fix in an hour or two and let you know.

Thanks for the quick response!

@elBoberido
Copy link
Member

No problem. We are used to quick fixes for QNX on master :)

@gpalmer-latai
Copy link
Author

Now I see

In file included from external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/introspection/port_introspection.hpp:24,
                 from external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.hpp:36,
                 from external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/process_manager.hpp:23,
                 from external/iceoryx/iceoryx_posh/source/roudi/process_manager.cpp:19:
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp: In instantiation of 'class iox::FixedPositionContainer<iox::popo::SubscriberPortData, 1024>::IteratorBase<(iox::FixedPositionContainer<iox::popo::SubscriberPortData, 1024>::IterMutability)0>':
external/iceoryx/iceoryx_posh/include/iceoryx_posh/roudi/port_pool.inl:38:49:   required from here
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:55:30: error: template parameter 'iox::FixedPositionContainer<T, CAPACITY>::IterMutability ITER_MUTABILITY'
     template <IterMutability ITER_MUTABILITY>
                              ^~~~~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:67:22: error: redeclared here as 'iox::FixedPositionContainer<iox::popo::SubscriberPortData, 1024>::IterMutability <anonymous>'
         friend class IteratorBase;
                      ^~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp: In instantiation of 'class iox::FixedPositionContainer<iox::popo::PublisherPortData, 512>::IteratorBase<(iox::FixedPositionContainer<iox::popo::PublisherPortData, 512>::IterMutability)0>':
external/iceoryx/iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.inl:33:39:   required from here
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:55:30: error: template parameter 'iox::FixedPositionContainer<T, CAPACITY>::IterMutability ITER_MUTABILITY'
     template <IterMutability ITER_MUTABILITY>
                              ^~~~~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:67:22: error: redeclared here as 'iox::FixedPositionContainer<iox::popo::PublisherPortData, 512>::IterMutability <anonymous>'
         friend class IteratorBase;
                      ^~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp: In instantiation of 'class iox::FixedPositionContainer<iox::runtime::Heartbeat, 300>::IteratorBase<(iox::FixedPositionContainer<iox::runtime::Heartbeat, 300>::IterMutability)0>':
external/iceoryx/iceoryx_posh/source/roudi/process_manager.cpp:298:51:   required from here
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:55:30: error: template parameter 'iox::FixedPositionContainer<T, CAPACITY>::IterMutability ITER_MUTABILITY'
     template <IterMutability ITER_MUTABILITY>
                              ^~~~~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:67:22: error: redeclared here as 'iox::FixedPositionContainer<iox::runtime::Heartbeat, 300>::IterMutability <anonymous>'
         friend class IteratorBase;
                      ^~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp: In instantiation of 'class iox::FixedPositionContainer<iox::runtime::Heartbeat, 300>::IteratorBase<(iox::FixedPositionContainer<iox::runtime::Heartbeat, 300>::IterMutability)1>':
external/iceoryx/iceoryx_posh/source/roudi/process_manager.cpp:370:49:   required from here
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:55:30: error: template parameter 'iox::FixedPositionContainer<T, CAPACITY>::IterMutability ITER_MUTABILITY'
     template <IterMutability ITER_MUTABILITY>
                              ^~~~~~~~~~~~~~~
external/iceoryx/iceoryx_dust/container/include/iox/fixed_position_container.hpp:67:22: error: redeclared here as 'iox::FixedPositionContainer<iox::runtime::Heartbeat, 300>::IterMutability <anonymous>'
         friend class IteratorBase;

@elBoberido
Copy link
Member

Yeah, I just wanted to write that I have good and bad news. The bad news is that the branch does not fix the problem. The good news is that we soon have a CI with the GCC8.3 compiler which corresponds to QCC on QNX 7.1.

elBoberido added a commit that referenced this issue Nov 10, 2023
@elBoberido
Copy link
Member

This branch compiles with GCC8.3 on Arch Linux https://github.com/eclipse-iceoryx/iceoryx/tree/iox-2084-fix-qnx-build-and-setup-ci-for-gcc-8-3. It should also build on QNX

@gpalmer-latai
Copy link
Author

Yep, that appeared to do the trick. I'm curious - I didn't spend too much time squinting at the code to fully grasp what is going on (looked like some nonsense about the expanded template conflicting with the non-expanded template) but does that friend declaration turn out not to be needed?

@elBoberido
Copy link
Member

It seems it was just a leftover from a previous attempt. The tests should capture all the combinations for the iterators

@elBoberido
Copy link
Member

Btw, do you have warnings on QNX? On Arch with gcc 8.3 there are quire a few warning regarding string overflow. They are false positives but might need suppression on gcc 8.3

@gpalmer-latai
Copy link
Author

gpalmer-latai commented Nov 10, 2023

Btw, do you have warnings on QNX? On Arch with gcc 8.3 there are quire a few warning regarding string overflow. They are false positives but might need suppression on gcc 8.3

In my current setup where I am building for QNX, Iceoryx is treated as a third-party dependency and warnings that come from it are suppressed. At some point I intend to remove this suppression and take a closer look.

I also have not messed around with building iceoryx by itself, for QNX. It becomes a bit annoying to do so because right now I'm relying on some configurations present in the project that depends on iceoryx.

elBoberido added a commit that referenced this issue Nov 10, 2023
@elBoberido
Copy link
Member

Okay, no problem. If you encounter the warnings please open an issue

@dkroenke @mossmaurice in case you notice this earlier please also open an issue :)

elBoberido added a commit that referenced this issue Nov 10, 2023
elBoberido added a commit that referenced this issue Nov 10, 2023
elBoberido added a commit that referenced this issue Nov 10, 2023
elBoberido added a commit that referenced this issue Nov 10, 2023
@elBoberido
Copy link
Member

elBoberido commented Nov 10, 2023

Oh, the warnings come from gcc 13.1. I forgot to set the correct env variables on my local docker image.

cc @dkroenke @mossmaurice

elBoberido added a commit that referenced this issue Nov 13, 2023
elBoberido added a commit that referenced this issue Nov 13, 2023
elBoberido added a commit that referenced this issue Nov 13, 2023
elBoberido added a commit that referenced this issue Nov 13, 2023
elfenpiff added a commit that referenced this issue Nov 15, 2023
…and-setup-ci-for-gcc-8-3

iox-#2084 Fix qnx build and setup CI for gcc 8.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants