Skip to content
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

Build issues with deasync #972

Closed
azchohfi opened this issue Sep 19, 2023 · 6 comments
Closed

Build issues with deasync #972

azchohfi opened this issue Sep 19, 2023 · 6 comments
Assignees

Comments

@azchohfi
Copy link

azchohfi commented Sep 19, 2023

Environment

azure-pipelines-task-lib version: 4.6.0

Issue Description

Fails to npm install. Seems to be related to deasync being a dependency now, and they are not working well on node 20.

Expected behaviour

Works just like 4.5.0, and builds fine on node 20.

Actual behaviour

Fails to restore packages on node 20.

Steps to reproduce

  1. clone https://github.com/microsoft/setup-msstore-cli
  2. Update azure-pipelines-task-lib to 4.6.0
  3. npm i
  4. Fail

Logs

@sverdlov93
Copy link

Hi, the addition on "deasync": "^0.1.28", to the package-json made our ndoe_modules 3 times bigger and our 30MB extension to 80MB extension.
Can you look into it?
@DenisRumyantsev

@ivanduplenskikh
Copy link
Contributor

@azchohfi, that is the problem related to missing binaries as I see.
There are no node20 binaries deasync-bin repository.

@ivanduplenskikh ivanduplenskikh self-assigned this Oct 3, 2023
@ivanduplenskikh
Copy link
Contributor

@azchohfi I noticed binaries (node v19-21) that were uploaded 3 days ago.
I'm closing this ticket for now.

@sverdlov93 upgrading azure-pipelines-task-lib from 4.5.0 to 4.6.0 makes node_modules bigger by 7MB. Could you please double-check that your problem depends on deasync module? If your problem persists, feel free to create another issue.

@azchohfi
Copy link
Author

azchohfi commented Nov 27, 2023

I'm still having issues with newer version of this lib. The packages are now installing, but they fail to run:

Could not locate the bindings file. Tried:
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\build\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\build\Debug\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\build\Release\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\out\Debug\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\Debug\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\out\Release\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\Release\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\build\default\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\compiled\21.2.0\win32\x64\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\addon-build\release\install-root\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\addon-build\debug\install-root\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\addon-build\default\install-root\deasync.node
     → C:\Users\alzollin\source\repos\setup-msstore-cli\node_modules\deasync\lib\binding\node-v120-win32-x64\deasync.node

It is installing version 0.1.29 of deasync. I've tried forcing it to 0.1.28, but then it fails to build.

Version 0.1.29 has the node files in here:
.\node_modules\deasync\bin\win32-x64-node-21\deasync.node

@azchohfi
Copy link
Author

azchohfi commented Dec 5, 2023

The specific issue was related to Jest itself. I had to add 'node' do the moduleFileExtensions in the jest.config.js.
Still, I'm facing a different issue now. deasyn doesn't seem to work with Jest:
abbr/deasync#156

@azchohfi
Copy link
Author

azchohfi commented Dec 5, 2023

Ok, solution is to avoid the deasync code paths completely.
The problem is that whenever the deasync lib is called, the promises start to not work anymore. Solution? Don't go through the deasync code paths. How? Avoid the constructor that calls the sync methods.

Instead of doing:

let tr: ttm.MockTestRunner = new ttm.MockTestRunner(testPath, taskJsonPath)
await tr.runAsync()

Do:

let tr: ttm.MockTestRunner = new ttm.MockTestRunner()
await tr.LoadAsync(testPath, taskJsonPath);
await tr.runAsync()

It will completelly avoid calling deasync, as it won't call getNodePathSync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants