Skip to content

Commit

Permalink
Use the locally-installed version of Gulp instead a globally-installe…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
timvandermeij committed May 31, 2024
1 parent 93f8df0 commit 269b263
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion on_cmd_browsertest.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ silent(true);
echo('>> Regression tests');

// Using {async} to avoid unnecessary CPU usage
exec('gulp botbrowsertest', {silent:false, async:true}, function(error, output) {
exec('npx gulp botbrowsertest', {silent:false, async:true}, function(error, output) {
var regSuccessMatch = output.match(/All regression tests passed/g);

if (regSuccessMatch) {
Expand Down
2 changes: 1 addition & 1 deletion on_cmd_integrationtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cp('-f', __dirname+'/test-files/browser_manifest.json', './test/resources/browse
echo();
echo('>> Integration Tests');

exec('gulp integrationtest', {silent:false, async:true}, function(error, output) {
exec('npx gulp integrationtest', {silent:false, async:true}, function(error, output) {
var successMatch = output.match(/All integration tests passed/g);

if (successMatch) {
Expand Down
2 changes: 1 addition & 1 deletion on_cmd_makeref.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exec('npm install', {async:true}, function() {
echo('>> Making references');

// Using {async} to avoid unnecessary CPU usage
exec('gulp botmakeref', {silent:false, async:true}, function(error, output) {
exec('npx gulp botmakeref', {silent:false, async:true}, function(error, output) {
var successMatch = output.match(/All regression tests passed/g);

if (successMatch) {
Expand Down
2 changes: 1 addition & 1 deletion on_cmd_preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exec('npm install');

echo();
echo('>> Making web site');
exec('gulp web');
exec('npx gulp web');

echo();
echo('>> Moving files');
Expand Down
2 changes: 1 addition & 1 deletion on_cmd_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ silent(true);
echo('>> Running tests');

// Using {async} to avoid unnecessary CPU usage
exec('gulp bottest', {silent:false, async:true}, function(error, output) {
exec('npx gulp bottest', {silent:false, async:true}, function(error, output) {
var integrationSuccessMatch = output.match(/All integration tests passed/g);
var unitSuccessMatch = output.match(/All unit tests passed/g);
var regSuccessMatch = output.match(/All regression tests passed/g);
Expand Down
2 changes: 1 addition & 1 deletion on_cmd_unittest.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cp('-f', __dirname+'/test-files/browser_manifest.json', './test/resources/browse
echo();
echo('>> Unit Tests');

exec('gulp unittest', {silent:false, async:true}, function(error, output) {
exec('npx gulp unittest', {silent:false, async:true}, function(error, output) {
var successMatch = output.match(/All unit tests passed/g);

if (successMatch) {
Expand Down
2 changes: 1 addition & 1 deletion on_cmd_xfatest.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ silent(true);
echo('>> Running tests');

// Using {async} to avoid unnecessary CPU usage
exec('gulp botxfatest', {silent:false, async:true}, function(error, output) {
exec('npx gulp botxfatest', {silent:false, async:true}, function(error, output) {
var integrationSuccessMatch = output.match(/All integration tests passed/g);
var unitSuccessMatch = output.match(/All unit tests passed/g);
var regSuccessMatch = output.match(/All regression tests passed/g);
Expand Down
4 changes: 2 additions & 2 deletions on_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ exec('npm install', {async:true}, function () {
//
// Publish library to pdfjs-dist
//
exec('gulp dist', {async:true}, function() {
exec('npx gulp dist', {async:true}, function() {

cd('build/dist');
exec('git push --tags [email protected]:mozilla/pdfjs-dist.git master');
exec('npm publish');
cd('../..');

}); // gulp dist
}); // npx gulp dist
}); // npm install

0 comments on commit 269b263

Please sign in to comment.