Skip to content

'Build-CMakeBuild' should run configuration if the codemodel file doesn't exist #62

@MarkSchofield

Description

@MarkSchofield

Build-CMakeBuild checks for the existence of the '.cmake/api/v1/reply' folder to see if it should run configuration - if it doesn't exist, then it will re-run configuration. If the folder does exist, it goes ahead and attempts to load the 'code model'. But the '.cmake/api/v1/reply' folder can exist without a code model in - when configuration fails a error-<<timstamp>>.json file is written to the folder. In this situation Build-CMakeBuild fails with a cryptic:

Invoke-Command: W:\Source\repos\Monstrosity\PSCMake\PSCMake\Common\Common.ps1:83
Line |
  83 |          Invoke-Command $Scriptlet
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'configurations' cannot be found on this object. Verify that the property exists.

as it tries to access $CodeModel.configurations when $CodeModel (returned from Get-CMakeBuildCodeModel $BinaryDirectory) is $null.

Build-CMakeBuild should really just try and load the code model, and if that fails, re-run configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions