neon: Slow recompilation
If i run make
twice, I expect the second time to take no time. But actually it takes a while.
There’s something about running make postgres-headers
that causes cargo build
to reinstall a lot of things. I suspect it has to do with bindgen but I don’t see what’s going on. build.rs
says cargo:rerun-if-changed=pg_control_ffi.h
, and I can see that ls -l pg_control_ffi.h
doesn’t change after make postgres-headers
, but cargo build
still rebuilds from scratch.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 18 (18 by maintainers)
Commits related to this issue
- Avoid recompiling postgres_ffi every time you run "make". Running "make" at the top level calls "make install" to install the PostgreSQL headers into the pg_install/ directory. That always updated th... — committed to neondatabase/neon by hlinnaka 2 years ago
- Avoid recompiling postgres_ffi every time you run "make". Running "make" at the top level calls "make install" to install the PostgreSQL headers into the pg_install/ directory. That always updated th... — committed to neondatabase/neon by hlinnaka 2 years ago
- Use custom `install` command in Makefile to speed up incremental builds Fixes #1873: previously any run of `make` caused the `postgres-v15-headers` target to build. It copied a bunch of headers via `... — committed to neondatabase/neon by yeputons 2 years ago
- Use custom `install` command in Makefile to speed up incremental builds (#2458) Fixes #1873: previously any run of `make` caused the `postgres-v15-headers` target to build. It copied a bunch of head... — committed to neondatabase/neon by yeputons 2 years ago
- fix unnecessary header overwrites use $(INSTALL_DATA) to copy header files, similar to in more recent v15 branch. this helps with unnecessary rebuilds of postgres_ffi in neon. Cc: https://github.com... — committed to neondatabase/postgres by koivunej 2 years ago
- fix unnecessary header overwrites use $(INSTALL_DATA) to copy header files, similar to in more recent v15 branch. this helps with unnecessary rebuilds of postgres_ffi in neon. Cc: https://github.com... — committed to neondatabase/postgres by koivunej 2 years ago
There’s semi-recent discussion on this on pgsql-hackers here: https://www.postgresql.org/message-id/flat/2415283.1641852217%40sss.pgh.pa.us. The conclusion seems to be that we could switch to use the normal
install
, effectively reverting commit https://github.com/neondatabase/postgres/commit/a7032690f96efde6e05f166c21c583b02bf71bd2 as you suggested. I can write a patch to do that and send it to revive that discussion.I do that too, but the problem is still there and it shows up when switching branches with pg differences. I need to recompile pg, which is fast, but then also i need to recompile the rust ffi and all dependencies, even if there’s no change in the header file. This part is not so fast.