-
Notifications
You must be signed in to change notification settings - Fork 41
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
Arm64 with prebuilds #238
Arm64 with prebuilds #238
Conversation
0ee7dac
to
6bd965d
Compare
e33a24c
to
f3f0b89
Compare
7f73309
to
e07055a
Compare
e07055a
to
5276a1e
Compare
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.
Nice work 👏🏻 . A few questions and some comments around lack of testing in build.js. This reduces so much manual code to pre build, upload, etc, so much better. I did verify that I could install the .tgz built from the CI and tested the npm run build
and instal from source flows.
This PR also addresses or by making irrelevant:
npm install --verbose --maxsockets 1 | ||
cp -R node_modules /host/ | ||
npm run unit | ||
# Skipping integration until we can get native arm64 runners |
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.
do we have a ticket for this?
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.
Not yet. We can file one once we merge this.
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.
Great work. This reduces a lot of bespoke code and also adds more pre-builts 🚀
This PR resolves #205.
Proposed Release Notes
Migrated to using prebuildify and node-gyp-install.
Links
Details
Utilizing prebuildify and node-gyp-install allows us to remove all of the custom code around checking for a local binary and downloading one from an S3 bucket if a binary isn't found. This is accomplished by bundling a binary for all known supported platforms within the npm package. If the module is installed on a platform we have not bundled a binary for, then node-gyp-install will run the build locally as per normal node-gyp. Additionally, if anyone wants to force a build, they can
npm install --build-from-source
.Notice: the
create-release.yml
workflow does not directly use the one fromnewrelic/node-newrelic
. We need to do some extra steps to 1. build the binaries, 2. grab them from the GHA artifacts cache, 3. construct a project structure with the binaries andnpm pack
to build the shippable module, and 4. grab the packed module from the GHA actions cache and then publish it to npmjs.com.The process can be seen in this dry run. The npm-module artifact from that run can be downloaded and:
unzip npm-module.zip
mkdir foo && cd foo && npm init && npm install ../newrelic-*.tgz
echo -e "const nr = require('@newrelic/native-metrics')\nconsole.log(nr)" > index.js
node index.js
You'll see the serialized representation of the exported module since the prebuilt binary gets loaded from the
require
line 😁