Skip to content

Commit 0e55ced

Browse files
authored
Fixed glob includes for ignore_root_user_error (bazel-contrib#1037)
1 parent a47c6cd commit 0e55ced

File tree

7 files changed

+61
-0
lines changed

7 files changed

+61
-0
lines changed

.bazelci/presubmit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,3 +273,24 @@ tasks:
273273
name: pip_repository_entry_points integration tests on Windows
274274
working_directory: tests/pip_repository_entry_points
275275
platform: windows
276+
277+
integration_test_ignore_root_user_error_ubuntu:
278+
<<: *reusable_build_test_all
279+
name: ignore_root_user_error integration tests on Ubuntu
280+
working_directory: tests/ignore_root_user_error
281+
platform: ubuntu2004
282+
integration_test_ignore_root_user_error_debian:
283+
<<: *reusable_build_test_all
284+
name: ignore_root_user_error integration tests on Debian
285+
working_directory: tests/ignore_root_user_error
286+
platform: debian11
287+
integration_test_ignore_root_user_error_macos:
288+
<<: *reusable_build_test_all
289+
name: ignore_root_user_error integration tests on macOS
290+
working_directory: tests/ignore_root_user_error
291+
platform: macos
292+
integration_test_ignore_root_user_error_windows:
293+
<<: *reusable_build_test_all
294+
name: ignore_root_user_error integration tests on Windows
295+
working_directory: tests/ignore_root_user_error
296+
platform: windows

tests/ignore_root_user_error/.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
test --test_output=errors
2+
3+
# Windows requires these for multi-python support:
4+
build --enable_runfiles
5+
startup --windows_enable_symlinks
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bazel-*
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
load("@rules_python//python:defs.bzl", "py_test")
2+
3+
py_test(
4+
name = "foo_test",
5+
srcs = ["foo_test.py"],
6+
visibility = ["//visibility:public"],
7+
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ignore_root_user_errors
2+
There are cases when we have to run Python targets with root, e.g., in Docker containers, requiring setting `ignore_root_user_error = True` when registering Python toolchain. This test makes sure that rules_python works in this case.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
local_repository(
2+
name = "rules_python",
3+
path = "../..",
4+
)
5+
6+
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
7+
8+
python_register_toolchains(
9+
name = "python39",
10+
ignore_root_user_error = True,
11+
python_version = "3.9",
12+
)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2019 The Bazel Authors. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy