Skip to content

Commit

Permalink
[rust] Include optimization parameters for Selenium Manager releases (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia authored Oct 13, 2022
1 parent 423e7db commit 5c375dd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@ infer = "0.9.0"

[dev-dependencies]
assert_cmd = "2.0.4"
rstest = "0.15.0"
rstest = "0.15.0"

[profile.release]
opt-level = 'z' # Optimize for size
lto = true # Enable Link Time Optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
strip = true # Strip symbols from binary*

3 comments on commit 5c375dd

@krmahadevan
Copy link
Contributor

Choose a reason for hiding this comment

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

@bonigarcia - After this change, when I try to build the grid from trunk using bazel build grid I see the below error

INFO: Repository crates instantiated at:
  /Users/krmahadevan/githome/oss/selenium/WORKSPACE:172:18: in <toplevel>
Repository rule crates_repository defined at:
  /private/var/tmp/_bazel_krmahadevan/2f150a8d0ea60f214705b438406075e7/external/rules_rust/crate_universe/private/crates_repository.bzl:106:36: in <toplevel>
INFO: Repository 'crates' used the following cache hits instead of downloading the corresponding file.
 * Hash 'fb80acb9fcfd83674f73e98bf956bc65b33f31a4380ba72fbc1a6a9bf22c2f8c' for https://github.com/bazelbuild/rules_rust/releases/download/0.10.0/cargo-bazel-x86_64-apple-darwin
If the definition of 'crates' was updated, verify that the hashes were also updated.
WARNING: Download from https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/0.10.0/rules_rust-v0.10.0.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
DEBUG: /private/var/tmp/_bazel_krmahadevan/2f150a8d0ea60f214705b438406075e7/external/rules_rust/crate_universe/private/generate_utils.bzl:364:14: Digests do not match: Digest("cc945fa5e2e86802cfd4b19657cc9464373e4b0e3c8d7f49588a6f275e14f839") != Digest("28ddb8bea23fa94462ef0125d65a8381953e95db622d4e72f70ec97ed7940756")
ERROR: An error occurred during the fetch of repository 'crates':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_krmahadevan/2f150a8d0ea60f214705b438406075e7/external/rules_rust/crate_universe/private/crates_repository.bzl", line 45, column 28, in _crates_repository_impl
                repin = determine_repin(
        File "/private/var/tmp/_bazel_krmahadevan/2f150a8d0ea60f214705b438406075e7/external/rules_rust/crate_universe/private/generate_utils.bzl", line 365, column 13, in determine_repin
                fail((
Error in fail: The current `lockfile` is out of date for 'crates'. Please re-run bazel using `CARGO_BAZEL_REPIN=true` if this is expected and the lockfile should be updated.
ERROR: /Users/krmahadevan/githome/oss/selenium/WORKSPACE:172:18: fetching crates_repository rule //external:crates: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_krmahadevan/2f150a8d0ea60f214705b438406075e7/external/rules_rust/crate_universe/private/crates_repository.bzl", line 45, column 28, in _crates_repository_impl
                repin = determine_repin(
        File "/private/var/tmp/_bazel_krmahadevan/2f150a8d0ea60f214705b438406075e7/external/rules_rust/crate_universe/private/generate_utils.bzl", line 365, column 13, in determine_repin
                fail((
Error in fail: The current `lockfile` is out of date for 'crates'. Please re-run bazel using `CARGO_BAZEL_REPIN=true` if this is expected and the lockfile should be updated.
ERROR: no such package '@crates//': The current `lockfile` is out of date for 'crates'. Please re-run bazel using `CARGO_BAZEL_REPIN=true` if this is expected and the lockfile should be updated.
INFO: Elapsed time: 1.416s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

This got fixed only after I re-ran the build using bazel build grid --action_env=CARGO_BAZEL_REPIN=true

But this is causing changes to the below cargo files

        modified:   rust/Cargo.Bazel.lock
        modified:   rust/Cargo.lock

Not sure if these two files are to be updated and checked in.

My knowledge on rust is zero. So I thought I would call this out

@krmahadevan
Copy link
Contributor

Choose a reason for hiding this comment

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

Here's the complete diff

diff --git a/rust/Cargo.Bazel.lock b/rust/Cargo.Bazel.lock
index aa87a934df..86789f08c5 100644
--- a/rust/Cargo.Bazel.lock
+++ b/rust/Cargo.Bazel.lock
@@ -1,5 +1,5 @@
 {
-  "checksum": "cc945fa5e2e86802cfd4b19657cc9464373e4b0e3c8d7f49588a6f275e14f839",
+  "checksum": "cbdd307f41fcf4c246a8beaad469ba65c9ec0b569596d9b50893c87cdd650d9c",
   "crates": {
     "adler 1.0.2": {
       "name": "adler",
@@ -921,13 +921,13 @@
       },
       "license": "MIT OR Apache-2.0"
     },
-    "clap 4.0.11": {
+    "clap 4.0.14": {
       "name": "clap",
-      "version": "4.0.11",
+      "version": "4.0.14",
       "repository": {
         "Http": {
-          "url": "https://crates.io/api/v1/crates/clap/4.0.11/download",
-          "sha256": "4ed45cc2c62a3eff523e718d8576ba762c83a3146151093283ac62ae11933a73"
+          "url": "https://crates.io/api/v1/crates/clap/4.0.14/download",
+          "sha256": "6ea54a38e4bce14ff6931c72e5b3c43da7051df056913d4e7e1fcdb1c03df69d"
         }
       },
       "targets": [
@@ -1004,23 +1004,23 @@
         "proc_macro_deps": {
           "common": [
             {
-              "id": "clap_derive 4.0.10",
+              "id": "clap_derive 4.0.13",
               "target": "clap_derive"
             }
           ],
           "selects": {}
         },
-        "version": "4.0.11"
+        "version": "4.0.14"
       },
       "license": "MIT OR Apache-2.0"
     },
-    "clap_derive 4.0.10": {
+    "clap_derive 4.0.13": {
       "name": "clap_derive",
-      "version": "4.0.10",
+      "version": "4.0.13",
       "repository": {
         "Http": {
-          "url": "https://crates.io/api/v1/crates/clap_derive/4.0.10/download",
-          "sha256": "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce"
+          "url": "https://crates.io/api/v1/crates/clap_derive/4.0.13/download",
+          "sha256": "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad"
         }
       },
       "targets": [
@@ -1071,7 +1071,7 @@
           "selects": {}
         },
         "edition": "2021",
-        "version": "4.0.10"
+        "version": "4.0.13"
       },
       "license": "MIT OR Apache-2.0"
     },
@@ -6793,7 +6793,7 @@
         "deps": {
           "common": [
             {
-              "id": "clap 4.0.11",
+              "id": "clap 4.0.14",
               "target": "clap"
             },
             {
@@ -10672,7 +10672,7 @@
   "binary_crates": [
     "assert_cmd 2.0.4",
     "cc 1.0.73",
-    "clap 4.0.11",
+    "clap 4.0.14",
     "wait-timeout 0.2.0"
   ],
   "workspace_members": {
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 1b75d584a4..e72bb90674 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -174,9 +174,9 @@ dependencies = [
 
 [[package]]
 name = "clap"
-version = "4.0.11"
+version = "4.0.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ed45cc2c62a3eff523e718d8576ba762c83a3146151093283ac62ae11933a73"
+checksum = "6ea54a38e4bce14ff6931c72e5b3c43da7051df056913d4e7e1fcdb1c03df69d"
 dependencies = [
  "atty",
  "bitflags",
@@ -189,9 +189,9 @@ dependencies = [
 
 [[package]]
 name = "clap_derive"
-version = "4.0.10"
+version = "4.0.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce"
+checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad"
 dependencies = [
  "heck",
  "proc-macro-error",

@bonigarcia
Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the dependencies needed to be repined (REPIN=1 bazel build rust/...). It's fixed now, thanks for reporting.

Please sign in to comment.