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

[bug] ast-grep at v. 0.21.x doesn't work on MacOS Intel machines #1140

Closed
laurenmbeatty opened this issue May 12, 2024 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@laurenmbeatty
Copy link

The version 2.1.0 of @ast-grep/napi doesn't work on MacOS Intel machines.

When using the latest version of vite-plugin-lib-inject-css, my build fails. The latest version of this package included @ast-grep/napi as a dependency (at version 2.1.0).

The error I was getting:

Screen Shot 2024-05-12 at 7 22 03 AM

Error: Cannot find module @ast-grep/napi-darwin-x64.

When I looked at my pnpm-lock.yaml file I could see that there were options for different OS:

Screen Shot 2024-05-12 at 9 04 19 AM

I'm on MacOS, but not on an arm machine.

When I explicitly installed @ast-grep/napi-darwin-x64 as a devDependency, then my build succeeds.

It looks like @ast-grep/napi-darwin-x64 is only available up to version 0.20.5 but not beyond.

Screen Shot 2024-05-12 at 9 37 14 AM

Related issue.

Minimal reproduction..

Note, you'll need to be on a MacOS Intel machine.

@laurenmbeatty laurenmbeatty added the bug Something isn't working label May 12, 2024
@HerringtonDarkholme
Copy link
Member

In napi 0.20.x publish workflow:

https://github.com/ast-grep/ast-grep/actions/runs/8592707349/job/23543271091

image

In napi 0.22.x publish workflow:
https://github.com/ast-grep/ast-grep/actions/runs/9007554793/job/24747805358#logs

image

I guess the problem may be napi workflow's issue

@HerringtonDarkholme
Copy link
Member

Curiously in 0.22.x the x86_64 darwin builds arm64 binding

image

@HerringtonDarkholme
Copy link
Member

Confirm it is because GitHub runner now uses Apple Chip instead of Intel's.

Reference napi-rs/napi-rs#2076

@laurenmbeatty
Copy link
Author

It looks like the fix will be available in 3.X

@HerringtonDarkholme
Copy link
Member

@laurenmbeatty
Copy link
Author

Thanks @HerringtonDarkholme !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants