mapbox / node-pre-gyp

Node.js tool for easy binary deployment of C++ addons
BSD 3-Clause "New" or "Revised" License
1.11k stars 260 forks source link

Update for node Node 22, update AppVeyor and tests #712

Closed acalcutt closed 1 month ago

acalcutt commented 3 months ago

This is a merge of #649 #711 and #709 as requested by https://github.com/mapbox/node-pre-gyp/pull/649#issuecomment-2049490190

This PR updates node-pre-gyp to support up to Node 21. 1.) I updated abi_crosswalk.json to include node 21 with 'npm run update-crosswalk'
2.) It adds test coverage for cases of unsupported/unknown targets from #649 3.) It adds building with msvs 2022 and get AppVeyor to pass, from #709

Known Issues Some tests are failing in node 20 and 21 for what look like minor line ending issues or slight path differences (which seem like differences in the responses from the node versions used more than a real issue with node-pre-gyp)

Testing I have been using an updated abi_crosswalk.json in @acalcutt/node-pre-gyp and have used it with maplibre-native package up to node 20 (not to 21 only because we are only supporting lts releases)

Note from my own fork testing Do not publish this from windows, it messes up the line endings in abi_crosswalk.json and makes the package fail on linux.

acalcutt commented 3 months ago

Does anyone ( @cclauss ) have any ideas for the node 20 appveyor errors? node 18 seems to run fine but node 20 gets some tests failures that look like possible line endings (\n) issues

cclauss commented 3 months ago

Failing tests are an extra \n at the end. https://github.com/mapbox/node-pre-gyp/blob/a74f5e367c0d71033620aa0112e7baf7f3515b9d/test/build.test.js#L140

https://github.com/mapbox/node-pre-gyp/blob/a74f5e367c0d71033620aa0112e7baf7f3515b9d/lib/configure.js#L11

acalcutt commented 3 months ago

Failing tests are an extra \n at the end.

an extra "\n" where though

cclauss commented 1 month ago

Please rebase because I have merged

acalcutt commented 1 month ago

looks like the only change left not already merged is adding node 22 to the list of node version being tested.

cclauss commented 1 month ago

Awesome! Now we need to get the tests to pass on AppVeyor and then add some GitHub Actions tests too.