Hello everyone,
The Scala Center would like to announce its participation into the development of sbt until the next Advisory Board meeting, scheduled for the 30th May.
The news
In the previous weeks, we have been discussing a plan with the Tooling Team at Lightbend. We proposed several ways to collaborate with them on the future of sbt, provided in-depth feedback on the tool (as both power and normal users) and tried to understand the direction that sbt 1.0 is taking.
In these discussions, the sbt team promised to make public a 1.0 roadmap and release a beta version in the next weeks. As they accepted our help, we believe this is an excellent opportunity for the Scala Center to:
- Collect feedback from the community.
- Improve sbt 1.0: make it faster and easier to use.
- Ease migration from 0.13 to 1.0.
In this thread, we would like to focus on your feedback. In particular, we would like to listen to your ideas and suggestions to improve the build tool. How could we make sbt easier for your day-to-day job? What current interactions with the tool you would like to see optimized?
In order to guide the discussion, we provide a list with some ideas. We have tried to spot the most urgent pain points of the tool from our personal experience, and we highlight three major user-facing issues:
- Sub-par performance.
- Learning and using sbt is difficult.
- Lack of community involvement.
To address these deficiencies, we would like to contribute some of the following issues.
The list
- Get feedback from the community.
- Understand the most important user-facing problems of sbt.
- Act on the most important issues.
- Give the community an opportunity to drive our efforts into sbt.
- Keep in touch with the community via two-week status updates.
- Produce warning/error on potentially wrong sbt code. Examples:
- Use of value within an if expression of a sbt task.
- Orphan settings/tasks that miss a .value.
- Misuse of tasks by storing them in variables producing āillegal dynamic referenceā. Provide better error message too, if possible.
- Cyclic dependencies on tasks (not sure if possible).
- More changes focused on making sbt easier to use.
- Improve sub-par performance.
- Remove extra parsing that causes a runtime overhead.
- Make sbt compilation more efficient.
- Intern class loaders across different subprojects (also for compilers).
- Optimize initialization of sbt.
- Cache plugin class loaders to speed up reload times.
- Parallelize plugin class loading in two ways.
- Class load plugins in parallel (since they are in independent class loaders).
- Class load plugins while sbt compiles the build.
- Experiment: Disable setting parallel evaluation at startup and see its effect on the runtime performance of sbt.
- Introduce an sbt IR. This intermediate representation would:
- Reduce runtime dependency on Scala Reflect.
- Improve initialization of sbt by skipping class loading for already compiled builds.
- Add coursier-based resolver (119 votes, most voted ticket in sbt issue tracker history).
- Maintain sbt-migration-rewrites.
- Publish it and prepare it for consumption.
- Test it with real-world plugins.
- Add suport for future migrations added at the last minute.
- Improve Zinc API and stabilize it.
- Create high-level Java-friendly API. Potential use cases:
- Fetch and compile bridges all at once.
- Provide a simplified Zinc incremental compiler API.
- Create building blocks and simple APIs for build tools, like pants (Twitter), bazel (Stripe), CBT, et cetera.
- Implement protobuf-based serialization (which highly affects API design) to speed up compilation runs.
- Create high-level Java-friendly API. Potential use cases:
This list was signed off by the Tooling team at Lightbend.
Current status
We have already started to contribute some of these tasks, as well as bug reports and feature requests.
On the migration front, we have created sbt-migration-rewrites, an automatic tool based on Scalafix to rewrite 0.12.x and 0.13.x sbt code into sbt 1.0.x. These rewrites aim at helping sbt maintainers rewrite +95% of the code, but manual intervention may be required in some corner cases. More information in the README.
On the performance front, we have two work-in-progress pull requests:
- #2982: Add a parallel ivy artifact downloader.
- #3019: Speed up startup and reload times by 12 to 14%.
We still feel there is work to do and thatās why we reach out to you to help us focus on the key tasks. Getting to know your suggestions and pain points is crucial so that we can make the biggest impact from this initiative ā donāt be shy and comment.
Letās kickstart the discussion!