bazelbuild / setup-bazelisk

Set up your GitHub Actions workflow with a specific version of Bazelisk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows: Bazel Command does Nothing

Ragora opened this issue · comments

For some reason, just for Windows, the bazel command when setup through this repository does nothing (and thus falsely passing my current testing on a project). Maybe it's just an issue with how I'm using it, but I don't see what I can be doing wrong for it to fail on Windows only.

See the following run (note how the Ubuntu and MacOSX builds actually ran in the 'Build & Test all' stage - ignore MacOSX overall status as we only care that it actually ran): https://github.com/DraconicEnt/rules_third_party/actions/runs/807596092

However, if you view the Windows runs they don't appear to have attempted to do anything at all and simply returned a zero exit status.

You can see the workflow file here: https://github.com/DraconicEnt/rules_third_party/blob/develop/.github/workflows/main.yml#L38

Hello @Ragora,

This is a very interesting case, as it seems like bazel version does work and produce the correct output when run on windows (as you can see by the actions in this repository: https://github.com/bazelbuild/setup-bazelisk/runs/1857272505?check_suite_focus=true#step:4:9).

Two things that I'd like you to try to help us debug:

  1. Can you please enable debug logs for your runs (as documented here: https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging)
  2. Can you please add a bazel version stage (to eliminate any suspicion that bazel test is somehow different)

Thanks for the report, and for the help.

I have done both of these for this run here: https://github.com/DraconicEnt/rules_third_party/runs/2495105578

Waiting for the run to complete so we can obtain the full debug logs.

Reviewing the logs and it seems to be trying to run some powershell script that just returns (I think you can access the debugging logs?). Does anything stand out to you or any further debugging I should do?

EDIT:
It appears that the default shell for Windows is the problem, I tried specifying 'bash' directly and it's gotten further along the process: https://github.com/DraconicEnt/rules_third_party/runs/2495569436

@Ragora,

You beat me to it - was just going to write that I noticed that I only ever ran it with shell: bash on windows :)
Not sure why it's not working with pwsh, but I think it'll be easier to document rather than debug right now.

At this point it fails with:
ERROR: Skipping '/tests:test_all': not a valid absolute pattern (absolute target patterns must start with exactly two slashes): '/tests:test_all'
It seems like it's ignoring one of the slashes (it's /tests:test_all instead of //tests:test_all).
To solve it quickly, you can just remove the absolute path (do bazel test tests:test_all). It'll work because you're in the WORKSPACE dir when running the github action.

I do think we need to solve both of the above problems, but for now I think we have a workaround for you.

Yeah, it looks like it works fine with these changes applied.

@Ragora,

Thanks again for helping to debug this issue.
I've split it into two separate issues: #3 and #4, and closing this one.

I also updated the documentation with the workaround in this commit: 0047576