Skip to content
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

Merged
merged 1 commit into from
Jun 1, 2024
Merged

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented May 31, 2024

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.

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.

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.
@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Contributor Author

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Contributor Author

timvandermeij commented May 31, 2024

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 mozilla/botio-files-pdfjs#44 to fix that on the bots, which after deployment should make this work.

timvandermeij added a commit to timvandermeij/botio-files-pdfjs that referenced this pull request May 31, 2024
…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.
timvandermeij added a commit to timvandermeij/botio-files-pdfjs that referenced this pull request May 31, 2024
…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.
@timvandermeij
Copy link
Contributor Author

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

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

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

Total script time: 28.08 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  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
Copy link
Collaborator

From: Bot.io (Windows)


Failed

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

Total script time: 40.98 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 8

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

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@timvandermeij timvandermeij merged commit 53dfb5a into mozilla:master Jun 1, 2024
17 checks passed
@timvandermeij
Copy link
Contributor Author

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

@moz-tools-bot
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

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

Total script time: 19.40 mins

  • Make references: Passed
  • Check references: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

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

Total script time: 24.45 mins

  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade gulp to version 5.0.0
3 participants