v3.5.0 breaks conf-perl-* package resolution on Windows · Issue #1094 · ocaml/setup-ocaml · GitHub
Skip to content

v3.5.0 breaks conf-perl-* package resolution on Windows #1094

Open
ocaml/opam-repository
#29613

Description

@a2line

conf-perl-ipc-system-simple and conf-perl-string-shellquote
(required by camlp5) have always required manual installation
on Windows. This worked fine through v3.4.8.

Since v3.5.0, two issues:

  1. cpanm is no longer found in PATH:
    Can't open perl script "/cygdrive/c/Strawberry/perl/bin/cpanm":
    No such file or directory

  2. Even when installing modules via curl cpanmin.us | perl,
    opam verifies conf-perl-* using its internal Cygwin perl
    (C:\.opam\.cygwin\root\bin\perl.exe) which has a separate
    @inc from the perl where modules are installed. The check
    always fails:

   command: C:\.opam\.cygwin\root\bin\perl.exe -MIPC::System::Simple -e 1
   @INC: /usr/local/lib/perl5/site_perl/5.40/...

Worked fine with v3.4.8. Current workaround: fetch cpanm via
curl and pin conf-perl-* to no-op packages.

Activity

  1. smorimoto commented on Mar 29, 2026

    @smorimoto
    Member

    How about 3.5.1?

  2. a2line commented on Mar 29, 2026

    @a2line
    Author

    I'm not sure, but I think it's the same. The fix I found is geneweb/geneweb#2708. I'll retry fixing the version of the Action on my fork and will give you a feedback on that.

  3. a2line commented on Mar 29, 2026

    @a2line
    Author

    I confirm after fixing setup-ocaml@v3.5.1 and retrying with what we had working last week that was:
    run: cpanm --notest String::ShellQuote IPC::System::Simple

    1. It fails to find the tool: https://github.com/a2line/geneweb/actions/runs/23702718391/job/69049955210#step:6:25

    2. From here I add only curl for cpanm and relaunch CIs, the modules get installed, but the CI fails on the next step: https://github.com/a2line/geneweb/actions/runs/23703119761/job/69050439874#step:8:290

  4. smorimoto commented on Mar 29, 2026

    @smorimoto
    Member

    I investigated this. The root cause is a combination of two issues.

    1. setup-ocaml v3.5.0 changes

    v3.5.0 switched from an external Cygwin installation (C:\cygwin) to opam's internal Cygwin (--cygwin-internal-install, C:\.opam\.cygwin\root) in #1067. As a result, opam now uses C:\.opam\.cygwin\root\bin\perl.exe to verify conf-perl-* packages.

    The fact that cpanm worked in v3.4.8 was because the external Cygwin's bash and PATH ordering happened to align by coincidence — it was not intentional behavior.

    2. Missing support in opam-repository

    conf-perl-string-shellquote and conf-perl-ipc-system-simple have no Cygwin depexts entries. Furthermore, the corresponding Cygwin packages (perl-String-ShellQuote, etc.) don't exist in the Cygwin package repository at all.

    However, Cygwin perl ships with cpan out of the box. If the conf packages use cpan to install the required modules on Cygwin as part of their build step, users won't need to install them manually. I plan to propose this fix to opam-repository.

    Workaround

    Until the opam-repository fix is merged, you can install modules using the internal Cygwin perl's cpan in your workflow:

    - run: cpan -T String::ShellQuote IPC::System::Simple

    Since v3.5.1 adds CYGWIN_ROOT_BIN to PATH for the cygwin environment, cpan will use the internal Cygwin perl, and modules will be installed into the @inc that opam checks during conf-perl-* verification.

  5. added theissue type on Mar 29, 2026
  6. a2line commented on Mar 29, 2026

    @a2line
    Author

    For context, we've added the conf-perl step for camlp5 (Geneweb/Windows)
    after a long work last year with @chetmurthy to port camlp5 for Ocaml > 5 to Windows.

    Two things worth considering:

    1. In our experience, cpan without a config file can be
      problematic (interactive prompts, slow CPAN mirror selection).
      We had to ship a >50-line cpan-config.pm and call it with
      cpan -j config.pm. Would -T alone guarantee silent
      non-interactive behavior in the Cygwin perl context?

    2. Two weeks ago, after a 404 on those Perl modules. I tried
      cpanm. I'm not sure if it's available in Cygwin perl but
      it's installable via cpan App::cpanminus and it would
      perhaps be a better choice for performances: cpan takes
      ~26 s vs ~6 s for cpanm on CI runners.

  7. 6 remaining items

  8. linked a pull request that will close this issueInstall opam base packages on MSYS2 #1096on Mar 30, 2026
  9. smorimoto commented on Mar 30, 2026

    @smorimoto
    Member

    @a2line What do you think about this fix? ocaml/opam-repository#29613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions