-
Notifications
You must be signed in to change notification settings - Fork 278
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
Tracking issue- move from deps to toolchains #940
Comments
FYI, more than anything: We're looking at what it will take to be able to compile with multiple versions of scala in the same build. We only need to support different major versions, we don't see the need to support different minor versions. We need to be able to build the same (for some definition of "same") library/binary against different versions of scala and also different versions of dependencies. Doing something like external templating of We end up defining The macros handle all the muck around scala version suffixes and also clean up some of the junk that we, along with @johnynek, found annoying with
and use macro code to do the conversion to labels. We do find the pinning/version resolution in The last step for this effort is supporting multiple scala compiler/runtime versions in the same build. Working on that now ... though I'm only now getting familiar with toolchains so it's early. I'd like to do this part "right" but not sure I know enough to get it right (and for our use, we don't necessarily need this to be "right" as long as we don't have to make incompatible changes with |
I understand. |
Understood. Thanks for the comment: I haven't kept up with what the bazel folks have been working on. Helps to know that other folks are looking for the right pattern: makes it a bit easier to live with something a bit more hack-ish knowing there's a better solution coming up that we should be able to move to when it lands.
I looked at this but didn't find a solution ... but there are a lot of different ways to approach this so I'm not at all confident I considered the right alternatives. The blocker for us for multiple invocations has been using different versions of deps for different platforms. Since platform is not available until analysis, it appears we would have to go way deeper into rule implementation and I'm not sure I'm particularly competent there. The macro approach ( Not sure there's anything actionable at this point for others (but happy for input). If things go well, I'll put up an example of what we've done and see what others think/use as a place for folks to share thoughts. Maybe folks at that point can point me in a better direction and I can iterate from there. Definitely looking to collaborate with others that are facing the similar issues ... |
See also bazelbuild/bazel#7572 |
I actually made progress on this. I wasn't sure I was going to be able to but it's actually come out fairly well (at least enough that I can live with it.) Example: https://github.com/smparkes/multi-scala-example I'll put more comments in the PR. This is only a PR within my fork: if there's interest in pursuing it, I can switch the PR to here and we can chat there. |
@smparkes does this allow having multiple minor versions as well (e.g. using both 2.12.0 and 2.12.5 simultaneously)? |
I hadn't planned on that. It's not a need for us. It would be a moderately simple extension. It would require suffixing everything with the complete version,e.g., See #962. |
Hey, here are my ideas how to introduce toolchains for dependencies: #1067 |
Description:
We'd like to move from using the deps/repositories pattern and bind to toolchains.
A great deal of the work has been done in #399 #530 and finally in #544 but we only handled scala itself and left the other parts of the repo untouched. This means that using a different proto version or specs2 is still difficult.
Motivation:
For one bind is deprecated, it causes issues with labels (strict-deps/unused-deps) and also the configurability roadmap (which toolchains belongs to) specifies that one should be able to run bazel with more than one toolchain configured (so we will be able to have a single bazel build cross building scala versions for example).
Additional motivation surfaced in #769 where unclarity on which dependencies actually come from which features of rules_scala led to a user asking to split up the repo. If we had separate distinct toolchains this view would have been easier.
The text was updated successfully, but these errors were encountered: