Skip to content

Commit

Permalink
[build] Provide ARM build of RE2 (#84163)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley committed Nov 24, 2020
1 parent 6ef6c0f commit e892b03
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/dev/build/tasks/patch_native_modules_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,30 @@ const packages: Package[] = [
destinationPath: 'node_modules/re2/build/Release/re2.node',
extractMethod: 'gunzip',
archives: {
darwin: {
'darwin-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/darwin-x64-72.gz',
sha256: '983106049bb86e21b7f823144b2b83e3f1408217401879b3cde0312c803512c9',
},
linux: {
'linux-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/linux-x64-72.gz',
sha256: '8b6692037f7b0df24dabc9c9b039038d1c3a3110f62121616b406c482169710a',
},
win32: {

// ARM build is currently done manually as Github Actions used in upstream project
// do not natively support an ARM target.

// From a AWS Graviton instance:
// * checkout the node-re2 project,
// * install Node using the same minor used by Kibana
// * npm install, which will also create a build
// * gzip -c build/Release/re2.node > linux-arm64-72.gz
// * upload to kibana-ci-proxy-cache bucket
'linux-arm64': {
url:
'https://storage.googleapis.com/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.15.4/linux-arm64-72.gz',
sha256: '5942353ec9cf46a39199818d474f7af137cfbb1bc5727047fe22f31f36602a7e',
},
'win32-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-72.gz',
sha256: '0a6991e693577160c3e9a3f196bd2518368c52d920af331a1a183313e0175604',
},
Expand Down Expand Up @@ -84,7 +99,7 @@ async function patchModule(
`Can't patch ${pkg.name}'s native module, we were expecting version ${pkg.version} and found ${installedVersion}`
);
}
const platformName = platform.getName();
const platformName = platform.getNodeArch();
const archive = pkg.archives[platformName];
const archiveName = path.basename(archive.url);
const downloadPath = config.resolveFromRepo(DOWNLOAD_DIRECTORY, pkg.name, archiveName);
Expand Down

0 comments on commit e892b03

Please sign in to comment.