Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Windows: Bazel Command does Nothing #2

Closed
Ragora opened this issue May 3, 2021 · 6 comments
Closed

Windows: Bazel Command does Nothing #2

Ragora opened this issue May 3, 2021 · 6 comments

Comments

@Ragora
Copy link

Ragora commented May 3, 2021

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

@mishas
Copy link
Contributor

mishas commented May 3, 2021

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.

@Ragora
Copy link
Author

Ragora commented May 3, 2021

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.

@Ragora
Copy link
Author

Ragora commented May 3, 2021

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

@mishas
Copy link
Contributor

mishas commented May 3, 2021

@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.

@Ragora
Copy link
Author

Ragora commented May 3, 2021

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

@mishas
Copy link
Contributor

mishas commented May 3, 2021

@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

@mishas mishas closed this as completed May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants