Road to sbt 1.0: Paved with server (2015 Amsterdam)

Eugene Yokota
Eugene YokotaSoftware Engineer at Lightbend
Road to sbt 1.0: Paved with server (2015 Amsterdam)
The road to sbt 1.0: Paved with
server
Josh Suereth (@jsuereth)
Eugene Yokota (@eed3si9n)
Reactive Platform team
Agenda
● A brief (incomplete and mostly wrong) history of Build Tools
● A roadmap to sbt 1.0
o Modularization
● sbt-server
A brief history of build tools
Incomplete and mostly wrong
#!/bin/sh
$ make -j 2 hello
# Makefile
OBJ = test.o test2.o
%.o : %.c
$(CC) -c -o $@ < $<
hello : $(OBJ)
gcc -o $@ $^
Make (1976)
● new! Dependency-based programming
● Uses system command to carry out tasks
● problem! Machine-dependent
Q: How do I build this program?
Autoconf/Automake (1991/1996)
● Generate configure script and Makefile templates
o Configure generates header scripts and real makefile
o Configure discovers what the machine has
● Use an even MORE arcane syntax
o m4 macros
o magic strings
Q: How do I build on this machine?
Internet
$ ant dist
<project name="MyProject" default="dist" basedir=".">
<description>example build file</description>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<target name="compile" description="compile the source " >
<javac srcdir="${src}" destdir="${build}"/>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<mkdir dir="${dist}/lib"/>
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar"
basedir="${build}"/>
</target>
</project>
Ant (2000)
Q: How do I build on this machine?
● new! Built-in tasks like mkdir, javac, and jar
o Self-contained and platform-independent
● task plugins (like ant-contrib)
● problem! Hard to reuse build logic
Package managers
Q: How do I find library source/binary?
● new! Metadata to track library dependencies
● new! Repository to host source and binary
● CTAN (1993), Port (1994), RPM (1997), APT (1998)
Maven (2004)
Q: How do I find library source/binary?
Q: How do I enforce consistent builds?
● Metadata to track library dependencies
● Repository to host source and binary
● new! Default build (Convention over Configuration)
● new! Plugins that allowed reuse of build logic
● problem! Difficult to customize
Ivy (2004)
Q: How do I find library source/binary?
● Metadata to track library dependencies
● Repository to host source and binary
● Maven integration on top of Ant
Rake (2003)
rule '.o' => ['.c'] do |t|
sh "cc #{t.source} -c -o #{t.name}"
end
task :name, [:first_name, :last_name] do |t, args|
puts "First name is #{args.first_name}"
puts "Last name is #{args.last_name}"
end
Rake (2004)
Q: How do I build on this machine?
Q: How do I customize my build?
● new! Internal DSL
o Leverage Ruby libraries rather than shell programs
o Provide cross-platform ruby libraries for supported language tools
● Real programming language to write tasks
O NOES XML!
SAX parsing is declared uncool
(immediately after inception)
REST/JSON attempt to displace SOAP
Buildr (2008)/Gradle (2009)/ Leningen(2009)
● Maven integration
Q: How do I find library source/binary?
Q: How do I customize my build?
● Use an internal DSL and a real program language
sbt (2008)
Q: How do I find library source/binary?
Q: How do I customize my build?
Q: How can I develop faster?
● new! Incremental compiler tracking source deps
● new! Interactive shell + library-aware REPL
● new! Test framework abstraction
● new! Parallel by default
● shabby-chic! ANSI colors
● Internal DSL + Maven integration
Google Blaze/Bazel (2009)
Q: How can I develop faster?
Q: How do I avoid version conflicts?
● new! Incremental build
● new! Cache builds remotely
● new! Clustered Building
● Abandon Maven. Check in all source to version control.
Force everyone on the same version.
● 1 SCM repo for all projects
● Assume homogeneous-ish environment
Pants (2014)/Buck (2014)
Q: How can I develop faster?
Q: How do I avoid version conflicts?
● Incremental build
● Cache builds remotely
● Force all dependencies to the same version for all
projects
● Put everything in a mono-repository
History
make (1977)
automake (1996)/
autoconf (1991)
Rake (2003)
Maven (2004)
Ivy (2004)
sbt (2008)
Blaze (2009)
Gradle (2009)
Leiningen
(2009)
Pants (2014)
Buck (2014)
RPM (1997)
Ant (2000)
Buildr (2008)
Jon Pretty's shell scripts (2004-2015)
History Recap
● sbt has inherited:
o dependency based programming (Make)
o internal build DSL (Rake)
o Package/Library Management (Maven)
o Convention over configuration (Maven)
o Re-usable build flow (Maven)
● sbt brings:
o interactivity (on the shell)
o parallel by default
A roadmap to sbt 1.0
stability + sbt server => modularization
sbt 1.0 technical previews
● sbt 0.13.5, 0.13.6, 0.13.7, 0.13.8, (0.13.9)
● Binary compatible with sbt 0.13.x plugins
Community participation
● New committer: @dwijnand (Dale Wijnand)
o :_* no longer needed for settings(Seq(...))
o -= & --= for settings & tasks
o Numbers of bug fixes
● Warszaw Scala (@ajozwik Andrzej,
@rkrzewski rkrzewski, @jaceklaskowski
Jacek etc)
o Natural whitespace handling
o Stackoverflow
● @Duhemm (Martin Duhem, EPFL)
o Incremental compilation of macros
● @ajsquared (Andrew Johnson)
Auto plugins
● See Plugins
● enablePlugins, disablePlugins
● requires
● trigger (noTrigger, allRequirements)
● Good for company-wide plugins
Cached resolution
● See cached resolution
● Caches dependency graph
o Subproject graph within a single run
o Direct dependencies across builds
● Uses sbt/serialization (non/jawn + Pickling)
Stability
1. Conceptual stability
2. Binary compatibility of sbt plugins
3. Source compatibility of build files
Concepts (mostly stable)
1. Scala incremental compiler
2. Dependency manager (Scala-aware)
3. Task and plugin system (using Scala)
4. Test framework abstraction
5. Text-based interactive shell
5. sbt server + client(s)
Plugin binary compatibility
● sbt 0.13 maintained 18 months of bincompat
o Lots of hacks and effort. Unable to remove cruft.
● sbt 1.x.y should be bincompat with 1.0.0
● Need to minimize surface API
o able to add small features when requested
Build source compatibility
● Source compatibility of your build.sbt
● sbt 1.x.y should be stable
● sbt 1.0 gives us opportunity to break DSL
o Deprecate project/build.scala?
o Unify sbt shell key syntax w/ Scala DSL syntax
Modularization
Componentize stable features, innovate new ideas
1. Pull out cohesive subprojects
2. Distinguish public API and internal details
3. Document usages
4. Clean up historical code
5. Cross publish for latest scala versions
(if applicable)
6. Publish to Maven Central (or JCenter)
Module candidates
● IO API
● Launcher API
● Serialization API
● Compiler/REPL API
● Test framework API
● Dependency Management API
● Network API
● Task DSL
● Completion API
● sbt client (sbt-server)
sbt-server
Architecture and Design
The problem
● Many things want access to the build
● We need to centrally control build-related
tasks to avoid breakage.
o intellij auto-import + "sbt ~ test"
o activator + "play run"
sbt-server design
sbt-server
disk (target/)
sbt client
commands /
watches
changes
Events
(logs, status, custom)
After server - Execution Queue
CMD
(compile)
Engine
TasksRead server
Queue
Next
command
previous
log file
Reload
the build
Server Event
Loop
Request Queue
CommandQueue
Client #1 Client #2
LatestState
Next State
Problem: Disconnects
● Client may not be the one to start sbt
● Client may disconnect from server, or server
may crash
Connect as an Event
val connector = SbtConnector(
"terminal", "Command Line Terminal",
configuration.baseDirectory)
def onConnect(client: SbtClient): Unit = {
client handleEvents { … }
client watch ...
}
connector.open(onConnect, onError)(<execution context>)
Connect as an Event
val connector = SbtConnector(
"terminal", "Command Line Terminal",
configuration.baseDirectory)
def onConnect(client: SbtClient): Unit = {
client handleEvents { … }
client watch ...
}
connector.open(onConnect, onError)(
<execution context>)
Clients
reconstruct their
watches
and restore their
view of the build
on any reconnect
Problem: Input
sbt tasks may want the user to type input
Example Client (input)
client.requestExecution(
"run",
Some(TerminalInteraction -> TerminalThread)
)
client
server
ExecutionRequest
Example task (input)
readInput := {
val context = (interactionService in Global).value
context.readLine("> ", mask=false)
}
Problem: commands block
When running the `run` task, all other build
commands are blocked.
Background Jobs
● tasks can "fork" background jobs in server
● clients can discover/connect/stop with
background jobs.
server
background
job service
Forked "run"
of application
scala REPL
ensime
server?
not implemented
Input/Interaction Design
● Commands
o The requesting client provides the means for
terminal interaction
o Logs and stderr/stdout are sent to all clients.
● Background Jobs (Not Completed Yet)
o Any client can take terminal interaction for a
background task
o opt-in for getting stdout/stderr events
Problem: Existing plugins
Current plugins + sbt should be able to try out
sbt server, without breaking anything
sbt-core-next
A new, optional, plugin for sbt 0.13.x series
which provides the new services for sbt-server
● BackgroundRunService
● InteractionServicePlugin
● SendEventServicePlugin
● SerializersService
In use in Play 2.4
What's next?
sbt-server TODOS
● Interaction Improvements
o readline abstraction (a.k.a. Scala REPL support)
o Background Job hooks
● meta-project as first class citizen
o replace `reload plugins` command for first-class
support
o ~ as first-class citizen in server
● kill-on-bad-state watchdog
● sbt-terminal-client (drop existing client)
How can I help?
http://www.scala-sbt.org/community.html#how-can-I-help
● Follow @scala_sbt
● Contribute to StackOverflow sbt tag
● Report bugs
● Create plugins
o Try/migrate your plugins to remote APIs: https://github.com/sbt/sbt-
core-next
● Patch the core
o Github Community labeled issues
o Subscribe to sbt-dev list
o Join the discussion on Gitter sbt/sbt
Thanks!
1 of 54

Recommended

Bootify your spring application by
Bootify your spring applicationBootify your spring application
Bootify your spring applicationJimmy Lu
8.3K views30 slides
“Bootify your app - from zero to hero by
“Bootify  your app - from zero to hero“Bootify  your app - from zero to hero
“Bootify your app - from zero to heroIzzet Mustafaiev
2.2K views43 slides
Jenkins 101: Continuos Integration with Jenkins by
Jenkins 101: Continuos Integration with JenkinsJenkins 101: Continuos Integration with Jenkins
Jenkins 101: Continuos Integration with JenkinsAll Things Open
1.7K views48 slides
Ninja Build: Simple Guide for Beginners by
Ninja Build: Simple Guide for BeginnersNinja Build: Simple Guide for Beginners
Ninja Build: Simple Guide for BeginnersChang W. Doh
43.8K views33 slides
Gradle起步走: 以CLI Application為例 @ JCConf 2014 by
Gradle起步走: 以CLI Application為例 @ JCConf 2014Gradle起步走: 以CLI Application為例 @ JCConf 2014
Gradle起步走: 以CLI Application為例 @ JCConf 2014Chen-en Lu
6.4K views30 slides
Git+jenkins+rex presentation by
Git+jenkins+rex presentationGit+jenkins+rex presentation
Git+jenkins+rex presentationDwi Sasongko Supriyadi
748 views13 slides

More Related Content

What's hot

Introduction to .NET Core by
Introduction to .NET CoreIntroduction to .NET Core
Introduction to .NET CoreMarco Parenzan
3.7K views65 slides
What's new in MySQL 5.6 by
What's new in MySQL 5.6What's new in MySQL 5.6
What's new in MySQL 5.6Shlomi Noach
945 views26 slides
How to develop the Standard Libraries of Ruby? by
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?Hiroshi SHIBATA
3.6K views25 slides
Testing cloud and kubernetes applications - ElasTest by
Testing cloud and kubernetes applications - ElasTestTesting cloud and kubernetes applications - ElasTest
Testing cloud and kubernetes applications - ElasTestMicael Gallego
534 views111 slides
Ruby, the language of devops by
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devopsRob Kinyon
4.3K views68 slides
[네이버오픈소스세미나] What’s new in Zipkin - Adrian Cole by
[네이버오픈소스세미나] What’s new in Zipkin - Adrian Cole[네이버오픈소스세미나] What’s new in Zipkin - Adrian Cole
[네이버오픈소스세미나] What’s new in Zipkin - Adrian ColeNAVER Engineering
5.9K views29 slides

What's hot(20)

Introduction to .NET Core by Marco Parenzan
Introduction to .NET CoreIntroduction to .NET Core
Introduction to .NET Core
Marco Parenzan3.7K views
What's new in MySQL 5.6 by Shlomi Noach
What's new in MySQL 5.6What's new in MySQL 5.6
What's new in MySQL 5.6
Shlomi Noach945 views
How to develop the Standard Libraries of Ruby? by Hiroshi SHIBATA
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
Hiroshi SHIBATA3.6K views
Testing cloud and kubernetes applications - ElasTest by Micael Gallego
Testing cloud and kubernetes applications - ElasTestTesting cloud and kubernetes applications - ElasTest
Testing cloud and kubernetes applications - ElasTest
Micael Gallego534 views
Ruby, the language of devops by Rob Kinyon
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
Rob Kinyon4.3K views
[네이버오픈소스세미나] What’s new in Zipkin - Adrian Cole by NAVER Engineering
[네이버오픈소스세미나] What’s new in Zipkin - Adrian Cole[네이버오픈소스세미나] What’s new in Zipkin - Adrian Cole
[네이버오픈소스세미나] What’s new in Zipkin - Adrian Cole
NAVER Engineering5.9K views
Sep Nasiri "Upwork PHP Architecture" by Fwdays
Sep Nasiri "Upwork PHP Architecture"Sep Nasiri "Upwork PHP Architecture"
Sep Nasiri "Upwork PHP Architecture"
Fwdays1.1K views
An introduction to maven gradle and sbt by Fabio Fumarola
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
Fabio Fumarola8.2K views
How to develop Jenkins plugin using to ruby and Jenkins.rb by Hiroshi SHIBATA
How to develop Jenkins plugin using to ruby and Jenkins.rbHow to develop Jenkins plugin using to ruby and Jenkins.rb
How to develop Jenkins plugin using to ruby and Jenkins.rb
Hiroshi SHIBATA1.1K views
tDiary annual report 2009 - Sapporo Ruby Kaigi02 by Hiroshi SHIBATA
tDiary annual report 2009 - Sapporo Ruby Kaigi02tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02
Hiroshi SHIBATA1.5K views
Q4.11: Getting Started in LAVA by Linaro
Q4.11: Getting Started in LAVAQ4.11: Getting Started in LAVA
Q4.11: Getting Started in LAVA
Linaro2.4K views
Performance Profiling Tools and Tricks by Phase2
Performance Profiling Tools and TricksPerformance Profiling Tools and Tricks
Performance Profiling Tools and Tricks
Phase22K views
Expressive Microservice Framework Blastoff by Adam Culp
Expressive Microservice Framework BlastoffExpressive Microservice Framework Blastoff
Expressive Microservice Framework Blastoff
Adam Culp1.6K views
The Future of Bundled Bundler by Hiroshi SHIBATA
The Future of Bundled BundlerThe Future of Bundled Bundler
The Future of Bundled Bundler
Hiroshi SHIBATA4.7K views
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ... by Mark West
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
Mark West1.9K views

