Skip to content

perl: build for cygwin#5177

Merged
lazka merged 3 commits into
msys2:masterfrom
lazka:perl-cygwin
Feb 2, 2025
Merged

perl: build for cygwin#5177
lazka merged 3 commits into
msys2:masterfrom
lazka:perl-cygwin

Conversation

@lazka

@lazka lazka commented Feb 1, 2025

Copy link
Copy Markdown
Member

The goal is for perl to report that it was built for cygwin ($^O gives "cygwin" for example) and to adjust all the code depending on that and remove all the patches for handing the "msys" case. Everything else should work as before.

  • In case cygwin check was extended with msys, remove msys case
  • In case msys check was added, replace with cygwin check
  • In case msys specific checks/code was added, merge that into the cygwin paths

We still check/set the MSYS env var instead of the CYGWIN env var, since msys2-runtime doesn't handle both yet, so keep that as is for now.

Part of #3012

edit: confirmed with the test suite that there are no changes in the test results

The goal is for perl to report that it was built for cygwin
($^O gives "cygwin" for example) and to adjust all the code depending
on that and remove all the patches for handing the "msys" case.
Everything else should work as before.

* In case cygwin check was extended with msys, remove msys case
* In case msys check was added, replace with cygwin check
* In case msys specific checks/code was added, merge that into the cygwin paths

We still check/set the MSYS env var instead of the CYGWIN env var,
since msys2-runtime doesn't handle both yet, so keep that as is for now.
@lazka

lazka commented Feb 1, 2025

Copy link
Copy Markdown
Member Author

@dscho since I've always copied the perl work from git4win, any thoughts/feedback on this?

It should make updating perl easier in the future.

@lazka lazka marked this pull request as ready for review February 1, 2025 16:33
Comment thread perl/0006-perl-5.36.0-msys2.patch Outdated
Comment on lines +428 to +435
-# - eliminate -lc, implied by gcc and a symlink to libcygwin.a
+# - eliminate -lc, implied by gcc and a symlink to libmsys-2.0.a
libswanted=`echo " $libswanted " | sed -e 's/ c / /g'`
-# - eliminate -lm, symlink to libcygwin.a
+# - eliminate -lm, symlink to libmsys-2.0.a
libswanted=`echo " $libswanted " | sed -e 's/ m / /g'`
-# - eliminate -lutil, symbols are all in libcygwin.a
+# - eliminate -lutil, symbols are all in libmsys-2.0.a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really worth patching comments?

@lazka lazka Feb 1, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, but I just copied over the hints/msys.sh changes to hints/cygwin.sh (and adjusting the arch strings) to avoid any other side effects of this PR.

So the diff was there before, just in a different file

I'm fine with removing the comment changes though.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so cygwin.sh probably diverged since msys.sh was created

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +448 to +449
-test -z "$useithreads" && useithreads='define'
+test -z "$usethreads" && usethreads='define'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

@lazka lazka Feb 1, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above, not changed in this PR

Comment on lines +460 to +468
-
-# Seems that exporting _Thread_local doesn't work on cygwin. This 6 year old
-# gcc bug suggests that maybe the problem really is binutils, but either way
-# it still doesn't work, despite our probes looking good:
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
-d_thread_local=undef
-
-# Broken: https://sourceware.org/pipermail/cygwin/2022-August/252043.html */
-d_newlocale=undef

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove these?

@lazka lazka Feb 1, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above, not changed in this PR

Comment thread perl/0006-perl-5.36.0-msys2.patch Outdated
@dscho

dscho commented Feb 2, 2025

Copy link
Copy Markdown
Contributor

@dscho since I've always copied the perl work from git4win, any thoughts/feedback on this?

It should make updating perl easier in the future.

That's a good goal!

As for Git for Windows, I recognize that for i686 builds, we're stuck with requiring the msys2 patches, though, and therefore the updating will be a bit harder in the future.

Having said that, it's a good idea for MSYS2 to go ahead with this.

In Git for Windows, I'll have to adjust a couple of lines:

Note how inconsistently the affected Git code is: Even the underlying theme is to handle DOS/Unix paths issues, the handling is ad-hoc and not standardized in Git.pm. Unfortunately, this kind of inconsistency is pretty consistent in Git's source code, and a consequence of Conway's Law.

tl;dr no objections from my side!

@jeremyd2019

Copy link
Copy Markdown
Member

As for Git for Windows, I recognize that for i686 builds, we're stuck with requiring the msys2 patches, though, and therefore the updating will be a bit harder in the future.

Why would i686 builds still require the msys2 patches? I've been building i686 packages, including those that remove msys2 patches, without issues

@lazka

lazka commented Feb 2, 2025

Copy link
Copy Markdown
Member Author

Why would i686 builds still require the msys2 patches? I've been building i686 packages, including those that remove msys2 patches, without issues

hmmm, I'd guess because the MSYSTEM=CYGWIN logic is not in the current i686 repo. I need to look into #4712 ...

In Git for Windows, I'll have to adjust a couple of lines:

yeah, that needs to be adjusted

lazka added 2 commits February 2, 2025 21:23
This is since this used to be a separate msys.sh file
which was synced back.

Let's keep things simple and only patch what we need to.

TODO: check if the other changes in that file are really needed,
or if they just diverged since the split for no good reason.
@lazka lazka merged commit 8f0d849 into msys2:master Feb 2, 2025
@dscho

dscho commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

Why would i686 builds still require the msys2 patches? I've been building i686 packages, including those that remove msys2 patches, without issues

hmmm, I'd guess because the MSYSTEM=CYGWIN logic is not in the current i686 repo.

It's a bit worse than that: Git for Windows' and MSYS2's commit histories of the msys2-runtime-3.3/ MSYS2-package are completely divergent. I do not want to put any more work into it, really: As documented in https://gitforwindows.org/32-bit Git for Windows is near/at its end of limited 32-bit support, and will soon drop building anything except the MinGit packages (which notably do not include Perl). I guess Git for Windows v2.48.1 will be the last Git for Windows release with i686 installers...

whitwham added a commit to whitwham/htslib that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
whitwham added a commit to whitwham/samtools that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
whitwham added a commit to whitwham/samtools that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
whitwham added a commit to whitwham/bcftools that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
vasudeva8 pushed a commit to samtools/htslib that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
vasudeva8 pushed a commit to samtools/samtools that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
whitwham added a commit to whitwham/bcftools that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
whitwham added a commit to whitwham/bcftools that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
vasudeva8 pushed a commit to samtools/bcftools that referenced this pull request Feb 28, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
vasudeva8 pushed a commit to vasudeva8/htslib that referenced this pull request Mar 18, 2025
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177
daviesrob pushed a commit to daviesrob/htslib that referenced this pull request Mar 18, 2026
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177

(cherry picked from commit 5057d66)
daviesrob pushed a commit to daviesrob/samtools that referenced this pull request Mar 18, 2026
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177

(cherry picked from commit 74ae962)
daviesrob pushed a commit to daviesrob/bcftools that referenced this pull request Mar 18, 2026
Due to changes in how msys2 perl reported the identity of the OS it was built
for, our tests were failing to adapt to the Windows style file locations.

Background:
https://www.msys2.org/news/#2025-02-14-moving-msys2-closer-to-cygwin

Msys2 PR:
msys2/MSYS2-packages#5177

(cherry picked from commit 7674af0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants