fix: DEV-DEPENDENCIES.sh só instala ferramentas, não configura cargo
- Remove configuração automática do ~/.cargo/config.toml - O workspace já tem .cargo/config.toml que sobrescreve o global - Devs só precisam rodar ./DEV-DEPENDENCIES.sh para instalar mold/lld/clang - Config do projeto (./.cargo/config.toml) é usado automaticamente
This commit is contained in:
parent
abc8a8eaf3
commit
685c7d6a96
1 changed files with 10 additions and 27 deletions
|
|
@ -50,30 +50,13 @@ ldconfig
|
||||||
|
|
||||||
command -v mold &> /dev/null || install_mold
|
command -v mold &> /dev/null || install_mold
|
||||||
|
|
||||||
configure_cargo() {
|
echo "Dev dependencies installed!"
|
||||||
echo "Configuring Cargo for fast linking (mold/lld)..."
|
echo ""
|
||||||
|
echo "✅ Tools installed: clang, lld, mold, sccache"
|
||||||
# Detect current user's home directory
|
echo "📦 Project will use .cargo/config.toml from workspace"
|
||||||
if [ -n "$SUDO_USER" ]; then
|
echo "⚡ Link time reduced by ~30-40% with mold/lld"
|
||||||
USER_HOME=$(eval echo ~$SUDO_USER)
|
echo ""
|
||||||
else
|
echo "Next steps:"
|
||||||
USER_HOME=$HOME
|
echo " 1. Run: ./DEV-DEPENDENCIES.sh (already done)"
|
||||||
fi
|
echo " 2. Workspace .cargo/config.toml will be used automatically"
|
||||||
|
echo " 3. Build: cargo build -p botserver --bin botserver"
|
||||||
mkdir -p "$USER_HOME/.cargo"
|
|
||||||
cat > "$USER_HOME/.cargo/config.toml" << 'EOF'
|
|
||||||
[target.x86_64-unknown-linux-gnu]
|
|
||||||
linker = "clang"
|
|
||||||
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
|
|
||||||
|
|
||||||
[build]
|
|
||||||
jobs = 6
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "Cargo configured for $USER_HOME!"
|
|
||||||
echo "Link time reduced by ~30-40%"
|
|
||||||
}
|
|
||||||
|
|
||||||
configure_cargo
|
|
||||||
|
|
||||||
echo "Dev dependencies installed!"
|
|
||||||
Loading…
Add table
Reference in a new issue