Skip to content

net/tun: fix the Windows build - #4274

Merged
BaseMax merged 1 commit into
mainfrom
tun-windows-build
Nov 26, 2026
Merged

BaseMax merged 1 commit into
mainfrom
tun-windows-build

Conversation

@BaseMax

@BaseMax BaseMax commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

A useless cast in device.salam is error E093, so no program importing net/tun builds for Windows. With the cast removed, x86_64-w64-windows-gnu builds link again (checked with salam check --check-std and a full cross build using a compiler from main, and with 0.7.1).

Summary by CodeRabbit

  • Release Notes
    • No end-user-visible changes are included in this update.

@BaseMax
BaseMax requested a review from a team as a code owner November 26, 2026 15:44
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Windows _dev_read path now passes timeout_ms directly to WaitForSingleObject, without an explicit int cast.

Changes: Windows TUN Read Wait

Layer / File(s) Summary
Pass timeout directly
std/net/tun/device.salam
The WaitForSingleObject call now receives timeout_ms without an explicit int cast.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: bdadmehr0, erfangnu

Merge Risk: Minimal · up to d85bd

This change removes a cast that blocked Windows builds of programs importing net/tun. It has no identified behavioral impact and a very small footprint, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "net/tun: fix the Windows build" matches the main change. The PR removes a useless cast in the Windows _dev_read wait call in std/net/tun/device.salam, which the author says triggers error E…
Description check Passed The description covers the problem and the fix clearly. It explains that the useless cast causes error E093, that the cast removal restores x86_64-w64-windows-gnu builds, and how the author checked th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "net/tun: fix the Windows build" matches the main change. The PR removes a useless cast in the Windows _dev_read wait call in std/net/tun/device.salam, which the author says triggers error E093 and stops programs that import net/tun from building for Windows. The title names the module and the platform, and it states the goal of the fix. It does not name the specific cast removal, but that detail is not required.

Full details: Description check

Explanation

The description covers the problem and the fix clearly. It explains that the useless cast causes error E093, that the cast removal restores x86_64-w64-windows-gnu builds, and how the author checked the change (salam check --check-std, a cross build from main, and a build with 0.7.1). It is missing several template sections: Related Issue, a formal Proposed Changes list, a How Was This Tested section with commands, Additional Notes, and most of the checklist. The testing information exists but is not in the template's format. These gaps are non-critical for a one-line fix, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 395f1587-65a1-460a-85fb-28c51767a166
Commits

Reviewing files that changed from the base of the PR and between 1d1e634 and d85bd1e.

Files selected for processing: 1

  • std/net/tun/device.salam

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@BaseMax
BaseMax merged commit fe8c079 into main Nov 26, 2026
19 checks passed
@BaseMax
BaseMax deleted the tun-windows-build branch November 26, 2026 15:55
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.

1 participant