Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Fix entrypoint lookup in package debug-symbol smoke tests (#56032)

Dmitriy Kovalenko004c13292f3e
diff --git a/scripts/codex_package/smoke_tests/test_codex_package.py b/scripts/codex_package/smoke_tests/test_codex_package.py
index b7d839ce4a..c05818e031 100644
--- a/scripts/codex_package/smoke_tests/test_codex_package.py
+++ b/scripts/codex_package/smoke_tests/test_codex_package.py
@@ -161,7 +161,7 @@ def _code_mode_host_symbol_address(
*arguments: str,
) -> str:
symbol_output = subprocess.run(
- ["nm", *arguments, str(symbols)],
+ ["nm", "-C", *arguments, str(symbols)],
cwd=package.directory,
env=package.environment,
capture_output=True,
@@ -169,12 +169,14 @@ def _code_mode_host_symbol_address(
check=True,
timeout=45,
).stdout
+ # Rust v0 symbols can name this crate only as the instantiating crate of
+ # a dependency's generic function. Match the demangled entrypoint instead.
return next(
parts[0]
for line in symbol_output.splitlines()
- if len(parts := line.split()) == 3
+ if len(parts := line.split(maxsplit=2)) == 3
and parts[1].lower() == "t"
- and "codex_code_mode_host" in parts[2]
+ and parts[2] == "codex_code_mode_host::main"
)
@@ -185,7 +187,7 @@ def test_linux_debug_symbols_resolve_packaged_code(
) -> None:
"""Linux host symbols resolve a packaged function and its source location."""
address = _code_mode_host_symbol_address(
- package, code_mode_host_debug_symbols, "--defined-only", "--extern-only"
+ package, code_mode_host_debug_symbols, "--defined-only"
)
resolved = subprocess.run(
[