Perl - Dockerfile Publish Failures

クローズ
#2,401 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #2402 @Omnideth による — マージ済み

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, docker, perl

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
C#
スター
632
フォーク
204
平均マージ
2日 13時間
マージ済み PR(30日)
92

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CommunityToolkit/Aspire のほかの issue

CommunityToolkit/Aspire の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。