-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
lib / src : add undici version to process.versions #45599
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.
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
Fixes: #45260 Refs: #45599 Refs: #45260 PR-URL: #45621 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
Fixes: #45260 Refs: #45599 Refs: #45260 PR-URL: #45621 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
Fixes: #45260 Refs: #45599 Refs: #45260 PR-URL: #45621 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
Fixes: #45260 Refs: #45599 Refs: #45260 PR-URL: #45621 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
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