Skip to content
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

Remove re2 library #186155

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ fi

export GECKODRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX"
export CHROMEDRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX"
export RE2_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX"
export CYPRESS_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache$CI_PROXY_CACHE_SUFFIX/cypress"

export NODE_OPTIONS="--max-old-space-size=4096"
Expand Down
1 change: 0 additions & 1 deletion WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ yarn_install(
"GECKODRIVER_CDNURL": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache",
"CHROMEDRIVER_CDNURL": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache",
"CHROMEDRIVER_CDNBINARIESURL": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache",
"RE2_DOWNLOAD_MIRROR": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2",
"CYPRESS_DOWNLOAD_MIRROR": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/cypress",
}
)
5 changes: 1 addition & 4 deletions kbn_pm/src/lib/bazel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,7 @@ export async function installYarnDeps(log, opts = undefined) {
await runBazel(log, ['run', '@nodejs//:yarn'], {
offline: opts?.offline,
quiet: opts?.quiet,
env: {
RE2_DOWNLOAD_MIRROR:
'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2',
},
env: {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kept the entry, tell me if I should remove env: {} altogether.

});

log.success('yarn deps installed');
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,6 @@
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.9.9",
"re2": "1.20.9",
"react": "^17.0.2",
"react-ace": "^7.0.5",
"react-diff-view": "^3.2.0",
Expand Down
39 changes: 0 additions & 39 deletions scripts/download_re2.sh

This file was deleted.

5 changes: 1 addition & 4 deletions src/dev/build/tasks/install_dependencies_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export const InstallDependencies: Task = {
],
{
cwd: build.resolvePath(),
env: {
RE2_DOWNLOAD_MIRROR:
'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2',
},
env: {},
}
);
},
Expand Down
44 changes: 1 addition & 43 deletions src/dev/build/tasks/patch_native_modules_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,7 @@ interface Package {
>;
}

const packages: Package[] = [
{
// Tip: use `scripts/download_re2.sh` to download binary artifacts from GitHub
name: 're2',
version: '1.20.9',
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.20.9/linux-x64-115.gz',
sha256: 'b88183fe7bc8afa260d22cd909f496ab5636aace7075b54ac345d33ea32aedc0',
},
// 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
// * `npm install [email protected]`
// * re2 will build itself on install
// * `cp node_modules/re2/build/Release/re2.node linux-arm64-$(node -e "console.log(process.versions.modules)")`
// * `gzip linux-arm64-*`
// * 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.20.9/linux-arm64-115.gz',
sha256: '6c04136a6658df3dcc5b8ac0041641c227d232bed385fe55f62c8470f8db041d',
},
'darwin-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/darwin-x64-115.gz',
sha256: '1e0d79983c94222c414a5410444ec0ccf37614fd0e45187d0f313a19b203702c',
},
'darwin-arm64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/darwin-arm64-115.gz',
sha256: '192c8e036062504b818941989c44ddb799efe0419d039f7089caedb09d49a597',
},
'win32-x64': {
url: 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.20.9/win32-x64-115.gz',
sha256: '01ae2df89f976f4097e50e121d7ec6ac62ec8050c838107dcfb976d037a60d59',
},
},
},
];
const packages: Package[] = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept the empty array and the task, in case we may need to re-add more native modules at some point.

Please tell me if I should fully remove that task instead.


async function getInstalledVersion(config: Config, packageName: string) {
const packageJSONPath = config.resolveFromRepo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ export default new Chainable('label', {
const config = args.byName;
return alter(args, function (eachSeries) {
if (config.regex) {
// not using a standard `import` so that if there's an issue with the re2 native module
// that it doesn't prevent Kibana from starting up and we only have an issue using Timelion labels
const RE2 = require('re2');
eachSeries.label = eachSeries.label.replace(new RE2(config.regex), config.label);
eachSeries.label = eachSeries.label.replace(new RegExp(config.regex), config.label);
} else if (config.label) {
eachSeries.label = config.label;
}
Expand Down
Loading