Viewers also liked

Road to sbt 1.0 paved with server by
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with serverEugene Yokota
4.9K views53 slides
SBT Crash Course by
SBT Crash CourseSBT Crash Course
SBT Crash CourseMichal Bigos
5.9K views30 slides
Innovating faster with SBT, Continuous Delivery, and LXC by
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXCkscaldef
10K views44 slides
Hadoop Summit 2013 : Continuous Integration on top of hadoop by
Hadoop Summit 2013 : Continuous Integration on top of hadoopHadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoopWisely chen
3.7K views31 slides
Continuous Integration for Spark Apps by Sean McIntyre by
Continuous Integration for Spark Apps by Sean McIntyreContinuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyreSpark Summit
3.6K views45 slides
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver) by
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)Eugene Yokota
1.4K views43 slides

Viewers also liked(14)

Road to sbt 1.0 paved with server by Eugene Yokota
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
Eugene Yokota4.9K views
Innovating faster with SBT, Continuous Delivery, and LXC by kscaldef
Innovating faster with SBT, Continuous Delivery, and LXCInnovating faster with SBT, Continuous Delivery, and LXC
Innovating faster with SBT, Continuous Delivery, and LXC
kscaldef10K views
Hadoop Summit 2013 : Continuous Integration on top of hadoop by Wisely chen
Hadoop Summit 2013 : Continuous Integration on top of hadoopHadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoop
Wisely chen3.7K views
Continuous Integration for Spark Apps by Sean McIntyre by Spark Summit
Continuous Integration for Spark Apps by Sean McIntyreContinuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyre
Spark Summit3.6K views
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver) by Eugene Yokota
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
Eugene Yokota1.4K views
sbt, past and future / sbt, 傾向と対策 by scalaconfjp
sbt, past and future / sbt, 傾向と対策sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策
scalaconfjp4.5K views
“Satisfaction from e banking services. a comparative study of hdfc and icici... by bairasiareshu
“Satisfaction from e banking services. a comparative study of  hdfc and icici...“Satisfaction from e banking services. a comparative study of  hdfc and icici...
“Satisfaction from e banking services. a comparative study of hdfc and icici...
bairasiareshu51.4K views
Internet banking - College Project by Sheril Daniel
Internet banking - College ProjectInternet banking - College Project
Internet banking - College Project
Sheril Daniel142.6K views
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver) by Eugene Yokota
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
Eugene Yokota1.3K views
E Banking by cssangoram
E BankingE Banking
E Banking
cssangoram143K views

