Skip to content

Getting Started instructions don't work #662

@jdob

Description

@jdob

🐞 bug report

Description

I tried following the instructions in the Getting Started guide in the README [1]. I copied in the first two snippets, with the rules import and the interpreter creation, but when I run the build, I get an error.

I'm guessing this is just slightly outdated based on new releases.

[1] https://github.com/bazelbuild/rules_python

🔬 Minimal Reproduction

Copy the first two snippets from the README (included below) and attempt a build.


rules_python_version = "740825b7f74930c62f44af95c9a4c1bd428d2c53" # Latest @ 2021-06-23

http_archive(
    name = "rules_python",
    sha256 = "3474c5815da4cb003ff22811a36a11894927eda1c2e64bf2dac63e914bfdf30f",
    strip_prefix = "rules_python-{}".format(rules_python_version),
    url = "https://github.com/bazelbuild/rules_python/archive/{}.zip".format(rules_python_version),
)

# -- Interpreter --

load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
    name = "python3_9",
    # Available versions are listed in @rules_python//python:versions.bzl.
    # We recommend using the same version your team is already standardized on.
    python_version = "3.9",
)

load("@python3_9//:defs.bzl", "interpreter")

🔥 Exception or Error


$ bazel run //service
INFO: Repository rules_python instantiated at:
  /Users/jdob/Code/bookstore/WORKSPACE:18:13: in 
Repository rule http_archive defined at:
  /private/var/tmp/_bazel_jdob/300f9ff46946083ee2e5c32c9a7995b7/external/bazel_tools/tools/build_defs/repo/http.bzl:364:31: in 
WARNING: Download from https://github.com/bazelbuild/rules_python/archive/740825b7f74930c62f44af95c9a4c1bd428d2c53.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was 09a3c4791c61b62c2cbc5b2cbea4ccc32487b38c7a2cc8f87a794d7a659cc742 but wanted 3474c5815da4cb003ff22811a36a11894927eda1c2e64bf2dac63e914bfdf30f
ERROR: An error occurred during the fetch of repository 'rules_python':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_jdob/300f9ff46946083ee2e5c32c9a7995b7/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_python/archive/740825b7f74930c62f44af95c9a4c1bd428d2c53.zip] to /private/var/tmp/_bazel_jdob/300f9ff46946083ee2e5c32c9a7995b7/external/rules_python/temp15994664139200499251/740825b7f74930c62f44af95c9a4c1bd428d2c53.zip: Checksum was 09a3c4791c61b62c2cbc5b2cbea4ccc32487b38c7a2cc8f87a794d7a659cc742 but wanted 3474c5815da4cb003ff22811a36a11894927eda1c2e64bf2dac63e914bfdf30f
ERROR: /Users/jdob/Code/bookstore/WORKSPACE:18:13: fetching http_archive rule //external:rules_python: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_jdob/300f9ff46946083ee2e5c32c9a7995b7/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
                download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_python/archive/740825b7f74930c62f44af95c9a4c1bd428d2c53.zip] to /private/var/tmp/_bazel_jdob/300f9ff46946083ee2e5c32c9a7995b7/external/rules_python/temp15994664139200499251/740825b7f74930c62f44af95c9a4c1bd428d2c53.zip: Checksum was 09a3c4791c61b62c2cbc5b2cbea4ccc32487b38c7a2cc8f87a794d7a659cc742 but wanted 3474c5815da4cb003ff22811a36a11894927eda1c2e64bf2dac63e914bfdf30f
ERROR: no such package '@rules_python//python': java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_python/archive/740825b7f74930c62f44af95c9a4c1bd428d2c53.zip] to /private/var/tmp/_bazel_jdob/300f9ff46946083ee2e5c32c9a7995b7/external/rules_python/temp15994664139200499251/740825b7f74930c62f44af95c9a4c1bd428d2c53.zip: Checksum was 09a3c4791c61b62c2cbc5b2cbea4ccc32487b38c7a2cc8f87a794d7a659cc742 but wanted 3474c5815da4cb003ff22811a36a11894927eda1c2e64bf2dac63e914bfdf30f
INFO: Elapsed time: 1.234s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

🌍 Your Environment

Operating System:

  
System Version:	macOS 12.2.1 (21D62)
Kernel Version:	Darwin 21.3.0
  

Output of bazel version:

  
Build label: 5.0.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Jan 19 14:15:55 2022 (1642601755)
Build timestamp: 1642601755
Build timestamp as int: 1642601755
  

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions