Skip to content

Commit 0e297a4

Browse files
committed
fix windows please
1 parent 0d35002 commit 0e297a4

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.github/workflows/python-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ jobs:
116116
# Also ensure LLVM bin is in PATH
117117
$llvmBinDir = Join-Path -Path $env:LLVM_SYS_140_PREFIX -ChildPath "bin"
118118
if (Test-Path $llvmBinDir) {
119+
# Update PATH for current session (so pytest can find llvm-as)
120+
$env:PATH = "$llvmBinDir;$env:PATH"
121+
# Update PATH for future steps
119122
"$llvmBinDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
120123
Write-Host "Added LLVM bin to PATH: $llvmBinDir"
121124
}

python/quantum-pecos/tests/guppy/test_hugr_compilation.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,15 @@ def test_llvm_ir_format_validation(self) -> None:
128128
try:
129129
# Find llvm-as - check PATH first, then use pecos-llvm-utils
130130
llvm_as_path = shutil.which("llvm-as")
131+
print(f"DEBUG: llvm-as in PATH: {llvm_as_path}")
131132

132133
if not llvm_as_path:
133134
# Use pecos-llvm-utils to find the tool
134135
cargo_path = shutil.which("cargo")
136+
print(f"DEBUG: cargo found at: {cargo_path}")
135137
if cargo_path:
136138
try:
139+
print("DEBUG: Running cargo to find llvm-as...")
137140
result = subprocess.run(
138141
[
139142
cargo_path,
@@ -151,13 +154,20 @@ def test_llvm_ir_format_validation(self) -> None:
151154
capture_output=True,
152155
text=True,
153156
check=False,
154-
timeout=30,
157+
timeout=120, # Increased from 30s to account for compilation time on CI
155158
)
159+
print(f"DEBUG: cargo returncode: {result.returncode}")
160+
print(f"DEBUG: cargo stdout: {result.stdout[:200]}")
161+
print(f"DEBUG: cargo stderr: {result.stderr[:200]}")
156162
if result.returncode == 0 and result.stdout.strip():
157163
llvm_as_path = result.stdout.strip()
158-
except (subprocess.TimeoutExpired, Exception): # noqa: S110
159-
# Silently fall through to failure case - error will be reported below
160-
pass
164+
print(f"DEBUG: llvm-as found at: {llvm_as_path}")
165+
except subprocess.TimeoutExpired as e:
166+
print(f"DEBUG: cargo command timed out after {e.timeout}s")
167+
except Exception as e:
168+
print(f"DEBUG: cargo command failed with exception: {e}")
169+
else:
170+
print("DEBUG: cargo not found in PATH")
161171

162172
if llvm_as_path:
163173
# Validate with llvm-as

0 commit comments

Comments
 (0)