New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] tauri-build build script always rebuild if tauri.conf.json is missing #8721
Comments
In my opinion, adding an empty So, if a user deletes the And thanks for reporting the bug btw. |
In principle, I really dislike ambiguous logic/environment/etc, because it causes confusion. 3 months later when I revisit this project and see both tauri.conf.json and Tauri.toml, especially the former being But if you guys really want to keep the empty tauri.conf.json, please document this behavior in https://tauri.app/v1/references/configuration-files. There is currently no mentioning that by switching the non-default option and deleting the old file, it causes side-effect. |
Yeah, because that's a bug 😅 Don't worry, we will fix it ASAP and consider all the odds. Thank You |
I agree, this should be the solution |
This allows disabling rebuilding when `tauri.conf.json` when using another config format see #8721
Actually, according to my test, if I see you are making #8732. Thank you so much! However, I do not know where in |
* feat(tauri-build): add `config-json` feature flag This allows disabling rebuilding when `tauri.conf.json` when using another config format see #8721 * document feature flag * Update .changes/tauri-build-config-json.md [skip ci] * Update core/tauri/src/lib.rs [skip ci] * disable default features for tauri-build on tauri, plugins * fmt --------- Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Describe the bug
When only using Tauri.toml for the config file, the build script always rebuilds the final executable even nothing is changed. This is due to the usage of unconditional
cargo:rerun-if-changed=tauri.conf.json
in the build function. Since there is notauri.conf.json
file, andrerun-if-changed
considers missing file the same as "stale file", it always triggers the rerun.Removing the unconditional
println!("cargo:rerun-if-changed=tauri.conf.json")
line, or placing a duplicatetauri.conf.json
in the project bypasses the problem.Reproduction
Simply switch to use the Tauri.toml file (and of course the
config-toml
feature). Build the project, then build it again without changing anything.Expected behavior
There should be no rebuild triggering.
Full
tauri info
outputStack trace
No response
Additional context
I think the default
tauri.conf.json
should have its own feature, just likeconfig-toml
, and make it default in Cargo. Then we can conditionally include the rerun line with a#[cfg(feature)]
.The text was updated successfully, but these errors were encountered: