Perl - Dockerfile Publish Failures

Chiusa
#2,401 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #2402 di @Omnideth — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, docker, perl

Direzione di ricerca

Start with the cpanm and Carton Dockerfile generators in src/CommunityToolkit.Aspire.Hosting.Perl/PerlAppResourceBuilderExtensions.Dockerfile.cs, then read HasDependencyFiles in src/CommunityToolkit.Aspire.Hosting.Perl/PerlAppResourceBuilderExtensions.cs to compare publish behavior with run mode. Trace how WithPackage(...) modules and cartonDeployment are represented, then inspect the related tests. Done means the listed manifest and package cases generate images that build and include their dependencies.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

Both Dockerfile generators emit COPY lines for dependency manifests without checking that the files exist:

docker build fails with "/cpanfile": not found for:

  • any Perl app with no cpanfile, including a plain AddPerlScript with no dependencies, which is the
    default publish path (the cpanm generator is the fallback for every resource);
  • apps that declare dependencies through Makefile.PL / Build.PL only. Run mode supports these
    (HasDependencyFiles),
    but publish doesn't;
  • Carton apps without a snapshot, when cartonDeployment: false.

A related gap: modules declared only through WithPackage(...) are never installed in the image, so an
app that publishes successfully can still fail at runtime with Can't locate Foo/Bar.pm.

Regression

No response

Steps to reproduce
1. Create an app directory with only `app.pl`, and no `cpanfile`.
2. `builder.AddPerlScript("app", "../app", "app.pl");`
3. `aspire publish`, then build the generated Dockerfile.
Expected behavior
  • No manifest: no dependency COPY / install step, and the image builds.
  • Makefile.PL / Build.PL only: copy them and run cpanm --installdeps --notest ..
  • Carton: copy cpanfile.snapshot only if it exists; require it only when cartonDeployment is true.
  • WithPackage modules: install them with cpanm --notest <Module> ... in the image (respecting
    local::lib), after project dependencies.
Screenshots

No response

IDE and version

VS Code

IDE version

No response

Nuget packages

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

Lingua principale
C#
Stelle
632
Fork
204
Merge medio
2g 13h
PR unite (30g)
92

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CommunityToolkit/Aspire

Tutte le issue di CommunityToolkit/Aspire

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.