Created
July 7, 2025 18:43
-
-
Save HenkPoley/6bc7f6108706b01d01806e9f14a4885c to your computer and use it in GitHub Desktop.
OpenAI Codex up to date rust environment, and download packages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The 'dev' profile is an attempt to faster compilation.