Similar to Road to sbt 1.0: Paved with server (2015 Amsterdam)

.NET Applications & Cloud Meetup at 7 Peaks by
.NET Applications & Cloud Meetup at 7 Peaks.NET Applications & Cloud Meetup at 7 Peaks
.NET Applications & Cloud Meetup at 7 PeaksSeven Peaks Speaks
364 views28 slides
Why kernelspace sucks? by
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?OpenFest team
1.7K views63 slides
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches... by
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...NETWAYS
19 views106 slides
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches... by
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...NETWAYS
199 views106 slides
Nodejs by
NodejsNodejs
NodejsVinod Kumar Marupu
443 views21 slides
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM by
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVMJung Kim
4.6K views75 slides

Similar to Road to sbt 1.0: Paved with server (2015 Amsterdam)(20)

Why kernelspace sucks? by OpenFest team
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?
OpenFest team1.7K views
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches... by NETWAYS
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
NETWAYS19 views
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches... by NETWAYS
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
NETWAYS199 views
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM by Jung Kim
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
Jung Kim4.6K views
From development environments to production deployments with Docker, Compose,... by Jérôme Petazzoni
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
Jérôme Petazzoni33K views
Odo improving the developer experience on OpenShift - hack &amp; sangria by Jorge Morales
Odo   improving the developer experience on OpenShift - hack &amp; sangriaOdo   improving the developer experience on OpenShift - hack &amp; sangria
Odo improving the developer experience on OpenShift - hack &amp; sangria
Jorge Morales891 views
Angular (v2 and up) - Morning to understand - Linagora by LINAGORA
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA480 views
Counterclockwise past present future by lolopetit
Counterclockwise  past present futureCounterclockwise  past present future
Counterclockwise past present future
lolopetit1.5K views
Spring Boot 3 And Beyond by VMware Tanzu
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
VMware Tanzu155 views
(1) c sharp introduction_basics_dot_net by Nico Ludwig
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net
Nico Ludwig244 views
Cape Cod Web Technology Meetup - 3 by Asher Martin
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
Asher Martin468 views
Настройка окружения для кросскомпиляции проектов на основе docker'a by corehard_by
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
corehard_by174 views
node.js: Javascript's in your backend by David Padbury
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
David Padbury12.6K views
Introduction to Performance APIs by Shogo Sensui
Introduction to Performance APIsIntroduction to Performance APIs
Introduction to Performance APIs
Shogo Sensui566 views
SCM Puppet: from an intro to the scaling by Stanislav Osipov
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
Stanislav Osipov5.1K views
Dart the Better JavaScript by Jorg Janke
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke1.1K views
The next step from Microsoft - Vnext (Srdjan Poznic) by Geekstone
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
Geekstone131 views

More from Eugene Yokota

Equality in Scala (ScalaMatsuri 2020) by
Equality in Scala (ScalaMatsuri 2020)Equality in Scala (ScalaMatsuri 2020)
Equality in Scala (ScalaMatsuri 2020)Eugene Yokota
998 views61 slides
sbt: core concepts and updates (Scala Love 2020) by
sbt: core concepts and updates (Scala Love 2020)sbt: core concepts and updates (Scala Love 2020)
sbt: core concepts and updates (Scala Love 2020)Eugene Yokota
394 views50 slides
Analysis of Zinc (nescala 2020) by
Analysis of Zinc (nescala 2020)Analysis of Zinc (nescala 2020)
Analysis of Zinc (nescala 2020)Eugene Yokota
519 views35 slides
Analysis of Zinc (ScalaSphere 2019) by
Analysis of Zinc (ScalaSphere 2019)Analysis of Zinc (ScalaSphere 2019)
Analysis of Zinc (ScalaSphere 2019)Eugene Yokota
574 views50 slides
sbt core concepts (ScalaMatsuri 2019) by
sbt core concepts (ScalaMatsuri 2019)sbt core concepts (ScalaMatsuri 2019)
sbt core concepts (ScalaMatsuri 2019)Eugene Yokota
790 views56 slides
pull requests I sent to scala/scala (ny-scala 2019) by
pull requests I sent to scala/scala (ny-scala 2019)pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)Eugene Yokota
703 views42 slides

