Perl - Readme Drift

Chiusa Adatta ai principianti
#2,375 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #2376 di @Omnideth — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
markdown
Ambito
documentation

Direzione di ricerca

Leggi src/CommunityToolkit.Aspire.Hosting.Perl/README.md insieme a src/CommunityToolkit.Aspire.Hosting.Perl/PerlAppResourceBuilderExtensions.cs e alla sua parte PackageManager. Inizia controllando i quattro punti di ingresso AddPerl*, il comportamento dei relativi comandi, la gestione dei percorsi e il rilevamento dei file delle dipendenze in modalità di esecuzione citato nell’issue. Aggiorna il README per descrivere questi comportamenti e verifica ogni affermazione rispetto al codice; il lavoro è completato quando il README documenta correttamente tutti e tre i punti sollevati.

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

Descrizione

Page URL

https://github.com/CommunityToolkit/Aspire/blob/main/src/CommunityToolkit.Aspire.Hosting.Perl/PerlAppResourceBuilderExtensions.cs

Describe the issue

Describe the bug

README.md disagrees with the code:

  1. Entry points. "Core Concepts" (README.md#L40)
    says the integration provides two entry points (AddPerlScript, AddPerlApi). There are four:
    AddPerlModule and AddPerlExecutable are missing.

  2. Script path base. The "Key insight" callout
    (README.md#L98) says:

    The script path in AddPerlScript / AddPerlApi is relative to AppHost.cs

    The XML docs and the implementation resolve the script path relative to appDirectory: it's
    passed as a bare argument and the working directory is appDirectory. In the README's own
    "../scripts" example the script path is "Worker.pl", which only works relative to appDirectory.

  3. Implicit WithProjectDependencies(). The Package Management table and callout
    (README.md#L137,
    #L141-L143) already say that calling
    WithProjectDependencies() switches the default cpan to cpanm. They don't say that in run mode every
    AddPerl* method calls WithProjectDependencies() itself when appDirectory contains cpanfile,
    Makefile.PL, or Build.PL
    (PerlAppResourceBuilderExtensions.cs#L254-L259,
    HasDependencyFiles).
    A resource with no package-manager calls then gets a cpanm installer and a cpanm required-command
    check
    (PerlAppResourceBuilderExtensions.PackageManager.cs#L275-L280,
    #L34).
    Users are surprised when cpanm is reported missing.

    Related, out of scope here: detection runs inside AddPerl*, so a later .WithCarton() replaces the
    package manager but leaves the cpanm check in place. If that behavior should change, file it as a
    separate code issue. This issue only documents current behavior.

Suggestion

The README lists all four Add* methods and the command each one runs:

Method Runs
AddPerlScript perl -s <script>
AddPerlApi perl <script> daemon
AddPerlModule perl -M<Module> -e "<Module>->run()" (the module must provide run and be on @INC; the integration adds only WithLocalLib paths to PERL5LIB)
AddPerlExecutable <executable> directly

The "Key insight" callout says the script path, WithLocalLib, cpanfile discovery, and the working
directory are all relative to appDirectory, which is itself relative to the AppHost project
directory.

The Package Management section documents the auto-detection: which files trigger it, that it runs only
in run mode (publish behavior is issue 09), and that it switches the default cpan to cpanm.
Add this to the existing callout at L141-L143 rather than as a new paragraph after it (see below).
The fix inserts it between L142 and L143. git merge-tree against each branch below reports a clean merge.

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 6h
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.