From 12377c78f97f1e0bdbb7525950afa6effa24f1b1 Mon Sep 17 00:00:00 2001 From: "G.Reijn" Date: Fri, 22 Aug 2025 08:29:38 +0200 Subject: [PATCH] Fix build script to use CratesIO --- .cargo/config.toml | 5 ----- build.ps1 | 20 +++++++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 5c7f0d697..eabb62219 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -19,8 +19,3 @@ rustflags = ["-Ccontrol-flow-guard", "-Ctarget-feature=+crt-static", "-Clink-arg [source.crates-io] replace-with = "POWERSHELL" -#[target.aarch64-unknown-linux-gnu] -#linker = "aarch64-linux-gnu-gcc" - -#[target.aarch64-unknown-linux-musl] -#linker = "aarch64-linux-musl-gcc" diff --git a/build.ps1 b/build.ps1 index c551877d5..d632dd19d 100755 --- a/build.ps1 +++ b/build.ps1 @@ -164,8 +164,6 @@ if ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore } } elseif ($null -ne (Get-Command rustup -CommandType Application -ErrorAction Ignore)) { $rustup = 'rustup' -} else { - $rustup = 'echo' } if ($null -ne $packageType) { @@ -229,7 +227,11 @@ if ($null -ne $packageType) { ## Test if tree-sitter is installed if ($null -eq (Get-Command tree-sitter -ErrorAction Ignore)) { Write-Verbose -Verbose "tree-sitter not found, installing..." - cargo install tree-sitter-cli --config .cargo/config.toml + if ($UseCratesIO) { + cargo install tree-sitter-cli + } else { + cargo install tree-sitter-cli --config .cargo/config.toml + } if ($LASTEXITCODE -ne 0) { throw "Failed to install tree-sitter-cli" } @@ -380,7 +382,11 @@ if (!$SkipBuild) { else { if ($Audit) { if ($null -eq (Get-Command cargo-audit -ErrorAction Ignore)) { - cargo install cargo-audit --features=fix --config .cargo/config.toml + if ($UseCratesIO) { + cargo install cargo-audit --features=fix + } else { + cargo install cargo-audit --features=fix --config .cargo/config.toml + } } cargo audit fix @@ -413,7 +419,11 @@ if (!$SkipBuild) { else { if ($Audit) { if ($null -eq (Get-Command cargo-audit -ErrorAction Ignore)) { - cargo install cargo-audit --features=fix --config .cargo/config.toml + if ($UseCratesIO) { + cargo install cargo-audit --features=fix + } else { + cargo install cargo-audit --features=fix --config .cargo/config.toml + } } cargo audit fix