From 24b5e22eaa08e5d32324c4d5c0ac13394da08b31 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Thu, 10 Dec 2020 22:49:19 -0800 Subject: [PATCH] chore: update rules_sass to latest This includes an explicit opt-in to the --bazel_patch_module_resolver flag, which we need before flipping the default. Note that there's some issue upstream AFAICT so I filed https://github.com/bazelbuild/rules_sass/issues/127 and patched that here --- BUILD.bazel | 1 + examples/angular/WORKSPACE | 14 ++++++++++---- examples/angular_view_engine/WORKSPACE | 14 ++++++++++---- package.bzl | 14 ++++++++++---- rules_sass.issue127.patch | 12 ++++++++++++ 5 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 rules_sass.issue127.patch diff --git a/BUILD.bazel b/BUILD.bazel index 67fb6217d3..f2432eaf26 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -79,6 +79,7 @@ pkg_npm( srcs = glob(["*.bzl"]) + [ "BUILD.bazel", "LICENSE", + "rules_sass.issue127.patch", ], substitutions = COMMON_REPLACEMENTS, deps = [ diff --git a/examples/angular/WORKSPACE b/examples/angular/WORKSPACE index 1a91a10a9c..8756e83c89 100644 --- a/examples/angular/WORKSPACE +++ b/examples/angular/WORKSPACE @@ -36,11 +36,17 @@ http_archive( # Fetch sass rules for compiling sass files http_archive( name = "io_bazel_rules_sass", - sha256 = "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", - strip_prefix = "rules_sass-1.25.0", + patch_args = ["-p1"], + # We need the latest rules_sass to get the --bazel_patch_module_resolver behavior + # However it seems to have a bug, so we patch back to the prior dart-sass version. + # See https://github.com/bazelbuild/rules_sass/issues/127 + # TODO(alexeagle): fix upstream and remove patch + patches = ["@build_bazel_rules_nodejs//:rules_sass.issue127.patch"], + sha256 = "8392cf8910db2b1dc3b488ea18113bfe4fd666037bf8ec30d2a3f08fc602a6d8", + strip_prefix = "rules_sass-1.30.0", urls = [ - "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", - "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", + "https://github.com/bazelbuild/rules_sass/archive/1.30.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.30.0.zip", ], ) diff --git a/examples/angular_view_engine/WORKSPACE b/examples/angular_view_engine/WORKSPACE index 81eeaf77aa..e90e85ab0e 100644 --- a/examples/angular_view_engine/WORKSPACE +++ b/examples/angular_view_engine/WORKSPACE @@ -23,11 +23,17 @@ http_archive( # Fetch sass rules for compiling sass files http_archive( name = "io_bazel_rules_sass", - sha256 = "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", - strip_prefix = "rules_sass-1.25.0", + patch_args = ["-p1"], + # We need the latest rules_sass to get the --bazel_patch_module_resolver behavior + # However it seems to have a bug, so we patch back to the prior dart-sass version. + # See https://github.com/bazelbuild/rules_sass/issues/127 + # TODO(alexeagle): fix upstream and remove patch + patches = ["@build_bazel_rules_nodejs//:rules_sass.issue127.patch"], + sha256 = "8392cf8910db2b1dc3b488ea18113bfe4fd666037bf8ec30d2a3f08fc602a6d8", + strip_prefix = "rules_sass-1.30.0", urls = [ - "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", - "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", + "https://github.com/bazelbuild/rules_sass/archive/1.30.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.30.0.zip", ], ) diff --git a/package.bzl b/package.bzl index 3ca9f39cc3..7105cf0486 100644 --- a/package.bzl +++ b/package.bzl @@ -31,11 +31,17 @@ def rules_nodejs_dev_dependencies(): _maybe( http_archive, name = "io_bazel_rules_sass", - sha256 = "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", - strip_prefix = "rules_sass-1.25.0", + patch_args = ["-p1"], + # We need the latest rules_sass to get the --bazel_patch_module_resolver behavior + # However it seems to have a bug, so we patch back to the prior dart-sass version. + # See https://github.com/bazelbuild/rules_sass/issues/127 + # TODO(alexeagle): fix upstream and remove patch + patches = ["@build_bazel_rules_nodejs//:rules_sass.issue127.patch"], + sha256 = "8392cf8910db2b1dc3b488ea18113bfe4fd666037bf8ec30d2a3f08fc602a6d8", + strip_prefix = "rules_sass-1.30.0", urls = [ - "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", - "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", + "https://github.com/bazelbuild/rules_sass/archive/1.30.0.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.30.0.zip", ], ) diff --git a/rules_sass.issue127.patch b/rules_sass.issue127.patch new file mode 100644 index 0000000000..3e011df9e6 --- /dev/null +++ b/rules_sass.issue127.patch @@ -0,0 +1,12 @@ +diff --git a/sass/package.json b/sass/package.json +index 584a86c..1f54da3 100644 +--- a/sass/package.json ++++ b/sass/package.json +@@ -1,6 +1,6 @@ + { + "devDependencies": { + "@bazel/worker": "2.3.1", +- "sass": "1.30.0" ++ "sass": "1.29.0" + } + }