More from Eugene Yokota(10)

Equality in Scala (ScalaMatsuri 2020) by Eugene Yokota
Equality in Scala (ScalaMatsuri 2020)Equality in Scala (ScalaMatsuri 2020)
Equality in Scala (ScalaMatsuri 2020)
Eugene Yokota998 views
sbt: core concepts and updates (Scala Love 2020) by Eugene Yokota
sbt: core concepts and updates (Scala Love 2020)sbt: core concepts and updates (Scala Love 2020)
sbt: core concepts and updates (Scala Love 2020)
Eugene Yokota394 views
Analysis of Zinc (nescala 2020) by Eugene Yokota
Analysis of Zinc (nescala 2020)Analysis of Zinc (nescala 2020)
Analysis of Zinc (nescala 2020)
Eugene Yokota519 views
Analysis of Zinc (ScalaSphere 2019) by Eugene Yokota
Analysis of Zinc (ScalaSphere 2019)Analysis of Zinc (ScalaSphere 2019)
Analysis of Zinc (ScalaSphere 2019)
Eugene Yokota574 views
sbt core concepts (ScalaMatsuri 2019) by Eugene Yokota
sbt core concepts (ScalaMatsuri 2019)sbt core concepts (ScalaMatsuri 2019)
sbt core concepts (ScalaMatsuri 2019)
Eugene Yokota790 views
pull requests I sent to scala/scala (ny-scala 2019) by Eugene Yokota
pull requests I sent to scala/scala (ny-scala 2019)pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)
Eugene Yokota703 views
sbt server (LSP discussion, 2018 Jan) by Eugene Yokota
sbt server (LSP discussion, 2018 Jan)sbt server (LSP discussion, 2018 Jan)
sbt server (LSP discussion, 2018 Jan)
Eugene Yokota293 views
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver) by Eugene Yokota
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaSphere ver)
Eugene Yokota10.1K views

Recently uploaded

DRBD Deep Dive - Philipp Reisner - LINBIT by
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBITShapeBlue
180 views21 slides
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlueShapeBlue
147 views23 slides
CryptoBotsAI by
CryptoBotsAICryptoBotsAI
CryptoBotsAIchandureddyvadala199
40 views5 slides
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...ShapeBlue
145 views17 slides
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...ShapeBlue
106 views12 slides
Initiating and Advancing Your Strategic GIS Governance Strategy by
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance StrategySafe Software
176 views68 slides

Recently uploaded(20)

DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue180 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue147 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue145 views
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... by ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue106 views
Initiating and Advancing Your Strategic GIS Governance Strategy by Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software176 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10123 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu423 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty64 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash158 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue180 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue194 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue139 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue138 views
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue119 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue166 views

