Skip to content

Fix Windows build failing on dead code errors - #2737

Merged
leighmcculloch merged 4 commits into
mainfrom
fix-windows-build-warnings
Sep 21, 2026
Merged

leighmcculloch merged 4 commits into
mainfrom
fix-windows-build-warnings

Conversation

@leighmcculloch

Copy link
Copy Markdown
Member

What

Put FileMode and enforce_hardened_tree in the config locator fully behind #[cfg(unix)].

Why

The Rust workflow's Windows jobs (build-and-test-windows, publish-dry-run) have been failing because FileMode and enforce_hardened_tree are only ever called from unix-only sites and tests and become dead code on windows.

For example:

Since the items are only needed on unix builds, they can be cfg behind the unix property so that the dead code doesn't exist for Windows builds.

Known limitations

N/A

@leighmcculloch
leighmcculloch requested review from a team and a balanced review from Copilot September 21, 2026 09:20
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Sep 21, 2026
@leighmcculloch leighmcculloch changed the title Fix Windows build put unix-only logic behind cfg(unix) Fix Windows build failing on dead code errors Sep 21, 2026
@leighmcculloch
leighmcculloch enabled auto-merge (squash) September 21, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The platform gates consistently cover the Unix-only implementation, callers, and tests without changing Unix behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Restricts Unix-specific permission-hardening code and test imports to Unix builds, resolving Windows compilation failures.

Changes:

  • Gates FileMode and enforce_hardened_tree behind #[cfg(unix)].
  • Gates the corresponding test import on Unix.
File Description
cmd/​soroban-cli/​src/​config/​locator.rs Makes permission-tree hardening Unix-only.
cmd/​soroban-cli/​src/​commands/​contract/​build/​source_archive.rs Prevents unused imports in Windows tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 21, 2026 19:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The platform gates directly address the reported Windows warnings without changing Unix behavior.

Review effort: Balanced
Findings: None

@leighmcculloch
leighmcculloch merged commit b093f2f into main Sep 21, 2026
233 checks passed
@leighmcculloch
leighmcculloch deleted the fix-windows-build-warnings branch September 21, 2026 19:38
@github-project-automation github-project-automation Bot moved this from Backlog (Not Ready) to Done in DevX Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants