-
Notifications
You must be signed in to change notification settings - Fork 59
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
fix: ABI registry updater #95
fix: ABI registry updater #95
Conversation
d9a5daf
to
8adf19e
Compare
Please merge this PR. This breaks prebuilded packages with prebuildify. In fact as Node 12 is curent LTS version. |
@ludiazv I was having issues with prebuildify and that's how I got to investigating |
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.
Thanks for the fixes, it's much appreciated! I think there's one more thing that needs to happen to make node-abi
more robust.
Also, the PR title should be in Conventional Commits format since the PR is likely going to get squashed. |
Thanks, @malept, for the review. I committed your suggestion and changed the PR title to adhere to CC standards. Let me know if there's anything else needed to be changed. |
I made an additional comment that I think got lost in my suggestion:
Do you mind doing this as well? I think otherwise the tests will continue to fail (I have no idea why the tests aren't running for PRs...). |
@malept I'm trying to understand what the real issue is here with generating the ABI versions for electron. And what exactly are you asking me to change 🙂 The ABI updater fetches the abi version from here and the electron version from here. What the ABI source says about electron v11 is that it uses modules v85. {
"NODE_MODULE_VERSION": [
{ "modules": 85, "runtime": "electron", "variant": "electron", "versions": "11" },
{ "modules": 84, "runtime": "node", "variant": "v8_8.3", "versions": "15.0.0-pre" },
{ "modules": 83, "runtime": "node", "variant": "v8_8.1", "versions": "14.0.0" },
{ "modules": 82, "runtime": "electron", "variant": "electron", "versions": "10" }
]
} What the electron source says about Electron v11.0.0-beta.1 is that it uses modules 82 (it does not list an electron version 11.0.0): {
"node_id": "MDc6UmVsZWFzZTMwMTY4NjQ4",
"tag_name": "v11.0.0-beta.1",
"name": "electron v11.0.0-beta.1",
"prerelease": true,
"published_at": "2020-08-26T22:41:19Z",
"version": "11.0.0-beta.1",
"npm_package_name": "electron",
"deps": {
"node": "12.18.3",
"v8": "8.6.373-electron.0",
"uv": "1.38.0",
"zlib": "1.2.11",
"openssl": "1.1.0",
"modules": "82",
"chrome": "86.0.4234.0"
},
"npm_dist_tags": [],
"total_downloads": 401
} Furthermore, how the ABI updater was designed, I assume, was that if it doesn't find an Electron version satisfying a major stable version (like v11 coming from the ABI source), then it appends |
Ideally, what would happen is you'd take the Electron version from the Node registry and append
Well, it's complicated. The Node registry is supposed to be the source of truth but humans are fallible. I reported the bug and the Releases WG very quickly put together some fixes. I think the correct way to do this is to use the Node registry, and mismatches should be reported to the Electron Releases WG. |
Is there anything that can be done to help? I think there are still lot of builds that are broken, waiting for this fix. |
At this point I'm just waiting on a response to my latest comment. |
@malept Sorry for the late reply. I'm still trying to wrap my head around this. I tried your suggestion and updated the Electron code, so that the generated targets are always t.equal(getTarget('82', 'electron'), '10.0.0')
/*
operator: equal
expected: |-
'10.0.0'
actual: |-
'10.0.0-beta.1'
*/
t.equal(getTarget('76', 'electron'), '8.0.0')
/*
operator: equal
expected: |-
'8.0.0'
actual: |-
'8.0.0-beta.1'
*/ The reason why for (var i = 0; i < allTargets.length; i++) {
var t = allTargets[i]
if (t.runtime !== runtime) continue
if (semver.lte(t.target, target)) abi = t.abi
else break
} This loops over "all" the targets: var allTargets = deprecatedTargets
.concat(supportedTargets)
.concat(additionalTargets)
.concat(futureTargets) and sets the ABI version to the target's version unless the target is larger based on semver comparison. When it comes to Currently, I suggest fixing Electron ABI versions in a separate PR. In that case, I would have to drop 1050f3d first. |
@malept I gave it another shot, decided to take a different route, and refactored the processing of electron targets a little bit. |
Co-authored-by: Mark Lee <[email protected]>
f111507
to
64b86ee
Compare
64b86ee
to
2052e95
Compare
94ce372
to
56c25df
Compare
56c25df
to
dc36ed4
Compare
Hi @cb1kenobi and thanks for noticing the issue. It was caused by an inconsistency in the abi version registry: [
{ "modules": 88, "runtime": "node", "variant": "v8_8.6", "versions": "15.0.0" },
{ "modules": 83, "runtime": "node", "variant": "v8_8.1", "versions": "14.0.0" },
{ "modules": 79, "runtime": "node", "variant": "v8_7.8", "versions": "13" },
{ "modules": 72, "runtime": "node", "variant": "node", "versions": "12" },
{ "modules": 67, "runtime": "node", "variant": "node", "versions": "11" },
] Fixed it by properly coercing the versions and updated the tests to include v14 and v15 as well. This uncovered an issue with sorting in |
@malept I believe I addressed your comments, may I ask you to re-review the PR? 🙂 |
Another week went by, another bump 🙂 Apparently, there's quite some number of tools depending on this package. It would be nice to get this in asap. |
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.
In the interests of getting a new release out (keeping in mind that I don't actually have approval/merge rights here), I'm not going to block the approval of this PR. However, I think the way that filter/map/reduce was used here makes it more difficult to maintain, and should be refactored.
Object mutation is evil 👿
This PR fixes the bug in the ABI registry updater that caused incorrect ABI values to be mapped to different Node runtime versions.
Fixes #90 and #93. Also updates the tests.
Makes #94 obsolete.
CC: @MarshallOfSound