Use versions module from Skylib for version checking
diff --git a/protobuf.bzl b/protobuf.bzl
index 6aed44a..9e2600f 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -1,3 +1,5 @@
+load("@bazel_skylib//:lib.bzl", "versions")
+
 def _GetPath(ctx, path):
   if ctx.label.workspace_root:
     return ctx.label.workspace_root + '/' + path
@@ -408,7 +410,4 @@
   This ensures bazel supports our approach to proto_library() depending on a
   copied filegroup. (Fixed in bazel 0.5.4)
   """
-  expected = apple_common.dotted_version("0.5.4")
-  current = apple_common.dotted_version(native.bazel_version)
-  if current.compare_to(expected) < 0:
-    fail("Bazel must be newer than 0.5.4")
+  versions.check(minimum_bazel_version = "0.5.4")