chocolatey-community / chocolatey-packages

Chocolatey Community Maintainers Team Packages - packages that are managed and maintained by core community team for community package repository (https://community.chocolatey.org/packages)
https://community.chocolatey.org/profiles/chocolatey-community
Apache License 2.0
448 stars 381 forks source link

(node.install) Correct nodejs packages/auto-update to support nodejs 23 without 32-bit version #2556

Open chadlwilson opened 1 week ago

chadlwilson commented 1 week ago

Checklist

Chocolatey Version

2.3.0

Chocolatey License

None

Package Version

23.0.0

Current Behaviour

Currently auto-updates for all NodeJS versions are blocked because v23 dropped 32-bit support and the auto-update script is failing with

[125/243] nodejs ERROR: 
     Can't validate URL 
     Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (404) Not Found.":https://nodejs.org/dist/v23.0.0/node-v23.0.0-x86.msi (19.01s)

This is as noted in https://github.com/chocolatey-community/chocolatey-packages/pull/2453#issuecomment-2426488448 and https://github.com/chocolatey-community/chocolatey-packages/issues/2555#issuecomment-2426449606

There is also a separate issue making this hard to see as the bot gist at https://gist.github.com/choco-bot/a14b1e5bfaf70839b338eb1ab7f8226f is not being updated (to separately be fixed).

Expected Behaviour

nodejs and nodejs.install packages should be available for 22.10.0 and ideally 23.0.0.

Steps To Reproduce

N/A

Environment

N/A

Chocolatey Log

N/A

Anything else?

No response

AdmiringWorm commented 6 days ago

I had a look around, and from what it looks like the NodeJS team officially dropped support for 32bit on v23.0.0, as such the package should also drop this support going forward (at least for that version and later).

https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V23.md#2024-10-16-version-2300-current-rafaelgss

@chadlwilson since you have created a PR to remove this support, I'll assign this issue to you.

chadlwilson commented 6 days ago

Yeah, I mentioned they dropped support in the issue description :)

I created a PR primarily to unblock auto-updates for other versions including LTSes and the upcoming v22 LTS.

Personally I don't have any interest in non LTS or 32 bit Node releases so likely wont prioritise spending time figuring out how to alter the package in a canonical way for 64-bit only (to fail gracefully if attempted on 32-bit arch) ... unless someone can point me in the right direction. :)

AdmiringWorm commented 6 days ago

Yeah, I mentioned they dropped support in the issue description :)

I completely missed that, but would have still added a comment with a link to where it was mentioned in the changelog.

Personally I don't have any interest in non LTS or 32 bit Node releases so likely wont prioritise spending time figuring out how to alter the package in a canonical way for 64-bit only (to fail gracefully if attempted on 32-bit arch) ... unless someone can point me in the right direction. :)

I understand, but in its current state we cannot pull that PR in. I can try pointing you into what I had in my mind when looking at this issue before I saw the PR you created.

  1. Make a copy of the VERIFICATION.txt file and move it to its parent directory (renaming it to something like VERIFICATION.full.txt).
  2. Create another copy of the file and name it something like VEREFICATION.64.txt
  3. Remove any mention of the 32bit executable, checksum and download URL in VERIFICATION.64.txt
  4. Add/update the function global:au_BeforeUpdate to check if there is a 32bit URL, copying and replacing the original VERIFICATION.txt file with the one that is appropriate.
  5. Update the global:au_SearchReplace to add an if statement around the 32bit file and checksum when the 32bit URL is not available (only for the VERIFICATION.txt replacement). This can be inline inside the hash table.
  6. Update the Readme.md file with a new Note list item that says something along the line of - 32bit installation is no longer supported for version 23.0.0 and later.
AdmiringWorm commented 6 days ago

Additionally, you mentioned that you are only interested in LTS releases, if that is the case it is recommended to use the nodejs-lts package instead of the normal nodejs package.

It is by a different maintainer, and is not subjected to any issue with the update script in this repository.

chadlwilson commented 6 days ago

Additionally, you mentioned that you are only interested in LTS releases, if that is the case it is recommended to use the nodejs-lts package instead of the normal nodejs package.

I'm aware of it. That package is typically too slow for my liking to get updates to come through compared to the auto-updated ones here. I install specific versions indexed elsewhere rather than "latest" so whether there are other versions newer than I'm interested in under the same package is not really relevant.