Skip to content

Commit 0ce1ea5

Browse files
committed
Merge branch 'main' into uv-lock-rule-instead-of-genrule
2 parents 318a462 + bfc0314 commit 0ce1ea5

File tree

8 files changed

+193
-38
lines changed

8 files changed

+193
-38
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,21 @@ Unreleased changes template.
5757
`py3_runtime` field from the `target` configuration toolchain. This is for
5858
increased compatibility with the `RBE` setups where access to the `exec`
5959
configuration interpreter is needed.
60+
* (toolchains) Use the latest astrahl-sh toolchain release [20250317] for Python versions:
61+
* 3.9.21
62+
* 3.10.16
63+
* 3.11.11
64+
* 3.12.9
65+
* 3.13.2
66+
67+
[20250317]: https://github.com/astral-sh/python-build-standalone/releases/tag/20250317
6068

6169
{#v0-0-0-fixed}
6270
### Fixed
63-
* Nothing fixed.
71+
* (runfiles) ({obj}`--bootstrap_impl=script`) Follow symlinks when searching for runfiles.
72+
* Do not try to run `chmod` when downloading non-windows hermetic toolchain
73+
repositories on Windows. Fixes
74+
[#2660](https://github.com/bazel-contrib/rules_python/issues/2660).
6475

6576
{#v0-0-0-added}
6677
### Added
@@ -72,6 +83,8 @@ Unreleased changes template.
7283
it, there is no more automatic `test` target (but it can be added on the user
7384
side by using `native_test`). For customizing the `uv` version that is used,
7485
please check the {obj}`uv.configure` tag class.
86+
* Add support for riscv64 linux platform.
87+
* (toolchains) Add python 3.13.2 and 3.12.9 toolchains
7588

7689
{#v0-0-0-removed}
7790
### Removed

MODULE.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ dev_pip.parse(
131131
download_only = True,
132132
experimental_index_url = "https://pypi.org/simple",
133133
hub_name = "dev_pip",
134-
python_version = "3.13.0",
134+
python_version = "3.13",
135135
requirements_lock = "//docs:requirements.txt",
136136
)
137137
dev_pip.parse(
@@ -221,6 +221,13 @@ uv.default(
221221
],
222222
platform = "s390x-unknown-linux-gnu",
223223
)
224+
uv.default(
225+
compatible_with = [
226+
"@platforms//os:linux",
227+
"@platforms//cpu:riscv64",
228+
],
229+
platform = "riscv64-unknown-linux-gnu",
230+
)
224231
uv.default(
225232
compatible_with = [
226233
"@platforms//os:macos",

gazelle/deps.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def python_stdlib_list_deps():
2626
http_archive(
2727
name = "python_stdlib_list",
2828
build_file_content = """exports_files(glob(["stdlib_list/lists/*.txt"]))""",
29-
sha256 = "3f6fc8fba0a99ce8fa76c1b794a24f38962f6275ea9d5cfb43a874abe472571e",
30-
strip_prefix = "stdlib-list-0.10.0",
31-
url = "https://github.com/pypi/stdlib-list/releases/download/v0.10.0/v0.10.0.tar.gz",
29+
sha256 = "aa21a4f219530e85ecc364f0bbff2df4e6097a8954c63652af060f4e64afa65d",
30+
strip_prefix = "stdlib-list-0.11.0",
31+
url = "https://github.com/pypi/stdlib-list/releases/download/v0.11.0/v0.11.0.tar.gz",
3232
)
3333

3434
def gazelle_deps():

python/private/python_repository.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def _python_repository_impl(rctx):
127127
# pycs being generated at runtime:
128128
# * The pycs are not deterministic (they contain timestamps)
129129
# * Multiple processes trying to write the same pycs can result in errors.
130-
if "windows" not in platform:
130+
#
131+
# Note, when on Windows the `chmod` may not work
132+
if "windows" not in platform and "windows" != repo_utils.get_platforms_os_name(rctx):
131133
repo_utils.execute_checked(
132134
rctx,
133135
op = "python_repository.MakeReadOnly",

python/private/stage1_bootstrap_template.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ else
8181
if [[ ! -L "$stub_filename" ]]; then
8282
break
8383
fi
84-
target=$(realpath $maybe_runfiles_root)
85-
stub_filename="$target"
84+
stub_filename=$(readlink $stub_filename)
8685
done
8786
echo >&2 "Unable to find runfiles directory for $1"
8887
exit 1

python/versions.bzl

Lines changed: 90 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,17 @@ TOOL_VERSIONS = {
253253
"strip_prefix": "python",
254254
},
255255
"3.9.21": {
256-
"url": "20241206/cpython-{python_version}+20241206-{platform}-{build}.tar.gz",
256+
"url": "20250317/cpython-{python_version}+20250317-{platform}-{build}.tar.gz",
257257
"sha256": {
258-
"aarch64-apple-darwin": "4bddc18228789d0316dcebc45b2242e0010fa6bc33c302b6b5a62a5ac39d2147",
259-
"aarch64-unknown-linux-gnu": "7d3b4ab90f73fa9dab0c350ca64b1caa9b8e4655913acd098e594473c49921c8",
260-
"ppc64le-unknown-linux-gnu": "966477345ca93f056cf18de9cff961aacda2318a8e641546e0fd7222f1362ee2",
261-
"s390x-unknown-linux-gnu": "3ba05a408edce4e20ebd116643c8418e62f7c8066c8a35fe8d3b78371d90b46a",
262-
"x86_64-apple-darwin": "619f5082288c771ad9b71e2daaf6df6bd39ca86e442638d150a71a6ccf62978d",
263-
"x86_64-pc-windows-msvc": "82736b5a185c57b296188ce778ed865ff10edc5fe9ff1ec4cb33b39ac8e4819c",
264-
"x86_64-unknown-linux-gnu": "208b2adc7c7e5d5df6d9385400dc7c4e3b4c3eed428e19a2326848978e98517e",
265-
"x86_64-unknown-linux-musl": "67c058dbaae8fd8c4f68e13b10805a9227918afc94326f21a9a2ec2daca3ddbd",
258+
"aarch64-apple-darwin": "2a7d83db10c082ce59e9c4b8bd6c5790310198fb759a7c94aceebac1d93676d3",
259+
"aarch64-unknown-linux-gnu": "758ebbc4d60b3ca26cf21720232043ad626373fbeb6632122e5db622a1f55465",
260+
"ppc64le-unknown-linux-gnu": "3c7c0cc16468659049ac2f843ffba29144dd987869c943b83c2730569b7f57bd",
261+
"riscv64-unknown-linux-gnu": "ef1463ad5349419309060854a5f942b0bd7bd0b9245b53980129836187e68ad9",
262+
"s390x-unknown-linux-gnu": "e66e52dcbe3e20153e7d5844451bf58a69f41b858348e0f59c547444bfe191ee",
263+
"x86_64-apple-darwin": "786ebd91e4dd0920acf60aa3428a627a937342d2455f7eb5e9a491517c32db3d",
264+
"x86_64-pc-windows-msvc": "5392cee2ef7cd20b34128384d0b31864fb3c02bdb7a8ae6995cfec621bb657bc",
265+
"x86_64-unknown-linux-gnu": "6f426b5494e90701ffa2753e229252e8b3ac61151a09c8cd6c0a649512df8ab2",
266+
"x86_64-unknown-linux-musl": "6113c6c5f88d295bb26279b8a49d74126ee12db137854e0d8c3077051a4eddc4",
266267
},
267268
"strip_prefix": "python",
268269
},
@@ -387,16 +388,17 @@ TOOL_VERSIONS = {
387388
"strip_prefix": "python",
388389
},
389390
"3.10.16": {
390-
"url": "20241206/cpython-{python_version}+20241206-{platform}-{build}.tar.gz",
391+
"url": "20250317/cpython-{python_version}+20250317-{platform}-{build}.tar.gz",
391392
"sha256": {
392-
"aarch64-apple-darwin": "c2d25840756127f3583b04b0697bef79edacb15f1402cd980292c93488c3df22",
393-
"aarch64-unknown-linux-gnu": "bbfc345615c5ed33916b4fd959fc16fa2e896a3c5eec1fb782c91b47c85c0542",
394-
"ppc64le-unknown-linux-gnu": "cb474b392733d5ac2adaa1cfcc2b63b957611dc26697e76822706cc61ac21515",
395-
"s390x-unknown-linux-gnu": "886a7effc8a3061d53cacc9cf54e82d6d57ac3665c258c6a2193528c16b557cd",
396-
"x86_64-apple-darwin": "31a110b631eb79103675ed556255045deeea5ff533296d7f35b4d195a0df0315",
397-
"x86_64-pc-windows-msvc": "fb7870717dc7e3aedcbab4a647782637da0046a4238db1d41eeaabb78566d814",
398-
"x86_64-unknown-linux-gnu": "b15de0d63eed9871ed57285f81fd123cf6c4117251a9cac8f81f9cf0cccc0a53",
399-
"x86_64-unknown-linux-musl": "bf956eeffcff002d2f38232faa750c279cbb76197b744761d1b253bf94d6f637",
393+
"aarch64-apple-darwin": "e99f8457d9c79592c036489c5cfa78df76e4762d170665e499833e045d82608f",
394+
"aarch64-unknown-linux-gnu": "76d0f04d2444e77200fdc70d1c57480e29cca78cb7420d713bc1c523709c198d",
395+
"ppc64le-unknown-linux-gnu": "39c9b3486de984fe1d72d90278229c70d6b08bcf69cd55796881b2d75077b603",
396+
"riscv64-unknown-linux-gnu": "ebe949ada9293581c17d9bcdaa8f645f67d95f73eac65def760a71ef9dd6600d",
397+
"s390x-unknown-linux-gnu": "9b2fc0b7f1c75b48e799b6fa14f7e24f5c61f2db82e3c65d13ed25e08f7f0857",
398+
"x86_64-apple-darwin": "e03e62dbe95afa2f56b7344ff3bd061b180a0b690ff77f9a1d7e6601935e05ca",
399+
"x86_64-pc-windows-msvc": "c7e0eb0ff5b36758b7a8cacd42eb223c056b9c4d36eded9bf5b9fe0c0b9aeb08",
400+
"x86_64-unknown-linux-gnu": "b350c7e63956ca8edb856b91316328e0fd003a840cbd63d08253af43b2c63643",
401+
"x86_64-unknown-linux-musl": "6ed64923ee4fbea4c5780f1a5a66651d239191ac10bd23420db4f5e4e0bf79c4",
400402
},
401403
"strip_prefix": "python",
402404
},
@@ -516,16 +518,17 @@ TOOL_VERSIONS = {
516518
"strip_prefix": "python",
517519
},
518520
"3.11.11": {
519-
"url": "20241206/cpython-{python_version}+20241206-{platform}-{build}.tar.gz",
521+
"url": "20250317/cpython-{python_version}+20250317-{platform}-{build}.tar.gz",
520522
"sha256": {
521-
"aarch64-apple-darwin": "566c5e266f2c933d0c0b213a75496bc6a090e493097802f809dbe21c75cd5d13",
522-
"aarch64-unknown-linux-gnu": "50ee364cfa24ee7d933eda955c9fe455bc0a8ebb9d998c9948f2909dac701dd9",
523-
"ppc64le-unknown-linux-gnu": "e0cdc00e42a05191b9b75ba976fc0fca9205c66fdaef7571c20532346fd3db1e",
524-
"s390x-unknown-linux-gnu": "3b106b8a3c5aa97ff76200cd0d9ba6eaed23d88ccb947e00ff6bb2d9f5422d2a",
525-
"x86_64-apple-darwin": "8ecd267281fb5b2464ddcd2de79622cfa7aff42e929b17989da2721ba39d4a5e",
526-
"x86_64-pc-windows-msvc": "d8986f026599074ddd206f3f62d6f2c323ca8fa7a854bf744989bfc0b12f5d0d",
527-
"x86_64-unknown-linux-gnu": "57a171af687c926c5cabe3d1c7ce9950b98f00b932accd596eb60e14ca39c42d",
528-
"x86_64-unknown-linux-musl": "8129a9a5c3f2654e1a9eed6093f5dc42399667b341050ff03219cb7df210c348",
523+
"aarch64-apple-darwin": "19b147c7e4b742656da4cb6ba35bc3ea2f15aa5f4d1bbbc38d09e2e85551e927",
524+
"aarch64-unknown-linux-gnu": "7d52b5206afe617de2899af477f5a1d275ecbce80fb8300301b254ebf1da5a90",
525+
"ppc64le-unknown-linux-gnu": "17c049f70ce719adc89dd0ae26f4e6a28f6aaedc63c2efef6bbb9c112ea4d692",
526+
"riscv64-unknown-linux-gnu": "83ed50713409576756f5708e8f0549a15c17071bea22b71f15e11a7084f09481",
527+
"s390x-unknown-linux-gnu": "298507f1f8d962b1bb98cb506c99e7e0d291a63eb9117e1521141e6b3825fd56",
528+
"x86_64-apple-darwin": "a870cd965e7dded5100d13b1d34cab1c32a92811e000d10fbfe9bbdb36cdaa0e",
529+
"x86_64-pc-windows-msvc": "1cf5760eea0a9df3308ca2c4111b5cc18fd638b2a912dbe07606193e3f9aa123",
530+
"x86_64-unknown-linux-gnu": "51e47bc0d1b9f4bf68dd395f7a39f60c58a87cde854cab47264a859eb666bb69",
531+
"x86_64-unknown-linux-musl": "ee4d84f992c6a1df42096e26b970fe5938fd6c1eadd245894bc94c5737ff9977",
529532
},
530533
"strip_prefix": "python",
531534
},
@@ -622,6 +625,21 @@ TOOL_VERSIONS = {
622625
},
623626
"strip_prefix": "python",
624627
},
628+
"3.12.9": {
629+
"url": "20250317/cpython-{python_version}+20250317-{platform}-{build}.tar.gz",
630+
"sha256": {
631+
"aarch64-apple-darwin": "7c7fd9809da0382a601a79287b5d62d61ce0b15f5a5ee836233727a516e85381",
632+
"aarch64-unknown-linux-gnu": "00c6bf9acef21ac741fea24dc449d0149834d30e9113429e50a95cce4b00bb80",
633+
"ppc64le-unknown-linux-gnu": "25d77599dfd5849f17391d92da0da99079e4e94f19a881f763f5cc62530ef7e1",
634+
"riscv64-unknown-linux-gnu": "e97ab0fdf443b302c56a52b4fd08f513bf3be66aa47263f0f9df3c6e60e05f2e",
635+
"s390x-unknown-linux-gnu": "7492d079ffa8425c8f6c58e43b237c37e3fb7b31e2e14635927bb4d3397ba21e",
636+
"x86_64-apple-darwin": "1ee1b1bb9fbce5c145c4bec9a3c98d7a4fa22543e09a7c1d932bc8599283c2dc",
637+
"x86_64-pc-windows-msvc": "d15361fd202dd74ae9c3eece1abdab7655f1eba90bf6255cad1d7c53d463ed4d",
638+
"x86_64-unknown-linux-gnu": "ef382fb88cbb41a3b0801690bd716b8a1aec07a6c6471010bcc6bd14cd575226",
639+
"x86_64-unknown-linux-musl": "94e3837da1adf9964aab2d6047b33f70167de3096d1f9a2d1fa9340b1bbf537d",
640+
},
641+
"strip_prefix": "python",
642+
},
625643
"3.13.0": {
626644
"url": "20241016/cpython-{python_version}+20241016-{platform}-{build}.{ext}",
627645
"sha256": {
@@ -696,6 +714,47 @@ TOOL_VERSIONS = {
696714
"x86_64-unknown-linux-gnu-freethreaded": "python/install",
697715
},
698716
},
717+
"3.13.2": {
718+
"url": "20250317/cpython-{python_version}+20250317-{platform}-{build}.{ext}",
719+
"sha256": {
720+
"aarch64-apple-darwin": "faa44274a331eb39786362818b21b3a4e74514e8805000b20b0e55c590cecb94",
721+
"aarch64-unknown-linux-gnu": "9c67260446fee6ea706dad577a0b32936c63f449c25d66e4383d5846b2ab2e36",
722+
"ppc64le-unknown-linux-gnu": "345b53d2f86c9dbd7f1320657cb227ff9a42ef63ff21f129abbbc8c82a375147",
723+
"riscv64-unknown-linux-gnu": "172d22b2330737f3a028ea538ffe497c39a066a8d3200b22dd4d177a3332ad85",
724+
"s390x-unknown-linux-gnu": "ec3b16ea8a97e3138acec72bc5ff35949950c62c8994a8ec8e213fd93f0e806b",
725+
"x86_64-apple-darwin": "ee4526e84b5ce5b11141c50060b385320f2773616249a741f90c96d460ce8e8f",
726+
"x86_64-pc-windows-msvc": "84d7b52f3558c8e35c670a4fa14080c75e3ec584adfae49fec8b51008b75b21e",
727+
"x86_64-unknown-linux-gnu": "db011f0cd29cab2291584958f4e2eb001b0e6051848d89b38a2dc23c5c54e512",
728+
"x86_64-unknown-linux-musl": "00bb2d629f7eacbb5c6b44dc04af26d1f1da64cee3425b0d8eb5135a93830296",
729+
"aarch64-apple-darwin-freethreaded": "c98c9c977e6fa05c3813bd49f3553904d89d60fed27e2e36468da7afa1d6d5e2",
730+
"aarch64-unknown-linux-gnu-freethreaded": "b8635e59e3143fd17f19a3dfe8ccc246ee6587c87da359bd1bcab35eefbb5f19",
731+
"ppc64le-unknown-linux-gnu-freethreaded": "6ae8fa44cb2edf4ab49cff1820b53c40c10349c0f39e11b8cd76ce7f3e7e1def",
732+
"riscv64-unknown-linux-gnu-freethreaded": "2af1b8850c52801fb6189e7a17a51e0c93d9e46ddefcca72247b76329c97d02a",
733+
"s390x-unknown-linux-gnu-freethreaded": "c074144cc80c2af32c420b79a9df26e8db405212619990c1fbdd308bd75afe3f",
734+
"x86_64-apple-darwin-freethreaded": "0d73e4348d8d4b5159058609d2303705190405b485dd09ad05d870d7e0f36e0f",
735+
"x86_64-pc-windows-msvc-freethreaded": "c51b4845fda5421e044067c111192f645234081d704313f74ee77fa013a186ea",
736+
"x86_64-unknown-linux-gnu-freethreaded": "1aea5062614c036904b55c1cc2fb4b500b7f6f7a4cacc263f4888889d355eef8",
737+
},
738+
"strip_prefix": {
739+
"aarch64-apple-darwin": "python",
740+
"aarch64-unknown-linux-gnu": "python",
741+
"ppc64le-unknown-linux-gnu": "python",
742+
"s390x-unknown-linux-gnu": "python",
743+
"riscv64-unknown-linux-gnu": "python",
744+
"x86_64-apple-darwin": "python",
745+
"x86_64-pc-windows-msvc": "python",
746+
"x86_64-unknown-linux-gnu": "python",
747+
"x86_64-unknown-linux-musl": "python",
748+
"aarch64-apple-darwin-freethreaded": "python/install",
749+
"aarch64-unknown-linux-gnu-freethreaded": "python/install",
750+
"ppc64le-unknown-linux-gnu-freethreaded": "python/install",
751+
"riscv64-unknown-linux-gnu-freethreaded": "python/install",
752+
"s390x-unknown-linux-gnu-freethreaded": "python/install",
753+
"x86_64-apple-darwin-freethreaded": "python/install",
754+
"x86_64-pc-windows-msvc-freethreaded": "python/install",
755+
"x86_64-unknown-linux-gnu-freethreaded": "python/install",
756+
},
757+
},
699758
}
700759

701760
# buildifier: disable=unsorted-dict-items
@@ -704,8 +763,8 @@ MINOR_MAPPING = {
704763
"3.9": "3.9.21",
705764
"3.10": "3.10.16",
706765
"3.11": "3.11.11",
707-
"3.12": "3.12.8",
708-
"3.13": "3.13.1",
766+
"3.12": "3.12.9",
767+
"3.13": "3.13.2",
709768
}
710769

711770
def _generate_platforms():
@@ -895,6 +954,7 @@ def get_release_info(platform, python_version, base_url = DEFAULT_RELEASE_BASE_U
895954
"aarch64-apple-darwin": "pgo+lto",
896955
"aarch64-unknown-linux-gnu": "lto",
897956
"ppc64le-unknown-linux-gnu": "lto",
957+
"riscv64-unknown-linux-gnu": "lto",
898958
"s390x-unknown-linux-gnu": "lto",
899959
"x86_64-apple-darwin": "pgo+lto",
900960
"x86_64-pc-windows-msvc": "pgo",
@@ -904,7 +964,7 @@ def get_release_info(platform, python_version, base_url = DEFAULT_RELEASE_BASE_U
904964
else:
905965
build = INSTALL_ONLY
906966

907-
if WINDOWS_NAME in platform:
967+
if WINDOWS_NAME in platform and int(u.split("/")[0]) < 20250317:
908968
build = "shared-" + build
909969

910970
release_filename = u.format(

tests/bootstrap_impls/BUILD.bazel

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ sh_py_run_test(
7070
venvs_use_declare_symlink = "no",
7171
)
7272

73+
sh_py_run_test(
74+
name = "run_binary_find_runfiles_test",
75+
py_src = "bin.py",
76+
sh_src = "run_binary_find_runfiles_test.sh",
77+
target_compatible_with = SUPPORTS_BOOTSTRAP_SCRIPT,
78+
)
79+
7380
sh_py_run_test(
7481
name = "run_binary_bootstrap_script_zip_yes_test",
7582
bootstrap_impl = "script",
@@ -88,6 +95,14 @@ sh_py_run_test(
8895
target_compatible_with = SUPPORTS_BOOTSTRAP_SCRIPT,
8996
)
9097

98+
sh_py_run_test(
99+
name = "run_binary_bootstrap_script_find_runfiles_test",
100+
bootstrap_impl = "script",
101+
py_src = "bin.py",
102+
sh_src = "run_binary_find_runfiles_test.sh",
103+
target_compatible_with = SUPPORTS_BOOTSTRAP_SCRIPT,
104+
)
105+
91106
py_reconfig_test(
92107
name = "sys_path_order_bootstrap_script_test",
93108
srcs = ["sys_path_order_test.py"],
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright 2023 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.
14+
15+
# --- begin runfiles.bash initialization v3 ---
16+
# Copy-pasted from the Bazel Bash runfiles library v3.
17+
set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash
18+
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
19+
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
20+
source "$0.runfiles/$f" 2>/dev/null || \
21+
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
22+
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
23+
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
24+
# --- end runfiles.bash initialization v3 ---
25+
set +e
26+
27+
bin=$(rlocation $BIN_RLOCATION)
28+
if [[ -z "$bin" ]]; then
29+
echo "Unable to locate test binary: $BIN_RLOCATION"
30+
exit 1
31+
fi
32+
33+
bin_link_layer_1=$TEST_TMPDIR/link1
34+
ln -s "$bin" "$bin_link_layer_1"
35+
bin_link_layer_2=$TEST_TMPDIR/link2
36+
ln -s "$bin_link_layer_1" "$bin_link_layer_2"
37+
38+
result=$(RUNFILES_DIR='' RUNFILES_MANIFEST_FILE='' $bin)
39+
result_link_layer_1=$(RUNFILES_DIR='' RUNFILES_MANIFEST_FILE='' $bin_link_layer_1)
40+
result_link_layer_2=$(RUNFILES_DIR='' RUNFILES_MANIFEST_FILE='' $bin_link_layer_2)
41+
42+
if [[ "$result" != "$result_link_layer_1" ]]; then
43+
echo "Output from test does not match output when invoked via a link;"
44+
echo "Output from test:"
45+
echo "$result"
46+
echo "Output when invoked via a link:"
47+
echo "$result_link_layer_1"
48+
exit 1
49+
fi
50+
if [[ "$result" != "$result_link_layer_2" ]]; then
51+
echo "Output from test does not match output when invoked via a link to a link;"
52+
echo "Output from test:"
53+
echo "$result"
54+
echo "Output when invoked via a link to a link:"
55+
echo "$result_link_layer_2"
56+
exit 1
57+
fi
58+
59+
exit 0

0 commit comments

Comments
 (0)