Skip to content

Building PowerShell Core on WSL generates error #5194

@rkeithhill

Description

@rkeithhill

FWIW I do seem to get a valid pwsh built and I can run it. So that is good.

Steps to reproduce

  1. Make sure you're running WSL Xenial 16.04.
  2. Install PowerShell Core for Ubuntu 16.04 in WSL
  3. Start PowerShell Core in WSL
  4. Cd to your Windows clone dir e.g. cd /mnt/c/GitHub/PowerShell
  5. ipmo ./build.psm1
  6. Start-PSBootstrap
  7. Start-PSBuild

BTW this is a darn convenient way to build/test for both Windows and Linux. No need to push your changes to origin so you can pull them to Linux to test.

Expected behavior

pwsh builds - no errors.

Actual behavior

Get an error:

PowerShell output: /mnt/c/Users/Keith/GitHub/rkeithhill/PowerShell/src/powershell-unix/bin/Linux/netcoreapp2.0/linux-x64/publish/pwsh
Copy-Item : Cannot find path 'C:/Program
Files/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.0.0/ref/netcoreapp2.0/Microsoft.CSharp.dll' because it
does not exist.
At /mnt/c/Users/Keith/GitHub/rkeithhill/PowerShell/build.psm1:528 char:9
+         Copy-Item -Path $refAssemblies -Destination $refDestFolder -F ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:/Program File...soft.CSharp.dll:String) [Copy-Item], ItemNotFoundExce
   ption
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyItemCommand

Sure enough, the powershell.inc file includes a whole bunch of paths that start with C:\.

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-beta.8
PSEdition                      Core
GitCommitId                    v6.0.0-beta.8
OS                             Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

BTW the root of the problem is that TypeGen dir - $PSScriptRoot/src/TypeCatalogGen - is not platform specific. It probably should be $PSScriptRoot/src/TypeCatalogGen/$Runtime. Easiest work-around for now is Start-PSBuild -Clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Maintainers-Buildspecific to affecting the buildHacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions