pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
gettext instructions for Windows seems wrong
6+ messages / 4 participants
[nested] [flat]

* gettext instructions for Windows seems wrong
@ 2022-01-17 22:55  PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 6+ messages in thread

From: PG Doc comments form @ 2022-01-17 22:55 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: liambowen@gmail.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/install-windows-full.html
Description:

I have to build Postgres on Windows 10. I got everything building from a git
checkout without NLS. I followed the instructions the way I understood them
(possibly incorrectly).

To add NLS support, I read this:
Gettext is required to build with NLS support, and can be downloaded from
http://gnuwin32.sourceforge.net. Note that binaries, dependencies and
developer files are all needed.

So, I went to that site and downloaded the binaries, dependencies, and
developer files as three separate ZIPs. I created a folder,
C:\Users\Documents\Code\libintl and then extracted all three ZIPs into that
directory. In that folder, there end up being directories for: bin, contrib,
include, lib, man, manifest, share. This makes sense to me; all the
extracted files are merged into one coherent directory tree rooted at
C:\Users\Documents\Code\libintl.

The instructions say that I have to edit config.pl (actually, I had to
create it), and I added this line:
$config->{nls} = 'C:\Users\dcbow\Documents\Code\libintl';

Then when I run "build", I get:

fe-misc.obj : error LNK2019: unresolved external symbol
__imp_libintl_dgettext referenced in function libpq_gettext
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
fe-misc.obj : error LNK2019: unresolved external symbol
__imp_libintl_dngettext referenced in function libpq_ngettext
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
fe-misc.obj : error LNK2019: unresolved external symbol
__imp_libintl_bindtextdomain referenced in function libpq_binddomain
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
libpgport.lib(strerror.obj) : error LNK2019: unresolved external symbol
__imp_libintl_gettext referenced in function pg_strerror_r
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
libpgport.lib(chklocale.obj) : error LNK2001: unresolved external symbol
__imp_libintl_gettext
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
C:\Users\dcbow\Documents\Code\libintl\lib\libintl.lib : warning LNK4272:
library machine type 'x86' conflicts with target machine type 'x64'
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
.\Debug\libpq\libpq.dll : fatal error LNK1120: 4 unresolved externals
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]

Based on the line containing LNK4272, I learned two things here: 1. It seems
like extracting the files that I did in the place that I did and also
setting the line in config.pl that I did all seem right; at least the build
can find the files. 2. It's 32 bit, not 64, which seems to create another
problem. The documentation says: "To use a server-side third party library
such as python or OpenSSL, this library must also be 64-bit. There is no
support for loading a 32-bit library in a 64-bit server. "

I'm trying to build this, rather than use the installer,  in order to find
whatever commit introduced a particular bug in libpq. I downloaded the
binary (ZIP) files from EnterpriseDB at
https://www.enterprisedb.com/download-postgresql-binaries, and they include
libintl-9.dll. In fact, in at least 12.9, 13.5 and 14.1, it's the exact same
binary. But the libintl DLL that's in http://gnuwin32.sourceforge.net/ is
named libintl3.dll and was built 17 years ago.

So, my chief complaint is that the gettext/libintl download that's listed in
the documentation is a creaky antique that, due to API changes and bitness
issues in the given build, will not work. I'm investigating
https://mlocati.github.io/articles/gettext-iconv-windows.html, which are
just more modern builds, or building all of it myself with MSYS2.

Any guidance would be appreciated, as would some sort of update to the docs
that do not have such an outdated dependency reference. Thanks for such
otherwise excellent documentation!


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: gettext instructions for Windows seems wrong
@ 2022-01-19 09:24  Daniel Gustafsson <daniel@yesql.se>
  parent: PG Doc comments form <noreply@postgresql.org>
  0 siblings, 1 reply; 6+ messages in thread

From: Daniel Gustafsson @ 2022-01-19 09:24 UTC (permalink / raw)
  To: Liam Bowen <liambowen@gmail.com>; pgsql-docs@lists.postgresql.org

> On 17 Jan 2022, at 23:55, PG Doc comments form <noreply@postgresql.org> wrote:

> The instructions say that I have to edit config.pl (actually, I had to
> create it)..

I know next to nothing about NLS on Windows, but regardless of doc updates for
this I think we should clarify that config.pl may not exist, like how we do for
buildenv.pl.

--
Daniel Gustafsson		https://vmware.com/






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: gettext instructions for Windows seems wrong
@ 2022-07-22 14:32  Bruce Momjian <bruce@momjian.us>
  parent: Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 3 replies; 6+ messages in thread

From: Bruce Momjian @ 2022-07-22 14:32 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Liam Bowen <liambowen@gmail.com>; pgsql-docs@lists.postgresql.org

On Wed, Jan 19, 2022 at 10:24:57AM +0100, Daniel Gustafsson wrote:
> > On 17 Jan 2022, at 23:55, PG Doc comments form <noreply@postgresql.org> wrote:
> 
> > The instructions say that I have to edit config.pl (actually, I had to
> > create it)..
> 
> I know next to nothing about NLS on Windows, but regardless of doc updates for
> this I think we should clarify that config.pl may not exist, like how we do for
> buildenv.pl.

