lib / src : add undici version to process.versions#45599
lib / src : add undici version to process.versions#45599kivancbilen wants to merge 1 commit intonodejs:mainfrom
Conversation
|
👋 and thank you for your contribution! Please update the commit message to use |
| while (!hasEnding(cwd.parent_path().string(), "node")) { | ||
| cwd = cwd.parent_path(); | ||
| } | ||
| std::ifstream myFile(cwd.parent_path().string()+"\\deps\\" + packageName + "\\src\\package.json"); |
There was a problem hiding this comment.
Unfortunately, this is not going to work. This file won't exist for the binaries available from nodejs.org.
There was a problem hiding this comment.
@richardlau How about updating the update script for undici to statically update a C++ variable with the latest version number?
There was a problem hiding this comment.
Would this also be an option, read versions and write them in a text file in build step, then read that file to return missing versions? File and node.exe can be in the same directory.
There was a problem hiding this comment.
Node.js is compiled into a single binary so you cannot assume any other files are present at run time.
There was a problem hiding this comment.
You can create a dep-versions.cc and replace the value on tools/deps_updater scripts either through bash or javascript.
process.versions is not returning undici version, this PR will read the version number from undici/src/package.json and add it to result. If this approach is ok then other missing libraries will be added Refs:nodejs#45260
f06a2ec to
ca57d50
Compare
Attempted to update undici version when the update scripts are run Fixes: nodejs#45260 Refs: nodejs#45599
jasnell
left a comment
There was a problem hiding this comment.
Really appreciate you taking this on, but this is definitely the wrong approach. The versions should be extracted either when the dependency is updated or the binary is built.
|
#45621 is already approved, therefore I am closing this PR. |
Attempted to update undici version when the update scripts are run Fixes: nodejs#45260 Refs: nodejs#45599
process.versions is not returning undici version,
this PR will read the version number from undici/src/package.json and add it to result. If this approach is ok then other missing libraries will be added
Refs: #45260