tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 307 forks source link

util._extend will be removed in node v23 #607

Open mcollina opened 2 months ago

mcollina commented 2 months ago

Currently the tests for tape fails on Node v23:

 > tape@5.7.5 prepublish
 > not-in-publish || npm run prepublishOnly
 added 852 packages in 41s
 > tape@5.7.5 tests-only
 > cross-env NODE_OPTIONS='--no-warnings' nyc tap 'test/*.js'
 /home/iojs/tmp/citgm_tmp/5e2892bd-922c-45d1-87d3-ad3da4f8442d/tape/node_modules/nyc/node_modules/debug/src/node.js:234
   debug.inspectOpts = util._extend({}, exports.inspectOpts);
                            ^
 TypeError: util._extend is not a function
     at Function.init (/home/iojs/tmp/citgm_tmp/5e2892bd-922c-45d1-87d3-ad3da4f8442d/tape/node_modules/nyc/node_modules/debug/src/node.js:234:28)
     at createDebug (/home/iojs/tmp/citgm_tmp/5e2892bd-922c-45d1-87d3-ad3da4f8442d/tape/node_modules/nyc/node_modules/debug/src/debug.js:124:13)
     at Object.<anonymous> (/home/iojs/tmp/citgm_tmp/5e2892bd-922c-45d1-87d3-ad3da4f8442d/tape/node_modules/nyc/node_modules/istanbul-lib-source-maps/lib/map-store.js:7:29)
     at Module._compile (node:internal/modules/cjs/loader:1460:14)
     at Module._extensions..js (node:internal/modules/cjs/loader:1544:10)
     at Module.load (node:internal/modules/cjs/loader:1275:32)
     at Module._load (node:internal/modules/cjs/loader:1091:12)
     at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
     at Module.require (node:internal/modules/cjs/loader:1297:12)
     at require (node:internal/modules/helpers:123:16)
 Node.js v23.0.0-pre

I think this is using an old version of debug

ljharb commented 2 months ago

As are 95 million other people every week, nearly as many as are using the latest, v4: https://majors.nullvoxpopuli.com/q?minors=&old=&packages=debug

node may want to reconsider this deprecation given the usage.

ljharb commented 2 months ago

Additionally, motivated by recent CITGM failures, tape's tests should no longer be failing due to these debug messages: 8d40837

mcollina commented 2 months ago

@ljharb that's not released yet.

ljharb commented 2 months ago

ah, i thought CITGM was configured to run on tape's HEAD instead of the latest version.

Unfortunately I can't upgrade beyond debug v2 due to engines constraints. If this API is indeed something node is determined to remove, it'd be ideal to ship a backport in debug that refactors to avoid using it.

mcollina commented 2 months ago

~Largely it does not seem feasible, because the v2 line of debug is already patched. This is due to some dependencies using locked versions.~

We'll revert in Node

ljharb commented 2 months ago

Makes sense. Which dependencies are using locked versions? I could certainly see about updating those, so node isn't held back.

mcollina commented 2 months ago

nyc depends on debug@2, which does not have the patch.

ljharb commented 2 months ago

aha, gotcha. there remains one ecosystem-active maintainer of debug; i can try to pursue a backport?

mcollina commented 2 months ago

I think it would be best. nyc will keep the noisy warning anyway for another semver-major cycle of Node.js.

ljharb commented 2 months ago

The warning can't be removed as a non-major?

mcollina commented 2 months ago

Currently using util._extend() emits a warning. In v23, this will have the same behavior of v22.

We will remove it at some point.