Good point --- I have developed the attached patch to implement this.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson

Attachments:

  [text/x-diff] nls.diff (632B, ../../Ytq1CmkfqXQ35ljC@momjian.us/2-nls.diff)
  download | inline diff:
diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml
index afb004b5cf..11e153578c 100644
--- a/doc/src/sgml/install-windows.sgml
+++ b/doc/src/sgml/install-windows.sgml
@@ -122,7 +122,7 @@
  </para>
 
  <para>
-  Before you build, you may need to edit the file <filename>config.pl</filename>
+  Before you build, you can create the file <filename>config.pl</filename>
   to reflect any configuration options you want to change, or the paths to
   any third party libraries to use. The complete configuration is determined
   by first reading and parsing the file <filename>config_default.pl</filename>,

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: gettext instructions for Windows seems wrong
@ 2022-07-23 03:12  Julien Rouhaud <rjuju123@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  2 siblings, 0 replies; 6+ messages in thread

From: Julien Rouhaud @ 2022-07-23 03:12 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Daniel Gustafsson <daniel@yesql.se>; Liam Bowen <liambowen@gmail.com>; pgsql-docs@lists.postgresql.org

Hi,

On Fri, Jul 22, 2022 at 10:32:42AM -0400, Bruce Momjian wrote:
> On Wed, Jan 19, 2022 at 10:24:57AM +0100, Daniel Gustafsson wrote:
> > > On 17 Jan 2022, at 23:55, PG Doc comments form <noreply@postgresql.org> wrote:
> >
> > > The instructions say that I have to edit config.pl (actually, I had to
> > > create it)..
> >
> > I know next to nothing about NLS on Windows, but regardless of doc updates for
> > this I think we should clarify that config.pl may not exist, like how we do for
> > buildenv.pl.
>
> Good point --- I have developed the attached patch to implement this.

+1, I remember I also got confused by it for a minute the first time I tried to
manually build postgres on Windows.

Patch LGTM.





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: gettext instructions for Windows seems wrong
@ 2022-07-23 21:04  Daniel Gustafsson <daniel@yesql.se>
  parent: Bruce Momjian <bruce@momjian.us>
  2 siblings, 0 replies; 6+ messages in thread

From: Daniel Gustafsson @ 2022-07-23 21:04 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Liam Bowen <liambowen@gmail.com>; pgsql-docs@lists.postgresql.org

> On 22 Jul 2022, at 16:32, Bruce Momjian <bruce@momjian.us> wrote:
> 
> On Wed, Jan 19, 2022 at 10:24:57AM +0100, Daniel Gustafsson wrote:
>>> On 17 Jan 2022, at 23:55, PG Doc comments form <noreply@postgresql.org> wrote:
>> 
>>> The instructions say that I have to edit config.pl (actually, I had to
>>> create it)..
>> 
>> I know next to nothing about NLS on Windows, but regardless of doc updates for
>> this I think we should clarify that config.pl may not exist, like how we do for
>> buildenv.pl.
> 
> Good point --- I have developed the attached patch to implement this.

Thanks, LGTM

--
Daniel Gustafsson		https://vmware.com/






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: gettext instructions for Windows seems wrong
@ 2022-08-12 15:35  Bruce Momjian <bruce@momjian.us>
  parent: Bruce Momjian <bruce@momjian.us>
  2 siblings, 0 replies; 6+ messages in thread

From: Bruce Momjian @ 2022-08-12 15:35 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: Liam Bowen <liambowen@gmail.com>; pgsql-docs@lists.postgresql.org

On Fri, Jul 22, 2022 at 10:32:42AM -0400, Bruce Momjian wrote:
> On Wed, Jan 19, 2022 at 10:24:57AM +0100, Daniel Gustafsson wrote:
> > > On 17 Jan 2022, at 23:55, PG Doc comments form <noreply@postgresql.org> wrote:
> > 
> > > The instructions say that I have to edit config.pl (actually, I had to
> > > create it)..
> > 
> > I know next to nothing about NLS on Windows, but regardless of doc updates for
> > this I think we should clarify that config.pl may not exist, like how we do for
> > buildenv.pl.
> 
> Good point --- I have developed the attached patch to implement this.

Patch applied back to PG 10.  Thanks for the report.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Indecision is a decision.  Inaction is an action.  Mark Batterson






^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2022-08-12 15:35 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 22:55 gettext instructions for Windows seems wrong PG Doc comments form <noreply@postgresql.org>
2022-01-19 09:24 ` Daniel Gustafsson <daniel@yesql.se>
2022-07-22 14:32   ` Bruce Momjian <bruce@momjian.us>
2022-07-23 03:12     ` Julien Rouhaud <rjuju123@gmail.com>
2022-07-23 21:04     ` Daniel Gustafsson <daniel@yesql.se>
2022-08-12 15:35     ` Bruce Momjian <bruce@momjian.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox