Thanks to visit codestin.com
Credit goes to github.com

Skip to content

getting error indicating that uname is not in path on WSL #2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
williamohara opened this issue Aug 22, 2024 · 1 comment · Fixed by #2406
Closed

getting error indicating that uname is not in path on WSL #2145

williamohara opened this issue Aug 22, 2024 · 1 comment · Fixed by #2406
Milestone

Comments

@williamohara
Copy link

Running Linux in WSL,
set up all Bazel dependencies
running bazel build command

hitting error

ERROR: An error occurred during the fetch of repository 'python3_12':
   Traceback (most recent call last):
        File "/home/williamohara/.cache/bazel/_bazel_williamohara/de29fde09bd221a16d787c59318532b3/external/rules_python/python/private/toolchains_repo.bzl", line 117, column 39, in _toolchain_aliases_impl
                (os_name, arch) = get_host_os_arch(rctx)
        File "/home/williamohara/.cache/bazel/_bazel_williamohara/de29fde09bd221a16d787c59318532b3/external/rules_python/python/private/toolchains_repo.bzl", line 419, column 50, in get_host_os_arch
                arguments = [repo_utils.which_checked(rctx, "uname"), "-m"],
        File "/home/williamohara/.cache/bazel/_bazel_williamohara/de29fde09bd221a16d787c59318532b3/external/rules_python/python/private/repo_utils.bzl", line 163, column 13, in _which_checked
                fail((
Error in fail: Unable to find the binary 'uname' on PATH.

it seems to be generated by this point in the toolchains_repo.bzl file
https://github.com/bazelbuild/rules_python/blob/5eff339f75ea663151b9df7e68c18c417ea91d62/python/private/toolchains_repo.bzl#L430

I have uname in my path - is there some dependency I am missing?

@aignas
Copy link
Collaborator

aignas commented Aug 23, 2024

It seems that python/private/toolchains_repo.bzl has _get_host_os_arch which could be updated to drop dependency on uname.

@aignas aignas added this to the v1.0.0 milestone Sep 3, 2024
github-merge-queue bot pushed a commit that referenced this issue Nov 18, 2024
…2406)

Before this PR we would shell out to `uname` on UNIX systems to get the
`arch`
of the toolchain - on Windows we would not need to do it because there
used to
be only a single Windows platform. With this change we can correctly
support
the resolution of the python interpreter on various platforms and I have
also
added an env variable to customize the selection, so that users can use
`musl`
or a `freethreaded` interpreter if they wish.

As part of this change, I have restricted visibility of the config
settings
used in the toolchain alias repo so that we are creating fewer targets.
This is
a very good time to do this before `1.0.0`.

Fixes #2145
Work towards #2276
Work towards #2386
Work towards #1211 to unblock #2402
Work towards #1361

---------

Co-authored-by: Richard Levasseur <[email protected]>
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 a pull request may close this issue.

2 participants