actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.91k stars 965 forks source link

Node 20 versions prior to Node 20.11 had a bug that caused a crash when accessing files with emojis in their names. #3263

Closed kzrnm closed 6 months ago

kzrnm commented 6 months ago

Describe the bug

Node 20 on Windows prior to Node 20.11 had a bug that caused it to crash when accessing a file with an emoji in its name.

The current runner uses 20.8.1 and is affected by this bug.

https://github.com/actions/runner/blob/04b07b6675c56da40e532ab73eeb4287bf223e34/src/Misc/externals.sh#L9

To Reproduce

name: Python
on:
  workflow_dispatch:
jobs:
  download:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python:
          - "3.9"
      fail-fast: false

    runs-on: ${{ matrix.os }}
    steps:
      - run: |
          touch "👍.txt"
          touch requirements.txt
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "${{ matrix.python }}"
          cache: pip

Expected behavior

All strategies are successfully completed.

Actual behavior:

On windows,

Runner Version and Platform

What's not working?

Job Log Output

Error: Cannot read properties of undefined (reading '0')
node:internal/fs/promises:894
  const result = await binding.stat(pathModule.toNamespacedPath(path),
                               ^
Error: ENOENT: no such file or directory, stat
    at Object.stat (node:internal/fs/promises:894:32)
    at DefaultGlobber.<anonymous> (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:7081:47)
    at Generator.next (<anonymous>)
    at D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:6911:71
    at new Promise (<anonymous>)
    at __webpack_modules__.8298.__awaiter (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:6907:12)
    at DefaultGlobber.stat (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:7073:16)
    at DefaultGlobber.globGenerator_1 (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:7018:60)
    at globGenerator_1.next (<anonymous>)
    at resume (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:6927:44) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat'
}

Simple example repository

https://github.com/kzrnm/emoji-file-action/tree/simple