Skip to content

Commit 54815e0

Browse files
authored
Split launcher/daemon terminology from client/server (#5135)
We always had two clients and two servers: previously `mill.main.client`/`mill.runner.client` and `mill.main.server`/`mill.runner.server`, and when you saw `client` or `server` it was never clear which one you were referring to. Furthermore, `client`/`server` was always very confusing since it brings to mind HTTP clients/server or network client/servers which Mill is not. In `main` with #5062 we started using `client`/`server` to refer to the underlying protocol, while `launcher`/`daemon` referred to the high-level JVM processes. These are much better names for the two concepts, and avoid conflicting with the `client`/`server` terms used for the underlying protocol components This PR standardizes our terminology to use `launcher`/`daemon` throughout the codebase, with the `.fork`/`.server` names in our integration tests renamed to `.nodaemon`/`.daemon`
1 parent d9612e1 commit 54815e0

File tree

51 files changed

+308
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+308
-302
lines changed

.github/workflows/run-tests.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# - uses: sbt/setup-sbt@v1
2222
#
2323
#
24-
# - run: ./mill 'integration.migrating[init].local.server.testOnly' mill.integration.MillInitSbtGatlingTests
24+
# - run: ./mill 'integration.migrating[init].local.daemon.testOnly' mill.integration.MillInitSbtGatlingTests
2525
#
2626

2727

@@ -91,15 +91,15 @@ jobs:
9191
# Run these with Mill native launcher as a smoketest
9292
include:
9393
- os: ubuntu-24.04-arm
94-
millargs: "'example.thirdparty[fansi].native.server'"
94+
millargs: "'example.thirdparty[fansi].native.daemon'"
9595
java-version: 17
9696

9797
- os: macos-latest
98-
millargs: "'example.thirdparty[acyclic].native.server'"
98+
millargs: "'example.thirdparty[acyclic].native.daemon'"
9999
java-version: 11
100100

101101
- os: macos-13
102-
millargs: "'example.thirdparty[jimfs].native.server'"
102+
millargs: "'example.thirdparty[jimfs].native.daemon'"
103103
java-version: 11
104104
steps:
105105
- uses: actions/checkout@v4
@@ -154,88 +154,88 @@ jobs:
154154
install-sbt: false
155155

156156
- java-version: 17
157-
millargs: "example.javalib.__.local.server"
157+
millargs: "example.javalib.__.local.daemon"
158158
install-android-sdk: false
159159
install-sbt: false
160160

161161
- java-version: 17
162-
millargs: "example.kotlinlib.__.local.server"
162+
millargs: "example.kotlinlib.__.local.daemon"
163163
install-android-sdk: false
164164
install-sbt: false
165165

166166
# Run this one using `.native` as a smoketest. Also make sure the java-version
167167
# is the same as that used in the `build-linux` job to avoid diverging code
168168
# hashes (https://github.com/com-lihaoyi/mill/pull/4410)
169169
- java-version: 11
170-
millargs: "example.scalalib.__.native.server"
170+
millargs: "example.scalalib.__.native.daemon"
171171
install-android-sdk: false
172172
install-sbt: false
173173

174174
- java-version: 17
175-
millargs: "'example.androidlib.__.local.server'"
175+
millargs: "'example.androidlib.__.local.daemon'"
176176
install-android-sdk: true
177177
install-sbt: false
178178

179179
- java-version: 17
180-
millargs: "'example.thirdparty[androidtodo].local.server'"
180+
millargs: "'example.thirdparty[androidtodo].local.daemon'"
181181
install-android-sdk: true
182182
install-sbt: false
183183

184184
- java-version: 17
185-
millargs: "'example.thirdparty[android-endless-tunnel].local.server'"
185+
millargs: "'example.thirdparty[android-endless-tunnel].local.daemon'"
186186
install-android-sdk: true
187187
install-sbt: false
188188

189189
- java-version: 17
190-
millargs: "'{example,integration}.migrating.__.local.server'"
190+
millargs: "'{example,integration}.migrating.__.local.daemon'"
191191
install-android-sdk: false
192192
install-sbt: true
193193

194194
- java-version: 17
195-
millargs: "'example.{pythonlib,javascriptlib}.__.local.server'"
195+
millargs: "'example.{pythonlib,javascriptlib}.__.local.daemon'"
196196
install-android-sdk: false
197197
install-sbt: false
198198

199199
- java-version: 11
200-
millargs: "'example.thirdparty[{mockito,commons-io}].local.server'"
200+
millargs: "'example.thirdparty[{mockito,commons-io}].local.daemon'"
201201
install-android-sdk: false
202202
install-sbt: false
203203

204204
- java-version: 17
205-
millargs: "'example.thirdparty[{netty,gatling}].local.server'"
205+
millargs: "'example.thirdparty[{netty,gatling}].local.daemon'"
206206
install-android-sdk: false
207207
install-sbt: false
208208

209209
- java-version: '17'
210-
millargs: "'example.thirdparty[arrow].local.server'"
210+
millargs: "'example.thirdparty[arrow].local.daemon'"
211211
install-android-sdk: false
212212
install-sbt: false
213213

214214
- java-version: 11
215-
millargs: "'example.{cli,fundamentals,depth,extending}.__.local.server'"
215+
millargs: "'example.{cli,fundamentals,depth,extending}.__.local.daemon'"
216216
install-android-sdk: false
217217
install-sbt: false
218218

219219
- java-version: 11
220-
millargs: "'integration.{failure,feature,ide}.__.packaged.server'"
220+
millargs: "'integration.{failure,feature,ide}.__.packaged.daemon'"
221221
install-android-sdk: false
222222
install-sbt: false
223223

224224
# run this specifically in `native` mode to make sure our non-JVM native image
225225
# launcher is able to bootstrap everything necessary without a JVM installed
226226
- java-version: 17
227-
millargs: "'integration.bootstrap[no-java-bootstrap].native.server'"
227+
millargs: "'integration.bootstrap[no-java-bootstrap].native.daemon'"
228228
install-android-sdk: false
229229

230230
# These invalidation tests need to be exercised in both execution modes
231231
# to make sure they work with and without -i/--no-server being passed
232232
- java-version: 17
233-
millargs: "'integration.invalidation.__.packaged.fork'"
233+
millargs: "'integration.invalidation.__.packaged.nodaemon'"
234234
install-android-sdk: false
235235
install-sbt: false
236236

237237
- java-version: 17
238-
millargs: "'integration.invalidation.__.packaged.server'"
238+
millargs: "'integration.invalidation.__.packaged.daemon'"
239239
install-android-sdk: false
240240
install-sbt: false
241241

@@ -264,23 +264,23 @@ jobs:
264264
install-sbt: false
265265

266266
- java-version: 11
267-
millargs: '"example.scalalib.{basic,publishing}.__.local.fork"'
267+
millargs: '"example.scalalib.{basic,publishing}.__.local.nodaemon"'
268268
install-sbt: false
269269

270270
- java-version: 11
271-
millargs: '"example.migrating.{scalalib,javalib}.__.local.fork"'
271+
millargs: '"example.migrating.{scalalib,javalib}.__.local.nodaemon"'
272272
install-sbt: true
273273

274274
- java-version: 17
275-
millargs: "'integration.{feature,failure}.__.packaged.fork'"
275+
millargs: "'integration.{feature,failure}.__.packaged.nodaemon'"
276276
install-sbt: false
277277

278278
- java-version: 11 # Run this with Mill native launcher as a smoketest
279-
millargs: "'integration.invalidation.__.native.server'"
279+
millargs: "'integration.invalidation.__.native.daemon'"
280280
install-sbt: false
281281

282282
- java-version: 17
283-
millargs: "'integration.bootstrap[no-java-bootstrap].native.server'"
283+
millargs: "'integration.bootstrap[no-java-bootstrap].native.daemon'"
284284

285285
uses: ./.github/workflows/post-build-selective.yml
286286
with:

changelog.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ to Coursier rather than implementing it in Mill {link-pr}/4145[#4145]
150150

151151
* Honor the `NO_COLOR` env variable {link-pr}/4246[#4246]
152152

153-
* Fix race condition that occasionally caused Mill's background server to exit and
153+
* Fix race condition that occasionally caused Mill's background daemon to exit and
154154
restart unnecessarily {link-pr}/4254[#4254]
155155

156156
* Improvements to Mill's https://mill-build.org/mill/android/java.html[experimental

ci/test-mill-bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ rm -rf out
2424

2525
# Run tests
2626
./mill-assembly.jar -i "__.compile"
27-
./mill-assembly.jar -i "example.scalalib.basic[1-simple].packaged.server.testForked"
27+
./mill-assembly.jar -i "example.scalalib.basic[1-simple].packaged.daemon.testForked"

core/constants/src/mill/constants/ServerFiles.java renamed to core/constants/src/mill/constants/DaemonFiles.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
package mill.constants;
22

33
/**
4-
* Central place containing all the files that live inside the `out/mill-server-*` folder
4+
* Central place containing all the files that live inside the `out/mill-daemon-*` folder
55
* and documentation about what they do
66
*/
7-
public class ServerFiles {
7+
public class DaemonFiles {
88
public static final String processId = "processId";
99
public static final String sandbox = "sandbox";
1010

1111
/**
12-
* Ensures only a single client is manipulating each mill-server folder at
12+
* Ensures only a single launcher is manipulating each mill-daemon folder at
1313
* a time, either spawning the server or submitting a command. Also used by
1414
* the server to detect when a client disconnects, so it can terminate execution
1515
*/
16-
public static final String clientLock = "clientLock";
16+
public static final String launcherLock = "launcherLock";
1717

1818
/**
19-
* Lock file ensuring a single server is running in a particular mill-server
19+
* Lock file ensuring a single server is running in a particular mill-daemon
2020
* folder. If multiple servers are spawned in the same folder, only one takes
2121
* the lock and the others fail to do so and terminate immediately.
2222
*/
23-
public static final String serverLock = "serverLock";
23+
public static final String daemonLock = "daemonLock";
2424

2525
/**
2626
* The port used to connect between server and client
2727
*/
2828
public static final String socketPort = "socketPort";
2929

3030
/**
31-
* The pipe by which the client snd server exchange IO
31+
* The pipe by which the launcher snd daemon exchange IO
3232
*
3333
* Use uniquely-named pipes based on the fully qualified path of the project folder
3434
* because on Windows the un-qualified name of the pipe must be globally unique

core/constants/src/mill/constants/EnvVars.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class EnvVars {
1717
public static final String MILL_TEST_RESOURCE_DIR = "MILL_TEST_RESOURCE_DIR";
1818

1919
/**
20-
* How long the Mill background server should run before timing out from inactivity
20+
* How long the Mill background daemon should run before timing out from inactivity
2121
*/
2222
public static final String MILL_SERVER_TIMEOUT_MILLIS = "MILL_SERVER_TIMEOUT_MILLIS";
2323

core/constants/src/mill/constants/OutFiles.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public class OutFiles {
5050
* Subfolder of `out/` that contains the machinery necessary for a single Mill background
5151
* server: metadata files, pipes, logs, etc.
5252
*/
53-
public static final String millServer = "mill-server";
53+
public static final String millDaemon = "mill-daemon";
5454

5555
/**
5656
* Subfolder of `out/` used to contain the Mill subprocess when run in no-server mode
5757
*/
58-
public static final String millNoServer = "mill-no-server";
58+
public static final String millNoDaemon = "mill-no-deamon";
5959

6060
/**
6161
* Lock file used for exclusive access to the Mill output directory

developer.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ The following table contains the main ways you can test the code in
2727
|===
2828
| Config | Automated Testing | Manual Testing | Manual Testing CI
2929
| In-Process Tests | `main.__.test`, `scalalib.test`, `contrib.buildinfo.test`, etc. | |
30-
| Sub-Process w/o packaging/publishing| `example.\\__.local.server`, `integration.__.local.server` | `dist.run` | `test-mill-dev.sh`
31-
| Sub-Process w/ packaging/publishing | `example.\\__.packaged.server`, `integration.__.packaged.server` | `dist.assembly` | `test-mill-release.sh`
30+
| Sub-Process w/o packaging/publishing| `example.\\__.local.daemon`, `integration.__.local.daemon` | `dist.run` | `test-mill-dev.sh`
31+
| Sub-Process w/ packaging/publishing | `example.\\__.packaged.daemon`, `integration.__.packaged.daemon` | `dist.assembly` | `test-mill-release.sh`
3232
| Bootstrapping: Building Mill with your current checkout of Mill | | `dist.installLocal` | `test-mill-bootstrap.sh`
3333
|===
3434

@@ -60,7 +60,7 @@ and do not exercise the Mill script-file bootstrapping, transformation, and comp
6060

6161
=== Sub-Process Tests *without* Packaging/Publishing
6262

63-
`example.\\__.local.server` and `integration.__.local.server` tests run Mill end-to-end in a subprocess,
63+
`example.\\__.local.daemon` and `integration.__.local.daemon` tests run Mill end-to-end in a subprocess,
6464
but *without* the expensive/slow steps of packaging the core packages into an assembly jar
6565
and publishing the remaining packages to
6666
`~/.ivy2/local`.
@@ -95,7 +95,7 @@ You can reproduce any of the tests manually using `dist.run`, e.g.
9595

9696
[source,console]
9797
----
98-
> ./mill "example.javalib.basic[1-simple].local.server"
98+
> ./mill "example.javalib.basic[1-simple].local.daemon"
9999
----
100100

101101
**Manual Test**
@@ -114,8 +114,8 @@ You can reproduce any of the tests manually using `dist.run`, e.g.
114114

115115
=== Sub-Process Tests *with* Packaging/Publishing
116116

117-
`example.\\__.server`, `integration.__.server`, `example.\\__.fork` and
118-
`integration.__.fork` cover the same test cases as the `.local.server` tests described above, but
117+
`example.\\__.daemon`, `integration.__.daemon`, `example.\\__.nodaemon` and
118+
`integration.__.nodaemon` cover the same test cases as the `.local.daemon` tests described above, but
119119
they perform packaging of the Mill core modules into an assembly jar, and publish the
120120
remaining modules to `~/.ivy2/local`.
121121
This results in a more realistic test environment, but at the cost of taking tens-of-seconds
@@ -131,7 +131,7 @@ You can reproduce these tests manually using `dist.installLocal`:
131131
You can also use `dist.native.installLocal` for a Graal Native Image executable,
132132
which is slower to create but faster to start than the default executable assembly.
133133

134-
There are two six of these tests, `.{local,assembly,native}.{server,fork}`.
134+
There are two six of these tests, `.{local,assembly,native}.{daemon,fork}`.
135135

136136
The first label specifies how the Mill code is packaged before testing
137137

@@ -148,13 +148,13 @@ This is the slowest mode is only really necessary for debugging Mill's Graal nat
148148
The second label specifies how the Mill process is managed during the test:
149149

150150

151-
1. `.server` test run the test cases with the default configuration, so consecutive commands
152-
run in the same long-lived background server process
151+
1. `.daemon` test run the test cases with the default configuration, so consecutive commands
152+
run in the same long-lived background daemon process
153153

154-
2. `.fork` test run the test cases with `--no-server`, meaning each command runs in a newly
154+
2. `.nodaemon` test run the test cases with `--no-daemon`, meaning each command runs in a newly
155155
spawned Mill process
156156

157-
In general you should spend most of your time working with the `.local.server` version of the
157+
In general you should spend most of your time working with the `.local.daemon` version of the
158158
`example` and `integration` tests to save time, and only run the others if you have a specific
159159
thing you want to test that needs those code paths to run.
160160

dist/scripts/src/mill.bat

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,15 @@ if [%~1%]==[--bsp] (
272272
if [%~1%]==[--no-server] (
273273
set MILL_FIRST_ARG=%1%
274274
) else (
275-
if [%~1%]==[--repl] (
275+
if [%~1%]==[--no-daemon] (
276276
set MILL_FIRST_ARG=%1%
277277
) else (
278-
if [%~1%]==[--help] (
278+
if [%~1%]==[--repl] (
279279
set MILL_FIRST_ARG=%1%
280+
) else (
281+
if [%~1%]==[--help] (
282+
set MILL_FIRST_ARG=%1%
283+
)
280284
)
281285
)
282286
)

dist/scripts/src/mill.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ if [ -z "$MILL_MAIN_CLI" ] ; then
309309
fi
310310

311311
MILL_FIRST_ARG=""
312-
if [ "$1" = "--bsp" ] || [ "$1" = "-i" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then
312+
if [ "$1" = "--bsp" ] || [ "$1" = "-i" ] || [ "$1" = "--interactive" ] || [ "$1" = "--no-server" ] || [ "$1" = "--no-daemon" ] || [ "$1" = "--repl" ] || [ "$1" = "--help" ] ; then
313313
# Need to preserve the first position of those listed options
314314
MILL_FIRST_ARG=$1
315315
shift

example/depth/sandbox/1-task/build.mill

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ def osProcTask = Task {
7878
//
7979
// Lastly, there is the possibily of calling `os.pwd` outside of a task. When outside of
8080
// a task there is no `.dest/` folder associated, so instead Mill will redirect `os.pwd`
81-
// towards an empty `sandbox/` folder in `out/mill-server/...`:
81+
// towards an empty `sandbox/` folder in `out/mill-daemon/...`:
8282

8383
val externalPwd = os.pwd
8484
def externalPwdTask = Task { println(externalPwd.toString) }
8585

8686
/** Usage
8787
> ./mill externalPwdTask
88-
.../out/mill-server/sandbox
88+
.../out/mill-daemon/sandbox
8989
*/
9090

9191
// === Limitations of Mill's Sandboxing

0 commit comments

Comments
 (0)