Commit Graph
181 Commits
Author SHA1 Message Date
github-actions[bot] 6bbd44d4ef publish new versions (#3675)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-10 12:50:18 -03:00
42ae8b4501 fix(ios): make init_plugin_* entry points public so release builds link on Xcode 27 (#3684)
* fix(ios): make `init_plugin_*` entry points public so release builds link on Xcode 27

Xcode 27's SwiftPM (Swift Build) gives non-public @_cdecl functions local
visibility in release builds, so each plugin's init_plugin_* is undefined
when Rust links. Mark them public in the 11 plugins with an iOS part.

See tauri-apps/tauri#16130

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Apply suggestion from @lucasfernog

---------

Co-authored-by: takakix2 <1370181+takakix2@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
2026-10-10 08:09:53 -03:00
Lucas Nogueira 46f7c878a0 chore: fmt 2026-10-09 15:08:52 -03:00
a8acd178bd feat(shell): add process group spawn option (fix #1332) (#3351)
* feat(shell): add process group spawn option (fix #1332)

Add a `processGroup` boolean option to the shell plugin's spawn command.
When enabled, the child process is spawned in its own process group (POSIX)
or job object (Windows) using the `process-wrap` crate, so that killing
the child also kills the entire process tree.

This fixes the issue where programs like PyInstaller wrappers spawn a
child process that gets orphaned when Tauri kills the parent.

* test(shell): add PyInstaller simulation tests for process group kill

Add end-to-end tests that reproduce the exact scenario from issue #1332:
a wrapper process (like PyInstaller's bootloader) spawns a grandchild.

- Without process_group: killing the wrapper orphans the grandchild
- With process_group: killing the wrapper also kills the grandchild

* refactor(shell): drop redundant cfg gates, trim process-wrap features

Address review feedback on #3351:

- Remove `#[cfg(any(unix, windows))]` gates on `ChildKind::ProcessGroup`,
  the kill/pid match arms, and the spawn block, plus the now-dead
  `#[cfg(not(any(unix, windows)))]` fallback. That cfg only excluded wasm,
  which this plugin never builds for.
- Set `default-features = false` on process-wrap and enable only the
  features actually used: std, process-group (unix), creation-flags and
  job-object (windows). Drops kill-on-drop, process-session, and tracing.

* fix(shell): enable process-wrap tracing feature, fix CI formatting and changefile

- Add `tracing` feature to process-wrap: with default-features = false its
  Windows job_object.rs calls `debug\!` unconditionally while the import is
  gated behind `#[cfg(feature = "tracing")]`, failing the Windows build with
  "cannot find macro `debug`".
- Reformat process/mod.rs assertions to satisfy `cargo fmt --check`.
- Reindent the process-wrap features array to 2 spaces for taplo.
- Use covector package keys (`shell` / `shell-js`) in the change file so the
  check-change-files and covector status jobs pass.

* refactor(shell): unify child handling on process-wrap, drop SharedChild

Collapse the ChildKind enum and the per-platform GroupChild types into a
single process-wrap-backed child. The command always spawns through
StdCommandWrap; the process_group flag is now just an optional wrapper
rather than a switch into a separate child type.

This drops the shared_child dependency and resolves two review notes:
the Unix path no longer hand-rolls killpg, and kill() now goes through
process-wrap's kill (start_kill + wait), which reaps the entire process
group instead of only signalling it.

A background thread polls try_wait to surface the exit status, since
process-wrap's wrappers only expose &mut self wait methods (the reason
SharedChild was used on Unix in the first place).

* chore(example): add process group toggle to shell view

* fix(shell): pass typed creation flags to process-wrap on Windows

`process_wrap::std::CreationFlags` is a newtype over the `windows` crate's
`PROCESS_CREATION_FLAGS`, not a raw `u32`, so the Windows build failed to
compile. Depend on `windows` (already in the tree via `tauri`, pinned to the
same 0.61 that `process-wrap` links against) and use its `CREATE_NO_WINDOW`
constant, which drops the hand-rolled magic number.

The wrap is still required: `JobObject::pre_spawn` calls `creation_flags` and
would otherwise clobber the `CREATE_NO_WINDOW` set at construction.

* perf(shell): block on child exit instead of polling try_wait

The switch from `SharedChild` to `process-wrap` moved the child behind a
mutex, since `StdChildWrapper`'s wait methods take `&mut self` while both
the wait thread and `CommandChild::kill()` need access. A blocking wait
would hold the lock for the child's whole lifetime and starve `kill()`,
so the wait thread polled `try_wait` every 10ms instead.

Block on the raw process outside the lock using a wait that does not reap
(`waitid` with `WNOWAIT` on unix, `WaitForSingleObject` on windows), then
take the lock once to let process-wrap collect the exit status. This is
the same technique shared_child uses internally, applied on top of
process-wrap's kill/reap semantics. No new dependencies or Cargo features
are required.

`kill()` reaps the child while holding the lock, so the raw wait can lose
that race and return ECHILD. That means the exit status is already cached
in the wrapper, so it is treated as success and the status is collected
via `try_wait`. Without this guard, a stress test of 300 spawn+kill
cycles produced 36 Error events in place of Terminated; with it, none in
900 cycles. The `try_wait` loop stays as a defensive fallback, though in
practice the first call succeeds immediately.

Mean latency for `Command::output()` on macOS (debug, 30 iterations of
`echo`) drops from 13.22ms to ~1.8ms, and 10 idle 5s children cost ~11ms
CPU total instead of ~75ms with the poll loop.

* fix(shell): keep CREATE_NO_WINDOW on process-group children (windows)

process-wrap's CreationFlags/JobObject coordination is broken during
spawn (watchexec/process-wrap#35): JobObject::pre_spawn cannot see the
CreationFlags wrapper, so it overwrote our flags with just
CREATE_SUSPENDED and process-group children flashed a console window.

Register CreationFlags(CREATE_SUSPENDED | CREATE_NO_WINDOW) after
JobObject so its pre_spawn runs last and wins. CREATE_SUSPENDED is kept
so the child cannot spawn grandchildren before job assignment; the same
upstream bug keeps wrap_child's resume check from seeing it, so the
child is still resumed.

* test(shell): run the process-tree kill tests on windows

Add a powershell variant of the pyinstaller simulation script and lift
the unix-only gates on the process-group tests, so the windows job in
test-rust exercises the job-object spawn/kill path instead of skipping
it. Both pyinstaller tests now also assert that a Terminated event is
still delivered after kill().

* Update plugins/shell/src/process/mod.rs

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>

* Update .changes/shell-process-group.md

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>

* Update plugins/shell/src/process/mod.rs

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>

* Delete .changes/shell-wait-no-poll.md

* refactor(shell): replace process-wrap with shared_child and an inlined job object

Use std process groups on unix and a job object on windows, with
shared_child handling wait and kill on all platforms.

* fix(shell): kill the process group even after its leader exited

CommandChild::kill returned early once the direct child had been reaped,
so killpg/TerminateJobObject never ran and anything the child left running
in its process group or job object survived, including on app exit.

Adds a launcher-style test (the child starts a grandchild and exits) that
runs on Windows, Linux and macOS.

* fix(shell): restore Debug on CommandChild

Dropping the derive was a breaking change for downstream types that derive
Debug and hold a CommandChild.

* fix(shell): don't block the main thread in the kill command

CommandChild::kill now waits for the child to exit, and the sync kill
command ran it on the main thread while still holding the children lock.
Make the command async and release the lock before killing.

---------

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-10-09 15:08:15 -03:00
github-actions[bot] 7eb8246d47 publish new versions (#3673)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-10-07 20:28:15 +02:00
Lucas Fernandes Nogueira 65ce65bdbb fix(ci): Android e2e flakes, shell Terminated sent before output (#3672)
* fix(ci): Android e2e flakes, shell `Terminated` sent before output

- close "isn't responding" system dialogs before each spec and hide error dialogs on the CI emulator:
  a launcher ANR dialog takes input focus from the app, and Android then denies clipboard reads
- retry switching to the webview context until it succeeds instead of running the spec in the
  native context when the first switch fails with "No such context found"
- save the focused window, a screenshot and logcat when an Android test fails
- shell: wait for the pipe readers to finish before emitting `Terminated`; the readers took their
  read lock on their own thread, so a child exiting quickly could have `close` emitted before
  its output

* Apply suggestion from @lucasfernog
2026-10-07 13:51:35 -03:00
github-actions[bot]andLucas Nogueira cbfd428bcc Publish New Versions (v2) (#3618)
* publish new versions

* clippy

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
2026-09-26 17:21:49 -03:00
Lucas Nogueira a433ec09d1 fix: mobile clippy warnings 2026-09-26 15:57:33 -03:00
Lucas Nogueira 3d8a3c877b chore: edition 2024 2026-09-26 15:36:22 -03:00
Lucas Nogueira 9b29b601f3 feat: update to tauri 2.12
- (MSRV bump
- Android compiler options update
- notification plugin windows7 feature deprecation
2026-09-26 14:46:48 -03:00
Lucas Fernandes Nogueira 28d644572c test(docs): run doctest on CI, make sure doctests pass (#3620)
* test(docs): run doctest on CI, make sure doctests pass

* no_run on dialog doctests [skip ci]
2026-09-22 13:18:21 -03:00
Lucas Nogueira a87a3c7d44 chore: update documentation 2026-09-22 11:30:47 -03:00
Lucas Fernandes Nogueira ae3c808eb6 fix: global API script should reuse window.__TAURI__ types (#3602)
currently each script inlines what it needs from @tauri-apps/api, so type checks like `image instanceof Image` all fail
2026-09-22 06:04:28 -03:00
github-actions[bot] 6aa2854f31 publish new versions (#3509)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-08-31 19:17:31 +08:00
Tony db9c5998fe fix(android): missing consumer-rules.pro (#3531)
* fix(android): missing `consumer-rules.pro`

* setup android test

* copy right too new

* build api first

* we're still on gradle 8 right now...

* restore the right host on mac
2026-08-13 17:44:29 +08:00
paul valladares dc7f87bc7e chore: exclude dev-only files from published crates (#3518)
* chore: exclude dev-only files from published crates

* format
2026-07-29 09:35:15 +02:00
Tony 13c63af965 chore: fix clippy (#3488) 2026-07-15 16:01:07 +08:00
Tony b86e999beb chore(deps): update tauri packages to 2.11 (#3407)
* chore(deps): update tauri packages to 2.11

* Downgrade derive_more

* Fix audit

* Update tauri-plugin
2026-05-01 16:39:43 +08:00
renovate[bot]andTony 250857b7b7 chore(deps): update dependency typescript to v6 (#3363)
* chore(deps): update dependency typescript to v6

* Use 6.0.3

* Fix eslint

* Add `rootDir` since it's no longer inferred
  > https://github.com/microsoft/TypeScript/issues/62508#issuecomment-3348659946

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2026-04-18 18:57:41 +08:00
renovate[bot]andTony 2c0883e64e chore(deps): update dependency vite to v8 (#3346)
* chore(deps): update dependency vite to v8

* `pnpm update --recursive`

* Regenerate api-iife

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2026-03-20 20:05:30 +08:00
github-actions[bot] 50b159f668 Publish New Versions (v2) (#3211)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-03 12:18:37 +01:00
Lucas Fernandes Nogueira 89f3e17952 chore: bump tauri to 2.10 (#3246)
* chore: bump tauri to 2.10

* pnpm i

* audit fix
2026-02-02 21:48:08 -03:00
Ale Sanchez d4613ff002 fix(shell): Make sidecars work in tests (fix #13767) (#3234) 2026-01-26 17:12:42 +01:00
github-actions[bot] 6e2e7e48c3 publish new versions (#3070)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-08 15:34:17 +01:00
TungliesandTony 31415effdf docs(shell): update example to include Encoding usage in Command::spawn (#3183)
* docs(shell): update example to include Encoding usage in `Command::spawn`

* docs(shell): update patch level to minor for Encoding usage in `Command::spawn` documentation

* Update .changes/doc-to-Encoding-usage-in-shell.md

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* docs(shell): update examples to demonstrate manual Encoding usage in command output

* Update plugins/shell/src/process/mod.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* docs(shell): update example to use 'windows-1252' encoding in command output

* Update plugins/shell/src/process/mod.rs

Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>

* docs(shell): update example command in documentation to use 'some-program' with 'some-arg'

* Bump shell-js in change file

* Fix indent
2025-12-29 10:58:55 +08:00
Nazar AntoniukandFabian-Lars a4aa53ab90 chore(shell): clarify that the code field in ExitStatus is intentionally left private (#3116)
Co-authored-by: Fabian-Lars <github@fabianlars.de>
2025-11-20 15:33:19 +01:00
Fabian-Lars 5438a5cd22 chore: apply clippy fixes (#3092) 2025-11-09 18:43:17 +01:00
github-actions[bot] e7a68fa637 publish new versions (#3068)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-27 11:31:06 +01:00
FabianLars 93426f8512 fix: fix docsrs builds 2025-10-27 11:12:56 +01:00
github-actions[bot] 06124af8d6 publish new versions (#2972)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-26 22:02:33 +01:00
Fabian-Lars 6c9b61fb65 chore: Update compileSdk to 36 (#3039) 2025-10-20 16:58:29 +02:00
github-actions[bot] b75f9f5cd3 publish new versions (#2954)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-25 18:15:22 +02:00
Lucas Fernandes Nogueira d865ed4768 fix(shell): run sidecar with dots in filename, closes #2310 (#2950)
* fix(shell): run sidecar with dots in filename, closes #2310

* fix import

* remove dead code

* code review suggestions

* clippy

* clippy
2025-08-25 10:44:47 -03:00
Lucas Fernandes NogueiraandTony 50cebdb6d5 chore(deps): update to tauri 2.8.0 (#2925)
* chore(deps): update to tauri 2.8.0

* fmt

* uipdate build

* tauri 2.8.1 and bump toml in plugin-fs

* tauri 2.8.1

* 2.8.2

* clippy [skip ci]

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
2025-08-19 10:09:44 -03:00
Fabian-Lars cc98e6a892 docs: Remove mirror install instructions (#2893) 2025-08-04 12:30:18 +02:00
Fabian-Lars 341919ed57 docs(shell): Remove left over tauri.conf.json > scope mentino 2025-07-22 09:58:00 +02:00
github-actions[bot] adc23d6c4f publish new versions (#2808)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-25 16:32:02 +02:00
renovate[bot]andTony f209b2f23c chore(deps): update tauri monorepo to v2.6.0 (v2) (#2804)
* chore(deps): update tauri monorepo to v2.6.0

* Regenerate api-iife.js

* Bump rust tauri

* Tweak all examples to match the new features

* Bump workspace min tauri version

* Bump `@tauri-apps/api` to ^2.6

* Add change file

* Update lock file

* missing `"`

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-06-25 17:52:38 +08:00
github-actions[bot]andFabianLars 3eebea2a17 publish new versions (#2712)
Co-authored-by: FabianLars <30730186+FabianLars@users.noreply.github.com>
2025-06-16 23:50:39 +02:00
renovate[bot]andFabianLars 8b63de9dfe chore(deps): update dependency rollup to v4.42.0 (v2) (#2750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-06-10 15:22:34 +02:00
renovate[bot]andTony c97e9c511d chore(deps): update tauri monorepo to v2.5.0 (v2) (#2634)
* chore(deps): update tauri monorepo to v2.5.0

* Update rust dependency and re-build iifes

* Downgrade for msrv

don't know why MSRV-aware resolver didn't work

* Downgrade cargo_metadata

* Downgrade home

* Downgrade native-tls

* trigger ci?

* Downgrade colored and base64ct

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-04-16 10:27:20 +08:00
9629c2f4f9 [v2][log]: Add generic fern::Dispatch TargetKind to log (#2600)
* [v2][log]: Add generic fern::Dispatch TargetKind to log

Original: https://github.com/tauri-apps/plugins-workspace/pull/1130/commits/b691382d1ea54733ca837995cfac9f82ea05f168

* Add change file

* clippy

---------

Co-authored-by: Tony <legendmastertony@gmail.com>
Co-authored-by: venkr <venkateshrameshkumar+1@gmail.com>
2025-04-07 10:13:17 +08:00
github-actions[bot]andlucasfernog 8b39aefb1b publish new versions (#2545)
Co-authored-by: lucasfernog <20051258+lucasfernog@users.noreply.github.com>
2025-04-02 00:31:52 -03:00
9cf0390a52 Merge commit from fork
* fix(shell): properly validate open scope

* change empty regex to an impossible match

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
Co-authored-by: Chip Reed <chip@chip.sh>
2025-04-02 00:24:25 -03:00
renovate[bot]andTony 4dd5c51436 chore(deps): update tauri monorepo to v2.4.1 (v2) (#2589)
* chore(deps): update tauri monorepo to v2.4.1

* Update tauri and regenerate command ref and schema

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tony <legendmastertony@gmail.com>
2025-04-02 09:37:19 +08:00
TonyandAmr Bashir 8ecb418a1a feat(auto-start): introduce a builder (#2569)
* feat(auto-start): introduce a builder

* Update examples

* Fix missing end --- in change file

* Fix missing self.

* Update .changes/autostart-builder.md

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>

---------

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
2025-03-25 22:57:40 +08:00
renovate[bot]andFabianLars 71f95c9f05 chore(deps): update rust crate windows to 0.60 (v2) (#2445)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
2025-02-27 11:45:55 +01:00
Tony c5da9d2579 chore: update prettier to 3.5.1 and enable experimentalOperatorPosition (#2427) 2025-02-16 10:36:53 +08:00
Tony 7d3869ced8 Regenerate api-iife (#2428) 2025-02-15 15:10:23 +02:00
renovate[bot]andFabianLars 05cca602d9 chore(deps): update rust crate tokio-tungstenite to 0.26 (v2) (#2210)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <fabianlars@fabianlars.de>
2025-01-06 13:38:40 +01:00