Staging flattens a culture directory's .psd1 into the output root
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 74/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- powershell
- Domínio
- build-system
Direção de pesquisa
Comece pela lógica de staging do Build-PSBuildModule descrita na issue e revise as issues relacionadas #206, #207 e #210 antes de alterar o comportamento de depth. Verifique se o manifesto raiz e os arquivos de módulo continuam sendo preparados corretamente, enquanto um arquivo localizado en-US/Messages.psd1 não é copiado para a raiz da saída.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Found while researching #207. Reading the code confirms it; it is also visible in that issue's own reproduction output.
What happens
Build-PSBuildModule stages the module's loose files with:
$getChildItemSplat = @{
Path = $Path
Include = "*.psm1", "*.psd1", "*.ps1xml"
Depth = 1
}
Get-ChildItem @getChildItemSplat |
Copy-Item -Destination $DestinationPath -Force
-Depth 1 implies recursion one level down, so this matches en-US/Messages.psd1 — and Copy-Item -Destination $DestinationPath writes it flat into the output root, discarding the directory it came from.
A module with a localized Messages.psd1 therefore builds an output containing a stray Messages.psd1 at the root that nothing reads. If CopyDirectories also names en-US, the correct copy is there too, and the built tree carries both.
Why it matters, mildly
Nothing breaks. Import-LocalizedData resolves through the culture directory and ignores the stray file, and a module without a culture directory never hits it. The costs are that the published package carries a file that serves no purpose and misleads anyone reading the tree, and that a consumer debugging localization finds two copies of the same file and has to work out which one is live.
It is also the same root cause as #210, seen from the other side: the depth-1 glob is trying to serve two purposes — collect the root manifest and module file, and leave everything else to CopyDirectories — and reaches one level too far.
Options
- Drop
-Depth 1, so the glob matches only the root. The manifest and root module are always at the root, so nothing intended is lost. Anything deeper isCopyDirectories' job. Smallest change. - Preserve relative paths when copying, so
en-US/Messages.psd1lands aten-US/Messages.psd1. More faithful, and it would partly address #210 — but it makes the glob a second, implicit staging mechanism competing withCopyDirectories, which is how the two got tangled in the first place. - Leave it. The stray file is inert.
(1) looks right, and it is a one-word deletion. But -Depth 1 was presumably added deliberately at some point, and I could not find what for — worth a moment's thought before removing it, in case some layout depends on it.
Related: #206, #207 and #210 are all in this same staging logic. Worth deciding together.
- Linguagem predominante
- PowerShell
- Estrelas
- 145
- Forks
- 27
- Merge médio
- 10h 16min
- PRs com merge (30d)
- 34
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de psake/PowerShellBuild
-
Nothing tests the Build-PSBuildUpdatableHelp branch that deletes a consumer's output directory Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
psake/PowerShellBuild#218 · 1 comentário ·
-
CI: Install the built module from a local repository to verify install-time dependency behaviour Abertaenhancement github_actions
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 68/100
psake/PowerShellBuild#229 ·
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
psake/PowerShellBuild#222 ·
-
bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 68/100
psake/PowerShellBuild#221 ·
-
bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
psake/PowerShellBuild#220 ·
Todas as issues de psake/PowerShellBuild
Issues semelhantes
-
type/automation type/tech-debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
priority: p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
googleapis/librarian#7636 ·
-
Update gh-dash to 4.26.0 Abertapackage-update
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comentário ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
agentic-workflows cascade-suspected
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100