Skip to content

fix(v2): keep generated wailsjs file permissions consistent - #6247

Open
taliesin-ai wants to merge 1 commit into
wailsapp:masterfrom
taliesin-ai:fix/issue-6192-1f6038ab20ea
Open

taliesin-ai wants to merge 1 commit into
wailsapp:masterfrom
taliesin-ai:fix/issue-6192-1f6038ab20ea

Conversation

@taliesin-ai

@taliesin-ai taliesin-ai commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Wails v2 alternates generated runtime file permissions between 0644 and 0755 when a project runs wails generate module and wails build. Initial template installation also leaves different permissions from the first regeneration.

Apply the existing binding generator's 0755 permission convention after runtime-wrapper extraction and initial installation of the default frontend/wailsjs directory. Add regression tests for both paths and a changelog entry.

Closes #6192.

Validation on the same fixed commit in native ARM64 VMs:

  • Ubuntu and macOS: ran init, generate module, build and generate module again. Permissions remain 0755 throughout on the fix; both added tests fail with the changes reverted and pass with the fix. Relevant native package tests pass.
  • Windows: both native CLI builds, all fixture child commands and the commands/templates/filesystem package tests pass. The Unix permission tests explicitly skip. Every generated file was hashed at four steps; corresponding base/fixed snapshots match exactly. The sealed Windows worker report retains partial status because runtime bytes differ between generate and build on both base and fix. Review accepts this as an unchanged baseline limitation, with no new content regression. Hash comparisons against the exact Git blobs establish that all three runtime files alternate solely between LF and CRLF; the cause of the differing embedded line endings has not been fully diagnosed. This PR does not claim a Windows permission reproduction or resolve that pre-existing content difference.

The CLI sequence used build -s; an interactive wails dev session was not exercised.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed inconsistent permissions on generated Wails JavaScript files and directories across initialization, generation, build, and development workflows.
  • Documentation
    • Added an unreleased changelog entry describing the permissions fix.

Workflow request: fb79679a-bd46-4310-b412-0e0851b61f89
Patch-SHA256: 4c25624ce86b6d198e260133c4b4d2a37a7dc6e57c26b5c3ef4ea2aa4ef4c991
@github-actions github-actions Bot added Bug Something isn't working v2 Documentation Improvements or additions to documentation cli templates labels Oct 10, 2026
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: wailsapp/wails/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b796ccca-8190-459e-92be-eaf9f1690625

📥 Commits

Reviewing files that changed from the base of the PR and between aa1c3c6 and 1f6038a.


📒 Files selected for processing (5)
  • v2/pkg/commands/build/base.go
  • v2/pkg/commands/build/base_test.go
  • v2/pkg/templates/templates.go
  • v2/pkg/templates/templates_test.go
  • website/src/pages/changelog.mdx

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



Walkthrough

The changes apply 0755 permissions to generated runtime wrapper and template wailsjs directories. New tests check permissions on non-Windows platforms. The Unreleased changelog records the reported file-mode inconsistency.

Changes

wailsjs permissions

Layer / File(s) Summary
Runtime wrapper permissions
v2/pkg/commands/build/base.go, v2/pkg/commands/build/base_test.go
Runtime wrapper generation applies 0755 permissions after extraction and returns any permission-setting error. The test checks permissions for each walked entry on non-Windows platforms.
Template installation permissions
v2/pkg/templates/templates.go, v2/pkg/templates/templates_test.go, website/src/pages/changelog.mdx
Template installation applies 0755 permissions to frontend/wailsjs when it exists. The test checks the directory tree on non-Windows platforms. The changelog records the file-mode inconsistency across the listed commands.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 1f603

The permission changes appear ready to merge after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: consistent permissions for generated wailsjs files.
Description check Passed The description explains the bug, fix, issue reference, regression tests, platform validation, changelog update, and known test limitations. It does not provide wails doctor output or complete the tem…
Linked Issues check Passed The PR meets the coding requirements in directly linked issue #6192. generateRuntimeWrapper calls fs.SetPermissions(wrapperDir, 0755) after extraction. CompileProject calls this path, so build a…
Out of Scope Changes check Passed The changed files support issue #6192. They update runtime-wrapper permissions, initial template permissions, regression tests, and the changelog. The reviewed changes do not show unrelated product be…

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 golangci-lint (2.13.2)

golangci-lint (2.13.2) skipped for v2/.golangci.yml: configuration requires version: "2". Migrate older configurations using golangci-lint migrate and review the result; see https://golangci-lint.run/docs/product/migration-guide/.



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

I’m a rabbit with paws in the code,
I hop where the runtime files go.
Each gets its mode set,
With a test to check yet,
Then I nibble a changelog note.

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working cli Documentation Improvements or additions to documentation templates v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2] wailsjs file modes differ between wails generate module and wails build/wails dev — spurious git mode changes

1 participant