mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
# Backport This will backport the following commits from `main` to `7.17`: - [chore(NA): remove usage of re2 and replace it with a non native module (#188134)](https://github.com/elastic/kibana/pull/188134) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"tiago.costa@elastic.co"},"sourceCommit":{"committedDate":"2024-07-15T19:33:28Z","message":"chore(NA): remove usage of re2 and replace it with a non native module (#188134)\n\nThis PR removes the usage of the native module version of `re2` and\r\nreplaces it with a js port called `re2js`.\r\nIt also ends our usage of native node modules in production and it\r\nremoves the task from the build as well. Further steps will be taken\r\nalong our strategy to avoid future usages of native node modules in prod\r\nenvironments.","sha":"3c338a82c2d6d59c91f0f3b74f725231c69c5b13","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","backport:all-open","v8.16.0"],"number":188134,"url":"https://github.com/elastic/kibana/pull/188134","mergeCommit":{"message":"chore(NA): remove usage of re2 and replace it with a non native module (#188134)\n\nThis PR removes the usage of the native module version of `re2` and\r\nreplaces it with a js port called `re2js`.\r\nIt also ends our usage of native node modules in production and it\r\nremoves the task from the build as well. Further steps will be taken\r\nalong our strategy to avoid future usages of native node modules in prod\r\nenvironments.","sha":"3c338a82c2d6d59c91f0f3b74f725231c69c5b13"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/188134","number":188134,"mergeCommit":{"message":"chore(NA): remove usage of re2 and replace it with a non native module (#188134)\n\nThis PR removes the usage of the native module version of `re2` and\r\nreplaces it with a js port called `re2js`.\r\nIt also ends our usage of native node modules in production and it\r\nremoves the task from the build as well. Further steps will be taken\r\nalong our strategy to avoid future usages of native node modules in prod\r\nenvironments.","sha":"3c338a82c2d6d59c91f0f3b74f725231c69c5b13"}}]}] BACKPORT-->
71 lines
3.3 KiB
Text
71 lines
3.3 KiB
Text
# Define the workspace base name and a managed directory by bazel
|
|
# that will hold the node_modules called @npm
|
|
workspace(
|
|
name = "kibana",
|
|
managed_directories = {"@npm": ["node_modules"]},
|
|
)
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
# Fetch Node.js rules
|
|
http_archive(
|
|
name = "build_bazel_rules_nodejs",
|
|
sha256 = "e79c08a488cc5ac40981987d862c7320cee8741122a2649e9b08e850b6f20442",
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.8.0/rules_nodejs-3.8.0.tar.gz"],
|
|
)
|
|
|
|
# Now that we have the rules let's import from them to complete the work
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")
|
|
|
|
# Assure we have at least a given rules_nodejs version
|
|
check_rules_nodejs_version(minimum_version_string = "3.8.0")
|
|
|
|
# Setup the Node.js toolchain for the architectures we want to support
|
|
#
|
|
# NOTE: darwin-arm64 is not being installed because bazel is not yet available on that architecture.
|
|
# The PR for it was merged and should be available in the next release of bazel and bazelisk. As soon as they have it
|
|
# we can update that rule.
|
|
node_repositories(
|
|
node_repositories = {
|
|
"20.15.1-darwin_amd64": ("node-v20.15.1-darwin-x64.tar.gz", "node-v20.15.1-darwin-x64", "f5379772ffae1404cfd1fcc8cf0c6c5971306b8fb2090d348019047306de39dc"),
|
|
"20.15.1-darwin_arm64": ("node-v20.15.1-darwin-arm64.tar.gz", "node-v20.15.1-darwin-arm64", "4743bc042f90ba5d9edf09403207290a9cdd2f6061bdccf7caaa0bbfd49f343e"),
|
|
"20.15.1-linux_arm64": ("node-v20.15.1-linux-arm64.tar.xz", "node-v20.15.1-linux-arm64", "c049d670df0c27ae2fd53446df79b6227ab23aff930e38daf0ab3da41c396db5"),
|
|
"20.15.1-linux_amd64": ("node-v20.15.1-linux-x64.tar.xz", "node-v20.15.1-linux-x64", "a854c291c7b775bedab54251e1e273cfee1adf1dba25435bc52305ef41f143ab"),
|
|
"20.15.1-windows_amd64": ("node-v20.15.1-win-x64.zip", "node-v20.15.1-win-x64", "ba6c3711e2c3d0638c5f7cea3c234553808a73c52a5962a6cdb47b5210b70b04"),
|
|
},
|
|
node_version = "20.15.1",
|
|
node_urls = [
|
|
"https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v{version}/{filename}",
|
|
],
|
|
yarn_repositories = {
|
|
"1.22.21": ("yarn-v1.22.21.tar.gz", "yarn-v1.22.21", "a55bb4e85405f5dfd6e7154a444e7e33ad305d7ca858bad8546e932a6688df08"),
|
|
},
|
|
yarn_version = "1.22.21",
|
|
yarn_urls = [
|
|
"https://github.com/yarnpkg/yarn/releases/download/v{version}/{filename}",
|
|
],
|
|
package_json = ["//:package.json"],
|
|
)
|
|
|
|
# Run yarn_install rule to take care of dependencies
|
|
#
|
|
# NOTE: FORCE_COLOR env var forces colors on non tty mode
|
|
yarn_install(
|
|
name = "npm",
|
|
package_json = "//:package.json",
|
|
yarn_lock = "//:yarn.lock",
|
|
data = [
|
|
"//:.yarnrc",
|
|
"//:preinstall_check.js",
|
|
],
|
|
exports_directories_only = True,
|
|
symlink_node_modules = True,
|
|
quiet = False,
|
|
frozen_lockfile = False,
|
|
environment = {
|
|
"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",
|
|
"CYPRESS_DOWNLOAD_MIRROR": "https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/cypress",
|
|
}
|
|
)
|