node-loader icon indicating copy to clipboard operation
node-loader copied to clipboard

fix(workflows): exclude node versions that don't have arm distributions from mac test workflow

Open SlyryD opened this issue 1 year ago • 9 comments

This PR contains a:

  • [X] bugfix
  • [ ] new feature
  • [ ] code refactor
  • [x] test update
  • [ ] typo fix
  • [ ] metadata update

Motivation / Use-Case

The test workflow for mac is broken because osx-arm64 versions of Node.js don't exist before v16.1.0. The macos-latest image now uses arm64, while the macos-latest-large image that uses x64 is available. When no architecture is specified for setup-node, it will use the system architecture, so by using an x64 mac image, it should successfully find Node 10.x, 12.x, 14.x, etc.

SlyryD avatar Oct 22 '24 19:10 SlyryD

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: SlyryD / name: Ryan Dorson (779f48d194397c77fe4053b24403eaa49949b672)

Ping @ersachin3112 to kick off the workflows so we can see whether this change fixes them. Thanks!

SlyryD avatar Oct 23 '24 16:10 SlyryD

Weird, github requires payment, although actions are free for us

alexander-akait avatar Oct 23 '24 16:10 alexander-akait

Weird, github requires payment, although actions are free for us

Is that related specicially to the macos-latest-large image?

SlyryD avatar Oct 23 '24 18:10 SlyryD

I think yes...

alexander-akait avatar Oct 23 '24 19:10 alexander-akait

I think yes...

Updated just to exclude node versions 10-14 in the macos test workflow.

SlyryD avatar Oct 23 '24 19:10 SlyryD

Let's remove sudo npm i -g npm at all from CI

alexander-akait avatar Oct 23 '24 20:10 alexander-akait

Yea sudo is a bad idea

evenstensberg avatar Oct 23 '24 20:10 evenstensberg

Travelling now, will try again next week.

SlyryD avatar Oct 24 '24 02:10 SlyryD

Let's remove sudo npm i -g npm at all from CI

Updated

SlyryD avatar Oct 28 '24 16:10 SlyryD

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (a0ed6c7) to head (779f48d). Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #140   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           12        12           
  Branches         3         3           
=========================================
  Hits            12        12           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 30 '24 13:10 codecov[bot]

New iteration where I force Python 3.12 for node-gyp, which has the distutils module. Alternative is to do one of the following to install distutils for newer versions of Python:

python3 -m pip install setuptools
brew install python-setuptools

But I figured that would take more iterations to get right.

SlyryD avatar Oct 30 '24 16:10 SlyryD

New iteration where I force Python 3.12 for node-gyp, which has the distutils module. Alternative is to do one of the following to install distutils for newer versions of Python:

python3 -m pip install setuptools
brew install python-setuptools

But I figured that would take more iterations to get right.

@alexander-akait, new iteration with installing python setuptools. Didn't realize that I didn't git add my files 2 weeks ago.

SlyryD avatar Nov 11 '24 23:11 SlyryD

Ah I've seen this Windows build failure before with finding the VS2022 version... but I found a workaround that I can't explain why it works. So I'd have to dive deeper for this one.

SlyryD avatar Nov 12 '24 02:11 SlyryD

Ah I've seen this Windows build failure before with finding the VS2022 version... but I found a workaround that I can't explain why it works. So I'd have to dive deeper for this one.

I'm thinking this might be why the original pipelines upgraded the version of npm...

SlyryD avatar Nov 12 '24 02:11 SlyryD

Ah I've seen this Windows build failure before with finding the VS2022 version... but I found a workaround that I can't explain why it works. So I'd have to dive deeper for this one.

I'm thinking this might be why the original pipelines upgraded the version of npm...

Yeah so latest node 14 has npm 6.14.18 which has node-gyp 5.1.1, and according to this VS2022 support was added in node-gyp 8.4.0: https://github.com/nodejs/node-gyp/issues/2958. Let me try something like this for Windows: https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md

SlyryD avatar Nov 12 '24 02:11 SlyryD

@alexander-akait, ready for another try :D Since the windows image has VS2022, we need node-gyp >= 8.x. The node-gyp 8.x dependencies do not support Node.js 10.x, so rule that version out for Windows. For Node.js 12.x and 14.x, update node-gyp to 8.x to get tests running.

SlyryD avatar Nov 12 '24 03:11 SlyryD

Dang... I got the same error locally in Windows but only when I had some NPM environment variables set. I guess they are set on the Windows image as well.

SlyryD avatar Nov 12 '24 14:11 SlyryD

@alexander-akait, I have another iteration that tries to mimic these instructions better. Hope it works!

SlyryD avatar Nov 12 '24 17:11 SlyryD

Yay! I'm not sure why macos-latest - Node v12.x and macos-latest - Node v14.x are pending though.

SlyryD avatar Nov 12 '24 21:11 SlyryD

@alexander-akait, I think you would need to update the branch protection rules to remove the requirement for mac node 12 and 14 checks. I see other repos owned by webpack-contrib requiring node 18, 20, and 22 for example. Thanks!

SlyryD avatar Nov 13 '24 06:11 SlyryD

Thanks a lot

alexander-akait avatar Nov 13 '24 12:11 alexander-akait