conf-perl.3, conf-perl-{string-shellquote,ipc-system-simple}.4: Cygwin/MSYS2 support#29613
Open
conf-perl.3, conf-perl-{string-shellquote,ipc-system-simple}.4: Cygwin/MSYS2 support#29613
Conversation
3fa6ede to
f325cd8
Compare
4b2b040 to
f8d6c4d
Compare
4a376cb to
95bf960
Compare
f8d6c4d to
792c360
Compare
c0b87bc to
aea3885
Compare
3f352ec to
df6af1e
Compare
13c0b16 to
62ce604
Compare
Contributor
|
Hello smorimoto, I’ve successfully tested your branch on our Windows CI by replacing the Perl module installation step with:
This is exactly what we needed. It makes maintaining manual workarounds for Thank you for the thorough work and the quick turnaround, especially over the weekend! |
a2line
added a commit
to a2line/geneweb
that referenced
this pull request
Mar 30, 2026
conf-perl-ipc-system-simple.4 and conf-perl-string-shellquote.4 (ocaml/opam-repository#29613) add native Cygwin/MSYS2 support, installing Perl modules via cpan automatically during opam dependency resolution — no manual step needed anymore. This removes the curl+cpanm and opam pin workaround introduced after setup-ocaml v3.5.0 broke conf-perl resolution on Windows by switching to --cygwin-internal-install (ocaml/setup-ocaml#1067).
a2line
added a commit
to a2line/geneweb
that referenced
this pull request
Mar 30, 2026
conf-perl-ipc-system-simple.4 and conf-perl-string-shellquote.4 (ocaml/opam-repository#29613) add native Cygwin/MSYS2 support, installing Perl modules via cpan automatically during opam dependency resolution — no manual step needed anymore. This removes the curl+cpanm and opam pin workaround introduced after setup-ocaml v3.5.0 broke conf-perl resolution on Windows by switching to --cygwin-internal-install (ocaml/setup-ocaml#1067).
71ace13 to
da071f3
Compare
…shellquote.4 Add new versions of conf-perl packages with Cygwin CPAN support for installing Perl modules on Windows.
On Windows (Cygwin/MSYS2), %{prefix}% returns a path with
backslashes (e.g. D:\a\...), which causes "illegal escape sequence"
errors when opam parses the generated conf-perl.config file.
Normalize backslashes to forward slashes before writing paths.
opam -> Cygwin shell -> Perl has three escaping layers: - opam string: \\\\\\\\ -> \\\\ - Cygwin command-line: \\\\ -> \\ - Perl regex: \\ -> matches literal \
918c45a to
5f64e54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Cygwin and MSYS2 support for conf-perl-* packages. These Perl modules have no corresponding system packages in either Cygwin or MSYS2 package repositories, so
depextsalone cannot satisfy the dependency.Changes
conf-perl.3 (new version):
MyConfig.pm) inside the opam switch, avoiding conflicts with any existing user CPAN configuration%{prefix}%to locate the switch directory and normalizes backslashes to forward slashes for Windows compatibility (opam → Cygwin command-line → Perl requires triple-layer escaping)perl5libandcpan_config_dirvia.configfile so dependent packages can find installed modules and use the switch-local CPAN configSHELL,PERL_MM_USE_DEFAULT, andPERL5LIBviasetenvfor dependent packagesMyConfig.pmsetsmaketo/usr/bin/maketo avoid the mingw make (/mingw64/bin/make.EXE) which cannot handle POSIX pathsperl-develtodepexts(providesConfig.pmrequired byExtUtils::MakeMaker)conf-perl-{string-shellquote,ipc-system-simple}.4 (new versions):
conf-perl >= 3perl -I <cpan_config_dir> -MCPANusing the switch-local CPAN configurationSHELL,PERL_MM_USE_DEFAULT, andPERL5LIBare propagated fromconf-perlviasetenvperl -MModule -e 1Background
Since setup-ocaml v3.5.0, opam uses
--cygwin-internal-installwhich manages its own internal Cygwin. This means opam uses the internal Cygwin perl forconf-perl-*verification. The corresponding Cygwin/MSYS2 system packages for these Perl modules (perl-String-ShellQuote, etc.) do not exist in the Cygwin or MSYS2 package repositories, sodepextscannot resolve them.The fix installs modules via the CPAN client bundled with perl, with platform-specific handling:
SHELL=/bin/shmust be set to work around afileparse()crash inCPAN::FirstTime(RT #131313)MyConfig.pmthat pointsmaketo/usr/bin/make(the MSYS2 POSIX make), because opam's PATH ordering places/mingw64/bin/make.EXE(mingw make) first, which cannot handle POSIX pathsWindows path handling
On Windows,
%{prefix}%returns a path with backslashes (e.g.D:\a\opam-repository\opam-repository\_opam). Since opam's.configfile parser treats\as an escape character, the generatedconf-perl.configmust use forward slashes. The Perl script normalizes backslashes vias{\\}{/}g, but this requires 8 backslashes (\\\\\\\\) in the opam file to survive three escaping layers: opam string unescaping, Cygwin command-line processing, and Perl regex parsing.Also requires setup-ocaml v3.6.0+ which installs the opam base packages (
make,tar,unzip,rsync) on MSYS2 (ocaml/setup-ocaml#1096).ref: ocaml/setup-ocaml#1094