Cygwin support
Last year the old Windows machine where I was running the buildfarm
member lorikeet died, and since then we've had no buildfarm coverage for
Cygwin. I now have a new (but slow) W11pro machine and I have been
testing out Cygwin builds on it. I wanted to have it running the TAP
tests, unlike lorikeet. Attached is a set of very small patches aimed at
enabling this.
The first patch makes us use our getopt implementation, just like we do
in Mingw. meson.build already has this, so this would just be bringing
configure into line with that.
The second patch makes cygwin use the WIN32 pattern for psql's \watch
command. Without that, the Unix style implementation hangs.
The third patch make Cygwin skip a permissions test in the SSL tests,
just like we do elsewhere in Windows.
The fourth test ensures that we honor MAX_CONNECTIONS in a couple of
places where we rerun the regression suite. MAX_CONNECTIONS was
originally designed mainly for Cygwin, where too many concurrent
connections cause issues.
The fifth patch disables one of the pgbench tests which is unstable on
Cygwin.
There are still some issues, with the pg_dump, pg_upgrade, recovery and
subscription test sets. But apart from that, with these patches I can
consistently get a successful run.
My intention is to apply these soon, and backpatch them as appropriate.
These are all pretty low risk. I'm going to be away for a while starting
in a day or so, but I'd like to get a buildfarm animal going with these
before I disappear.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
Attachments:
cygwin-fixes.tgzapplication/x-compressed-tar; name=cygwin-fixes.tgzDownload
� �\{s����_���l�zWk��e�$��{ln���R�1�u�J��������=�aN���QQH+���t�t��g���jJ�f��,���,M��Z��J�$�.�0H3%��?���{y�����hd�]��/Ck�{�9���vO�uM���z����Z��� ��#/aW�����?�z��3�j��������#O�����
�P���g�����CxGp����AUw�?�Q�-"��?�9�L~z�����?��v���/,IXb��?���K��3=�X ��8�x�zbgl���f��<A��4cw8�5'�S������7s�]��������A�.TTJ�R]���j�i������`������B��=�}��,R����A�R�i��8A����lN���Y��������.�r :>�Y�;i0����T�����\-��p����/��6�J�,����"�<e;���y�O��
h�k� ~��K;�`^�c�K� ��N���� �x�t[-/�}l�"�����g����#���8����t00m�
G�������0M�
����7�������}M��t���,pq���<�Iy��0v��J����f8����37�"������#�_ lS3^��M���`���e�EF,�����>�z"���'��4�������������
J�sRd���K�.XY�����Rv������;�����b[P�h��~���p�%k�B�h���X�#W^9��$J��� i�hO��Gj,��u�K�
�VTZ70*���l�z�
g��l���vl�#/�� �d��6-��7De@�vZ=9�p�������]|��[�O���=��g4��-,�����?>9�^�>�������������6D�0T��� B����thTo�s�uZ���� �����������|vL�q��A7|��=�b��$(6C+��=��I>^�u�l5_�kn�����/U�/��|�
��4�u�A��1���~:��I�������01�,����0I��Q�J2gn�(�,��]0A;�'=�1��De���=���An�q��<d��6����}h�Lyt�r']�P�uo��L�����O���}���[��[��Q<>�}�����e�y�p�z7�'��@�t���a�x��WG���>K�z��j\���U>u����s���P��E�U�ep�q Krs=1�zE�V���d�kMEp6C^�|���c�ed3W���������Q�-��c������h�-�Q4���P��a��!�Av:��+�;|���w�S#{\4��l�����;��>N�.���*����&�����Y����4�� E�[�nP�)�QDG��!�:H�:\���c�sb|
��P�8s�x?*�IZ7�A_X����F}J�&�~a����)�A@����QJY&���]�!mWiM�������=���+?�����k6�>�H����o?NL'�_����+,��3�4���?�tO��>:��������?��������0Q���uj�T���������C��-4��������������b��onb��\�p��
��p>���Z�cX������
C�;I��Hiv���H�4��`WW��xExy�#V��H�V�������w���sM����j�nr ����� m�k�-�|�Q�3;D7sp�b�YtY ���|�oyp6X�U�W�/������_� `��J��
�cNl'0I�\�Iz#�0r��F�/{~���g���;��(ADjj8N�8 ,��] ��;���DVp��@c���N -^�N��H�rD��G�Rw�i��IwFZ�h���!
�<"�<Z�oNN�D�y�c��N����3���=�'I������AVJ��@��E�I8����X
��pvp��w�P�By������_]RG;�v�t
�1�!E��G��k4�7s!��."+���).G|%Q��@�+��eA�\����V�Ah�Y$�2��c�^�lM2`+M];����?,P
D�l|��T�I�aa�*�p����2���V��,cTm��3�*!���1�B��]�bQx�B���{P+��as�G�S�W9h�!�����rj���Z�~��EH��[�!o�S��IB�@� ��y�\��z�y���~����z�~�q��7��K���!��Z7�[r>B#Ck��A>#M�g����y���!�r�����_��+����'Ht�-�j�1��N�
������R6��!'����pV�LYfY�� 5]X34b���}?eY���g�J��\"�c11�p(�����L��r��Ln���@���fR�Q1z ��o�+:$�!�H�G����BTH ]��I����BY�F�2)���6'`��\���s�4��y��4(w����8y���QV���F�|"����3��Tn*�� l�.��o�a��[�������66���06Vm�u�����O����rJS�
�u��>J
d���wAq���F��/�"@M��<R�8���,�`cm��^�#�I�U��F��6" MF}�.&E���yj8%W*�_��
^�W�HAW
����K�l��p%�^��`��E_���3���N ������/����}���%<'�~�{}���(�������f�D< 6�-�\=z���n�^x�eA�3S�y���q_'��%���H�B|�N|x�9@M���"��a�XA�k3�DGO
�U����m_��;%�k8�� ��j�����[���m�`���Y���*���j�.l� E���5Nw
.������������y�Z�70
��������W�oa���#{r���������F�������E
����9����6���|W�]�>i��Z.�x2�"����O���J�Q�n���,H$,&�F>�g�K�~I��U�@7s(��Od�K���_\��
�fJ5���Te��Y�b�f54��������'GO������U�>��Q�D����;����
M�D���AT����\G]��>�#-WSriL�U��ne�[E~�*D9����Ip�s9�a����CM�c��MPDL��EEo�����D �t���D8�:m�M��h)����q]�����@����P�C�`�H�ur7l���2�.�������}��t�P��>MX��NY����/���J��������o(L��AM3����;���)s6|���u4���5�������Ssy��2���5���z�4Q�x7���5�h� �e�CP� ��[JKAD� �<���3FM����E;�Z��4����H��K�����_k)kR"P�u3���p�+s3
��B���9�<k�-�q� y�x)RU<O�P���T� W��Y(��#������Y�C,�P�����W������W���:+xk1U7��[������PT��U��`�����6������+�����~�.P�
��o��15t�����L�115����r��� ����M�����������i�"�@ZD6�^�c����d#�as�B~��y����S>o�U�07��u��vm�B��*�����n�O�2�VZ����[$ ���Db��1)���X����.���#�����%���$��$�i�^2oicVA|U��i�^�/*l�E8���&_�}
g����}Q7[]�J�c/_�%8;������99>;�~���d�6n\wn,"����WW'��98�1mM3���l�6+m��b|s�F6�G7e1\��i�����^��'-����$�����C�?������8"��cK�����;��$~N���lFg����`�j�����Q00S�E�|`I�������&^_\�W����p�G�
���
��9�M�����p��}��������3�SC����8#6q
����=2}]�l�3�Q�M�8���m
���~��whGl�,?�s~������:������\>����w�@@=��� =��T�iK�A�����������n�Vo��1��`�Mg`����Y"uj�TMko0���j8��S2D��P����8�o=�������o����Wb����j�
�^�Q\������d��$��#�7e���a��(��=�<�W�u���5G�+���AK�e~����������Gm�'�L7���������;�(�#�G���2(q���+�dQ����p�������u�����:0�o�V�Z����
]����� �����K5�kdJ���~J���x�z�7�@�����N����Ul�^q�NFB�t��*��CK��#D�]��B�x�_�?����+|��Wy�����Jh��f�!S�%y������*W�$&� ����*>���1�}��/���g��}_;Lw��3���������h�z�f2������
sW����z��������2H��Sx�u GD����2 @�B���-��V��Tl��Ll�g��<!3�5������1��'���l�D�l�#O��y��'����-��N����K�i[m�/�A26���Wt�I<�_��A����ez��W��K�=R���Gg��CZ���Q�������]�w�;�0���� ���e����,j5
.��Y=�a2���^�����
E��xq�#~*�'�w��<�_�O�K��� 6�g�8����L�������T��g���<�E�����e�e8���z�~�L�}N��4�����������p�W��$!��&d�/B��2�"s`S��3AJ�-���"�M����%V���E:���W'��d����gG�����k��v�4� .8�
�a�\]���tn��������_n�+��.���yT��#~��M�Fm�oV�
��bYw8�8�����o~
�JY��r��������v���+y-�>�
F��dcAd���n�d��%���{�����1*�;����:K^Lu�~�K^�~�H/;i�5�����:�$H���`8����"f,�K�36��6���i�?,�;�������x�������������>Tj���������]0W��N�9�\���{��ww� ��kCs��������������i�1��6r��=6=}d8����:�#��&:S�L��!1����j�o�'=�S��)p=]��)%����N��}������yX&��X_ob}�������F�
�I���v|��8�`��c�9{+�b7���U�/D�o<��=��d�,J�t(_��C���!�
�K�Jbt����������#��%y�9C�v��!�hjs#\�/�8+�nI��Q����Jx��!O������8��6�����"�P����S�
h�oa�!w��O�#�?���d_2���]Tz�#x7p������/�e���������/���_�8S�H9?8U�� Ne�"��������?�66�?�H�������=�������:����������i��
��T�}�������6��M����&�����S:�z��)\��������6
�g�+R��J,_�[PPK��� �7km��H�a;@������iH�$U���J�;��'�3;��U���s ��A�h>���)�eiGw_��[�c������d�N'N��Hz�����-�<N�Z
5/�����+�s��/~���z�i���["�nm��m"�5[�6���Qd�X�wMe�6�U�c�]yJSU�W8��Y��?�E�����l�D'9���;X[a�/x��o?~����=���t�w7��m�s��h�hxE%����U�F��fs��5�����hM��ie�6^�e�
��0c����v9�oJ�n
�z�Q�_v*�*�$�Rq�F�8�XQ������1���|�m�^�w�z
�1-�������/�`7S��j�?V)f���kzvjY��&f���{i
��)u��O��m�,�� �����=B���%L���n�{ �����m�v9�EDQ��`��|��!�aDQ��Y>�|���{�����������<a���c�<7W�j1u�1C�+��KX���_n�ws���$�p>2��Vz�!�.������s<���$��G�q���v��C��2�
�N;�bWxY�f������9�JOW8_���?9Ey��S��mdl��m���{�T�����q��A�+
��~�L�4
�N��d��9����!x���1�e�����B����b��`�
?����]����Y�;�vD��KO\
�o\�G�{y�u2������4� ��0;>����~�3�CR#,2���jT��,��5�9�D���a9�#��%��8���/&"��o��J*(U
$���%[�P[7\?���Ad4�2^�v���@�\O�v�&(�� ��������e�i���>
�Q��2�E���������������������������� � x Hi Andrew,
Last year the old Windows machine where I was running the buildfarm
member lorikeet died, and since then we've had no buildfarm coverage for
Cygwin. I now have a new (but slow) W11pro machine and I have been
testing out Cygwin builds on it. I wanted to have it running the TAP
tests, unlike lorikeet. Attached is a set of very small patches aimed at
enabling this.[...]
Thanks for the patches.
I wonder though if it is advisable to support Cygwin if this requires
extra effort from our side, compared to a regular Linux or Windows
environment. I actually like the project but I wouldn't recommend
running Postgres on prod, and for development these days it's simpler
to use WSL / VirtualBox / Raspberry Pi, or running Postgres natively
on Windows.
--
Best regards,
Aleksander Alekseev
On 2025-04-22 Tu 8:10 AM, Aleksander Alekseev wrote:
Hi Andrew,
Last year the old Windows machine where I was running the buildfarm
member lorikeet died, and since then we've had no buildfarm coverage for
Cygwin. I now have a new (but slow) W11pro machine and I have been
testing out Cygwin builds on it. I wanted to have it running the TAP
tests, unlike lorikeet. Attached is a set of very small patches aimed at
enabling this.[...]
Thanks for the patches.
I wonder though if it is advisable to support Cygwin if this requires
extra effort from our side, compared to a regular Linux or Windows
environment. I actually like the project but I wouldn't recommend
running Postgres on prod, and for development these days it's simpler
to use WSL / VirtualBox / Raspberry Pi, or running Postgres natively
on Windows.
I agree that I would not normally use Cygwin to run a Postgres instance.
But its psql is nicer than others on Windows because unlike the native
builds we build it with readline. That's why I've kept a buildfarm
animal going all these years. If the maintenance burden were high I
wouldn't do so - but it's not really. And these patches are tiny.
What I might do with the new animal is run just enough TAP tests to
exercise psql. That would reduce the errors we get, so it would be less
bother to anyone.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
Andrew Dunstan <andrew@dunslane.net> writes:
I agree that I would not normally use Cygwin to run a Postgres instance.
But its psql is nicer than others on Windows because unlike the native
builds we build it with readline. That's why I've kept a buildfarm
animal going all these years. If the maintenance burden were high I
wouldn't do so - but it's not really. And these patches are tiny.
I vaguely recall some discussion about whether building with readline
has become possible under MSVC. I think it'd make a lot of people
happy if that could happen (but I hasten to add that I'm not
volunteering).
regards, tom lane
On 2025-04-22 Tu 10:26 AM, Tom Lane wrote:
Andrew Dunstan <andrew@dunslane.net> writes:
I agree that I would not normally use Cygwin to run a Postgres instance.
But its psql is nicer than others on Windows because unlike the native
builds we build it with readline. That's why I've kept a buildfarm
animal going all these years. If the maintenance burden were high I
wouldn't do so - but it's not really. And these patches are tiny.I vaguely recall some discussion about whether building with readline
has become possible under MSVC. I think it'd make a lot of people
happy if that could happen (but I hasten to add that I'm not
volunteering).
Neither am I, although I'll test it if somebody sends in a patch. If
that happens I'll be happy enough to retire Cygwin support.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
On Tue, 2025-04-22 at 10:26 -0400, Tom Lane wrote:
I vaguely recall some discussion about whether building with readline
has become possible under MSVC. I think it'd make a lot of people
happy if that could happen (but I hasten to add that I'm not
volunteering).
/messages/by-id/CACLU5mThm-uCtERMVHMoGED2EPfyS54j83WB20s_BmzVQuMkpg@mail.gmail.com
Seems like Kirk didn't pursue this further.
Yours,
Laurenz Albe
On 2025-04-22 Tu 12:55 PM, Laurenz Albe wrote:
On Tue, 2025-04-22 at 10:26 -0400, Tom Lane wrote:
I vaguely recall some discussion about whether building with readline
has become possible under MSVC. I think it'd make a lot of people
happy if that could happen (but I hasten to add that I'm not
volunteering)./messages/by-id/CACLU5mThm-uCtERMVHMoGED2EPfyS54j83WB20s_BmzVQuMkpg@mail.gmail.com
Seems like Kirk didn't pursue this further.
It's worth looking at, but I don't think it's possible for release 18
let alone the older releases. We should look at retiring Cygwin when all
the live branches have psql with a working readline on native Windows
builds.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com
On 2025-04-21 Mo 12:29 PM, Andrew Dunstan wrote:
Last year the old Windows machine where I was running the buildfarm
member lorikeet died, and since then we've had no buildfarm coverage
for Cygwin. I now have a new (but slow) W11pro machine and I have been
testing out Cygwin builds on it. I wanted to have it running the TAP
tests, unlike lorikeet. Attached is a set of very small patches aimed
at enabling this.The first patch makes us use our getopt implementation, just like we
do in Mingw. meson.build already has this, so this would just be
bringing configure into line with that.The second patch makes cygwin use the WIN32 pattern for psql's \watch
command. Without that, the Unix style implementation hangs.The third patch make Cygwin skip a permissions test in the SSL tests,
just like we do elsewhere in Windows.The fourth test ensures that we honor MAX_CONNECTIONS in a couple of
places where we rerun the regression suite. MAX_CONNECTIONS was
originally designed mainly for Cygwin, where too many concurrent
connections cause issues.The fifth patch disables one of the pgbench tests which is unstable on
Cygwin.There are still some issues, with the pg_dump, pg_upgrade, recovery
and subscription test sets. But apart from that, with these patches I
can consistently get a successful run.My intention is to apply these soon, and backpatch them as
appropriate. These are all pretty low risk. I'm going to be away for a
while starting in a day or so, but I'd like to get a buildfarm animal
going with these before I disappear.
Time has got the better of me, I won't be able to get back to this for a
couple of months.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
What are the economics of this? I used PostgreSQL and Cygwin 25 years ago
and am amazed it is still a thing.
How much effort is it to support PostgreSQL on Cygwin?
How many actual users are using PostgreSQL on cygwin in production? (I
should hope none!)
I would say it is something that should be announced as "deprecated" and
see how many people complain, my bet no one will really care. Cygwin was a
phenomenal hack in its day but I believe that those days have passed.
On Wed, Apr 23, 2025 at 3:56 PM Andrew Dunstan <andrew@dunslane.net> wrote:
Show quoted text
On 2025-04-21 Mo 12:29 PM, Andrew Dunstan wrote:
Last year the old Windows machine where I was running the buildfarm
member lorikeet died, and since then we've had no buildfarm coverage
for Cygwin. I now have a new (but slow) W11pro machine and I have been
testing out Cygwin builds on it. I wanted to have it running the TAP
tests, unlike lorikeet. Attached is a set of very small patches aimed
at enabling this.The first patch makes us use our getopt implementation, just like we
do in Mingw. meson.build already has this, so this would just be
bringing configure into line with that.The second patch makes cygwin use the WIN32 pattern for psql's \watch
command. Without that, the Unix style implementation hangs.The third patch make Cygwin skip a permissions test in the SSL tests,
just like we do elsewhere in Windows.The fourth test ensures that we honor MAX_CONNECTIONS in a couple of
places where we rerun the regression suite. MAX_CONNECTIONS was
originally designed mainly for Cygwin, where too many concurrent
connections cause issues.The fifth patch disables one of the pgbench tests which is unstable on
Cygwin.There are still some issues, with the pg_dump, pg_upgrade, recovery
and subscription test sets. But apart from that, with these patches I
can consistently get a successful run.My intention is to apply these soon, and backpatch them as
appropriate. These are all pretty low risk. I'm going to be away for a
while starting in a day or so, but I'd like to get a buildfarm animal
going with these before I disappear.Time has got the better of me, I won't be able to get back to this for a
couple of months.cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
On 2025-04-28 Mo 4:53 PM, Mark Woodward wrote:
What are the economics of this? I used PostgreSQL and Cygwin 25 years
ago and am amazed it is still a thing.
How much effort is it to support PostgreSQL on Cygwin?
How many actual users are using PostgreSQL on cygwin in production? (I
should hope none!)I would say it is something that should be announced as "deprecated"
and see how many people complain, my bet no one will really care.
Cygwin was a phenomenal hack in its day but I believe that those days
have passed.
Please don't top-post on PostgreSQL lists.
I don't see it as our role to pass judgements like this on what people
use. While Cygwin exists it's not our province to deprecate its use. If
the maintenance effort were onerous I might be willing to relook at our
support for it, but the simple answer to your first question is that the
maintenance effort is close to zero. As I pointed out elsewhere in this
thread, even if the server has limited use, the Cygwin psql client is
nicer to use on Windows than the native build, reason enough to keep it
going, at least until we improve the native build.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
On Tue, May 27, 2025 at 10:53:55AM -0400, Andrew Dunstan wrote:
On 2025-04-28 Mo 4:53 PM, Mark Woodward wrote:
What are the economics of this? I used PostgreSQL and Cygwin 25 years
ago and am amazed it is still a thing.
How much effort is it to support PostgreSQL on Cygwin?
How many actual users are using PostgreSQL on cygwin in production? (I
should hope none!)I would say it is something that should be announced as "deprecated" and
see how many people complain, my bet no one will really care. Cygwin was
a phenomenal hack in its day but I believe that those days have passed.Please don't top-post on PostgreSQL lists.
I don't see it as our role to pass judgements like this on what people use.
While Cygwin exists it's not our province to deprecate its use. If the
maintenance effort were onerous I might be willing to relook at our support
for it, but the simple answer to your first question is that the maintenance
effort is close to zero. As I pointed out elsewhere in this thread, even if
the server has limited use, the Cygwin psql client is nicer to use on
Windows than the native build, reason enough to keep it going, at least
until we improve the native build.cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
+1
I also have known of environments where Cygwin was an allowed
application and native Windows applications were severely restricted. Go
figure.
Regards,
Ken
On Tue, Apr 22, 2025 at 12:55 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:
On Tue, 2025-04-22 at 10:26 -0400, Tom Lane wrote:
I vaguely recall some discussion about whether building with readline
has become possible under MSVC. I think it'd make a lot of people
happy if that could happen (but I hasten to add that I'm not
volunteering)./messages/by-id/CACLU5mThm-uCtERMVHMoGED2EPfyS54j83WB20s_BmzVQuMkpg@mail.gmail.com
Seems like Kirk didn't pursue this further.
Laurenz, I was a bit early and the new build system and properly
understanding how to link this in got in the way.
As feedback, there are a lot of rough edges with readline() under windows.
(I've switched to WSL which is Ubuntu,
and tab completion works).
Since our big PG client went live, I will queue this up to take a peek at
it again. (They already fixed the GIANT if/then
condition that was breaking the MSVC build that the auto-complete was
using).
I believe the other 2-3 issues I had was where the system looks for the
"configuration" files for readline.
And the feedback was clear: We cannot modify the readline source. We must
use it as published.
I also thought one of the build guys said readline "might" come along for
the ride with the newer build...
Thanks for the reminder, this is back en queue for me to look at.
Since this thread discussed possibly bringing back Cygwin buildfarm
coverage, you might be interested in this proposed change:
/messages/by-id/CA+hUKG+BpW=KhGHTWGMe0cSETMYZsSygv5jFWD1Y6wcbAn2ecQ@mail.gmail.com
On 2025-11-23 Su 6:44 PM, Thomas Munro wrote:
Since this thread discussed possibly bringing back Cygwin buildfarm
coverage, you might be interested in this proposed change:/messages/by-id/CA+hUKG+BpW=KhGHTWGMe0cSETMYZsSygv5jFWD1Y6wcbAn2ecQ@mail.gmail.com
Well, I was going to look at reviving a Cygwin animal over the end of
year break. I have a machine available for it. I have no idea if Cygwin
even still has the issue ... let me see.
cheers
andrew
--
Andrew Dunstan
EDB:https://www.enterprisedb.com