You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
replace GNU time + tee with pure-Python run_command.py
Replace the GNU `time` binary dependency and `tee` shell pipeline with
a pure-Python wrapper (run_command.py) that measures wall time, CPU
time, and peak memory using Python stdlib (time.monotonic,
resource.getrusage). Output is streamed line-by-line with flush after
each line so `tail -f` works in real time for monitoring long runs.
This eliminates:
- The `env time` / GNU time dependency (not available in Bazel sandbox)
- The TIME_CMD / TIME_BIN / TIME_TEST Make variable machinery
- The STDBUF_CMD dependency (stdbuf -o L)
- The `eval "$TIME_CMD ..."` fragile shell expansion pattern
- The `(cmd) 2>&1 | tee` subshell+pipe pattern (~15 locations)
- The TIME_CMD exclusion from get_variables export filtering
Works on both Linux and macOS (ru_maxrss is KB on Linux, bytes on
macOS — normalized automatically). 19 unit tests cover timing output
format, streaming flush (tail -f use case), log discoverability via
ps, exit code propagation, and end-to-end parsing by genElapsedTime.py.
Triggered by The-OpenROAD-Project/bazel-orfs#651: `env: 'time': No
such file or directory` in Bazel sandboxed builds.
History of pain this eliminates (28+ commits, 10+ PRs, 4+ authors, 5 years):
- e7b140d Fix /usr/bin/time output formatting
#109
- a88a7c0 New time format to include CPU seconds (broke parsers)
- 44c455c TIME_CMD is not portable, do not save it
- 00749e7 Adjust wall time, cpu and peak memory regex to new format
- 16b0be7 Adjust wall time, cpu and peak memory regex to new format
- f53e1a2 make: fix gaffe in elapsed seconds summary, account for hours
#722
- 93ad8d4 Fix genElapsedTime.py ("0:02.08" parsed as 2m8s not 2s)
#1036
- ab171aa Handle zero elapsed time in genElapsedTime.py
#1044#1043
- 2694cfd tests: simpler to maintain test_genElapsedTime.py
#1968
- 7cd9e14 makefile: fix elapsed time for empty log files
#1716
- afccf3f makefile: elapsed time python code fewer red lines in editor
- b947b5c utl: do not look for elapsed time in eqy files
#1761
- 87e80c4 Adding total elapsed time (6 comments of discussion)
#1663
- f226341 genElapsedTime.py: handle lines after the elapsed time line
#3307
- 31b6b5f exclude lec check log from elapsed time extraction
#3927
- Elapsed time regression (couldn't distinguish hours from minutes)
#967
- genElapsedTime module and test adjustments
#1014
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Øyvind Harboe <[email protected]>
Copy file name to clipboardExpand all lines: docs/contrib/DeveloperGuide.md
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,63 @@
5
5
- Continuous Integration: [Guide](./CI.md).
6
6
- How do I update the codebase? There are different ways to update your codebase depending on the method you installed it. We provide detailed instructions in this [guide](../user/FAQS.md).
7
7
- How do I contribute? Follow our Git Quickstart guide [here](./GitGuide.md).
8
+
9
+
## Timing and Logging (`run_command.py`)
10
+
11
+
Every flow stage (synthesis, floorplan, CTS, routing, etc.) is wrapped by
12
+
`flow/scripts/run_command.py`, which replaces the previous GNU `time` + `tee`
0 commit comments