Remove workarounds needed for Scala 2.12.17 / scala-xml 2.1.0 / sbt#11441
Merged
Conversation
b78298a to
416534f
Compare
416534f to
e75a668
Compare
Member
Author
|
sbt 1.8 breaks our scripted tests, see #11527 |
felipebonezi
left a comment
Contributor
There was a problem hiding this comment.
Is there any migration needed for SBT 1.8? If so, we could provide a link to help some who needs to migrate from 1.7 to 1.8.
4004167 to
26d4927
Compare
Member
Author
|
This pull request is finished, however depends on sbt/sbt#7147. Locally everything works for me (including scripted tests). Last commit also implements $ sbt
[info] welcome to sbt 1.8.3-SNAPSHOT (Eclipse Adoptium Java 11.0.17)
...
[play-scala-seed] $ bgRun
Starting server
--- (Running the application, auto-reloading is enabled) ---
INFO p.c.s.AkkaHttpServer - Listening for HTTP on /127.0.0.1:9000
[success] Total time: 1 s, completed Feb 9, 2023, 12:25:09 PM
[play-scala-seed] $
# App is running in the background now
[play-scala-seed] $
# Making first request to localhost:9000, following log appears:
INFO p.a.h.HttpErrorHandlerExceptions - Registering exception handler: guice-provision-exception-handler
2023-02-09 12:25:14 INFO play.api.http.EnabledFilters Enabled Filters (see <https://www.playframework.com/documentation/latest/Filters>):
play.filters.csrf.CSRFFilter
play.filters.headers.SecurityHeadersFilter
play.filters.hosts.AllowedHostsFilter
2023-02-09 12:25:14 INFO play.api.Play Application started (Dev) (no global state)
[play-scala-seed] $
# Let's see the running processes:
[play-scala-seed] $ ps
[info] JobHandle(1, bgRun, ProjectRef(uri("file:/home/mkurz/work/play-scala-seed/"), "root") / Compile / bgRun)
[success] Total time: 0 s, completed Feb 9, 2023, 12:25:21 PM
[play-scala-seed] $
# Again but with bgList:
[play-scala-seed] $ show bgList
[info] * JobHandle(1, bgRun, ProjectRef(uri("file:/home/mkurz/work/play-scala-seed/"), "root") / Compile / bgRun)
[success] Total time: 0 s, completed Feb 9, 2023, 12:25:28 PM
[play-scala-seed] $
# Now let's change a file and see if re-compiling works:
[play-scala-seed] $
[info] compiling 1 Scala source to /home/mkurz/work/play-scala-seed/target/scala-2.13/classes ...
--- (RELOAD) ---
2023-02-09 12:25:48 INFO p.a.http.HttpErrorHandlerExceptions Registering exception handler: guice-provision-exception-handler
2023-02-09 12:25:48 INFO play.api.http.EnabledFilters Enabled Filters (see <https://www.playframework.com/documentation/latest/Filters>):
play.filters.csrf.CSRFFilter
play.filters.headers.SecurityHeadersFilter
play.filters.hosts.AllowedHostsFilter
2023-02-09 12:25:48 INFO play.api.Play Application started (Dev) (no global state)
[play-scala-seed] $
# Worked :) Again check the processes:
[play-scala-seed] $ ps
[info] JobHandle(1, bgRun, ProjectRef(uri("file:/home/mkurz/work/play-scala-seed/"), "root") / Compile / bgRun)
[success] Total time: 0 s, completed Feb 9, 2023, 12:25:52 PM
# Now let's shutdown process 1
[play-scala-seed] $ bgStop 1
Stopping server
[success] Total time: 0 s, completed Feb 9, 2023, 12:25:54 PM
2023-02-09 12:25:54 INFO p.a.i.l.c.CoordinatedShutdownSupport Starting synchronous coordinated shutdown with ServerStoppedReason reason and 35000 milliseconds timeout
2023-02-09 12:25:54 INFO play.core.server.AkkaHttpServer Stopping Akka HTTP server...
2023-02-09 12:25:54 INFO play.core.server.AkkaHttpServer Terminating server binding for /127.0.0.1:9000
2023-02-09 12:25:54 INFO play.core.server.AkkaHttpServer Running provided shutdown stop hooks
# Start app again:
[play-scala-seed] $ bgRun
Starting server
--- (Running the application, auto-reloading is enabled) ---
INFO p.c.s.AkkaHttpServer - Listening for HTTP on /127.0.0.1:9000
[success] Total time: 1 s, completed Feb 9, 2023, 12:29:20 PM
# Let's try to start a second app:
[play-scala-seed] $ bgRun
Not starting server since one is already started
[success] Total time: 0 s, completed Feb 9, 2023, 12:29:23 PM
# Only one app allowed. Let's check if only one process is running (the second bgRun needs to be ignored)
[play-scala-seed] $ ps
[info] JobHandle(2, bgRun, ProjectRef(uri("file:/home/mkurz/work/play-scala-seed/"), "root") / Compile / bgRun)
[success] Total time: 0 s, completed Feb 9, 2023, 12:29:23 PM
[play-scala-seed] $
# Worked! |
When a request hits Play and causes a re-compilation there needs to be an open LoggerContext sbt can use for logging. Since sbt 1.8.0 the LoggerContext gets closed after a user triggered command/task is finished, but re-compilation takes place _after_ a command ran (e.g. "run")
4c81d1d to
d6431b0
Compare
b9458b8 to
f958f5f
Compare
Member
Author
|
Instead of opening up methods and keys in sbt (sbt/sbt#7147), I moved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduced in #11435
Can be dropped as soon as sbt releases a version with it's Scala version upgraded (= 2.12.17+, where scala-xml 2.x gets pulled in), see sbt/sbt#7021, probably this will be sbt 1.8.0-M1