{{ message }}
Repository navigation
fix(tauri): ship generated permission files in the plugin crates - #743
Merged
Merged
Conversation
tauri-plugin-wdio-webdriver never packaged permissions/autogenerated/reference.md because the root .gitignore excluded it, so tauri_plugin::Builder tried to write it at build time and failed in read-only vendored source trees. Commit the generated files for both plugin crates and check in CI that they stay in sync with build.rs and end up in the packaged crate. Closes #730 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
2 tasks done
The package check only looked for reference.md, so tauri-plugin-wdio could drop its generated commands/*.toml from the crate without failing CI. Compare `cargo package --list` against every committed file under permissions/autogenerated and list the missing ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, Windows and old Tauri - turbo: stop caching permissions/ as build:rust outputs, so a cache hit at release can't restore stale bytes over the committed files. - tauri-plugin-wdio: raise the tauri-plugin build-dependency floor to 2.5.3, matching the webdriver crate; older generators write a different reference.md, so read-only builds of old-Tauri apps would still fail. - .gitattributes: never EOL-convert the generated files. - CI: the package check also covers permissions/schemas, runs even when clippy failed, and reads git status once so a git failure isn't read as clean. The nightly crate-drift run fails when fresh dependencies change the committed files. - detect-changes: a generated reference.md under packages/*/permissions runs its service's CI instead of being classed as docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks
- CI error says to delete permissions/autogenerated, rebuild, and commit including deletions, since stale files left on disk survive a rebuild. - Nightly crate-drift deletes permissions/autogenerated before building, and its issue text covers permission-file drift as well as build failures. - .editorconfig: only the schemas lack a final newline; the autogenerated files keep theirs. Biome's comment no longer claims otherwise. - tauri-plugin-wdio: declare the runtime tauri-plugin floor as 2.5.3, which cargo already enforces through the build-dependency. - detect-changes spec derives the expected runs from the service list. - Wrap lines over 120 characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heck - crate-drift compares a crate's permission files only when its build succeeded, so a broken fresh dependency isn't also reported as drift. - .gitignore re-includes only reference.md and commands/*.toml under permissions/autogenerated, so stray files there stay ignored. - rust-version matches what the dependency floors need: 1.77.2 for tauri-plugin-wdio (tauri-plugin 2.5.3) and 1.83 for tauri-plugin-wdio-webdriver (glib 0.21 on Linux). - tauri-plugin-wdio drops the unused runtime tauri-plugin and build-time tauri-build dependencies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d permission files - Restore the published rust-version values, so MSRV-aware resolvers still offer this fix to apps on older toolchains. - Re-include everything under permissions/autogenerated again, so the drift checks and the git-based package list see any new generator output. - Drop tauri-build from tauri-plugin-wdio in the Tauri fixture lockfiles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…b's build gate The schemas were always committed and packaged, so checking them guards nothing today. The drift job already fails on a build error, so skipping the permission comparison then only spared a second error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package check runs on Linux and the crates publish from Linux, and on Windows git normalises line endings when comparing, so they protected nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
tauri-plugin-wdio-webdriverhas never shippedpermissions/autogenerated/reference.md(1.0.0 through 1.5.0). Itsbuild.rsrunstauri_plugin::Builder, which writes that file at build time unless it already holds the exact bytes it would generate. In a read-only vendored source tree (cargo vendor+chmod -R a-w), the write fails withunable to create permissions dir: Permission denied.Cause: the root
.gitignorehas**/autogenerated/**/*. The webdriver crate has noinclude =, socargo packagerespects.gitignoreand leaves the generated files out.tauri-plugin-wdioonly ships them by luck: itsinclude = [...]makes cargo read the filesystem, so it picks up whatever the pre-publish build generated.Fix
This takes the same approach as Tauri's official plugins (
tauri-plugin-shell,tauri-plugin-fs): commit the generated files and make sure they ship byte-for-byte..gitignorerule,!packages/tauri-plugin*/permissions/autogenerated/**, re-includes everything under that directory. Any new generator output therefore shows up in the drift checks and the package file list. The files were generated withcargo check, so they're exactly whattauri_plugin::Builderwrites with the lockedtauri-plugin/tauri-utils.reference.mdonly, since its command list is empty.tauri-plugin:reference.mdpluscommands/*.toml.permissions/schemas/schema.jsondoesn't change for either crate.turbo.json:@wdio/tauri-plugin#build:rustno longer listspermissions/autogenerated/**andpermissions/schemas/**as outputs. The release workflow runs this task, and a cache hit would otherwise restore stale bytes over the committed files before publishing. Its inputs never includedpermissions/default.tomlorCargo.lock. No other task orscripts/test-package.tsrelies on these as build outputs;test-package.tscopies the plugin source tree.tauri-plugin-wdio: thetauri-pluginbuild-dependency floor goes from2.0.0to2.5.3, matching the webdriver crate. With the old floor, apps on older Tauri could resolve atauri-utilswhose generator writes a differentreference.md, so read-only builds would still fail.tauri-plugin-wdio: the unused runtimetauri-plugindependency and the unusedtauri-buildbuild-dependency are removed. The crate'sCargo.lockand both Tauri fixture lockfiles drop thetauri-buildedge. The crate's lockfile also updates its own version entry to 1.5.0, which matches main..editorconfig:insert_final_newline = falsenow applies only topermissions/schemas/**. The schemas have no final newline, but the autogenerated files end with one, and an editor stripping it would break byte identity. Biome's matching ignore comment is corrected._ci-rust-clippy.reusable.ymlbehind a newgenerated-permissions-cratesinput. Only the Linux Tauri clippy job enables it, because the generated files don't depend on the platform. The step runs even if clippy failed. For each crate, it:permissions/autogenerated, runscargo check, and fails ifgit status -- <crate>/permissionsisn't clean. This keeps the committed files in sync withbuild.rs; deleting first means the check can't pass just because the build script didn't re-run. The error tells you to do the same locally: deletepermissions/autogenerated, rebuild, and commit the result, including deletions.permissions/autogenerated, or ifcargo package --listis missing any committed file underpermissions/autogenerated. It lists the missing files.crate-drift.ymlre-resolves dependencies and runscargo check. It now deletespermissions/autogeneratedfirst, the same as the PR check. The run then fails if the build changed its committedpermissions/files, so a newtauri-utilsrelease that changes the generator's output gets caught. The auto-filed issue's text covers both cases.scripts/detect-changes.tsno longer classes*.mdunderpackages/<pkg>/permissions/**as docs, so a PR that only touches a generatedreference.mdstill runs the Tauri jobs.Why there's no read-only vendored build in CI: a dependency's build script makes no writes when two things hold: the committed files match what the generator produces, and they're in the package. The checks above cover exactly those. A CI read-only build would need
cargo package, unpacking the crate, a copied lockfile and a throwaway consumer crate. The only extra case it would catch is a future Tauri build script writing outsidepermissions/. I ran that build once by hand instead (see Testing).The crate versions in
Cargo.tomlare unchanged; releasekit handles them.rust-versionis also unchanged, so MSRV-aware resolvers still pick this release for apps on older toolchains.Related Issues
Closes #730
Type of Change
Scope
scope:electron- Electron service and CDP bridgescope:tauri- Tauri service and pluginChecklist
pnpm test)The tests are the new CI checks plus new
detect-changescases. I didn't run the fullpnpm testlocally. I did runpnpm test:scripts,cargo testfor both crates, and the pre-push hook's turbo typecheck/test, and all of them pass.Testing
Run locally on macOS (arm64), rustc 1.97.1:
Packaging:
cargo package --listnow includes every committed file underpermissions/autogeneratedandpermissions/schemasfor both crates. With the old.gitignoreand the files untracked, the webdriver crate's list didn't includereference.md, even though the file was on disk.Read-only vendored build, run by hand:
cargo package --no-verifyon the webdriver crate, unpack the.crate,chmod -R a-w, thencargo check --offlinea consumer crate that depends on it by path. It passes. Withpermissions/autogeneratedremoved from the unpacked crate, it fails with the error from the issue (unable to create permissions dir: ... PermissionDenied).New CI step script, extracted from the workflow and run per crate:
tauri-plugin'sbuild.rs. It reports the new untrackedcommands/drift_probe.tomland the modifiedreference.mdandschema.json, and the error gives the delete, rebuild and commit advice.tauri-pluginwith itsincludenarrowed: missingcommands/*.toml(all six are listed).exclude: missingreference.md.New
crate-drift.ymlblock (delete,cargo check, git status), run under/bin/bash3.2 to match the macOS runner:dioxus-bridge, which has nopermissions/directory..gitignore: a new file anywhere underpermissions/autogenerated/, including in a new subdirectory, shows up as untracked..editorconfig: the committed files contain no CR bytes or trailing whitespace. Only the twoschema.jsonfiles lack a final newline.Removed dependencies: nothing in
tauri-plugin'ssrc/orbuild.rsusestauri_pluginat runtime ortauri_build. In the fixture lockfiles, the only other change cargo would make is moving the two path crates' stale self-versions to 1.5.0, which main already has.detect-changes: the new spec cases fail against the old classifier and pass with the change.pnpm test:scriptspasses (111 tests), andtypecheck:scriptsis clean.Lint and Rust:
cargo clippy --all-targets -- -D warningsandcargo testare clean for both crates (webdriver: 28 tests pass;tauri-pluginhas no Rust tests).actionlintis clean on all changed workflows. Biome is clean on the changed TS/JSON.Left to CI: the new step on
ubuntu-latestin Clippy Tauri Crates [Linux].crate-drift.ymlalso runs on this PR because the workflow file changed, so its Fresh deps legs run against today's newest dependencies.Unit tests added/updated
Integration tests added/updated
E2E tests added/updated (if applicable)
Manually tested on: macOS 26 (arm64)
Additional Context
The committed files are tied to the generator in the locked
tauri-plugin/tauri-utils. If a later bump changes the output, the clippy-job check fails on the PR and the nightly crate-drift check fails on main. In both cases, the fix is to deletepermissions/autogenerated, build the crate and commit the regenerated files. Building a Tauri fixture app against a newer Tauri would also rewrite them in the working tree.🤖 Generated with Claude Code