Skip to content

Conversation

@cassiebeckley
Copy link
Contributor

Use the new Bazel module system. This should hopefully help fix the broken re2 import in SPIRV-Tools.

Use the new Bazel module system. This should hopefully help fix the
broken re2 import in SPIRV-Tools.
@cassiebeckley
Copy link
Contributor Author

@dneto0 for review

Copy link
Collaborator

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Nice, thank you!

@dneto0 dneto0 enabled auto-merge (rebase) April 19, 2024 19:15
Copy link
Collaborator

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Looks like kokoro/scripts/linux/build-docker.sh needs to request bazel-7.0.2 instead of 5

auto-merge was automatically disabled April 24, 2024 21:22

Head branch was pushed to by a user without write access

@cassiebeckley
Copy link
Contributor Author

@dneto0 I've updated the PR to use the correct Bazel version in Kokoro. I think the kokoro:run label might need to be added again.

Copy link
Collaborator

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Thanks, and thanks for your patienc.

@dneto0 dneto0 enabled auto-merge (rebase) April 25, 2024 06:54
@dneto0
Copy link
Collaborator

dneto0 commented Apr 25, 2024

Heh. a failure:

INFO: Repository rules_python~0.31.0~python~python_3_11_x86_64-unknown-linux-gnu instantiated at:
  : in 
Repository rule python_repository defined at:
  /root/.cache/bazel/_bazel_root/32ba09432cfff709a688fa7bb9a97efa/external/rules_python~0.31.0/python/repositories.bzl:402:36: in 
ERROR: An error occurred during the fetch of repository 'rules_python~0.31.0~python~python_3_11_x86_64-unknown-linux-gnu':
   Traceback (most recent call last):
	File "/root/.cache/bazel/_bazel_root/32ba09432cfff709a688fa7bb9a97efa/external/rules_python~0.31.0/python/repositories.bzl", line 205, column 25, in _python_repository_impl
		fail("The current user is root, please run as non-root when using the hermetic Python interpreter. See https://github.com/bazelbuild/rules_python/pull/713.")
Error in fail: The current user is root, please run as non-root when using the hermetic Python interpreter. See https://github.com/bazelbuild/rules_python/pull/713.

Looking at that PR, this seems like the useful advice:

bazel-contrib/rules_python#713 (comment)

Which exercises the ignore_root_user_error option introduced in this PR:
https://github.com/bazelbuild/rules_python//commit/e67e7dd719d34d5a13c15b24d0234c1ac753b52d

I started looking at the examples for rules_python. Starting from the docs at https://github.com/bazelbuild/rules_python/blob/main/BZLMOD_SUPPORT.md
and then looking at the first example here:
https://github.com/bazelbuild/rules_python/blob/main/examples/bzlmod/MODULE.bazel#L20
looks like the python.toolchain stanza is what would need the ignore_root_user_error clause.

dev_dependency = True,
)

bazel_dep(name = "re2", version = "2024-04-01")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like we need:

bazel_dep(name = "rules_python", version = "0.31.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    configure_coverage_tool = False,
    ignore_root_user_error = True,
    python_version = "3.11",
)

I think that's all the necessary pieces?

auto-merge was automatically disabled April 26, 2024 17:50

Head branch was pushed to by a user without write access

@dneto0 dneto0 merged commit aea1f4d into google:main Apr 30, 2024
@cassiebeckley cassiebeckley deleted the bzlmod branch April 30, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants