psake / psake/PowerShellBuild

Compile and non-compile modes disagree on whether the readme or a source about file wins

Offen
#212 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
PowerShell
Sterne
145
Forks
27
Ø Merge
10 Std. 16 Min.
Gemergte PRs (30 T.)
34

Beschreibung

Found while researching #207, and only visible once that issue is fixed.

The disagreement

Both modes can produce <Culture>/about_<Module>.help.txt, from two different sources, and they resolve the conflict differently — by accident of statement ordering rather than by design.

Non-compile mode. The readme block runs, then the bulk stage copies the whole source tree:

Copy-Item -Path (Join-Path $Path "*") -Destination $DestinationPath -Recurse -Force

That runs after, so a hand-written en-US/about_<Module>.help.txt in source overwrites the readme-derived one. Source wins.

Compile mode. There is no bulk copy. Once #207 is fixed the readme copy runs unconditionally, and the source about file only reaches the output if CopyDirectories names the culture directory — in which case CopyDirectories runs before the readme block. The readme wins.

So the same two inputs give opposite results depending on a setting that has nothing to do with help.

How to see it

Set ConvertReadMeToAboutHelp = $true and ship a hand-written en-US/about_<Module>.help.txt, then build twice, changing only CompileModule. In non-compile the hand-written text survives; in compile (post-#207) the readme replaces it.

Measured this way while validating the #207 fix. On main today the compile case produces no about file at all, so the disagreement is masked by the bug rather than absent.

Is either answer right?

Arguable both ways, which is why this is its own issue rather than a line in #207:

  • Source should win. A consumer who hand-wrote a conformant about topic has expressed a clear preference, and a Markdown readme is not a conformant about topic — it satisfies none of the TOPIC / four-space-indent structure Get-Help documents. Overwriting the good one with the bad one is the worse outcome.
  • The readme should win. ConvertReadMeToAboutHelp = $true is an explicit instruction. Silently ignoring it because a file happens to exist is how #207 happened in the first place.
  • The combination is contradictory and deserves a warning rather than a silent winner either way.

What is not defensible is the current state, where the answer depends on CompileModule.

Scope

Narrow today. Of 86 surveyed public consumers, none sets ConvertReadMeToAboutHelp through $PSBPreference; the only users reach it by calling Build-PSBuildModule directly. 14 ship a hand-written about topic. No consumer is known to do both, so nobody is hitting this now.

Worth settling anyway, because #207 makes the compile-mode behavior real for the first time, and it is cheaper to decide the precedence deliberately now than to discover it later as a surprise.

Related

#207 (the readme copy being skipped), #210 (a source about file being dropped entirely in compile mode), #211 (culture-directory files flattened into the output root). All four are the same staging logic; the precedence question here only becomes answerable once the other three are settled.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei Build-PSBuildModule und verfolge den README-Block, das Bulk-Quellkopieren und CopyDirectories in beiden CompileModule-Modi. Reproduziere den Konflikt mit aktiviertem ConvertReadMeToAboutHelp und einer von Hand geschriebenen kulturspezifischen About-Datei und prüfe anschließend die zugehörigen Issues #207, #210 und #211. Als erledigt gilt die Aufgabe, wenn das Vorrang- oder Warnverhalten bewusst gewählt wurde und in beiden Modi konsistent ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell
Bereich
build-system
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.