Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAyi8-0001Fg-7s for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 16:55:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kAyi7-0001Np-7F for pljava-dev@arkaria.postgresql.org; Wed, 26 Aug 2020 16:55:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAyi6-0001Ni-Uk for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 16:55:43 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kAyi4-0002ab-Lz for pljava-dev@lists.postgresql.org; Wed, 26 Aug 2020 16:55:42 +0000 Received: by mail-ej1-x633.google.com with SMTP id e23so3058533ejb.4 for ; Wed, 26 Aug 2020 09:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4tyoyWlNlK7Il8HrkZtWGLeyo27EGQJFBeMfGTSRa0Q=; b=PzSuEENginxJ7N/GZTxTSkiMH0zsC3cjyYpY13imyD0Yn2OVSzn4EeyQlSQ766aLVo Mr3jdpmGfjWa7EOCpXBa0ur75SaRARqsKy2hOkIJzfImS6FYnaUazgiU4XCNrRee0lxx gMyGn4eQ0sRzLylAEp1IPvD4wvJTX8bYZqL1fnT2cEpiIWceAi+1OrVvdM4zpK0gOZGh wmB9CLgMKedaTouGacciDK1/uvJYtIG87OI1uFFr3XCid8eaB3XGTLBaj2qbECOSFRfB SVwRU8UT7njmPdgOCZrGSbNA3nmVcW8e6YCsI4g+erEuat2Yt/myihkMy9/ieEvjK5jQ uvHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4tyoyWlNlK7Il8HrkZtWGLeyo27EGQJFBeMfGTSRa0Q=; b=MbIqJ6LToHF2DzKDzRanp/kg93qXMap/Sdcwv12QJiYWEC6qv9R+Gzrdqv2IY126Dn nEF4csg3R1js4dNGhd0KxQ39TCoeOIaf+CyTwyCBXAr9vMYRIAdIGuTtKBbCcg/wdYyQ Q7hh2/QVfXPUfUO6shxyIuyXO0rZrrnbA+v0RHglCH2MBKQHs/0/UV0VRsxPkGCfW5Gs x15gi/PWfqiFxIqxw1LnGcW0v79N20hpCfsN/rqlbZU5dH/0JWZ27LiOWgZE26+XiTSf 91sh//KKS5I9cDCS7WZmZJQ8o/WpfBFNhZ6P32mEmj12ASpH1V1Hs9PTfSFE+e6is5Vh 5tLw== X-Gm-Message-State: AOAM533eetpi5Ck+uNEbU81mwCpTuwwg3zquIuW2xC8Wg+6C+nSmfgIT LksTPWhY4RdJm21IqHxWViSxvkJEn0LdvVjcU4JNtg6GCro= X-Google-Smtp-Source: ABdhPJxNiEJEnA6yLnIt+CoqPbaEyISYVzdyZ7Oz66RFugRMGv1YObkOkIgvt5bhq/ZGDWtQKGk1mYP5mDGvC0dJsiE= X-Received: by 2002:a17:906:91c8:: with SMTP id b8mr7267029ejx.103.1598460939805; Wed, 26 Aug 2020 09:55:39 -0700 (PDT) MIME-Version: 1.0 References: <5F3A7DC6.8090905@anastigmatix.net> <5F3D32E9.80504@anastigmatix.net> <5F3D36BE.70703@anastigmatix.net> <5F3D38F8.7050907@anastigmatix.net> <5F3D3A75.5010304@anastigmatix.net> <5F3D3D2E.4070109@anastigmatix.net> <5F3D43BD.4020900@anastigmatix.net> <5F3DA48D.7090408@anastigmatix.net> <5F41943D.9080707@anastigmatix.net> <5F427604.5010103@anastigmatix.net> <5F42A71F.8000002@anastigmatix.net> <5F459B6E.3020803@anastigmatix.net> <5F45EE7F.5020609@anastigmatix.net> In-Reply-To: <5F45EE7F.5020609@anastigmatix.net> From: Kartik Ohri Date: Wed, 26 Aug 2020 22:25:08 +0530 Message-ID: Subject: Re: the ScriptingMojo To: Chapman Flack Cc: pljava-dev@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000081265205adcab029" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000081265205adcab029 Content-Type: text/plain; charset="UTF-8" Hi, > Yes ... because not only is it done by the nar-maven-plugin (which is not > what we want to imitate), it is also done that way by the PGXS makefiles > (which are what we want to imitate). In fact it has been the usual practice > for about as long as there have been makefiles. > > One reason is that compiling C programs is a kind of local activity. > Each .c file is transformed into a .o file, without needing to know > very much about the others. (What little it does need to know, it > gets from .h files.) > > Conceptually, it's a different operation once you have all of those .o > files and you want to edit and link all of them together into some kind > of binary image with the references resolved. On top of that, there are > choices in what kind of result to produce. A standalone executable? > A static library? A dynamic library? A loadable plugin? (The Mac OS > linker really makes a distinction between a regular dynamic library > and a plugin. The unresolved references in a dynamic library have to > be findable in the other libraries given as its dependencies. For a > plugin, the assumption is they will be findable in the program that > the plugin gets loaded into. The Mac linker actually checks that at > link time, which is why there is a -bundle_loader option added in > the Mac OS profile in pljava-so.) > > Even when you can just pile all the compiling and linking options onto > one gcc command line, that still is just the gcc wrapper command being > clever and sorting the options out and running the preprocessor and > compiler and then the linker. But for clarity in makefiles, it is very > common to separate the rules for compiling the components from the rules > for linking the final product. > Understood, that makes sense. ------------------------------------------- I have made some progress on the plugin. The Mac OS X configuration is working and passing the CI. I have also begun work on completing the Windows configuration. I am having some issues with the File.separator being used in paths. Once I am able to resolve it, we should have all the basic functionality ready. Also, I noticed that running pg_config in the Windows command line (MSVC) environment gives values of cc, cflags and ldflags so on as not recorded. Thanks. Regards, Kartik --00000000000081265205adcab029 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Yes ... because not only i= s it done by the nar-maven-plugin (which is not
what we want to imitate), it is also done that way by the PGXS makefiles (which are what we want to imitate). In fact it has been the usual practice=
for about as long as there have been makefiles.

