Skip to content

Conversation

Leont
Copy link
Contributor

@Leont Leont commented Apr 27, 2024

This is a first stab at implementing static installation.

It's not tested at all yet, nor is it complete (especially around logging and reporting), but it should in essence get the job done.

@briandfoy
Copy link
Contributor

briandfoy commented Jul 15, 2024

Taking out the Mac classic stuff might be better as a separate PR. But, oh, it is #82 and snuck into this PR. :)

@Leont
Copy link
Contributor Author

Leont commented May 4, 2025

Taking out the Mac classic stuff might be better as a separate PR. But, oh, it is #82 and snuck into this PR. :)

Yeah taking it apart causes conflicts, but #182 should be a no-brainer.

@Leont Leont force-pushed the static_install branch from 056d161 to 061f164 Compare May 11, 2025 12:27
@andk
Copy link
Owner

andk commented Jun 4, 2025

Thanks @Leont, I have taken your PR into my branch https://github.com/andk/cpanpm/tree/pr-183-contd and have continued on top of it.

Outstanding issues:

  • needs support for CPAN::Reporter
  • needs integration with code dealing with unsatisfiable prerequisites
  • maybe you know more open issues?

I could make this a TRIAL release if this is considered helpful. My testing seems to show that this branch is working well as long as the configuration turns static install support off (use_static_install => 0).

@andk
Copy link
Owner

andk commented Aug 27, 2025

@Leont or who it may concern : there was a bit of progress in my branch pr-183-contd , current commit is 2.38-28-g5cd61c4e ; but now I'm stuck and would be glad to get feedback. The last commit is just a sketch and does not work when there is no Build.PL and maybe under other circumstances. For CPAN::Reporter to work we need a commandline that gets passed to CPAN::Reporter::test(), which then runs the tests. Any suggestions?

BTW, the first report generated with that commit was: https://www.cpantesters.org/cpan/report/5b3bcb52-8317-11f0-bcfe-8752473a1684 about DBIx-Class-EncodedColumn-0.11

@Leont
Copy link
Contributor Author

Leont commented Aug 28, 2025

The last commit is just a sketch and does not work when there is no Build.PL and maybe under other circumstances.

The spec says that there should always be a Build.PL or Makefile.PL to fall back on, so that isn't necessarily a disaster. If we can't make static install work with CPAN::Reporter (but I think we can), we should just disable it if CPAN::Reporter is turned on.

For CPAN::Reporter to work we need a commandline that gets passed to CPAN::Reporter::test(),

CPAN::Static comes with a command-line tool: cpan-static. cpan-static test should DWIM, and should respect all the usual test harness environmental variables.

@andk
Copy link
Owner

andk commented Aug 28, 2025

@Leont : cpan-static does not seem to get installed per default. Should I write an issue to CPAN-Static-Install or do you have a better idea anyway?

@Leont
Copy link
Contributor Author

Leont commented Aug 28, 2025

cpan-static does not seem to get installed per default. Should I write an issue to CPAN-Static-Install or do you have a better idea anyway?

I can't reproduce that.

Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/man/man1/cpan-static.1
Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0/CPAN/Static.pm
Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0/CPAN/Static/Spec.pm
Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0/CPAN/Static/Install.pm
Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/man/man3/CPAN::Static::Install.3
Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/man/man3/CPAN::Static::Spec.3
Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/man/man3/CPAN::Static.3
Installing /home/leont/perl5/perlbrew/perls/perl-5.42.0/bin/cpan-static

@andk
Copy link
Owner

andk commented Aug 29, 2025

OMG, my bad, sorry.

@andk
Copy link
Owner

andk commented Aug 31, 2025

@Leont : now I think I have a case that calls for a defense directly in supports_static_install. Consider a META.json that has both
'dynamic_config' => '1', and 'x_static_install' => '1'.

In such a case supports_static_install() should most probably never return true; but currently it does.
What do you think?

Case in question: https://metacpan.org/release/CXW/List-AutoNumbered-0.000010/source/META.json

@andk
Copy link
Owner

andk commented Sep 3, 2025

@Leont , just FYI: in my latest commit 2.38-35-ged0daea8 I have implemented the defense I originally considered a good fit for supports_static_install(); so I feel safer now with my current implementation and I'm testing it in two fullsmoker VMs over the next weeks.

@Leont
Copy link
Contributor Author

Leont commented Sep 3, 2025

Consider a META.json that has both
'dynamic_config' => '1', and 'x_static_install' => '1'.

In such a case supports_static_install() should most probably never return true; but currently it does.
What do you think?

It shouldn't happen, but Murphy's law applies so it probably will at some point. Any author doing that is silly, and rejecting that seems reasonable.

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