惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

Yuexun J

Native macOS Updates in Tauri Why MCP Matters Developing an App with My AI Intern My Journey with Vim How the Notion Editor Works The Vim Guide for VS Code Users
How to Make Your Tauri Dev Faster
Yuexun Jiang · 2025-05-01 · via Yuexun J

Tauri is great. Small bundles. Low memory. Not Electron.

But tauri dev can be painfully slow. Change one line of Rust, wait a minute. Watch dependencies recompile for no apparent reason. Wonder if you made a terrible technology choice.

You didn’t. The tooling is just fighting itself.

Here’s how to fix it.

The Problem

Watch your terminal next time you run tauri dev. Notice how it recompiles dependencies that haven’t changed? That’s not normal. Something is triggering unnecessary rebuilds.

The culprit: MACOSX_DEPLOYMENT_TARGET.

Tauri reads bundle.macos.minimumSystemVersion from your config and sets this environment variable during builds. If you haven’t set it, it defaults to 10.13.

Meanwhile, rust-analyzer runs cargo check in your editor — without that variable set. Different environment means different build cache. Every time you save, both tools invalidate each other’s work.

One minute per change. Unacceptable.

The Fix

Make them agree. Add this to your editor settings:

{
  "rust-analyzer.cargo.extraEnv": {
    "MACOSX_DEPLOYMENT_TARGET": "10.13"
  }
}

And this to tauri.conf.json:

{
  "bundle": {
    "macos": {
      "minimumSystemVersion": "10.13"
    }
  }
}

Same value. Both places. Restart everything.

One minute became twenty-five seconds.

Still Slow?

You might still see this: Blocking waiting for file lock on build directory.

rust-analyzer and tauri dev are fighting over the same target folder. One waits for the other. Your build stalls.

Give them separate directories:

{
  "rust-analyzer.cargo.targetDir": "target/analyzer"
}

Now rust-analyzer writes to target/analyzer. tauri dev writes to target. No conflicts.

This also fixes the environment variable problem. Separate caches mean they can’t invalidate each other.

Twenty-five seconds became fifteen.

Going Further

Want more? Tweak your Cargo profiles.

You probably don’t need full debug info for dependencies. A little optimization can speed up linking.

# src-tauri/Cargo.toml

[profile.dev]
incremental = true
opt-level = 0
debug = true

[profile.dev.package."*"]
opt-level = 1
debug = false

First build after this change will be slow. Dependencies need recompiling. Judge by subsequent builds.

Fifteen seconds became ten.

Summary

Three changes:

  1. Match MACOSX_DEPLOYMENT_TARGET — Same value in editor settings and tauri.conf.json. Stops cache invalidation between tools.

  2. Set rust-analyzer.cargo.targetDir — Separate build caches. No file locks. No environment conflicts. This is the big one.

  3. Optimize dependency builds — Less debug info, slight optimization. Minor gains, some trade-offs.

One minute to ten seconds. Worth the five minutes it took to configure.

Now get back to building.

References