Repository navigation
fix: make tests pass with --incompatible_windows_native_test_wrapper - #1034
Conversation
| # limitations under the License. | ||
|
|
||
| def is_windows(ctx): | ||
| return ctx.configuration.host_path_separator == ';' |
There was a problem hiding this comment.
This is an ugly hack, the reason is that we don't have a proper way to tell the target platform in Starlark rule implementation.
There is another way to distinguish the platform,
https://github.com/bazelbuild/bazel-skylib/blob/master/rules/diff_test.bzl#L143
Maybe it's a litter better.
|
After this change, only two tests are still failing with They need to be fixed from rules_webtesting. |
|
I think this is the wrong long-term fix because we shouldn't need bash at all to run a nodejs program on Windows. Could you add --incompatible_windows_native_test_wrapper to the .bazelrc in this change so it doesn't regress, and the green CI proves that the fix works? |
| These functions help making rules work on Windows. | ||
| """ | ||
|
|
||
| def is_windows(ctx): |
There was a problem hiding this comment.
there's already a couple other implementations of is_windows logic in https://github.com/bazelbuild/rules_nodejs/blob/master/internal/node/node_repositories.bzl
https://github.com/bazelbuild/rules_nodejs/blob/master/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl
what do you think about reducing this ?
There was a problem hiding this comment.
Thanks for the suggestion!
The implementation in node_repositories.bzl is for repository rule only (requires repository_ctx), the repository_ctx.os.name API is not available in rule context (ctx). So we cannot use that.
The implementation in copy_file_private.bzl looks more reasonable. But it requires us to add is_windows attribute to every rule that wants to distinguish platforms and a macro to provide default value for that attribute. But essentially, it will give us the same result. Considering we are not going to do cross-platform build between Windows and Unix systems in near future, I think the current way is fine.
Agree, I can think of two options to make the launcher bashless on Windows:
WDYT? |
1d6d113 to
e700da7
Compare
|
All tests passed on Windows with |
06547b0 to
c959f42
Compare
940e6c7 to
7db2f58
Compare
|
I'm still getting a runfile failure on Windows even after the latest commit. I turned on debug mode and the log is here: log @alexeagle Can you help debug a bit? Looks like it still tries to resolve from npm modules even after resolving from manifest succeeded. Note that |
e700da7 to
481c214
Compare
This lets us enable --incompatible_windows_native_test_wrapper
a75903d to
66fc165
Compare
60a184d to
d36e293
Compare
d36e293 to
e4a59f2
Compare
|
@alexeagle I finally got most of tests passing except Linux: log Can you help debug this? |
|
Inside e2e_karma_stack_trace, the targets //:karma_test_chromium-local and //:karma_test_firefox-local are expected to fail - the remaining targets assert things about those failures. They are marked I added a commit with |
|
Thanks for pointing that out! You fix didn't work because the second But I also tested Bazel, it should recognize |
2eccecc to
8523345
Compare
|
I did bazel query --output=build and the manual label does appear on the target. I don't understand it either. But it's green now, do you want to merge like this? |
It seems that Bazel doesn't filter manual-tagged targets when other tags are also present.
8523345 to
cfa3202
Compare
|
Nice, thanks for merging this! When can we have a new release? rules_typescript still needs to be fixed, I guess upgrading rules_nodejs should do it. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #947
What is the new behavior?
A .bat script will be generated to launch the shell script.
For example
Does this PR introduce a breaking change?
Other information