Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perl: build for cygwin #5177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

perl: build for cygwin #5177

wants to merge 1 commit into from

Conversation

lazka
Copy link
Member

@lazka lazka commented Feb 1, 2025

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
Copy link
Member Author

lazka commented Feb 1, 2025

@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 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
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?

Copy link
Member Author

@lazka lazka Feb 1, 2025

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
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
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
Member

Choose a reason for hiding this comment

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

?

Copy link
Member Author

@lazka lazka Feb 1, 2025

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
Member

Choose a reason for hiding this comment

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

why remove these?

Copy link
Member Author

@lazka lazka Feb 1, 2025

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

@@ -1364,124 +211,22 @@ index 2bdf799..3637dc0 100644
*Term::ReadLine::Stub::devtty = sub { $donotexist };
is( Term::ReadLine->devtty(), $donotexist, "devtty mocked" );

+ skip('console is CONIN$/CONOUT$ in MSYS2, not /dev/tty', 3) if $^O eq 'msys';
+ skip('console is CONIN$/CONOUT$ in MSYS2, not /dev/tty', 3) if $^O eq 'cygwin';
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this works now.

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed, it works now

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.

2 participants