psake / psake/PowerShellBuild

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

Open
#212 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
145
Forks
27
Avg merge
10h 16m
Merged PRs (30d)
34

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Build-PSBuildModule and trace the readme block, bulk source copy, and CopyDirectories in both CompileModule modes. Reproduce the conflict with ConvertReadMeToAboutHelp enabled and a hand-written culture-specific about file, then review related issues #207, #210, and #211. Done means the precedence or warning behavior is deliberately chosen and consistent across both modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
build-system
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.