Skip to content
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

patch_cmds_win doesn't recognize pwsh #23648

Closed
FantasqueX opened this issue Sep 18, 2024 · 1 comment
Closed

patch_cmds_win doesn't recognize pwsh #23648

FantasqueX opened this issue Sep 18, 2024 · 1 comment
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged

Comments

@FantasqueX
Copy link
Contributor

Description of the bug:

I'm using rules_boost

def boost_deps():
    maybe(
        http_archive,
        name = "boost",
        build_file = "@com_github_nelhage_rules_boost//:boost.BUILD",
        patch_cmds = ["rm -f doc/pdf/BUILD"],
        patch_cmds_win = ["Remove-Item -Force doc/pdf/BUILD"],
        patches = ["@com_github_nelhage_rules_boost//:zlib.patch"],
        patch_args = ["-p1"],
        url = "https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.gz",
        sha256 = "4d27e9efed0f6f152dc28db6430b9d3dfb40c0345da7342eaa5a987dde57bd95",
        strip_prefix = "boost-1.84.0",
    )

Code above throws error.

ERROR: An error occurred during the fetch of repository 'boost':                                                                                                                                                                         
   Traceback (most recent call last):                                                                                                                                                                                                    
        File "C:/users/fantasquex/_bazel_fantasquex/ihflwhwa/external/bazel_tools/tools/build_defs/repo/http.bzl", line 143, column 10, in _http_archive_impl                                                                            
                patch(ctx, auth = auth)
        File "C:/users/fantasquex/_bazel_fantasquex/ihflwhwa/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 187, column 21, in patch
                fail("Error applying patch command %s:\n%s%s" %
Error in fail: Error applying patch command Remove-Item -Force doc/pdf/BUILD:
java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("powershell.exe" /c "Remove-Item -Force doc/pdf/BUILD"): ???????????
 (error: 2)
ERROR: C:/users/fantasquex/documents/develop/source/aidi-sdk/WORKSPACE:68:11: fetching http_archive rule //external:boost: Traceback (most recent call last):                                                                            
        File "C:/users/fantasquex/_bazel_fantasquex/ihflwhwa/external/bazel_tools/tools/build_defs/repo/http.bzl", line 143, column 10, in _http_archive_impl                                                                            
                patch(ctx, auth = auth)                                                                                                                                                                                                  
        File "C:/users/fantasquex/_bazel_fantasquex/ihflwhwa/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 187, column 21, in patch
                fail("Error applying patch command %s:\n%s%s" %
Error in fail: Error applying patch command Remove-Item -Force doc/pdf/BUILD:
java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("powershell.exe" /c "Remove-Item -Force doc/pdf/BUILD"): ???????????
 (error: 2)

The only powershell on my system is PowerShell 7.4.5 which only adds pwsh.exe to PATH instead of powershell.exe. And powershell.exe is not found in my PATH.

Which category does this issue belong to?

Core

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

Windows 11 22631.4169

What is the output of bazel info release?

release 6.4.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added the team-Core Skyframe, bazel query, BEP, options parsing, bazelrc label Sep 18, 2024
@peakschris
Copy link

@FantasqueX how did you resolve this? I am seeing similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged
Projects
None yet
Development

No branches or pull requests

5 participants