-
Notifications
You must be signed in to change notification settings - Fork 522
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
Initial toolchain support #827
Initial toolchain support #827
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
bb07f2a
to
d1e86d2
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
CI error seems unrelated:
|
We've been seeing this flake a lot in our CI internally recently. |
The only thing missing here now is docs as well as some specific tests. Not sure how to test the cross Compilation though. But the way one could build a docker image on mac (without native dependencies) is via: And for docs, should I just add something to the main readme? Or to the docs to |
b683803
to
ac12658
Compare
Added some docs now to the main README. I also had more of a look at starlark testing and I think we could utilise this (see https://docs.bazel.build/versions/master/skylark/testing.html#using-a-test-target) to also add some tests. But given the impact of this PR, I wonder if we could just try and merge this asap and then I can do a follow-up PR just for tests and maybe even adding a new doc for advanced use-cases like creating a custom toolchain etc. |
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.
Here's an idea for a simple way to test it:
build a docker_image (do we even have an example or an e2e that uses docker_nodejs_image?) and assert that the node binary contained in the image starts with the Linux binary header bytes (ELF64 or something?). Then we don't have to actually have a docker daemon on the machine where the test runs, but can still ensure that mac/win builds produce a docker image using the changes
another way to test it that's truer to what users do is to enable RBE for our Mac/Win builds on buildkite. this would fail without the change. Might need some help from @meteorcloudy if it gets hard to set this up
I'm fine with augmenting the docs in a separate change but I'd like to have at least a basic regression test in place given the pace of development in the repo |
We currently do not have any docker tests. I was thinking that as well but then we add a circular dependency on rules_docker as they already depend on rules_nodejs. I guess in theory it is fine as it is just a dev dependency. WDYT @alexeagle But yeah I will also have a look into the starlark tests and see if we can utilise those for these purposes. The other thing we could do is just get the sha from all the different node binaries and compare that in the test. |
Interesting, also seeing some toolchain references in the docs here: https://github.com/bazelbuild/bazel-skylib/blob/master/docs/unittest_doc.md like |
Turns out that is just toolchain setup for unittest itself and not to be used for unit testing. Having played around with it a bit, what it seems we could test via the unit testing is that with the different platform flags we are getting the nodejs binary from different external repositories. Would that be enough as a first round of tests? Then we can still see about doing a full e2e test scenario as a follow-up. Maybe it is also possible to hear from other rules maintainers how they test this functionality. |
When this will be merged to upstream? |
9f66784
to
053609a
Compare
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
@gregmagolan Currently Given all that my thinking was to really make this officially supported only in a follow-up PR. |
Seems CI is passing again - the building_karma_package step fails on a dependency download. |
Replaced by #898 |
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?
Nodejs is downloaded for each platform but does not support toolchains, so does e.g. also not support cross compilation or building of docker images on macOS.
Issue Number: First part of #396
What is the new behavior?
Switches out nodejs to be fetched using platform specific toolchains.
Does this PR introduce a breaking change?
Other information