-
Notifications
You must be signed in to change notification settings - Fork 34
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
New naming scheme #19
Conversation
Looking really good! See my one comment |
if (a.runtime !== b.runtime) { | ||
return a.runtime === runtime ? -1 : 1 | ||
} else if (a.abi !== b.abi) { | ||
return a.abi ? -1 : 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vweevers Mind explaining this a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to pick a prebuild that most closely matches the runtime (environment).
By this point in the code, we have already filtered out prebuilds with non-matching tags. But let's say the current runtime is Electron. There could still be:
- A prebuild specifically targeting Electron
- A runtime-agnostic prebuild (suitable for both Node and Electron)
If (1) exists, it should sort first and win. We're assuming that if (1) exists, it must mean that (2), though agnostic for most runtimes, is not suitable for this specific runtime.
The logic is the same for the ABI's. At this point in the code, we could have:
- A prebuild specifically targeting the current ABI
- An "ABI-agnostic" prebuild (i.e. N-API)
If (1) exists, it should sort first and win.
Counterpart of prebuild/prebuildify#27. Major.