m2ci-msp / gradle-pandoc-reveal-plugin

Apply common build logic to a slideshow project using Pandoc and reveal.js
Apache License 2.0
2 stars 1 forks source link

Mermaid filter test is broken for macOS Sonoma in GitHub Actions #43

Open psibre opened 1 month ago

psibre commented 1 month ago

Although it did work in the past, it turns out that the Mermaid filter test no longer runs on macOS in GitHub Actions. The issue has to do with Puppeteer failing to launch Chrome correctly:

    node:child_process:965
        throw err;
        ^

    Error: Command failed: "/opt/homebrew/lib/node_modules/mermaid-filter/node_modules/.bin/mmdc"    -w 800 -s 1 -f -i "/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T/tmp-5442k0Zm4Vj8JkSX.tmp" -t default -b white -o "/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T/tmp-5442k0Zm4Vj8JkSX.tmp.svg"

    TimeoutError: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout!
        at ChromeLauncher.launch (file:///opt/homebrew/lib/node_modules/mermaid-filter/node_modules/puppeteer-core/lib/esm/puppeteer/node/ProductLauncher.js:119:23)
        at async run (file:///opt/homebrew/lib/node_modules/mermaid-filter/node_modules/@mermaid-js/mermaid-cli/src/index.js:416:19)
        at async cli (file:///opt/homebrew/lib/node_modules/mermaid-filter/node_modules/@mermaid-js/mermaid-cli/src/index.js:192:3)

        at genericNodeError (node:internal/errors:984:15)
        at wrappedFn (node:internal/errors:538:14)
        at checkExecSyncError (node:child_process:890:11)
        at execSync (node:child_process:962:15)
        at mermaid (/opt/homebrew/lib/node_modules/mermaid-filter/index.js:84:5)
        at /opt/homebrew/lib/node_modules/mermaid-filter/index.js:164:12
        at /opt/homebrew/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:52:19
        at Array.forEach (<anonymous>)
        at walk (/opt/homebrew/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:50:7)
        at /opt/homebrew/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:74:16 {
      status: 1,
      signal: null,
      output: [
        null,
        Buffer(0) [Uint8Array] [],
        Buffer(518) [Uint8Array] [
           10,  84, 105, 109, 101, 111, 117, 116,  69, 114, 114, 111,
          114,  58,  32,  84, 105, 109, 101, 100,  32, 111, 117, 116,
           32,  97, 102, 116, 101, 114,  32,  51,  48,  48,  48,  48,
           32, 109, 115,  32, 119, 104, 105, 108, 101,  32, 119,  97,
          105, 116, 105, 110, 103,  32, 102, 111, 114,  32, 116, 104,
          101,  32,  87,  83,  32, 101, 110, 100, 112, 111, 105, 110,
          116,  32,  85,  82,  76,  32, 116, 111,  32,  97, 112, 112,
          101,  97, 114,  32, 105, 110,  32, 115, 116, 100, 111, 117,
          116,  33,  10,  32,
          ... 418 more items
        ]
      ],
      pid: 5443,
      stdout: Buffer(0) [Uint8Array] [],
      stderr: Buffer(518) [Uint8Array] [
         10,  84, 105, 109, 101, 111, 117, 116,  69, 114, 114, 111,
        114,  58,  32,  84, 105, 109, 101, 100,  32, 111, 117, 116,
         32,  97, 102, 116, 101, 114,  32,  51,  48,  48,  48,  48,
         32, 109, 115,  32, 119, 104, 105, 108, 101,  32, 119,  97,
        105, 116, 105, 110, 103,  32, 102, 111, 114,  32, 116, 104,
        101,  32,  87,  83,  32, 101, 110, 100, 112, 111, 105, 110,
        116,  32,  85,  82,  76,  32, 116, 111,  32,  97, 112, 112,
        101,  97, 114,  32, 105, 110,  32, 115, 116, 100, 111, 117,
        116,  33,  10,  32,
        ... 418 more items
      ]
    }

    Node.js v20.13.1
    Error running filter mermaid-filter:
    Filter returned error status 1
psibre commented 1 month ago

The last successful run was actually 2 months ago, when macos-latest meant macOS 12.7.4...

psibre commented 1 month ago

Indeed, this seems to be a combination of incompatibility of mermaid-filter (or rather, its dependency on Puppeteer) with macOS 14 in GitHub Actions, and the recent upgrade of macos-latest to point to macOS 14 (Sonoma) (see https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/)

psibre commented 1 month ago

Workaround: Run the macOS test on Ventura. Done in 91c53db6cb07bc36a419c1b91e37dde7cd80878b.