Skip to content

Instantly share code, notes, and snippets.

@HenkPoley
Created July 7, 2025 18:43
Show Gist options
  • Save HenkPoley/6bc7f6108706b01d01806e9f14a4885c to your computer and use it in GitHub Desktop.
Save HenkPoley/6bc7f6108706b01d01806e9f14a4885c to your computer and use it in GitHub Desktop.
OpenAI Codex up to date rust environment, and download packages.
#!/usr/bin/env bash
set -euo pipefail
CARGO_TOML="Cargo.toml"
PROFILE_CHUNK=$(cat <<'EOF'
[profile.dev]
opt-level = 0
debug = 0
incremental = true
codegen-units = 256
panic = "unwind"
lto = false
overflow-checks = false
[profile.test]
inherits = "dev"
EOF
)
# Check if profile.dev already exists
if grep -q "^\[profile\.dev\]" "$CARGO_TOML"; then
echo "Cargo.toml already contains [profile.dev], skipping patch."
else
echo "Appending dev/test profiles to $CARGO_TOML"
echo "$PROFILE_CHUNK" >> "$CARGO_TOML"
fi
rustup update
cargo fetch
cargo install --path . --profile dev
@HenkPoley
Copy link
Author

The 'dev' profile is an attempt to faster compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment