Upgrade re2 from v1.17.7 to v1.20.1 (#162880)

This commit is contained in:
Thomas Watson 2023-08-04 20:13:13 +02:00 committed by GitHub
parent ac66353a39
commit 4c41247f93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 65 additions and 35 deletions

View file

@ -935,7 +935,7 @@
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.9.9",
"re2": "1.17.7",
"re2": "1.20.1",
"react": "^17.0.2",
"react-ace": "^7.0.5",
"react-beautiful-dnd": "^13.1.0",

39
scripts/download_re2.sh Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
args=("$@")
re2_version=${args[0]}
if [ -z "$re2_version" ]; then
echo "Usage: ./download_re2.sh [re2_version]"
exit 1
fi
archs=(
"darwin-arm64"
"darwin-x64"
"linux-musl-x64"
"linux-x64"
"win32-x64"
)
node_api_versions=( 108 115 )
formats=( "br" "gz" )
echo "Downloading builds of re2 version ${re2_version} to /tmp/re2"
mkdir /tmp/re2
for node_api_version in "${node_api_versions[@]}"; do
echo " Node.js API version ${node_api_version}"
for arch in "${archs[@]}"; do
for format in "${formats[@]}"; do
url="https://github.com/uhop/node-re2/releases/download/${re2_version}/${arch}-${node_api_version}.${format}"
echo " ${url}"
(cd /tmp/re2 && curl -s -L -O "${url}")
done
done
done
echo
echo "Calculating shasums for downloaded artifacts..."
echo
shasum -a 256 /tmp/re2/*

View file

@ -40,19 +40,19 @@ interface Package {
const packages: Package[] = [
{
// Tip: use `scripts/download_re2.sh` to download binary artifacts from GitHub
name: 're2',
version: '1.17.7',
version: '1.20.1',
destinationPath: 'node_modules/re2/build/Release/re2.node',
extractMethod: 'gunzip',
archives: {
'linux-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/linux-x64-108.gz',
sha256: 'e0b62ff7c415c95f57232f2726711c0fd71056c848538f095ba3fa1126ef5e31',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.1/linux-x64-108.gz',
sha256: 'e14f274f73ede22f170bfe9e57a0645ebf7ed320042a27361fa158bc239a5563',
},
// ARM builds are currently done manually as Github Actions used in upstream project
// do not natively support an ARM target.
// Linux ARM builds are currently done manually as Github Actions used in upstream project
// do not natively support an Linux ARM target.
//
// From an AWS Graviton instance running Ubuntu or a GCE T2A instance running Debian:
// * install build-essential package: `sudo apt-get update` + `sudo apt install build-essential`
// * install nvm and the node version used by the Kibana repository
@ -63,29 +63,20 @@ const packages: Package[] = [
// * capture the sha256 with: `shasum -a 256 linux-arm64-*`
// * upload the `linux-arm64-*.gz` artifact to the `yarn-prebuilt-artifacts` bucket in GCS using the correct version number
'linux-arm64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/linux-arm64-108.gz',
sha256: 'e2025ead87be9f1ec4a9d892d1cce69c573101762720d56f52b1d52ed7ae0fef',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.1/linux-arm64-108.gz',
sha256: 'cbdf3f75a331c601ac0bd34715814d0a1fd17612c6d6b5269f176d46044defd5',
},
'darwin-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/darwin-x64-108.gz',
sha256: '4ed378c5a7fe6134b717afe7642254aff1ed7a881cbcaa53a012ac3efab49f99',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.1/darwin-x64-108.gz',
sha256: 'f88c09e98f152ac15c593b3b923b7fbe28d448cfde5986da40c34461bede5a09',
},
// A similar process is necessary for building on ARM macs:
// * bootstrap and re2 will build itself on install
// * `cp node_modules/re2/build/Release/re2.node darwin-arm64-$(node -e "console.log(process.versions.modules)")`
// * `gzip darwin-arm64-*`
// * capture the sha256 with: `shasum -a 256 darwin-arm64-*`
// * upload the `darwin-arm64-*.gz` artifact to the `yarn-prebuilt-artifacts` bucket in GCS using the correct version number
'darwin-arm64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/darwin-arm64-108.gz',
sha256: '42afc32137ff5c5bebae5d68347a9786906748c2f28e06194d8950707f2ae90e',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.1/darwin-arm64-108.gz',
sha256: '80700aecbe63052149aba721449a8ce30c24d884e414025124bb4602efe708be',
},
'win32-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.7/win32-x64-108.gz',
sha256: 'ff72fe02de652262659c8e17e44a932f3c873362233756b40d1a97538d05de92',
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.1/win32-x64-108.gz',
sha256: 'cadc4713907f3ad1de45f470810ec8e13e08f32c1a1e45e5d5ab5e9d7fcb9763',
},
},
},

View file

@ -18182,7 +18182,7 @@ inquirer@^8.2.5:
through "^2.3.6"
wrap-ansi "^7.0.0"
install-artifact-from-github@^1.3.1:
install-artifact-from-github@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/install-artifact-from-github/-/install-artifact-from-github-1.3.3.tgz#57d89bacfa0f47d7307fe41b6247cda9f9a8079c"
integrity sha512-x79SL0d8WOi1ZjXSTUqqs0GPQZ92YArJAN9O46wgU9wdH2U9ecyyhB9YGDbPe2OLV4ptmt6AZYRQZ2GydQZosQ==
@ -21879,7 +21879,7 @@ mute-stream@0.0.8:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
nan@^2.16.0, nan@^2.17.0:
nan@^2.17.0:
version "2.17.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb"
integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==
@ -22129,7 +22129,7 @@ node-gyp@^8.4.1:
tar "^6.1.2"
which "^2.0.2"
node-gyp@^9.0.0:
node-gyp@^9.4.0:
version "9.4.0"
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-9.4.0.tgz#2a7a91c7cba4eccfd95e949369f27c9ba704f369"
integrity sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg==
@ -24410,14 +24410,14 @@ re-resizable@^6.9.9:
resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.9.9.tgz#99e8b31c67a62115dc9c5394b7e55892265be216"
integrity sha512-l+MBlKZffv/SicxDySKEEh42hR6m5bAHfNu3Tvxks2c4Ah+ldnWjfnVRwxo/nxF27SsUsxDS0raAzFuJNKABXA==
re2@1.17.7:
version "1.17.7"
resolved "https://registry.yarnpkg.com/re2/-/re2-1.17.7.tgz#e14cab85a177a5534c7215c322d1b043c55aa1e9"
integrity sha512-X8GSuiBoVWwcjuppqSjsIkRxNUKDdjhkO9SBekQbZ2ksqWUReCy7DQPWOVpoTnpdtdz5PIpTTxTFzvJv5UMfjA==
re2@1.20.1:
version "1.20.1"
resolved "https://registry.yarnpkg.com/re2/-/re2-1.20.1.tgz#27450f6de6299635f50305a670cc15ac30687f85"
integrity sha512-JbzIoI5adNCqGUK8wHG1dMSyggvPyA4kx2hewt1lma5sP7/iWCfM15XKbCZlX2yvu5k80jSKAOQqJF7KC+2n8Q==
dependencies:
install-artifact-from-github "^1.3.1"
nan "^2.16.0"
node-gyp "^9.0.0"
install-artifact-from-github "^1.3.3"
nan "^2.17.0"
node-gyp "^9.4.0"
react-ace@^7.0.5:
version "7.0.5"