-
Notifications
You must be signed in to change notification settings - Fork 57
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
Slow build.rs / rust analyzer #913
Comments
Skipping the check in // Check if we're likely running in a check-like context
let opt_level = std::env::var("OPT_LEVEL").unwrap_or_else(|_| "0".to_string());
let profile = std::env::var("PROFILE").unwrap_or_else(|_| "release".to_string());
let is_check_like = profile == "debug" && opt_level == "0";
if is_check_like {
println!("cargo:rerun-if-changed=build.rs");
// Skip the heavy logic
println!("Skipping build.rs logic for cargo check/clippy.");
} else {
const BROWSER_ROOT: &str = "../browser/"; EDIT: No, this does not a good solutions, it too often maps to |
joepio
added a commit
that referenced
this issue
Jul 23, 2024
joepio
added a commit
that referenced
this issue
Jul 23, 2024
New solution: println!("cargo:rerun-if-changed=build.rs");
// Env is set in .vscode/settings.json when rust-analyzer runs
let is_rust_analyzer = !std::env::var("IS_RUST_ANALYZER")
.unwrap_or_default()
.is_empty();
if is_rust_analyzer {
p!("Skipping build.rs logic to keep cargo check/clippy fast. If you see this message in some other context: the JS build not run!");
} else {
const BROWSER_ROOT: &str = "../browser/"; |
joepio
added a commit
that referenced
this issue
Oct 7, 2024
joepio
added a commit
that referenced
this issue
Oct 7, 2024
joepio
added a commit
that referenced
this issue
Feb 3, 2025
joepio
added a commit
that referenced
this issue
Feb 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running
build.rs
has some steps that are sometimes unnecessarily slow. This is particularly annoying because rust-analyzer seems to be slowed down due to this.The text was updated successfully, but these errors were encountered: