-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Upgrade gulp
to version 5.0.0
#18197
Conversation
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 gulpjs/gulp#2764 (comment) 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.
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/69516a1c7aaf1d1/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/69516a1c7aaf1d1/output.txt Total script time: 0.52 mins Published |
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/f820eedc1ac3d19/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/f820eedc1ac3d19/output.txt Total script time: 0.51 mins Published |
The |
…d one The globally-installed version of Gulp on the bots is old, and recently we moved away from using globally-installed dependencies in favor of using locally-installed ones for maintainability, isolation and reproducibility of build environments. For more information, refer to PRs mozilla/pdf.js#17913 and mozilla/pdf.js#17489. In mozilla/pdf.js#18197 we have seen that even though locally Gulp 5 is installed the global version is preferred by the bots because the `gulp` command (available in the PATH) is used instead of `npx gulp` which prefers the locally-installed version from the `node_modules` folder. This commit fixes the issue by making all Gulp invocations use `npx gulp` instead, similar to what we already did in the GitHub Actions pipelines.
…d one The globally-installed version of Gulp on the bots is old, and recently we moved away from using globally-installed dependencies in favor of using locally-installed ones for maintainability, isolation and reproducibility of build environments. For more information, refer to PRs mozilla/pdf.js#17913 and mozilla/pdf.js#17489. In mozilla/pdf.js#18197 we have seen that even though locally Gulp 5 is installed the global version is preferred by the bots because the `gulp` command (available in the PATH) is used instead of `npx gulp` which prefers the locally-installed version from the `node_modules` folder. This commit fixes the issue by making all Gulp invocations use `npx gulp` instead, similar to what we already did in the GitHub Actions pipelines.
The bot fix is deployed, so let's try this again: /botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/b369a5c7701801a/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/b369a5c7701801a/output.txt Total script time: 1.10 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/b1e7ce00edb309c/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/8800ae243c4ff78/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/8800ae243c4ff78/output.txt Total script time: 28.08 mins
Image differences available at: http://54.241.84.105:8877/8800ae243c4ff78/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/b1e7ce00edb309c/output.txt Total script time: 40.98 mins
Image differences available at: http://54.193.163.58:8877/b1e7ce00edb309c/reftest-analyzer.html#web=eq.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you.
/botio makeref (to test this change in the bot scripts) |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c57a1e6142f70ab/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/c3f3a7806a78f5b/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/c57a1e6142f70ab/output.txt Total script time: 19.40 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/c3f3a7806a78f5b/output.txt Total script time: 24.45 mins
|
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 allgulp.src
calls (see gulpjs/gulp#2764 (comment) 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
reported39 vulnerabilities (15 moderate, 24 high)
, but after this patch it reports35 vulnerabilities (15 moderate, 20 high)
.Fixes #17922.