Road to sbt 1.0: Paved with server (2015 Amsterdam)

  • 2. The road to sbt 1.0: Paved with server Josh Suereth (@jsuereth) Eugene Yokota (@eed3si9n)
  • 4. Agenda ● A brief (incomplete and mostly wrong) history of Build Tools ● A roadmap to sbt 1.0 o Modularization ● sbt-server
  • 5. A brief history of build tools Incomplete and mostly wrong
  • 7. $ make -j 2 hello # Makefile OBJ = test.o test2.o %.o : %.c $(CC) -c -o $@ < $< hello : $(OBJ) gcc -o $@ $^
  • 8. Make (1976) ● new! Dependency-based programming ● Uses system command to carry out tasks ● problem! Machine-dependent Q: How do I build this program?
  • 9. Autoconf/Automake (1991/1996) ● Generate configure script and Makefile templates o Configure generates header scripts and real makefile o Configure discovers what the machine has ● Use an even MORE arcane syntax o m4 macros o magic strings Q: How do I build on this machine?
  • 11. $ ant dist <project name="MyProject" default="dist" basedir="."> <description>example build file</description> <property name="src" location="src"/> <property name="build" location="build"/> <property name="dist" location="dist"/> <target name="compile" description="compile the source " > <javac srcdir="${src}" destdir="${build}"/> </target> <target name="dist" depends="compile" description="generate the distribution" > <mkdir dir="${dist}/lib"/> <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/> </target> </project>
  • 12. Ant (2000) Q: How do I build on this machine? ● new! Built-in tasks like mkdir, javac, and jar o Self-contained and platform-independent ● task plugins (like ant-contrib) ● problem! Hard to reuse build logic
  • 13. Package managers Q: How do I find library source/binary? ● new! Metadata to track library dependencies ● new! Repository to host source and binary ● CTAN (1993), Port (1994), RPM (1997), APT (1998)
  • 14. Maven (2004) Q: How do I find library source/binary? Q: How do I enforce consistent builds? ● Metadata to track library dependencies ● Repository to host source and binary ● new! Default build (Convention over Configuration) ● new! Plugins that allowed reuse of build logic ● problem! Difficult to customize
  • 15. Ivy (2004) Q: How do I find library source/binary? ● Metadata to track library dependencies ● Repository to host source and binary ● Maven integration on top of Ant
  • 16. Rake (2003) rule '.o' => ['.c'] do |t| sh "cc #{t.source} -c -o #{t.name}" end task :name, [:first_name, :last_name] do |t, args| puts "First name is #{args.first_name}" puts "Last name is #{args.last_name}" end
  • 17. Rake (2004) Q: How do I build on this machine? Q: How do I customize my build? ● new! Internal DSL o Leverage Ruby libraries rather than shell programs o Provide cross-platform ruby libraries for supported language tools ● Real programming language to write tasks
  • 18. O NOES XML! SAX parsing is declared uncool (immediately after inception) REST/JSON attempt to displace SOAP
  • 19. Buildr (2008)/Gradle (2009)/ Leningen(2009) ● Maven integration Q: How do I find library source/binary? Q: How do I customize my build? ● Use an internal DSL and a real program language
  • 20. sbt (2008) Q: How do I find library source/binary? Q: How do I customize my build? Q: How can I develop faster? ● new! Incremental compiler tracking source deps ● new! Interactive shell + library-aware REPL ● new! Test framework abstraction ● new! Parallel by default ● shabby-chic! ANSI colors ● Internal DSL + Maven integration
  • 21. Google Blaze/Bazel (2009) Q: How can I develop faster? Q: How do I avoid version conflicts? ● new! Incremental build ● new! Cache builds remotely ● new! Clustered Building ● Abandon Maven. Check in all source to version control. Force everyone on the same version. ● 1 SCM repo for all projects ● Assume homogeneous-ish environment
  • 22. Pants (2014)/Buck (2014) Q: How can I develop faster? Q: How do I avoid version conflicts? ● Incremental build ● Cache builds remotely ● Force all dependencies to the same version for all projects ● Put everything in a mono-repository
  • 23. History make (1977) automake (1996)/ autoconf (1991) Rake (2003) Maven (2004) Ivy (2004) sbt (2008) Blaze (2009) Gradle (2009) Leiningen (2009) Pants (2014) Buck (2014) RPM (1997) Ant (2000) Buildr (2008) Jon Pretty's shell scripts (2004-2015)
  • 24. History Recap ● sbt has inherited: o dependency based programming (Make) o internal build DSL (Rake) o Package/Library Management (Maven) o Convention over configuration (Maven) o Re-usable build flow (Maven) ● sbt brings: o interactivity (on the shell) o parallel by default
  • 25. A roadmap to sbt 1.0 stability + sbt server => modularization
  • 26. sbt 1.0 technical previews ● sbt 0.13.5, 0.13.6, 0.13.7, 0.13.8, (0.13.9) ● Binary compatible with sbt 0.13.x plugins
  • 27. Community participation ● New committer: @dwijnand (Dale Wijnand) o :_* no longer needed for settings(Seq(...)) o -= & --= for settings & tasks o Numbers of bug fixes ● Warszaw Scala (@ajozwik Andrzej, @rkrzewski rkrzewski, @jaceklaskowski Jacek etc) o Natural whitespace handling o Stackoverflow ● @Duhemm (Martin Duhem, EPFL) o Incremental compilation of macros ● @ajsquared (Andrew Johnson)
  • 28. Auto plugins ● See Plugins ● enablePlugins, disablePlugins ● requires ● trigger (noTrigger, allRequirements) ● Good for company-wide plugins
  • 29. Cached resolution ● See cached resolution ● Caches dependency graph o Subproject graph within a single run o Direct dependencies across builds ● Uses sbt/serialization (non/jawn + Pickling)
  • 30. Stability 1. Conceptual stability 2. Binary compatibility of sbt plugins 3. Source compatibility of build files
  • 31. Concepts (mostly stable) 1. Scala incremental compiler 2. Dependency manager (Scala-aware) 3. Task and plugin system (using Scala) 4. Test framework abstraction 5. Text-based interactive shell 5. sbt server + client(s)
  • 32. Plugin binary compatibility ● sbt 0.13 maintained 18 months of bincompat o Lots of hacks and effort. Unable to remove cruft. ● sbt 1.x.y should be bincompat with 1.0.0 ● Need to minimize surface API o able to add small features when requested
  • 33. Build source compatibility ● Source compatibility of your build.sbt ● sbt 1.x.y should be stable ● sbt 1.0 gives us opportunity to break DSL o Deprecate project/build.scala? o Unify sbt shell key syntax w/ Scala DSL syntax
  • 34. Modularization Componentize stable features, innovate new ideas 1. Pull out cohesive subprojects 2. Distinguish public API and internal details 3. Document usages 4. Clean up historical code 5. Cross publish for latest scala versions (if applicable) 6. Publish to Maven Central (or JCenter)
  • 35. Module candidates ● IO API ● Launcher API ● Serialization API ● Compiler/REPL API ● Test framework API ● Dependency Management API ● Network API ● Task DSL ● Completion API ● sbt client (sbt-server)
  • 37. The problem ● Many things want access to the build ● We need to centrally control build-related tasks to avoid breakage. o intellij auto-import + "sbt ~ test" o activator + "play run"
  • 38. sbt-server design sbt-server disk (target/) sbt client commands / watches changes Events (logs, status, custom)
  • 39. After server - Execution Queue CMD (compile) Engine TasksRead server Queue Next command previous log file Reload the build Server Event Loop Request Queue CommandQueue Client #1 Client #2 LatestState Next State
  • 40. Problem: Disconnects ● Client may not be the one to start sbt ● Client may disconnect from server, or server may crash
  • 41. Connect as an Event val connector = SbtConnector( "terminal", "Command Line Terminal", configuration.baseDirectory) def onConnect(client: SbtClient): Unit = { client handleEvents { … } client watch ... } connector.open(onConnect, onError)(<execution context>)
  • 42. Connect as an Event val connector = SbtConnector( "terminal", "Command Line Terminal", configuration.baseDirectory) def onConnect(client: SbtClient): Unit = { client handleEvents { … } client watch ... } connector.open(onConnect, onError)( <execution context>) Clients reconstruct their watches and restore their view of the build on any reconnect
  • 43. Problem: Input sbt tasks may want the user to type input
  • 44. Example Client (input) client.requestExecution( "run", Some(TerminalInteraction -> TerminalThread) ) client server ExecutionRequest
  • 45. Example task (input) readInput := { val context = (interactionService in Global).value context.readLine("> ", mask=false) }
  • 46. Problem: commands block When running the `run` task, all other build commands are blocked.
  • 47. Background Jobs ● tasks can "fork" background jobs in server ● clients can discover/connect/stop with background jobs. server background job service Forked "run" of application scala REPL ensime server? not implemented
  • 48. Input/Interaction Design ● Commands o The requesting client provides the means for terminal interaction o Logs and stderr/stdout are sent to all clients. ● Background Jobs (Not Completed Yet) o Any client can take terminal interaction for a background task o opt-in for getting stdout/stderr events
  • 49. Problem: Existing plugins Current plugins + sbt should be able to try out sbt server, without breaking anything
  • 50. sbt-core-next A new, optional, plugin for sbt 0.13.x series which provides the new services for sbt-server ● BackgroundRunService ● InteractionServicePlugin ● SendEventServicePlugin ● SerializersService In use in Play 2.4
  • 52. sbt-server TODOS ● Interaction Improvements o readline abstraction (a.k.a. Scala REPL support) o Background Job hooks ● meta-project as first class citizen o replace `reload plugins` command for first-class support o ~ as first-class citizen in server ● kill-on-bad-state watchdog ● sbt-terminal-client (drop existing client)
  • 53. How can I help? http://www.scala-sbt.org/community.html#how-can-I-help ● Follow @scala_sbt ● Contribute to StackOverflow sbt tag ● Report bugs ● Create plugins o Try/migrate your plugins to remote APIs: https://github.com/sbt/sbt- core-next ● Patch the core o Github Community labeled issues o Subscribe to sbt-dev list o Join the discussion on Gitter sbt/sbt