Skip to content

Define SOL_TCP and SOL_UDP for WASIp1 - #876

Closed
Hokila wants to merge 1 commit into
WebAssembly:mainfrom
Hokila:fix/855-wasip1-socket-levels
Closed

Define SOL_TCP and SOL_UDP for WASIp1#876
Hokila wants to merge 1 commit into
WebAssembly:mainfrom
Hokila:fix/855-wasip1-socket-levels

Conversation

@Hokila

@Hokila Hokila commented Aug 30, 2026

Copy link
Copy Markdown

Summary

  • define SOL_TCP and SOL_UDP for the WASIp1 <sys/socket.h> path
  • add compile-time assertions for the socket-level values
  • register the regression test across supported WASI targets

Fixes #855.

Testing

  • verified the new WASIp1 assertion test fails before the header change because both constants are undeclared
  • verified the same WASIp1 syntax-only compilation succeeds after the header change
  • git diff --check

Environment limitations

  • cargo test --manifest-path tools/wasi-headers/Cargo.toml reaches the existing assert_same_as_src test but fails because the checked-in wasi/api.h already differs from the generator output
  • the full local CMake target is blocked by Apple ar rejecting the project's empty archive command
  • WASIp2/WASIp3 CMake configuration requires Clang 22+, while this host provides Apple Clang 21; their source branch is unchanged by this patch

@alexcrichton

Copy link
Copy Markdown
Collaborator

Personally I feel that given the state of networking on the wasip1 target, which is mostly broken, I am not confident myself in landing changes like this. I think it would be best to leave the wasip1 target as-is and focus on fixing/improving the targets with actual support for networking in wasip2/wasip3.

Do you have a specific motivation though for proposing this change?

@Hokila

Hokila commented Aug 31, 2026

Copy link
Copy Markdown
Author

Thanks, that makes sense. I don't currently have a concrete WASIp1 networking use case beyond fixing the inconsistency between predefined-macros.txt and <sys/socket.h>. Since this does not improve runtime networking support, I agree that it may not be worth extending the WASIp1 surface.

I’m happy to close this PR and focus on WASIp2/WASIp3 instead.

@Hokila Hokila closed this Aug 31, 2026
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

Successfully merging this pull request may close these issues.

Contradicting SOL_TCP and SOL_UDP definition for p1

2 participants