-
Notifications
You must be signed in to change notification settings - Fork 519
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
Fix node cross compile on Windows #916
Conversation
examples/nestjs/src/BUILD.bazel
Outdated
":app", | ||
], | ||
entry_point = ":main.ts", | ||
node_modules = "@npm//:node_modules", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest we should update rules_docker to not require this anymore so we just use fine-grained deps. Otherwise the image can really blow up in size. I will get a PR ready shortly for that. My workaround (and also from other users I have read) is to point this to an empty filegroup and just use fine-grained deps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -197,7 +197,7 @@ def _prepare_node(repository_ctx): | |||
""" | |||
|
|||
# TODO: Maybe we want to encode the OS as a specific attribute rather than do it based on naming? | |||
is_windows = is_windows_os(repository_ctx) or "_windows_" in repository_ctx.attr.name | |||
is_windows = "_windows_" in repository_ctx.attr.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so it was the issue we talked about, thanks @gregmagolan for the quick fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No prob. The trouble is getting coverage on Windows. buildkite fails on Windows when adding rules_docker because of some python issue 🙄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is much documentation on it, but I think for windows you might have to explicitely pass in the autodetecting_toolchain_nonstrict
- I could not find any documentation on it but just the comment here: https://github.com/bazelbuild/bazel/blob/00ec2e76e36ea540d8c26c5b9608cd38414b7d70/tools/python/pywrapper_template.txt#L87
Other than that rules_docker is just migrating everything away from python to go, but I think finishing that up is still a few weeks away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually finding there still is: bazelbuild/bazel#7844
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems the python toolchain for windows is still in a poor state and we would need to define a python toolchain manually as is done here: irengrig/bazel@10840c4#diff-c467ef71bdf4e156e40ab02be09dccd5R368
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh. Thanks for looking that up. #909 is reproducible without docker so simplified this PR to avoid the docker rules for now.
Fixes issue bazel-contrib#909: Toolchains support: Failed to build on Windows for Linux
buildkite failure observed without fix commit same as #909`:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love the test harness fixes
Fixes #909