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

Most upvoted comments

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.