tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.79k stars 2.45k forks source link

[bug v1] unable to use 2024 edition because tauri-build reads Cargo.toml with old cargo_toml crate #10412

Open anatawa12 opened 1 month ago

anatawa12 commented 1 month ago

Describe the bug

unable to use 2024 edition

error: failed to run custom build command for `app v0.1.0 (/Users/anatawa12/tauri-2024/src-tauri)`

Caused by:
  process didn't exit successfully: `/Users/anatawa12/tauri-2024/src-tauri/target/release/build/app-2cd9b7cd989b4b2b/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=TAURI_CONFIG
  cargo:rerun-if-changed=tauri.conf.json
  cargo:rustc-cfg=desktop
  TOML parse error at line 11, column 11
     |
  11 | edition = "2024"
     |           ^^^^^^
  data did not match any variant of untagged enum Inheritable
  : TOML parse error at line 11, column 11
     |
  11 | edition = "2024"
     |           ^^^^^^
  data did not match any variant of untagged enum Inheritable

warning: build failed, waiting for other jobs to finish...
       Error failed to build app: failed to build app

Reproduction

Create project with tauri cli and bump to 2024 edition

Expected behavior

it should work

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.81.0-beta.2 (08328a323 2024-07-25)
    ✔ cargo: 1.81.0-beta.2 (a2b58c3da 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: beta-aarch64-apple-darwin (default)
    - node: 20.12.2
    - pnpm: 8.15.4
    - yarn: 1.22.19
    - npm: 10.8.1

[-] Packages
    - tauri [RUST]: 1.7.1 (no lockfile)
    - tauri-build [RUST]: no manifest (no lockfile)
    - wry [RUST]: no manifest (no lockfile)
    - tao [RUST]: no manifest (no lockfile)
    - tauri-cli [RUST]: 1.5.14
    - @tauri-apps/api [NPM]: 1.6.0
    - @tauri-apps/cli [NPM]: 1.6.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: out
    - devPath: http://localhost:3030/
    - framework: React (Next.js)
    - bundler: Webpack

Stack trace

No response

Additional context

It looks parsing Cargo.toml is only for several checks so option to skip such a checks is one possible solution I think.

Rust 2024 is planned to be stabilized in rust 1.82.0 which will be released on October 17th so I tried them with nightly toolchain.

chippers commented 1 month ago

@anatawa12 can you test the feat/1.x-edition-2024 branch from #10414 and see if it works for your project?

anatawa12 commented 1 month ago

I tried a915361ddc6e63c749478f05bcb5ced9ad814aea and it works for my project. thank you