postgres_cmake icon indicating copy to clipboard operation
postgres_cmake copied to clipboard

Contrib modules built by default

Open ghost opened this issue 9 years ago • 9 comments

Contrib module building (and installing) should probably be optional.

ghost avatar Nov 18 '16 01:11 ghost

We have discussed this in our company and nobody knows why need build contribs separated. In Postgres many strange practices if we can do better we must do better.

I wish to discuss this approach in hackers.

stalkerg avatar Nov 18 '16 09:11 stalkerg

Yeah, I think discussion on hackers is the way to go. My view is that to make it easy for this build tool change to be merged it would be wise to make it behave as similarly as possible to the current build system. After it is in, then sensible changes to default targets etc can be considered :-)

ghost avatar Nov 29 '16 05:11 ghost

Ooops we have really trouble here and I forgot about it. You can't add to INSTALL optional target. https://cmake.org/cmake/help/v3.7/prop_tgt/EXCLUDE_FROM_ALL.html#prop_tgt:EXCLUDE_FROM_ALL

We have here big difference between CMake and GNUMake concepts. Have you any idea? I thinking about "cmake modules" but it is not exactly what we need.

stalkerg avatar Nov 29 '16 08:11 stalkerg

I'd suggest setting up a target so that after cmake step is done, then 'make contrib' builds the contrib modules. But float this idea on hackers...get their buy-in and then it will be easier!

ghost avatar Nov 29 '16 08:11 ghost

But float this idea on hackers...get their buy-in and then it will be easier!

I agree but we have technical reasons.

I'd suggest setting up a target so that after cmake step is done, then 'make contrib' builds the contrib modules.

You can exclude "contrib" target from "all" target but you also exclude from INSTALL target.

Installing a target with EXCLUDE_FROM_ALL set to true has undefined behavior.

stalkerg avatar Nov 29 '16 09:11 stalkerg

Ah yes, so won't work as I have suggested. So it might be ok if you have to 1/ specify you want contrib at cmake time if 2/ you want to build (and install) it at make time. This is the type of thing to discuss on hackers :-)

ghost avatar Nov 29 '16 22:11 ghost

So it might be ok if you have to 1/ specify you want contrib at cmake time if 2/ you want to build (and install) it at make time.

In GNUMake you have many enter points and it help here.

This is the type of thing to discuss on hackers :-)

I think too but at first I able be make README.cmake and make new patch.

stalkerg avatar Nov 30 '16 04:11 stalkerg

New patch - great idea. Now it might be wise to look at adding a section into doc/src/sgml/installation.sgml about building with cmake (essentially similar to what you have in README.cmake). The reviewers will insist that the generated docs cover the new way to build postgres. If SGML is completely alien to you I can probably transcribe whever you have in README.cmake into a new section :-)

ghost avatar Nov 30 '16 04:11 ghost

New patch - great idea

@markir9 done!

stalkerg avatar Dec 30 '16 14:12 stalkerg