Perl - Dockerfile Publish Failures

Đã đóng
#2,401 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Một pull request liên quan đã được merge.

  • #2402 của @Omnideth — đã merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, docker, perl
Lĩnh vực
build-system, devops

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
C#
Star
632
Fork
204
Merge trung bình
2 ngày 18 giờ
Pull request đã merge (30 ngày)
99

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CommunityToolkit/Aspire

Tất cả issue của CommunityToolkit/Aspire

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.