-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: update install and publish process #131
feat: update install and publish process #131
Conversation
Performance Report✔️ no performance regression detected Full benchmark results
|
binding.gyp
Outdated
@@ -1,63 +1,70 @@ | |||
{ | |||
'targets': [ | |||
"targets": [ |
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.
All of the changes in this file were to get Windows to publish. It’s mostly changes from ”
to ’
.
The only other meaningful changes are noted below.
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.
Updated. I reverted all the quote changes. The windows build error was coming from somewhere else. I noticed an indentation inconsistency in the file so when I was in there editing I reverted the quotes to the more standard '
.
"<!@(node -p \"require('node-addon-api').include_dir\")", | ||
"include_dirs": [ | ||
"blst/bindings", | ||
"<!@(node -p \"require('node-addon-api').include\")", |
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.
This is a known issue with how windows builds native modules. Need to use the include
export instead of include_dir
for it to be fully cross-compatible.
binding.gyp
Outdated
'AdditionalOptions': [ '/std:c++17' ], | ||
"conditions": [ | ||
[ "OS!='win'", { | ||
"sources": ["blst/build/assembly.S"], |
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.
This source is not for windows so refactored a bit to move it to a conditional.
"node-gyp": "^10.0.1" | ||
} | ||
"optionalDependencies": { | ||
"@jazzer.js/core": "^2.1.0" |
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.
This lib is not compatible with linux-arm64
. I attempted to fix it but just ended up fighting a battle that was not worth it. Its an issue with how the base C
lib exports artifacts for CMake in @jazzer/fuzzer
. I put up an issue in their repo here CodeIntelligenceTesting/jazzer.js#795
async function buildBindings(binaryName: string): Promise<string> { | ||
await exec("npm run clean:gyp", true, {cwd: ROOT_DIR}); | ||
await exec("npm run build:gyp", true, {cwd: ROOT_DIR}); | ||
const bindingPath = getBindingsPath(ROOT_DIR); |
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.
after we use node-gyp
do we know the exact location? looks like this getBindingsPath
function is more suitable for other places not this one because it involves a search
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.
Most of the times yes but not always.
Because its possible to npm install --debug
which will create a debug build in build/Debug
instead of in build/Release
. So its necessary to check several places...
}, | ||
"main": "./dist/lib/index.js", | ||
"types": "./dist/lib/index.d.ts", | ||
"files": [ |
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 also specified this in the publish workflow:
- name: Create Github release with prebuilds
if: steps.tag.outputs.tagcreated == 'yes'
uses: softprops/action-gh-release@v2
with:
files: release/*
tag_name: ${{ steps.tag.outputs.tagname }}
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
do they serve different purposes? looks like releases/*
only contains the binding files there
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.
Yes. The releases are for the github release and the prebuilds get included in the npm bundle. I added information explaining this in CONTRIBUTING.md
Description
linux/arm64
bindingsnode-fetch
and movejazzer.js
to optional dependencies to supportlinux/arm64
buildscripts/makeRelease
to move all CI prebuilds torelease
folder and then selectively move back the bundled version to the npm publishedprebuild
folderrandomBytesNonZero