mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* chore(NA): downgrade rules nodejs into v4.0.0
* chore(NA): include windows patch
* chore(NA): polish downgrade code
* chore(NA): include yarn.lock
(cherry picked from commit 0b2da10a7d
)
Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
This commit is contained in:
parent
5bcef84ab5
commit
2f310d87c0
7 changed files with 69 additions and 37 deletions
|
@ -11,15 +11,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|||
http_archive(
|
||||
name = "build_bazel_rules_nodejs",
|
||||
patch_args = ["-p1"],
|
||||
patches = ["//:src/dev/bazel/rules_nodejs_patches/exclude_npm_directory_copies_from_remote_cache.patch"],
|
||||
sha256 = "2b2004784358655f334925e7eadc7ba80f701144363df949b3293e1ae7a2fb7b",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.4.0/rules_nodejs-5.4.0.tar.gz"],
|
||||
patches = ["//:src/dev/bazel/rules_nodejs_patches/normalized_paths_for_windows_runfiles.patch"],
|
||||
sha256 = "6f15d75f9e99c19d9291ff8e64e4eb594a6b7d25517760a75ad3621a7a48c2df",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.7.0/rules_nodejs-4.7.0.tar.gz"],
|
||||
)
|
||||
|
||||
# Build Node.js rules dependencies
|
||||
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
|
||||
build_bazel_rules_nodejs_dependencies()
|
||||
|
||||
# Now that we have the rules let's import from them to complete the work
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
|
||||
|
||||
|
@ -41,7 +37,7 @@ node_repositories(
|
|||
node_urls = [
|
||||
"https://nodejs.org/dist/v{version}/{filename}",
|
||||
],
|
||||
yarn_releases = {
|
||||
yarn_repositories = {
|
||||
"1.21.1": ("yarn-v1.21.1.tar.gz", "yarn-v1.21.1", "d1d9f4a0f16f5ed484e814afeb98f39b82d4728c6c8beaafb5abc99c02db6674"),
|
||||
},
|
||||
yarn_version = "1.21.1",
|
||||
|
|
|
@ -450,7 +450,7 @@
|
|||
"@babel/traverse": "^7.17.3",
|
||||
"@babel/types": "^7.17.0",
|
||||
"@bazel/ibazel": "^0.16.2",
|
||||
"@bazel/typescript": "5.4.0",
|
||||
"@bazel/typescript": "4.6.2",
|
||||
"@cypress/code-coverage": "^3.9.12",
|
||||
"@cypress/snapshot": "^2.1.7",
|
||||
"@cypress/webpack-preprocessor": "^5.6.0",
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config")
|
||||
load("@rules_nodejs//nodejs:directory_file_path.bzl", "directory_file_path")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "nodejs_binary")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "directory_file_path", "js_library", "nodejs_binary")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
|
||||
|
||||
PKG_BASE_NAME = "kbn-type-summarizer"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# Side Public License, v 1.
|
||||
#
|
||||
|
||||
load("@rules_nodejs//nodejs/private:ts_config.bzl", "TsConfigInfo")
|
||||
load("@npm//@bazel/typescript/internal:ts_config.bzl", "TsConfigInfo")
|
||||
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node", "LinkablePackageInfo", "DeclarationInfo", "declaration_info")
|
||||
load("@build_bazel_rules_nodejs//internal/linker:link_node_modules.bzl", "module_mappings_aspect")
|
||||
|
||||
|
@ -142,7 +142,7 @@ pkg_npm_types = rule(
|
|||
"_packager": attr.label(
|
||||
doc = "Target that executes the npm types package assembler binary",
|
||||
executable = True,
|
||||
cfg = "exec",
|
||||
cfg = "host",
|
||||
default = Label("//packages/kbn-type-summarizer:bazel-cli"),
|
||||
),
|
||||
},
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
diff --git a/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl b/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl
|
||||
index a719174c..273322d0 100644
|
||||
--- a/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl
|
||||
+++ b/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl
|
||||
@@ -30,7 +30,9 @@ _execution_requirements = {
|
||||
# Also, remote-execution does not allow source directory inputs, see
|
||||
# https://github.com/bazelbuild/bazel/commit/c64421bc35214f0414e4f4226cc953e8c55fa0d2
|
||||
# So we must not attempt to execute remotely in that case.
|
||||
- "no-remote-exec": "1",
|
||||
+ # no-remote | Prevents the action or test from being executed remotely or cached remotely.
|
||||
+ # | This is equivalent to using both `no-remote-cache` and `no-remote-exec`.
|
||||
+ "no-remote": "1",
|
||||
}
|
||||
|
||||
def _hash_file(file):
|
|
@ -0,0 +1,52 @@
|
|||
diff --git a/internal/node/launcher.sh b/internal/node/launcher.sh
|
||||
index fd832d02..64820f48 100644
|
||||
--- a/internal/node/launcher.sh
|
||||
+++ b/internal/node/launcher.sh
|
||||
@@ -13,6 +13,32 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
+# It helps to determine if we are running on a Windows environment (excludes WSL as it acts like Unix)
|
||||
+function isWindows {
|
||||
+ case "$(uname -s)" in
|
||||
+ CYGWIN*) local IS_WINDOWS=1 ;;
|
||||
+ MINGW*) local IS_WINDOWS=1 ;;
|
||||
+ MSYS_NT*) local IS_WINDOWS=1 ;;
|
||||
+ *) local IS_WINDOWS=0 ;;
|
||||
+ esac
|
||||
+
|
||||
+ echo $IS_WINDOWS
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
+# It helps to normalizes paths when running on Windows.
|
||||
+#
|
||||
+# Example:
|
||||
+# C:/Users/XUser/_bazel_XUser/7q7kkv32/execroot/A/b/C -> /c/users/xuser/_bazel_xuser/7q7kkv32/execroot/a/b/c
|
||||
+function normalizeWindowsPath {
|
||||
+ # Apply the followings paths transformations to normalize paths on Windows
|
||||
+ # -process driver letter
|
||||
+ # -convert path separator
|
||||
+ # -lowercase everything
|
||||
+ echo $(sed -e 's#^\(.\):#/\L\1#' -e 's#\\#/#g' -e 's/[A-Z]/\L&/g' <<< "$1")
|
||||
+ return
|
||||
+}
|
||||
+
|
||||
# --- begin runfiles.bash initialization v2 ---
|
||||
# Copy-pasted from the Bazel Bash runfiles library v2.
|
||||
set -uo pipefail; f=build_bazel_rules_nodejs/third_party/github.com/bazelbuild/bazel/tools/bash/runfiles/runfiles.bash
|
||||
@@ -49,7 +75,13 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
|
||||
# Case 6a is handled like case 3.
|
||||
if [[ -n "${RUNFILES_MANIFEST_ONLY:-}" ]]; then
|
||||
# Windows only has a manifest file instead of symlinks.
|
||||
- RUNFILES=${RUNFILES_MANIFEST_FILE%/MANIFEST}
|
||||
+ if [[ $(isWindows) -eq "1" ]]; then
|
||||
+ # If Windows normalizing the path and case insensitive removing the `/MANIFEST` part of the path
|
||||
+ NORMALIZED_RUNFILES_MANIFEST_FILE_PATH=$(normalizeWindowsPath $RUNFILES_MANIFEST_FILE)
|
||||
+ RUNFILES=$(sed 's|\/MANIFEST$||i' <<< $NORMALIZED_RUNFILES_MANIFEST_FILE_PATH)
|
||||
+ else
|
||||
+ RUNFILES=${RUNFILES_MANIFEST_FILE%/MANIFEST}
|
||||
+ fi
|
||||
elif [[ -n "${TEST_SRCDIR:-}" ]]; then
|
||||
# Case 4, bazel has identified runfiles for us.
|
||||
RUNFILES="${TEST_SRCDIR:-}"
|
18
yarn.lock
18
yarn.lock
|
@ -1228,21 +1228,21 @@
|
|||
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.16.2.tgz#05dd7f06659759fda30f87b15534f1e42f1201bb"
|
||||
integrity sha512-KgqAWMH0emL6f3xH6nqyTryoBMqlJ627LBIe9PT1PRRQPz2FtHib3FIHJPukp1slzF3hJYZvdiVwgPnHbaSOOA==
|
||||
|
||||
"@bazel/typescript@5.4.0":
|
||||
version "5.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-5.4.0.tgz#0a24e8d47152728f71b26b73adc3913645e5309e"
|
||||
integrity sha512-AWmS9HcnjqGsPQv5lnqecA8xof+d4ChpbI/Z6aiSM0qOemc8e1WT9wb1VzM6g6hRfV5foWyIHt0VhTonTsPhYw==
|
||||
"@bazel/typescript@4.6.2":
|
||||
version "4.6.2"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-4.6.2.tgz#9f07b6f8cfb6b0a0e228e5971de412911c910a90"
|
||||
integrity sha512-AUF7kq82bP6DX9Brihr/eQqvNccxVfSXosFxt80h94og5cmMyoc/euXha6rxlOBP3yWXmSo+/qjzO7o8PWJduQ==
|
||||
dependencies:
|
||||
"@bazel/worker" "5.4.0"
|
||||
"@bazel/worker" "4.6.2"
|
||||
protobufjs "6.8.8"
|
||||
semver "5.6.0"
|
||||
source-map-support "0.5.9"
|
||||
tsutils "3.21.0"
|
||||
|
||||
"@bazel/worker@5.4.0":
|
||||
version "5.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-5.4.0.tgz#ce50e34951ccf7233b651f0be665bbd43d7ed7f1"
|
||||
integrity sha512-Rtkol9WoYs0NCZl1wt4Q8T7Rs0wbQjIvFiJzVeeoC/00TG0e/qi4mYE5iQwUJmO8st3N8VnaWz2N31UHc6yhRA==
|
||||
"@bazel/worker@4.6.2":
|
||||
version "4.6.2"
|
||||
resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-4.6.2.tgz#0bd105344533335327c2edfa3fc65b04c39cdea8"
|
||||
integrity sha512-DLpN6iQAH6uiUraAs4CESyqs60u55fcKmYgOOVObGuLSQQuX49Lw7XRIN90NibRPwpbBDQichWE3zfra0yKTTw==
|
||||
dependencies:
|
||||
google-protobuf "^3.6.1"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue