Comments (11)
I wonder what Databricks did internally to support cross_scala_library
from this post. That looks exactly like what I was looking for, but based on this thread it doesn't look like this is supported here and I couldn't find any of their code in the open.
from rules_scala.
Wrote a blog post cross build anything with Bazel documenting the stateful cross building (aka switch at CI approach).
from rules_scala.
I think this is similar to #14
I agree we should work on it.
The ideal case is that we just point at different repositories and maybe some functions to get the particular version numbers out.
We can certainly factor common code to something like scala_common.bzl
and then call that from scala2_11.bzl
and scala2_12.bzl
etc...
I don't think it is too hard, I just have not taken a stab.
Probably scala2_10.bzl
might be the first to do since many still use scala 2.10 and there are many libraries published that we could check with.
from rules_scala.
this could be a useful approach: #84
from rules_scala.
Indeed. I think one of the other rules uses it (rust? Go?)
On יום ד׳, 10 באוג׳ 2016 at 23:35 P. Oscar Boykin [email protected]
wrote:
this could be a useful approach: #84
#84—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#80 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABUIF6Ypb3faPQFhyvpabhposk4aWA0bks5qejYZgaJpZM4JTZ4n
.
from rules_scala.
#84 doesn't let you cross build, right? It just gives you a way to globally change the version?
A couple more thoughts
- Cross-building (as opposed to just choosing one version) is very important.
a. Most popular Scala libraries choose cross-build against two or more versions of Scala, so that they can be more widely consumed.
b. Even if a project is not for pubic consumption, it can take some time to migrate a large codebase and dependencies to a new Scala version. I used SBT + https://github.com/lucidsoftware/sbt-cross to cross and and migrate incrementally during 2.10 -> 2.11, and it was very helpful. - The cross-built versions project can differ in more than just Scala version, e.g. some 2.11 projects need scala-xml, while in 2.10, this dependency was not separate.
- It would be nice to keep just the one worker process, and use classloaders to load the different Scala compilers.
from rules_scala.
I agree cross-building is somewhat interesting, but it is a very low priority for me personally. I'm happy to review PRs.
Bazel is generally used for private (logical) monorepos. There is no support for publishing, for instance. We could have multiple parallel builds, or we could say that the cross building solution is to have your CI bump the scala version you are using.
At Twitter, where we used the similar pants build system, there was no support for this, and in general keeping a large monorepo green with more than one version of scala, I think will be very challenging, not to mention tooling to support versioning the external jars correctly, something bazel does not understand (that scala has multiple parallel artifacts for each different release of scala).
from rules_scala.
see #251
from rules_scala.
Checking in if this is something that will be supported. Otherwise, in order for us to adopt Bazel, we'll have to get all of our services on the same Scala version (which isn't ideal).
from rules_scala.
I think this thread is still the state of the art. You can switch scala versions and so you can manage to have your CI set two different versions, but having a two versions in the same build is not yet supported.
It sounds like you want to build some parts of the code with only version A and others with one version B. Is that right?
A key challenge is this: we want to support interoperability with java (java can depend on scala). But we can’t add two versions of the scala library on the class path. So we need some way to error if that happens.
I don’t think we have found a design where multiple versions of scala in the same build in bazel works great.
from rules_scala.
SGTM, thanks for the tip on the CI switch
from rules_scala.
Related Issues (20)
- Upgrade CI tests to use Bazel 6 HOT 2
- rules_scala cause IJ plugin failures with Bazel@HEAD
- Support for specifying test classes and/or test cases when using junit tests HOT 4
- warning: [path] bad path element
- [Scala 2.13.12] Issue with scala.tools.nsc.reporters.Reporter when compiling
- FYI - Discussion for SIP-51: drop 2.13 library forwards binary compatibility
- rules_scala support for JDK 21 HOT 42
- Add add_opens and add_exports support HOT 1
- Scalafmt fails with Build without the bytes HOT 20
- Support Scala 3.3.1
- SemanticdbInfo.plugin_jar should be File not string HOT 2
- coverage creates the offline.jar into same directory for tests with different directories
- Bazel 7 - scala_proto_aspect rule must declare '@@bazel_tools//tools/jdk:toolchain_type' toolchain in order to use java_common HOT 1
- Can't run a bazel executable within bazel on Windows HOT 10
- javacopts order differs from java_library
- strict_deps_mode = error complains about dependencies that aren't referenced HOT 3
- use newer version of scalafmt
- How to set JVM version? rules_scala keeps insisting on using Java 11 HOT 1
- Unreadable test result HOT 2
- test_scala_proto_server test is flaky on MacOS CI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rules_scala.