SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.77k stars 8.02k forks source link

[🐛 Bug]: Running ./scripts/format.sh on macOS cause an error with downloading coreutils #14086

Closed iampopovich closed 4 weeks ago

iampopovich commented 4 weeks ago

What happened?

i tried to apply formatting locally by running command in root selenium folder ./scripts/format.sh then I got error with downloading coreuitls from github releases

the root of problem is coreutils releases doesn't have architecture x86_64 for darwin platform. it's actually coreutils-0.0.26-aarch64-apple-darwin.tar.gz

I'm trying to figure out how to fix this using the build system tools, but I'm afraid it's not possible to explicitly specify the URL of a dependency. Is this behavior a bug in Bazel?

How can we reproduce the issue?

just run `./scripts/format.sh` in root directory of selenium project on macOS

Relevant log output

./scripts/format.sh
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
WARNING: Build option --run_under has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
Analyzing: target //scripts:google-java-format (0 packages loaded, 0 targets configured)
Analyzing: target //scripts:google-java-format (0 packages loaded, 0 targets configured)
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
INFO: Analyzed target //scripts:google-java-format (0 packages loaded, 4712 targets configured).
INFO: Found 1 target...
Target //scripts:google-java-format up-to-date:
  bazel-bin/scripts/google-java-format
  bazel-bin/scripts/google-java-format.jar
INFO: Elapsed time: 0.572s, Critical Path: 0.21s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: /bin/bash -c 'echo bazel-bin/scripts/google-java-format '
- Buildifier
    buildifier
WARNING: Build option --run_under has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: Analyzed target //:buildifier (0 packages loaded, 764 targets configured).
INFO: Found 1 target...
Target //:buildifier up-to-date:
  bazel-bin/buildifier.bash
INFO: Elapsed time: 0.355s, Critical Path: 0.11s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/buildifier.bash
- Java
    google-java-format
- Javascript
    javascript/node/selenium-webdriver - prettier
WARNING: Download from https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.23-x86_64-apple-darwin.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Repository aspect_bazel_lib~~toolchains~coreutils_darwin_amd64 instantiated at:
  <builtin>: in <toplevel>
Repository rule coreutils_platform_repo defined at:
  /private/var/tmp/_bazel_alexpopov/0d0b789b125293cf47ad44fa1c4bc483/external/aspect_bazel_lib~/lib/private/coreutils_toolchain.bzl:197:42: in <toplevel>
ERROR: An error occurred during the fetch of repository 'aspect_bazel_lib~~toolchains~coreutils_darwin_amd64':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_alexpopov/0d0b789b125293cf47ad44fa1c4bc483/external/aspect_bazel_lib~/lib/private/coreutils_toolchain.bzl", line 183, column 30, in _coreutils_platform_repo_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.23-x86_64-apple-darwin.tar.gz] to /private/var/tmp/_bazel_alexpopov/0d0b789b125293cf47ad44fa1c4bc483/external/aspect_bazel_lib~~toolchains~coreutils_darwin_amd64/temp10049011723120948715/coreutils-0.0.23-x86_64-apple-darwin.tar.gz: GET returned 404 Not Found
ERROR: <builtin>: fetching coreutils_platform_repo rule //:aspect_bazel_lib~~toolchains~coreutils_darwin_amd64: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_alexpopov/0d0b789b125293cf47ad44fa1c4bc483/external/aspect_bazel_lib~/lib/private/coreutils_toolchain.bzl", line 183, column 30, in _coreutils_platform_repo_impl
                rctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.23-x86_64-apple-darwin.tar.gz] to /private/var/tmp/_bazel_alexpopov/0d0b789b125293cf47ad44fa1c4bc483/external/aspect_bazel_lib~~toolchains~coreutils_darwin_amd64/temp10049011723120948715/coreutils-0.0.23-x86_64-apple-darwin.tar.gz: GET returned 404 Not Found
ERROR: no such package '@@aspect_bazel_lib~~toolchains~coreutils_darwin_amd64//': java.io.IOException: Error downloading [https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.23-x86_64-apple-darwin.tar.gz] to /private/var/tmp/_bazel_alexpopov/0d0b789b125293cf47ad44fa1c4bc483/external/aspect_bazel_lib~~toolchains~coreutils_darwin_amd64/temp10049011723120948715/coreutils-0.0.23-x86_64-apple-darwin.tar.gz: GET returned 404 Not Found
ERROR: /Users/alexpopov/IdeaProjects/selenium/javascript/BUILD.bazel:5:29: //javascript:prettier depends on @@aspect_bazel_lib~~toolchains~coreutils_darwin_amd64//:coreutils_toolchain in repository @@aspect_bazel_lib~~toolchains~coreutils_darwin_amd64 which failed to fetch. no such package '@@aspect_bazel_lib~~toolchains~coreutils_darwin_amd64//': java.io.IOException: Error downloading [https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.23-x86_64-apple-darwin.tar.gz] to /private/var/tmp/_bazel_alexpopov/0d0b789b125293cf47ad44fa1c4bc483/external/aspect_bazel_lib~~toolchains~coreutils_darwin_amd64/temp10049011723120948715/coreutils-0.0.23-x86_64-apple-darwin.tar.gz: GET returned 404 Not Found
ERROR: Analysis of target '//javascript:prettier' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.707s, Critical Path: 0.10s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED: 
    Fetching repository @@aspect_bazel_lib~~toolchains~copy_directory_darwin_amd64; starting
    Fetching repository @@aspect_bazel_lib~~toolchains~bsd_tar_darwin_amd64; starting


### Operating System

macos sonoma 14.5

### Selenium version

Java 4.21

### What are the browser(s) and version(s) where you see this issue?

-

### What are the browser driver(s) and version(s) where you see this issue?

-

### Are you using Selenium Grid?

_No response_
github-actions[bot] commented 4 weeks ago

@iampopovich, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

titusfortner commented 4 weeks ago

I just merged 16d3905975fc0cbfaf723d9b68c945fc0cfe4f7a to require code that includes this PR https://github.com/aspect-build/bazel-lib/pull/853/ which is the temporary fix until coreutils gets a new release with all the right architectures