Replies: 39 comments 96 replies
-
I'm not sure it's enough to have a global setting for |
Beta Was this translation helpful? Give feedback.
-
Really exciting to read this @eed3si9n! I just wanted to show some strong support of the following:
I know for the Metals side of things as it pertains to this discussion about defaulting to sbt for BSP having sbt be non-blocking for Metals users would make this choice almost a no-brainer. So I personally think the impact of this change would be huge for us. Thanks for writing this all up! |
Beta Was this translation helpful? Give feedback.
-
I don't have concrete suggestions for how to achieve these as I don't know anything like enough about sbt's internals. But I can list a bunch of pain points that have cost me literally months of time working on sbt-based projects and writing a couple of plugins which I'd dearly love to see addressed.
Admittedly some of the above will be down to my shallow understanding of sbt. My counter argument would be I don't want to need a deep understanding of my build tool to do what should be relatively day-to-day changes in my build. |
Beta Was this translation helpful? Give feedback.
-
Please add built-in support of multi-release JAR to allow assembling of JARs that could be specialized for different Java versions. That will allow to continue Java 8 support and keep up improving using latest Java versions. |
Beta Was this translation helpful? Give feedback.
-
This is great. It'd also be great if the internal graph could be optimised to prevent quadratic duplication of settings. Heavy-reliance on project-matrix leads to enormous build graphs in my experience (easily reaching 100K+ settings) which makes the start-up time extremely slow. Not sure what'd be achievable in that regards though. |
Beta Was this translation helpful? Give feedback.
-
Would be awesome if the build could be cached/persisted as it is done in mill. In gigantic multi-project builds it can take a minute just to start sbt even though there were no changes to the build file. This would also solve the issue of injecting env variables into sbt since it would take just milliseconds to start. This currently doesn't work with sbtn. |
Beta Was this translation helpful? Give feedback.
-
It would be great to introduce an abstraction for plugins that is not tied to SBT. The goal would be to allow sharing most of the core logic of a plugin between build tools like SBT, Mill, Bleep and others, and having thin build-tool specific wrappers around this. I'm not sure what this abstraction would look like, maybe it is more a convention to put the core logic into ordinary methods inside Though this is not necessarily tied to SBT 2.0, the timing might be an opportunity window as every plugin author would have to touch the code anyway. |
Beta Was this translation helpful? Give feedback.
-
Discoverablity of giter8 templates would be really cool. |
Beta Was this translation helpful? Give feedback.
-
I have trust issues so it's common for me to run the command |
Beta Was this translation helpful? Give feedback.
-
Allow to discriminate between implementation dependencies and api dependencies like gradle (https://docs.gradle.org/current/userguide/declaring_dependencies.html). |
Beta Was this translation helpful? Give feedback.
-
These ideas look cool. I like them and looking forward to sbt 2.x. I have a very simple and stupid idea of my own. I wonder if it is worth to explore the change of project definition DSL from the current one, i.e. It seems to me that one of the reason sbt creates an impression of being more complicated than it is (I find sbt really simple), is that developers have to learn its DSL, which differs from conventional Scala. I think some DSL is unavoidable, indeed, but making it really minimal would be awesome. I.e. I remember the sigh of relief when sbt got rid of |
Beta Was this translation helpful? Give feedback.
-
I think changing "Compile" => "Main" would really help initial comprehension of Sbt. |
Beta Was this translation helpful? Give feedback.
-
So I mentioned this on the equivalent reddit thread (see https://www.reddit.com/r/scala/comments/11q3rm8/comment/jc1dym9/) but I do have a concern with My main concern with this change is that we seem to be throwing out the baby with the bathwater when it comes to scoping/encapsulation (the whole ethos of using a language like Scala is that we are meant to use abstractions to abstract away commonalities unlike in contrast to languages such as Go). While I understand the task scoping rules are currently confusing I would prefer if we fix that confusion (2.0.x is a breaking release after all so this is an option?) or we come up with something new thats not so confusing for end users. I also don't see how this would ultimately would be net benefit, such a change would create an parabolic explosion of sbt keys (whenever a sbt plugin auto has to create a new config they need to create a new set of keys) which I would actually argue for a lot of users would be even more confusing than what we have now. At least on the presumption that Scala users are familiar with the concept of abstraction, while we don't have to deal with task scoping we now have to deal with copying over settings. For trivial usecases, sure this can be simpler, but for more complex usecases I fail to see how such a change would be that much better. |
Beta Was this translation helpful? Give feedback.
-
Since we're in blue-sky 2.0 mode, I'll mention a wish list item raised in discord: I would like a richer language to denote the role of dependencies of a project, to distinguish between:
That option 2 is even a thing seems quite controversial. Myself, I find this concept very useful to make dependency graphs closer to minimum spanning trees, rather than hairy thickets full of repeated links. For example, in a large multi-module one can declare that a widely used library like Cats is exposed by a base module, and then the other modules just depend on base and get the Cat for free. Presently there's no way afaict to signal this distinction, so I rely on convention, ie docs or comments. But I would like a way in SBT's DSL to denote an exposed dependency. Although, I'm doubtful if it can be done in general without help from Ivy, which defines the artifact metadata format iiuc. I had a look over the Ivy docs and didn't find anything useful. |
Beta Was this translation helpful? Give feedback.
-
I’m not sure if it is a good idea to consider sbt 2.0 as an opportunity to break source-level compatibility. The Scala community, especially sbt plugin authors, have had a ton of experience in cross build, so breaking binary compatibility in sbt 2.0 might be acceptable and plugin authors could migrate their plugins to sbt 2.0 smoothly. However, breaking source-level compatibility could be a risky idea because it might lose many plugins. |
Beta Was this translation helpful? Give feedback.
-
One thing I don't think anyone mentioned is JSON support. For custom tasks, caches, and general dealings with JSON from plugins. May be I'm holding it wrong, but I believe the builtin sjson-new is not nearly as convenient as modern JSON libraries we have. With SBT 2 being Scala 3, it would be great to have JSON support with both low-level upickle-style API, and automatic derivation out of the box. An existing library can be used and shaded. |
Beta Was this translation helpful? Give feedback.
-
Is there an explanation for why it's worth all the effort to make a substantially new version with breaking changes? If basically everyone will find that there are no breaking changes, but SBT2 is more future-proof (e.g. uses Scala 3), great! But if it's going to require a bunch of manual work to upgrade, we should think seriously about whether SBT is the right core technology to build on. There's a big difference between "just works" and "works except in difficult corner cases" because when you're building someone else's project (including the someone-else of you-a-few-years-ago) of course you don't understand their difficult corner cases. The build is just broken. And there's also a big difference between "just works" and "just works with some easy tweaks" because who really wants to have to do easy tweaks instead of no tweaks? There are some basic decisions about what is core functionality and what is a plugin, how to organize files, what the syntax of the build file is, how to describe the build both as a static object and as a series of goals, and so on, that have made things considerably less straightforward than, in retrospect, they could have been. Putting in considerable effort that then asks everyone who uses SBT (i.e. most Scala developers) to also put in significant effort all in order to mostly perpetuate not-quite-ideal choices doesn't seem like an obvious clear win to me, even if there is actually no plausible technical route to a (basically) fully compatible SBT2. It might be a win, but I think it deserves a detailed argument as to why. Otherwise, I think a modernized but fully backward compatible SBT2 is an obvious clear win because it preserves people's existing work for as long as possible. (Edit: to clarify, the argument would cover things like "why not mill", "why not bazel", "why not something like cargo", "why not a new synthesis of the best ideas from the last 15 years", etc..) |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing your ideas and making a room for that discussion. Get rid of interactive modeI am a heavy terminal user, and sbt interactive mode was always problematic for me. Sbt reimplements couple of shell features, like reverse search or ctrl+w to delete word. But this doesn't scale. Shells are much powerful these days than that. Some concrete examples:
As far as I understand in the past there was a valid reason to have this interactive mode, but it doesn't have to be like that anymore. (Interactive mode can stay, but there has to be an alternative, non-interactive mode that has feature parity with the interactive one) Add lock fileWithout getting to much into the details, in my previous company we needed to package our scala application using nix. Nix is fully declarative and during the package build it cannot access internet. I know that there is I am aware of #2989, just bringing it up here. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, I don't know if it has been asked already, but an annoying limitation of sbt 1.x is that you can only publish to one repository. It'd be nice if sbt was supporting this natively. Why do you want to publish to more than one repo? |
Beta Was this translation helpful? Give feedback.
-
This is something that just came up and would only be feasible/possible in a epic update, but what are the thoughts in treating multi/cross Scala version compilation properly rather than how its currently done? By that I mean currently if you use The idea would be that you would treat |
Beta Was this translation helpful? Give feedback.
-
What can be helpful in sbt-2.0: Support forking on Compile state and passing JVM options there. |
Beta Was this translation helpful? Give feedback.
-
Does setting |
Beta Was this translation helpful? Give feedback.
-
How about getting rid of After dabbling/starting to maintain a few sbt community plugins, one pitfall that I see very commonly done is when someone writes a sbt plugin that introduces new So the idea is that instead of doing this trait MyPluginKeys {
lazy val myPluginSetting = settingKey[String]("Some description")
} You would instead do trait MyPluginKeys {
lazy val myPluginSetting = settingKey[String]("Some description", "")
} Where that argument is a zero like value for that type (in this case its the empty string trait Zero[T] {
val zero: T
} and then you can provide a list of default zero values, i.e. The premise here is basically to get rid of |
Beta Was this translation helpful? Give feedback.
-
IMHO for 2.0 it should be considered to drop the deprecated sbt/launch/src/main/input_resources/sbt/sbt.boot.properties Lines 13 to 19 in 2d974be |
Beta Was this translation helpful? Give feedback.
-
I was wondering if 2.0 can solve this nicely: val scala2Settings = Seq(...)
val scala3Settings = Seq(...)
val foo = project.settings(
if(scalaVersion.value.startsWith("2.")) scala2Settings else scala3Settings
) I understand it'd require making |
Beta Was this translation helpful? Give feedback.
-
What about mixing declarative configuration with sbt's DSL, taking some inspiration from Gradle (https://blog.gradle.org/declarative-gradle)? Imagine an This would make CI/CD easier, as well as IDE support (the Gradle link goes into some of the whys). |
Beta Was this translation helpful? Give feedback.
-
Ideas mentioned here are very good as are others mentioned in this discussion. However the following improvements would have disproportionately positive impact on Scala adoption and growth:
Scala as a platform and SBT as its default build tool is competing with other modern platforms of which many have excellent ergonomy and user experience. As the technology develops, perceptions of such good ergonomy are shifting from a welcome innovation to a necessary minimum standard everyone intuitively expects. |
Beta Was this translation helpful? Give feedback.
-
Perhaps the client should be the default in 2.0 ? (And the shell an opt-in with e.g. |
Beta Was this translation helpful? Give feedback.
-
Define SBT API / Better modularisation for SBT internalsHello! But we started wondering if all of those libraries are supposed to be visible to developers SBT 2.0 looks like a good moment to rethink the internal module structure and define default API entities |
Beta Was this translation helpful? Give feedback.
-
This thread was meant to be a feedback for https://eed3si9n.com/sbt-2.0-ideas post, but since then became a general sbt 2.x idea list. I'm going to lock this thread, but feel free to open new topic under https://github.com/sbt/sbt/discussions if anyone else wants to discuss ideas. |
Beta Was this translation helpful? Give feedback.
-
This is a discussion thread to get feedback on https://eed3si9n.com/sbt-2.0-ideas.
Please note that sbt is mostly community and Scala Center maintained. I don't work on sbt at work. We are also always happy to hear ideas and issues affecting the open source authors and newcomers, but if you use sbt at work and have issues, feel free to open a new Discussion topic, and please consider contributing the required features or fixes that your work will benefit.
Beta Was this translation helpful? Give feedback.
All reactions