Skip to content

Commit 6cfa522

Browse files
authored
Merge branch 'main' into python-home-fix
2 parents 95ff01d + 2c7187d commit 6cfa522

17 files changed

+42
-25
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ END_UNRELEASED_TEMPLATE
7070
* (gazelle) Switched back to smacker/go-tree-sitter, fixing
7171
[#2630](https://github.com/bazel-contrib/rules_python/issues/2630)
7272
* (ci) We are now testing on Ubuntu 22.04 for RBE and non-RBE configurations.
73+
* (core) #!/usr/bin/env bash is now used as a shebang in the stage1 bootstrap template.
7374

7475
{#v0-0-0-fixed}
7576
### Fixed
@@ -84,10 +85,12 @@ END_UNRELEASED_TEMPLATE
8485
([#2503](https://github.com/bazel-contrib/rules_python/issues/2503)).
8586
* (toolchains) `local_runtime_repo` now checks if the include directory exists
8687
before attempting to watch it, fixing issues on macOS with system Python
87-
({gh-issue}`3043`).
88+
([#3043](https://github.com/bazel-contrib/rules_python/issues/3043)).
8889
* (pypi) The pipstar `defaults` configuration now supports any custom platform
8990
name.
9091
* Multi-line python imports (e.g. with escaped newlines) are now correctly processed by Gazelle.
92+
* (toolchains) `local_runtime_repo` works with multiarch Debian with Python 3.8
93+
([#3099](https://github.com/bazel-contrib/rules_python/issues/3099)).
9194

9295
{#v0-0-0-added}
9396
### Added

addlicense.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright 2023 The Bazel Authors. All rights reserved.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");

docs/readthedocs_build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -eou pipefail
44

docs/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ babel==2.17.0 \
1717
--hash=sha256:0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d \
1818
--hash=sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2
1919
# via sphinx
20-
certifi==2025.6.15 \
21-
--hash=sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057 \
22-
--hash=sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b
20+
certifi==2025.7.14 \
21+
--hash=sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2 \
22+
--hash=sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995
2323
# via requests
2424
charset-normalizer==3.4.2 \
2525
--hash=sha256:005fa3432484527f9732ebd315da8da8001593e2cf46a3d817669f062c3d9ed4 \

python/private/get_local_runtime_info.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@
3535
# of settings.
3636
# https://stackoverflow.com/questions/47423246/get-pythons-lib-path
3737
# For now, it seems LIBDIR has what is needed, so just use that.
38+
# See also: MULTIARCH
3839
"LIBDIR",
40+
# On Debian, with multiarch enabled, prior to Python 3.10, `LIBDIR` didn't
41+
# tell the location of the libs, just the base directory. The `MULTIARCH`
42+
# sysconfig variable tells the subdirectory within it with the libs.
43+
# See:
44+
# https://wiki.debian.org/Python/MultiArch
45+
# https://git.launchpad.net/ubuntu/+source/python3.12/tree/debian/changelog#n842
46+
"MULTIARCH",
3947
# The versioned libpythonX.Y.so.N file. Usually?
4048
# It might be a static archive (.a) file instead.
4149
"INSTSONAME",

python/private/interpreter_tmpl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# --- begin runfiles.bash initialization v3 ---
44
# Copy-pasted from the Bazel Bash runfiles library v3.

python/private/local_runtime_repo.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def _local_runtime_repo_impl(rctx):
126126
# In some cases, the same value is returned for multiple keys. Not clear why.
127127
shared_lib_names = {v: None for v in shared_lib_names}.keys()
128128
shared_lib_dir = info["LIBDIR"]
129+
multiarch = info["MULTIARCH"]
129130

130131
# The specific files are symlinked instead of the whole directory
131132
# because it can point to a directory that has more than just
@@ -135,6 +136,11 @@ def _local_runtime_repo_impl(rctx):
135136
for name in shared_lib_names:
136137
origin = rctx.path("{}/{}".format(shared_lib_dir, name))
137138

139+
# If the origin doesn't exist, try the multiarch location, in case
140+
# it's an older Python / Debian release.
141+
if not origin.exists and multiarch:
142+
origin = rctx.path("{}/{}/{}".format(shared_lib_dir, multiarch, name))
143+
138144
# The reported names don't always exist; it depends on the particulars
139145
# of the runtime installation.
140146
if origin.exists:

python/private/print_toolchain_checksums.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def print_toolchains_checksums(name):
2727

2828
template = """\
2929
cat > "$@" <<'EOF'
30-
#!/bin/bash
30+
#!/usr/bin/env bash
3131
set -euo pipefail
3232
3333
set -o errexit -o nounset -o pipefail

python/private/stage1_bootstrap_template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -e
44

python/uv/private/lock.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -euo pipefail
33

44
if [[ -n "${BUILD_WORKSPACE_DIRECTORY:-}" ]]; then

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