[GH-ISSUE #1891] Windows-latest with act error with ComSpec path #913

Closed
opened 2026-03-01 21:47:23 +03:00 by kerem · 7 comments
Owner

Originally created by @hirseboy on GitHub (Jul 1, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1891

Bug report info

act version:            0.2.46
GOOS:                   windows
GOARCH:                 amd64
NumCPU:                 20
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        \\.\pipe\docker_engine(broken)
Config files:
        C:\Users\Stephan Hirth\.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.10
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.46 -X main.commit=b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 -X main.date=2023-06-01T02:39:24Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 windows
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9
                vcs.time:             2023-06-01T02:39:05Z
                vcs.modified:         false
Docker Engine:
        Engine version:        24.0.2
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.79.1-microsoft-standard-WSL2
        OS CPU:                20
        OS memory:             15844 MB
        Security options:
                name=seccomp,profile=builtin

Command used with act

act -W .\.github\workflows\cmake_windows.yml -P windows-latest=-self-hosted

Describe issue

ComSpec path was not found

https://github.com/hirseboy/DWD-Weather-Data-Converter/

Workflow content

name: CMake

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  BUILD_TYPE: Release
  QT_VERSION: "5.15.12"
  VERSION: 0.9
  LONG_VERSION: 0.9.9
  CURRENT_YEAR: 2023
  FILE_BASENAME: DWDWeatherDataConverter_Win
  INNOSETUP_VERSION: "6.2.0"


jobs:
  build:
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v3
    
    - name: Create Directory
      run: mkdir ${{github.workspace}}\bin\release_x64
      shell: cmd
    
    - name: Download and Install Inno Setup
      run: |
        $url = "files.jrsoftware.org/is/6/innosetup-6.2.0.exe"
        $output = "${{github.workspace}}\innosetup-6.2.0-unicode.exe"
        Invoke-WebRequest -Uri $url -OutFile $output
        Start-Process $output -ArgumentList "/VERYSILENT" -NoNewWindow -Wait
        
    - name: Prepare Inno Setup Script
      run: |
        # Replace placeholders in .iss.in file here. 
        # This is just an example, adjust it to your needs.
        (Get-Content ${{github.workspace}}\build\installer\deploy64.iss.in) `
        | Set-Content ${{github.workspace}}\build\installer\deploy64.iss
      shell: powershell
    
    - name: Install Visual Studio Build Tools
      uses: ilammy/msvc-dev-cmd@v1

    - name: Install Qt
      uses: jurplel/install-qt-action@v3
      with:
        aqtversion: '==3.1.*'
        version: '5.15.2'
        host: 'windows'
        target: 'desktop'
        arch: 'win64_msvc2019_64'
    
        
    - name: Configure CMake
      env:
        CMAKE_PREFIX_PATH: ${{env.Qt5_Dir}}
      working-directory: ${{github.workspace}}\build\cmake
      run: cmake ${{github.workspace}}\build\cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
      
    - name: Build
      working-directory: ${{github.workspace}}\build\cmake
      run: cmake --build . --config ${{env.BUILD_TYPE}}

    - name: Test
      working-directory: ${{github.workspace}}\build\cmake
      run: ctest -C ${{env.BUILD_TYPE}} 
      
    - name: Copy Executable
      run: |
        "xcopy /Y ${{github.workspace}}\build\cmake\DWDWeatherDataConverter\release\DWDWeatherDataConverter.exe ${{github.workspace}}\bin\release_x64"
      shell: cmd

    - name: Build Installer
      run: |
        "%programfiles(x86)%\Inno Setup 6\iscc.exe" "${{github.workspace}}\build\installer\deploy64.iss"
      shell: cmd

Relevant log output

[CMake/build]   ☁  git clone 'https://github.com/ilammy/msvc-dev-cmd' # ref=v1
[CMake/build]   ☁  git clone 'https://github.com/jurplel/install-qt-action' # ref=v3
[CMake/build] ⭐ Run Pre Install Qt
[CMake/build]   ☁  git clone 'https://github.com/actions/setup-python' # ref=v4
[CMake/build]   ☁  git clone 'https://github.com/jurplel/install-qt-action' # ref=v3
[CMake/build]   ✅  Success - Pre Install Qt
[CMake/build] ⭐ Run Main actions/checkout@v3
[CMake/build]   ✅  Success - Main actions/checkout@v3
[CMake/build] ⭐ Run Main Create Directory
| Cannot find: %ComSpec% in PATH
[CMake/build]   ❌  Failure - Main Create Directory
[CMake/build] Cannot find: %ComSpec% in PATH
[CMake/build] 🏁  Job failed
Error: Job 'build' failed

Additional information

Originally created by @hirseboy on GitHub (Jul 1, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1891 ### Bug report info ```plain text act version: 0.2.46 GOOS: windows GOARCH: amd64 NumCPU: 20 Docker host: DOCKER_HOST environment variable is not set Sockets found: \\.\pipe\docker_engine(broken) Config files: C:\Users\Stephan Hirth\.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.46 -X main.commit=b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 -X main.date=2023-06-01T02:39:24Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: windows GOAMD64: v1 vcs: git vcs.revision: b0d0cec71f2240fc629dcaa1889ed8c4ad52beb9 vcs.time: 2023-06-01T02:39:05Z vcs.modified: false Docker Engine: Engine version: 24.0.2 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: x86_64 OS kernel: 5.15.79.1-microsoft-standard-WSL2 OS CPU: 20 OS memory: 15844 MB Security options: name=seccomp,profile=builtin ``` ### Command used with act ```sh act -W .\.github\workflows\cmake_windows.yml -P windows-latest=-self-hosted ``` ### Describe issue ComSpec path was not found ### Link to GitHub repository https://github.com/hirseboy/DWD-Weather-Data-Converter/ ### Workflow content ```yml name: CMake on: push: branches: [ "main" ] pull_request: branches: [ "main" ] env: BUILD_TYPE: Release QT_VERSION: "5.15.12" VERSION: 0.9 LONG_VERSION: 0.9.9 CURRENT_YEAR: 2023 FILE_BASENAME: DWDWeatherDataConverter_Win INNOSETUP_VERSION: "6.2.0" jobs: build: runs-on: windows-latest steps: - uses: actions/checkout@v3 - name: Create Directory run: mkdir ${{github.workspace}}\bin\release_x64 shell: cmd - name: Download and Install Inno Setup run: | $url = "files.jrsoftware.org/is/6/innosetup-6.2.0.exe" $output = "${{github.workspace}}\innosetup-6.2.0-unicode.exe" Invoke-WebRequest -Uri $url -OutFile $output Start-Process $output -ArgumentList "/VERYSILENT" -NoNewWindow -Wait - name: Prepare Inno Setup Script run: | # Replace placeholders in .iss.in file here. # This is just an example, adjust it to your needs. (Get-Content ${{github.workspace}}\build\installer\deploy64.iss.in) ` | Set-Content ${{github.workspace}}\build\installer\deploy64.iss shell: powershell - name: Install Visual Studio Build Tools uses: ilammy/msvc-dev-cmd@v1 - name: Install Qt uses: jurplel/install-qt-action@v3 with: aqtversion: '==3.1.*' version: '5.15.2' host: 'windows' target: 'desktop' arch: 'win64_msvc2019_64' - name: Configure CMake env: CMAKE_PREFIX_PATH: ${{env.Qt5_Dir}} working-directory: ${{github.workspace}}\build\cmake run: cmake ${{github.workspace}}\build\cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - name: Build working-directory: ${{github.workspace}}\build\cmake run: cmake --build . --config ${{env.BUILD_TYPE}} - name: Test working-directory: ${{github.workspace}}\build\cmake run: ctest -C ${{env.BUILD_TYPE}} - name: Copy Executable run: | "xcopy /Y ${{github.workspace}}\build\cmake\DWDWeatherDataConverter\release\DWDWeatherDataConverter.exe ${{github.workspace}}\bin\release_x64" shell: cmd - name: Build Installer run: | "%programfiles(x86)%\Inno Setup 6\iscc.exe" "${{github.workspace}}\build\installer\deploy64.iss" shell: cmd ``` ### Relevant log output ```sh [CMake/build] ☁ git clone 'https://github.com/ilammy/msvc-dev-cmd' # ref=v1 [CMake/build] ☁ git clone 'https://github.com/jurplel/install-qt-action' # ref=v3 [CMake/build] ⭐ Run Pre Install Qt [CMake/build] ☁ git clone 'https://github.com/actions/setup-python' # ref=v4 [CMake/build] ☁ git clone 'https://github.com/jurplel/install-qt-action' # ref=v3 [CMake/build] ✅ Success - Pre Install Qt [CMake/build] ⭐ Run Main actions/checkout@v3 [CMake/build] ✅ Success - Main actions/checkout@v3 [CMake/build] ⭐ Run Main Create Directory | Cannot find: %ComSpec% in PATH [CMake/build] ❌ Failure - Main Create Directory [CMake/build] Cannot find: %ComSpec% in PATH [CMake/build] 🏁 Job failed Error: Job 'build' failed ``` ### Additional information -
kerem 2026-03-01 21:47:23 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@wiktor-k commented on GitHub (Sep 13, 2023):

@hirseboy What was it? I'm getting this Cannot find: %ComSpec% in PATH when using cmd shell and the only thing that pops out when doing searches is this very issue 😕

<!-- gh-comment-id:1717469872 --> @wiktor-k commented on GitHub (Sep 13, 2023): @hirseboy What was it? I'm getting this `Cannot find: %ComSpec% in PATH` when using cmd shell and the only thing that pops out when doing searches is this very issue 😕️
Author
Owner

@hirseboy commented on GitHub (Sep 13, 2023):

I did not use it since I could not fix it. :(

<!-- gh-comment-id:1717474752 --> @hirseboy commented on GitHub (Sep 13, 2023): I did not use it since I could not fix it. :(
Author
Owner

@wiktor-k commented on GitHub (Sep 13, 2023):

I did not use it since I could not fix it. :(

Oh, okay, thanks for clarifying. I read "closed this as completed" as some kind of "it works now" :)

FTR it seems using shell: powershell is the only working option. I tried using cmd /k and cmd /c as shell and couldn't get any output.

Have a nice day! 👋

<!-- gh-comment-id:1717481377 --> @wiktor-k commented on GitHub (Sep 13, 2023): > I did not use it since I could not fix it. :( Oh, okay, thanks for clarifying. I read "closed this as completed" as some kind of "it works now" :) FTR it seems using `shell: powershell` is the only working option. I tried using `cmd /k` and `cmd /c` as `shell` and couldn't get any output. Have a nice day! :wave:
Author
Owner

@ChristopherHX commented on GitHub (Sep 13, 2023):

Sounds like you are behind some updates / using act_runner which is also behind updates

%COMSPEC% has been removed in 0.2.50 here: github.com/nektos/act@83140951bf

<!-- gh-comment-id:1717926592 --> @ChristopherHX commented on GitHub (Sep 13, 2023): Sounds like you are behind some updates / using act_runner which is also behind updates %COMSPEC% has been removed in 0.2.50 here: https://github.com/nektos/act/commit/83140951bf96c500f0c1a745e4333b27f2820e49
Author
Owner

@wiktor-k commented on GitHub (Sep 13, 2023):

Indeed, I'm using act_runner version 0.2.5. I'll try the nightly ASAP but one way or another it's good to know it's already fixed here. Thanks for the broader context @ChristopherHX !

(Edit: BTW the commit that you've linked also got me an idea of a workaround. Really nice, thanks again! 👋)

<!-- gh-comment-id:1718082601 --> @wiktor-k commented on GitHub (Sep 13, 2023): Indeed, I'm using act_runner [version 0.2.5](https://dl.gitea.com/act_runner/). I'll try the nightly ASAP but one way or another it's good to know it's already fixed here. Thanks for the broader context @ChristopherHX ! (Edit: BTW the commit that you've linked also got me an idea of a workaround. Really nice, thanks again! 👋)
Author
Owner

@ChristopherHX commented on GitHub (Sep 13, 2023):

Nah act_runner nightly is also based on a act 0.2.49 fork

You cannot compare the version numbers, also gitea/act diverges a lot in some details

<!-- gh-comment-id:1718165513 --> @ChristopherHX commented on GitHub (Sep 13, 2023): Nah act_runner nightly is also based on a act 0.2.49 fork You cannot compare the version numbers, also gitea/act diverges a lot in some details
Author
Owner

@wiktor-k commented on GitHub (Sep 13, 2023):

Ah, that's too bad. Overall I'm satisfied with act_runner, but I'd rather like it to be closer to the original (act). Gitea runner that exposes all OSes just like Github does is something I'm trying to replicate.

Thanks for your time! I learned a lot from this conversation (and I hope it'll help others navigate this space too).

<!-- gh-comment-id:1718187789 --> @wiktor-k commented on GitHub (Sep 13, 2023): Ah, that's too bad. Overall I'm satisfied with act_runner, but I'd rather like it to be closer to the original (act). Gitea runner that exposes all OSes just like Github does is something I'm trying to replicate. Thanks for your time! I learned a lot from this conversation (and I hope it'll help others navigate this space too).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#913
No description provided.