← Zurück zu Desktop-App-Entwickler
Entdecke, wie der Skill hilft
1. Understand Cargo Semver &
4. Feature Unification &
Rust und native Abhängigkeiten
Aktualisiert native Pakete mit Blick auf Lockstände, Typkompatibilität, Werkzeugketten und Zielplattformen.
rust-native-dependencies
Teammitglieder mit diesem Skill
Wann ist der Skill hilfreich?
Nutze diesen Skill bei Rust-Crates oder Brücken zu Desktop, Python, Node oder WebAssembly.
Wobei hilft er dir?
- Verfolgt doppelte Crates und gekoppelte Paketstände.
- Prüft Compileranforderungen und passende Generatorversionen.
- Nutzt gezielte Lockfile-Updates und Zielbuildprüfungen.
Das könntest du fragen
Untersuche widersprüchliche HTTP-Typen nach dem Upgrade und schlage die kleinste abgestimmte Aktualisierung vor. Verfolge inkompatible Typen zu Crate-Versionen und Features. Prüfe den abgestimmten Satz mit unterstütztem Compiler und nativem Ziel statt nur auf dem Host.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Rust & Native Dependencies
When to Use
Use when upgrading Rust crates (Cargo.toml / Cargo.lock), Tauri/NAPI-RS/PyO3 native bridges, WebAssembly toolchains (wasm-bindgen), or C/C++ native addons (node-gyp, prebuild, -sys crates).
Cargo Semver, Feature Flags & Lockfile Discipline
1. Understand Cargo Semver & 0.x Rules
- In Cargo, bare version strings (
"1.2.3") mean^1.2.3(semver-compatible). - For
0.x.ycrates (wherex > 0),0.2.0$\rightarrow$0.3.0is a breaking major bump in Cargo's resolver! Updating a0.xcrate frequently introduces duplicate versions inCargo.lockif sibling crates still depend on the older0.xminor. - Use
cargo update -p <crate>(orcargo update -p <crate>@<old> --precise <new>) to update specific crates inCargo.lockwithout moving the entire dependency tree.
2. Detect & Eliminate Duplicate Crate Resolutions
- Run
cargo tree -dafter everyCargo.tomledit. - Duplicate versions of core ecosystem crates (
tokio,serde,rand,http,bytes,syn,windows-sys,rustls,sqlx) bloat compile times, increase binary size, and—critically—cause type incompatibility errors when one crate returnshttp::Request(fromhttp 0.2) and another expectshttp::Request(fromhttp 1.0). - Upgrade coupled crate ecosystems together:
axum+tower-http+hyper+http+tokioserde+serde_json+serde_withtracing+tracing-subscriber+opentelemetrytauri+tauri-build+tauri-plugin-*(plus matching@tauri-apps/apiand@tauri-apps/plugin-*JS packages!)wasm-bindgencrate inCargo.lockmust match the exact version of thewasm-bindgen-clibinary used in build scripts.
3. MSRV (Minimum Supported Rust Version) & Toolchain Checks
- Check
rust-versioninCargo.toml,rust-toolchain.toml(channel = "1.xx.0"), and CI / Dockerfile Rust images. - Transitive crates frequently bump their MSRV in minor or patch releases (
cargo updatepulls a latest transitive version requiring Rust1.82+when CI runs1.78). - If constrained by an older MSRV, use
cargo update -p <transitive-crate> --precise <msrv-compatible-version>or Cargo's MSRV-aware resolver (resolver = "2"/"3"withcargo +<msrv> check).
4. Feature Unification & default-features = false
- Cargo unifies features across all workspace members unless isolated. Inspect
cargo tree -e features -i <crate>to see which dependency enabled an unwanted feature (e.g., pullingnative-tls/ OpenSSL when the project standardizes onrustls-tls). - When upgrading
-syscrates (openssl-sys,libsqlite3-sys,zstd-sys,ring,aws-lc-rs), check whethervendored/bundledfeatures or systempkg-config/cmake/clangbuild tools are required across macOS, Linux (gnuvsmusl), and Windows (msvc).
5. Native Addons in Node / Python / Desktop Apps
- For Node native modules (
better-sqlite3,sharp,bcrypt,keytar,node-pty,@swc/core,@rollup/rollup-*,esbuild):- Check prebuilt binary availability (
N-APIversion,node-pre-gyp,prebuild-install, or platform-specificoptionalDependencies). - Ensure
package-lock.json/pnpm-lock.yamlretains all platformoptionalDependencies(darwin-arm64,darwin-x64,linux-x64-gnu,linux-arm64-gnu,win32-x64-msvc) so developing on macOS does not strip Linux/Windows entries needed in CI or Docker. - In Electron/Tauri apps, verify
electron-rebuild/@electron/rebuildcompatibility against the bundled Electron ABI (process.versions.modules).
- Check prebuilt binary availability (
Enthaltene Dateien 1
SKILL.md
