-
Notifications
You must be signed in to change notification settings - Fork 15.5k
[codex] Restore release symbol artifacts with line tables #26202
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
Merged
nornagon-openai
merged 5 commits into
main
from
nornagon/codex/release-symbol-line-tables
Jun 8, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
95202ed
Restore release symbol artifacts with line tables
nornagon-openai c7f7ad7
Merge remote-tracking branch 'origin/main' into nornagon/codex/releas…
nornagon-openai 69c1858
Merge remote-tracking branch 'origin/main' into nornagon/codex/releas…
nornagon-openai 0fd91f1
Move release symbol profile into Cargo config
nornagon-openai c7a47e5
Merge remote-tracking branch 'origin/main' into nornagon/codex/releas…
nornagon-openai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
119 changes: 119 additions & 0 deletions
119
.github/scripts/archive-release-symbols-and-strip-binaries.sh
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| usage() { | ||
| cat <<'EOF' | ||
| Usage: archive-release-symbols-and-strip-binaries.sh \ | ||
| --target <rust-target> \ | ||
| --artifact-name <artifact-name> \ | ||
| --release-dir <dir> \ | ||
| --archive-dir <dir> \ | ||
| --binaries "<space-delimited binary basenames>" | ||
| EOF | ||
| } | ||
|
|
||
| target="" | ||
| artifact_name="" | ||
| release_dir="" | ||
| archive_dir="" | ||
| binaries="" | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --target) | ||
| target="${2:?--target requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --artifact-name) | ||
| artifact_name="${2:?--artifact-name requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --release-dir) | ||
| release_dir="${2:?--release-dir requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --archive-dir) | ||
| archive_dir="${2:?--archive-dir requires a value}" | ||
| shift 2 | ||
| ;; | ||
| --binaries) | ||
| binaries="${2:?--binaries requires a value}" | ||
| shift 2 | ||
| ;; | ||
| -h|--help) | ||
| usage | ||
| exit 0 | ||
| ;; | ||
| *) | ||
| echo "Unexpected argument: $1" >&2 | ||
| usage >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ -z "$target" || -z "$artifact_name" || -z "$release_dir" || -z "$archive_dir" || -z "$binaries" ]]; then | ||
| usage >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| symbols_root="${RUNNER_TEMP:-/tmp}/codex-symbols-${artifact_name}" | ||
| symbols_dir="${symbols_root}/codex-symbols-${artifact_name}" | ||
| archive_path="${archive_dir%/}/codex-symbols-${artifact_name}.tar.gz" | ||
| rm -rf "$symbols_root" | ||
| mkdir -p "$symbols_dir" "$archive_dir" | ||
| read -r -a binary_names <<< "$binaries" | ||
|
|
||
| case "$target" in | ||
| *apple-darwin) | ||
| for binary in "${binary_names[@]}"; do | ||
| binary_path="${release_dir%/}/${binary}" | ||
| dsym_path="${binary_path}.dSYM" | ||
| if [[ ! -f "$binary_path" ]]; then | ||
| echo "Binary $binary_path not found" >&2 | ||
| exit 1 | ||
| fi | ||
| if [[ ! -d "$dsym_path" ]]; then | ||
| echo "dSYM $dsym_path not found" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| cp -RL "$dsym_path" "${symbols_dir}/${binary}.dSYM" | ||
| strip -S -x "$binary_path" | ||
| done | ||
| ;; | ||
| *linux*) | ||
| objcopy_bin="${OBJCOPY:-objcopy}" | ||
| strip_bin="${STRIP:-strip}" | ||
| for binary in "${binary_names[@]}"; do | ||
| binary_path="${release_dir%/}/${binary}" | ||
| debug_path="${symbols_dir}/${binary}.debug" | ||
| if [[ ! -f "$binary_path" ]]; then | ||
| echo "Binary $binary_path not found" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| "$objcopy_bin" --only-keep-debug "$binary_path" "$debug_path" | ||
| "$strip_bin" --strip-debug --strip-unneeded "$binary_path" | ||
| "$objcopy_bin" --add-gnu-debuglink="$debug_path" "$binary_path" | ||
| done | ||
| ;; | ||
| *windows*) | ||
| for binary in "${binary_names[@]}"; do | ||
| pdb_path="${release_dir%/}/${binary}.pdb" | ||
| if [[ ! -f "$pdb_path" ]]; then | ||
| echo "PDB $pdb_path not found" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| cp "$pdb_path" "${symbols_dir}/${binary}.pdb" | ||
| done | ||
| ;; | ||
| *) | ||
| echo "No symbols packaging support for target: $target" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| rm -f "$archive_path" | ||
| tar -C "$symbols_root" -czf "$archive_path" "codex-symbols-${artifact_name}" |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.