Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The term 'cl' is not recognized as the name of a cmdlet #24

Closed
CJCombrink opened this issue Sep 5, 2020 · 4 comments
Closed

The term 'cl' is not recognized as the name of a cmdlet #24

CJCombrink opened this issue Sep 5, 2020 · 4 comments

Comments

@CJCombrink
Copy link

I am trying to build my C++ application using GitHub actions and added a step to use this action as follow:

      - name: Setup MSBuild
        if: runner.os == 'Windows'
        uses: microsoft/setup-msbuild@v1.0.1

msbuild is working, but not cl:
My Step:

      - name: Test MSBuild
        if: runner.os == 'Windows'
        shell: pwsh
        run: |
          msbuild -version
          cl

Output is:

Run msbuild -version
  msbuild -version
  cl
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    OS: win32
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

cl: D:\a\_temp\3109041e-6212-4b44-a224-795ce1d6037f.ps1:3
Line |
   3 |  cl
     |  ~~
     | The term 'cl' is not recognized as the name of a cmdlet, function, script file, or operable program.
     | Check the spelling of the name, or if a path was included, verify that the path is correct and try
     | again.

Is this expected?

@timheuer
Copy link
Member

timheuer commented Sep 8, 2020

@CJCombrink I think this is expected. The action simply finds and sets up the PATH for msbuild.exe and cl is not a part of that path.

@CJCombrink
Copy link
Author

I think this is expected. The action simply finds and sets up the PATH for msbuild.exe and cl is not a part of that path.

Thanks, I am assuming this is valid for .Net applications. Unfortunately cl is needed for C++ applications.

@timheuer
Copy link
Member

timheuer commented Sep 9, 2020

@CJCombrink there have been some discussions of enabling something similar for VC tools -- this action uses vswhere.exe to find things, and you could use similar techniques to get to the VCtools paths where cl.exe would be.

@CJCombrink
Copy link
Author

@timheuer Thanks, I used the information from this link: microsoft/terminal#3821 (comment) to achieve adding the tools to the path in my action script with good success: https://github.com/CJCombrink/SpellChecker-Plugin/blob/master/.github/workflows/build.yaml#L214

With this I can build my C++ application using msbuild from withing a powershell core console.
Perhaps it can be useful for someone else having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants