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

Platform detection of sendmsg/sendmmsg does not work as intended #2260

Open
jkalez opened this issue Jun 26, 2024 · 1 comment
Open

Platform detection of sendmsg/sendmmsg does not work as intended #2260

jkalez opened this issue Jun 26, 2024 · 1 comment

Comments

@jkalez
Copy link

jkalez commented Jun 26, 2024

Problem:

It appears that s2n-quic-platform/build.rs is trying to identify platform support for sendmsg/sendmmsg (and recv variants) at build time. However, the features/socket_mmsg.rs and features/socket_msg.rs are not actually ever compiled by build.rs, so this detection never happens.

One can test this simply by putting junk into any file in s2n-quic-platform/features and the build will still succeed.

Solution:

build.rs should probably attempt to run rustc on files in the features directory instead of just including them in cargo:rerun-if-changed. Alternatively, maybe there's a method to inform cargo via build.rs output that the file needs to be compiled, but rerun-if-changed does not do that.

Requirements / Acceptance Criteria:

cargo rustc -p s2n-quic-platform -- --print cfg will not print out s2n_quic_platform_socket_mmsg on platforms which do not support mmsg, and analogous for platforms which do not support msg. I'm not actually sure these platforms exist or are easy to find, so an alternative acceptance criteria is ensuring that putting a non-compilable file into features.rs does actually fail the build.

@WesleyRosenblum
Copy link
Contributor

Thanks, we'll investigate and see what can be done here.

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

No branches or pull requests

2 participants