mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
47.23k stars 9.83k forks source link

Upgrade `gulp` to version 5.0.0 #18197

Closed timvandermeij closed 1 month ago

timvandermeij commented 1 month ago

This is a major version bump, and the changelog at https://github.com/gulpjs/gulp/releases/tag/v5.0.0 indicates one breaking change that impacts us, namely that streams are now by default interpreted/transformed to UTF-8 encoding. This breaks gulp.src calls that work on binary files such as images or CMaps, but is fortunately easy to fix for us by disabling re-encoding for all gulp.src calls (see https://github.com/gulpjs/gulp/issues/2764#issuecomment-2063415792 for more information). This restores the previous behavior of copying the files as-is without Gulp performing any transformations to it, which is what we want because Gulp is only used for bundling and we make sure that the source files have the right encoding.

Note 1: I have, similar to previous PRs that touched the Gulpfile or its dependencies, run all commands with Gulp 5 to verify that they still work. Moreover, if output artifacts have been produced by the command I have compared the output with the Gulp 4 output using diff -r <old> <new> and verified that the diffs were either empty (indicating bit-by-bit equality) or only contained expected changes (such as timestamps being stored in the output of e.g. JSDoc that change after every run). I haven't found any meaningful changes in any of the output that should change behavior.

Note 2: This upgrade also fixes four vulnerabilities reported by NPM. Before this patch npm audit reported 39 vulnerabilities (15 moderate, 24 high), but after this patch it reports 35 vulnerabilities (15 moderate, 20 high).

Fixes #17922.

timvandermeij commented 1 month ago

/botio-linux preview

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/69516a1c7aaf1d1/output.txt

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/69516a1c7aaf1d1/output.txt

Total script time: 0.52 mins

Published

timvandermeij commented 1 month ago

/botio-linux preview

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/f820eedc1ac3d19/output.txt

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/f820eedc1ac3d19/output.txt

Total script time: 0.51 mins

Published

timvandermeij commented 1 month ago

The [13:07:51] Unsupported gulp version log in the preview output above is caused by the bots using an old globally-installed Gulp version instead of the new locally-installed Gulp version. I have created https://github.com/mozilla/botio-files-pdfjs/pull/44 to fix that on the bots, which after deployment should make this work.

timvandermeij commented 1 month ago

The bot fix is deployed, so let's try this again:

/botio-linux preview

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/b369a5c7701801a/output.txt

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/b369a5c7701801a/output.txt

Total script time: 1.10 mins

Published

timvandermeij commented 1 month ago

/botio test

moz-tools-bot commented 1 month ago

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/b1e7ce00edb309c/output.txt

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/8800ae243c4ff78/output.txt

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/8800ae243c4ff78/output.txt

Total script time: 28.08 mins

  different ref/snapshot: 20
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/8800ae243c4ff78/reftest-analyzer.html#web=eq.log

moz-tools-bot commented 1 month ago

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/b1e7ce00edb309c/output.txt

Total script time: 40.98 mins

  different ref/snapshot: 8

Image differences available at: http://54.193.163.58:8877/b1e7ce00edb309c/reftest-analyzer.html#web=eq.log

timvandermeij commented 1 month ago

/botio makeref (to test this change in the bot scripts)

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/c57a1e6142f70ab/output.txt

moz-tools-bot commented 1 month ago

From: Bot.io (Windows)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/c3f3a7806a78f5b/output.txt

moz-tools-bot commented 1 month ago

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/c57a1e6142f70ab/output.txt

Total script time: 19.40 mins

moz-tools-bot commented 1 month ago

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/c3f3a7806a78f5b/output.txt

Total script time: 24.45 mins