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

'cdylib' and integrationtests leads to warnings and build failures #298

Open
elBoberido opened this issue Jul 15, 2024 · 0 comments
Open

Comments

@elBoberido
Copy link
Member

Brief description

As it turned out cdylibs do not play well with integration tests. The cdylib is build
with panic="abort" but the tests require panic="unwind". This results in building the lib
twice if there are integration tests and leads to the following warning and eventually to build failures.

warning: output filename collision.
The lib target iceoryx2_ffi in package iceoryx2-ffi v0.3.0 (C:\Users\ekxide\iceoryx2\iceoryx2-ffi\ffi) has the same output filename as the lib target iceoryx2_ffi in package iceoryx2-ffi v0.3.0 (C:\Users\ekxide\iceoryx2\iceoryx2-ffi\ffi).
Colliding filename is: C:\Users\ekxide\iceoryx2\target\release\deps\iceoryx2_ffi.lib
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see rust-lang/cargo#6313.

Workaround

Currently the workaround is to have the integrationtests in the module. This would give access to private API though. To circumvent this problem only pub(super) shall be used if an API needs to be available in other modules but not pub(crate). With the following folder structure the tests can again only be written as whitebox tests

iceoryx2-ffi
  |- ffi
  |    |- src
  |    |    |- api
  |    |    |- tests
  |    |    |- lib.rs
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