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
tools: fix timezone update tool #44870
tools: fix timezone update tool #44870
Conversation
The spawnSync call was previously silently failing with this error: ```sh icupkg: unable to open input file "icudt*.dat" ``` because spawnSync doesn't support globbing. This change replaces the spawnSync call with execSync because that supports globbing. I have tested this workflow with some minor modifications in my fork and I can confirm that it works as expected now. The bot opened this PR - #2 which updates deps/icu-small/source/data/in/icudt71l.dat.bz2. Fixes: nodejs#44865 Signed-off-by: Darshan Sen <raisinten@gmail.com>
9d26788
to
0210498
Compare
Do you think we should be checking the sync calls for errors?
Also I've spotted another problem -- we do not build Node.js in the workflow so
node/tools/update-timezone.mjs
Line 18 in f4815fc
| const currentVersion = process.versions.tz; |
tzdata in the Node.js in the runner instead of what's in main. I'm not even sure what version of Node.js that is as the workflow doesn't appear to specify.
Good find! I've removed that optimization because the script is pretty fast anyways, PTAL. |
We do not build Node.js in the workflow so https://github.com/nodejs/node/blob/f4815fcd7691364d8139b44c1295dbc46f6ee4a8/tools/update-timezone.mjs#L18 is actually the version of `tzdata` in the Node.js in the runner instead of what's in `main`. The script is pretty fast even when the versions differ and there is an update, so this optimization doesn't seem to be worth having given the problem. Signed-off-by: Darshan Sen <raisinten@gmail.com>
302d48d
to
33d4ff6
Compare
| 'icudt*.dat', | ||
| ], { cwd: 'deps/icu-small/source/data/in/' } | ||
| ); | ||
| execSync(`icupkg -a ${file} icudt*.dat`, { cwd: 'deps/icu-small/source/data/in/' }); |
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.
Wouldn't this be an issue if file contains "weird" characters?
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.
Maybe but that's never supposed to happen because file is always gonna be one of
node/tools/update-timezone.mjs
Lines 7 to 12 in 0d80e73
| const fileNames = [ | |
| 'zoneinfo64.res', | |
| 'windowsZones.res', | |
| 'timezoneTypes.res', | |
| 'metaZones.res', | |
| ]; |
Commit Queue failed- Loading data for nodejs/node/pull/44870 ✔ Done loading data for nodejs/node/pull/44870 ----------------------------------- PR info ------------------------------------ Title tools: fix timezone update tool (#44870) Author Darshan Sen (@RaisinTen) Branch RaisinTen:fix-timezone-update-workflow-tool -> nodejs:main Labels tools, author ready Commits 2 - tools: fix timezone update tool - tools: remove faulty early termination logic from update-timezone.mjs Committers 1 - Darshan Sen PR-URL: https://github.com/nodejs/node/pull/44870 Fixes: https://github.com/nodejs/node/issues/44865 Reviewed-By: Richard Lau Reviewed-By: Antoine du Hamel ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/44870 Fixes: https://github.com/nodejs/node/issues/44865 Reviewed-By: Richard Lau Reviewed-By: Antoine du Hamel -------------------------------------------------------------------------------- ℹ This PR was created on Mon, 03 Oct 2022 06:31:26 GMT ✔ Approvals: 2 ✔ - Richard Lau (@richardlau) (TSC): https://github.com/nodejs/node/pull/44870#pullrequestreview-1128150857 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/44870#pullrequestreview-1136162346 ✔ Last GitHub CI successful ℹ Green GitHub CI is sufficient -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 44870 From https://github.com/nodejs/node * branch refs/pull/44870/merge -> FETCH_HEAD ✔ Fetched commits as 78d280a76821..33d4ff6c52fb -------------------------------------------------------------------------------- [main bf715e2db2] tools: fix timezone update tool Author: Darshan Sen Date: Mon Oct 3 10:46:48 2022 +0530 1 file changed, 2 insertions(+), 8 deletions(-) [main cf8eca8e4f] tools: remove faulty early termination logic from update-timezone.mjs Author: Darshan Sen Date: Mon Oct 3 15:48:06 2022 +0530 1 file changed, 7 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/3220375855 |
|
Landed in 22c39b1...b5add97 |
The spawnSync call was previously silently failing with this error: ```sh icupkg: unable to open input file "icudt*.dat" ``` because spawnSync doesn't support globbing. This change replaces the spawnSync call with execSync because that supports globbing. I have tested this workflow with some minor modifications in my fork and I can confirm that it works as expected now. The bot opened this PR - RaisinTen#2 which updates deps/icu-small/source/data/in/icudt71l.dat.bz2. Fixes: #44865 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #44870 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
We do not build Node.js in the workflow so https://github.com/nodejs/node/blob/f4815fcd7691364d8139b44c1295dbc46f6ee4a8/tools/update-timezone.mjs#L18 is actually the version of `tzdata` in the Node.js in the runner instead of what's in `main`. The script is pretty fast even when the versions differ and there is an update, so this optimization doesn't seem to be worth having given the problem. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #44870 Fixes: #44865 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
The spawnSync call was previously silently failing with this error: ```sh icupkg: unable to open input file "icudt*.dat" ``` because spawnSync doesn't support globbing. This change replaces the spawnSync call with execSync because that supports globbing. I have tested this workflow with some minor modifications in my fork and I can confirm that it works as expected now. The bot opened this PR - RaisinTen#2 which updates deps/icu-small/source/data/in/icudt71l.dat.bz2. Fixes: #44865 Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #44870 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
We do not build Node.js in the workflow so https://github.com/nodejs/node/blob/f4815fcd7691364d8139b44c1295dbc46f6ee4a8/tools/update-timezone.mjs#L18 is actually the version of `tzdata` in the Node.js in the runner instead of what's in `main`. The script is pretty fast even when the versions differ and there is an update, so this optimization doesn't seem to be worth having given the problem. Signed-off-by: Darshan Sen <raisinten@gmail.com> PR-URL: #44870 Fixes: #44865 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
tools: fix timezone update tool
The
spawnSync()call was previously silently failing with this error:icupkg: unable to open input file "icudt*.dat"because
spawnSync()doesn't support globbing. This change replaces thespawnSync()call withexecSync()because that supports globbing.I have tested this workflow with some minor modifications in my fork and I can confirm that it works as expected now. The bot opened this PR - RaisinTen#2 which updates
deps/icu-small/source/data/in/icudt71l.dat.bz2in RaisinTen@44c2400.Fixes: #44865
Signed-off-by: Darshan Sen raisinten@gmail.com
tools: remove faulty early termination logic from
update-timezone.mjsWe do not build Node.js in the workflow so
node/tools/update-timezone.mjs
Line 18 in f4815fc
is actually the version of
tzdatain the Node.js in the runner insteadof what's in
main.The script is pretty fast even when the versions differ and there is an
update, so this optimization doesn't seem to be worth having given the
problem.
Signed-off-by: Darshan Sen raisinten@gmail.com