One reason is that compiling C programs is a kind of local activity.
Each .c file is transformed into a .o file, without needing to know
very much about the others. (What little it does need to know, it
gets from .h files.)

Conceptually, it's a different operation once you have all of those .o<= br> files and you want to edit and link all of them together into some kind
of binary image with the references resolved. On top of that, there are
choices in what kind of result to produce. A standalone executable?
A static library? A dynamic library? A loadable plugin? (The Mac OS
linker really makes a distinction between a regular dynamic library
and a plugin. The unresolved references in a dynamic library have to
be findable in the other libraries given as its dependencies. For a
plugin, the assumption is they will be findable in the program that
the plugin gets loaded into. The Mac linker actually checks that at
link time, which is why there is a -bundle_loader option added in
the Mac OS profile in pljava-so.)

Even when you can just pile all the compiling and linking options onto
one gcc command line, that still is just the gcc wrapper command being
clever and sorting the options out and running the preprocessor and
compiler and then the linker. But for clarity in makefiles, it is very
common to separate the rules for compiling the components from the rules for linking the final product.

Understood, that makes sense.
-----------------------------------= --------
I have made some progress on the plugin. The Mac OS X co= nfiguration is working and passing the CI. I have also begun work on comple= ting the Windows configuration. I am having some issues with the File.separ= ator being used in paths. Once I am able to resolve it, we should have all = the basic functionality ready. Also, I noticed that running pg_config in th= e Windows command line (MSVC) environment gives values of cc, cflags and ld= flags so on as not recorded.
Thanks.
Regards,
Kartik
--00000000000081265205adcab029--