https://pantsbuild.org/ logo
w

wide-midnight-78598

09/26/2022, 7:54 PM
Is there any reason why native code is re-built every time I run a command? For a 5 minute code change, I'm on about 45 minutes of trying to commit it - between these compilation cycles, and pre-commit taking 10-15 minutes doing... something...
Copy code
sj@tinyrick pants-completions % PY=python3.9 ./pants --changed-since=origin/main fmt lint
[=== 00:00 Building native code... ===]
   Compiling pyo3-build-config v0.16.6
   Compiling engine v0.0.1 (/Users/sj/Developer/oss/pants-completions/src/rust/engine)
   Compiling pyo3-ffi v0.16.6
   Compiling pyo3 v0.16.6
    Building [=======================> ] 444/445: engine
Does this happen when something in the builtin goals change?
h

hundreds-father-404

09/26/2022, 7:58 PM
We've been hacking on the engine much more the past month for the Docker feature, but it shouldn't be every time you run a command. Maybe every time you pull main if you don't do so frequently
w

wide-midnight-78598

09/26/2022, 8:02 PM
Nope, cloned a new repo from main, created a branch, compiled, and then when doing linting/formatting, I got hit with I think 4-5 more compiles along the way - and I've only touched 3 python files (https://github.com/sureshjoshi/pants/commit/1865b15eb3e31fec137cabb83425a98644c03b3c)
Okay, just happened again and I committed and pushed my code, then haven't touched anything since - i went in to test a
./pants completions
run - and it re-built. Almost feels like a timeout
c

curved-television-6568

09/26/2022, 8:42 PM
besides the redundant builds, have you exported
MODE=debug
in order to speed up rust builds by avoiding the optimizations of a production build? https://www.pantsbuild.org/v2.14/docs/contributor-setup#step-3-bootstrap-the-rust-engine (Want a faster compile box)
w

wide-midnight-78598

09/26/2022, 8:43 PM
Nope, went for release as usual. I don't mind the one-off build time, for faster runtime
The setup I use is the same as always, it feels like there is something new causing it to re-build spuriously, which is concerning.
👍 1
h

happy-kitchen-89482

09/26/2022, 10:16 PM
Yeah, that sounds all sorts of wrong
w

wide-midnight-78598

09/26/2022, 10:48 PM
All kinds of wrong, and all kinds of frustrating. I mean, 6 core i5, so not top of the line, but it's no slouch of a computer. Still takes several minutes for the re-compilation each time