dsccommunity / DscWorkshop

Blueprint for a full featured DSC project for Push / Pull with or without CI/CD
MIT License
202 stars 163 forks source link

Build.ps1 does not build a freshly cloned repo #123

Closed nyanhp closed 2 years ago

nyanhp commented 2 years ago

Problem description

Build.ps1 -ResolveDependency does not build a freshly cloned repo

Verbose logs

Verbose output is too long for GitHub. Pasting only the last portion which ran into the error.

===============================================================================
                        COMPILEDATUMRSOP

-------------------------------------------------------------------------------
  /./build/CompileDatumRsop
  D:\tmp\DscWorkshop\output\RequiredModules\Sampler.DscPipeline\0.1.1\tasks\CompileDatumRsop.build.ps1:39

        Project Name               = ''
        Source Path                = 'source'
        Output Directory           = 'D:\tmp\DscWorkshop\output'
        Release Notes path         = 'D:\tmp\DscWorkshop\output\ReleaseNotes.md'
        Built Module Subdirectory  = 'D:\tmp\DscWorkshop\output\AvoidPSPathOverlap'
        Module Manifest Path (src) = 'C:\Users\janhe\source\.psd1'
VERBOSE: Module version is not determined yet. Evaluating methods to get module version.
VERBOSE: GitVersion is not installed. Trying to use the version from module manifest in path 'C:\Users\janhe\source\.psd1'.
ERROR: Cannot find path 'C:\Users\janhe\source\.psd1' because it does not exist.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psm1:544 char:35
+         foreach($resolvedPath in (Resolve-Path @PSBoundParameters))
+                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At D:\tmp\DscWorkshop\output\RequiredModules\Sampler.DscPipeline\0.1.1\tasks\CompileDatumRsop.build.ps1:39 char:1
+ task CompileDatumRsop {
+ ~~~~~~~~~~~~~~~~~~~~~~~
At D:\tmp\DscWorkshop\build.ps1:331 char:13
+             task $workflow $workflowItem
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At D:\tmp\DscWorkshop\build.ps1:331 char:13
+             task $workflow $workflowItem
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build FAILED. 7 tasks, 1 errors, 0 warnings 00:00:14.2525590
Resolve-Path : Cannot find path 'C:\Users\janhe\source\.psd1' because it does not exist.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psm1:544 char:35
+         foreach($resolvedPath in (Resolve-Path @PSBoundParameters))
+                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\janhe\source\.psd1:String) [Resolve-Path], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand

[00:19:30]PS /> $pwd

Path
----
D:\tmp\DscWorkshop

How to reproduce

$VerbosePreference = 'Continue' git clone git@github.com:dsccommunity/DscWorkshop.git cd DscWorkshop .\Build.ps1 -ResolveDependency

Expected behavior

Freshly cloned main branch should always build successfully.

Current behavior

Build.ps1 -ResolveDependency does not build a freshly cloned repo

Suggested solution

None. The build process has become too complex to troubleshoot since migrating to Sampler.

Operating system the target node is running

OsName               : Microsoft Windows 11 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 22000.1.amd64fre.co_release.210604-1628
OsLanguage           : en-US
OsMuiLanguages       : {en-US, de-DE, en-GB}

PowerShell version and build the target node is running

Name                           Value                                                                                                                                                                                                                                                                                                                                                     
----                           -----                                                                                                                                                                                                                                                                                                                                                     
PSVersion                      5.1.22000.282                                                                                                                                                                                                                                                                                                                                             
PSEdition                      Desktop                                                                                                                                                                                                                                                                                                                                                   
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                                                                                                                                   
BuildVersion                   10.0.22000.282                                                                                                                                                                                                                                                                                                                                            
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                                                                                                                                                           
WSManStackVersion              3.0                                                                                                                                                                                                                                                                                                                                                       
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                                                                                                                                       
SerializationVersion           1.1.0.1

Module version used

???
CommonTasks2 is not a module and does not exist. The code in use was the latest commit in the main branch:

[00:00:01]PS /> git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
[00:00:00]PS /> git log -n 1 --oneline
274d7ef (HEAD -> main, origin/main, origin/HEAD) Migration to sampler (#121)
nyanhp commented 2 years ago

Successfully built, thanks @raandree