Conversation
Build-from-checkout cibuildwheel workflow following upstream's own wheels.yml. Plain setuptools Extension build (two small C99 extensions, pthread only, no bundled native deps). objprint (the sole runtime dependency) is a py3-none-any wheel so needs no registry entry.
test_trace_self waits for the child process to print "Ctrl+C" via an unbounded readline loop (tests/cmdline_tmpl.py). Under --trace_self, every Python-level call in the interpreter's own startup goes through get_ts()/get_system_ts(), which use __rdtsc() on x86 but fall back to clock_gettime(CLOCK_MONOTONIC) elsewhere, including riscv64 - a syscall per call instead of one instruction. The self-traced startup compounds that cost across every import/argparse/socketserver call, so it never reaches the print in any practical time and the unbounded wait hangs rather than fails. All four matrix jobs on PR #1080 hung identically at this exact test until GitHub's 60-minute job timeout killed them. Adds a bounded timing diagnostic (timeout 120) ahead of the real test run to confirm the wheel is not actually deadlocked, just far too slow under self-tracing on this architecture.
test_use_external_processor hung identically to test_trace_self on all four interpreters after PR #1080's previous fix, this time in test_viewer.py. Root cause confirmed by reading source: ExternalProcessorProcess (src/viztracer/viewer.py) shells out to web_dist/trace_processor, Perfetto's own prebuilt-binary launcher, whose TRACE_PROCESSOR_SHELL_MANIFEST lists prebuilts only for x86_64/aarch64. On riscv64 it raises "No prebuilts available for linux-riscv64" and exits immediately - but ExternalProcessorProcess._wait_start() reads the child's stderr in an unguarded `while True: readline()` loop, and readline() on an already-closed pipe returns "" forever instead of raising, turning the child's fast crash into a silent, permanent busy loop rather than a clean failure. Also softened patch 0001's commit message: a bounded self-trace smoke test (see the new CIBW_TEST_COMMAND diagnostic) completes in ~1s, so clock_gettime overhead alone doesn't explain that hang as cleanly as first thought - the unbounded wait remains the confirmed defect either way. Scanned test_viewer.py and test_cmdline.py for the same subprocess-spawn-and-wait shape: every other Viewer-based test uses the same unbounded stdout wait but for the ordinary (non-external-processor) server path, which already completed successfully earlier in this same run, so only this one test is affected. test_once_timeout and test_directory also pass --use_external_processor but hit main.py's own early argument validation (--once and directory targets are rejected before ExternalProcessorProcess is ever constructed), so they are not at risk.
riscv64 has no prebuilt attach_riscv64.so (vendored blob, no source to build from - see the patch), which fails four tests in test_remote.py: TestAttachSanity.test_basic, TestRemote.test_attach, test_attach_installed, test_uninstall. test_install and test_attach_script are unaffected - both use viztracer's in-process attach API (SIGUSR/viztracer.attach), not the vendored .so. Also fixes test_combine, which failed with an unrelated ValueError: it reaches outside tests/ for tests/../example/json/*.json, which CIBW_TEST_SOURCES: tests never staged. Add example/json to CIBW_TEST_SOURCES. Removed the trace_self timing diagnostic added earlier - it did its job (confirming a trivial self-trace completes in ~1s) and isn't needed going forward.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
viztracer1.1.1Compiles two small C99 extensions (
snaptrace,vcompressor) linked only against pthread. Upstream publishes no riscv64 wheel.Mirrors upstream's
wheels.yml.Differs from upstream
Nothing beyond the riscv64 image.
Testing
wheels.ymlruns no tests; stagestests/andexample/jsonviatest-sourcesand runspython -m unittest -vinstead.lokytotest-requires- the only hard import in the suite not otherwise guarded.test_trace_selfandtest_use_external_processor- both hang indefinitely on riscv64 (self-tracing overhead and a missing Perfettotrace_processor_shellprebuilt, respectively).test_remote.pyattach tests - riscv64 has no prebuiltattach_riscv64.so(vendored blob, no source to build).License: OK
Built on cp312; 231 passed, 14 skipped.