Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 1 | This documentation describes usage of Jack server 1.3-a8. |
| 2 | |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 3 | Jack server |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 4 | =========== |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 5 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 6 | The Jack server's goal is to handle a pool of Jack compiler instances in |
| 7 | order to limit memory usage and benefit from already warm instances. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 8 | |
Yohann Roussel | 9710d33 | 2016-01-06 16:12:40 +0100 | [diff] [blame] | 9 | Setup for Mac OS |
| 10 | ---------------- |
| 11 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 12 | Jack server is automatically installed and started by android build but |
| 13 | requires initial setup on Mac OS: |
Yohann Roussel | 9710d33 | 2016-01-06 16:12:40 +0100 | [diff] [blame] | 14 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 15 | - Install MacPorts from macports.org |
| 16 | Make sure that /opt/local/bin appears in your path before /usr/bin. |
| 17 | If not, please add the following to your ~/.bash_profile file (If |
| 18 | you do not have a .bash_profile file in your home directory, create |
| 19 | one): |
Yohann Roussel | 9710d33 | 2016-01-06 16:12:40 +0100 | [diff] [blame] | 20 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 21 | export PATH=/opt/local/bin:$PATH` |
Yohann Roussel | 9710d33 | 2016-01-06 16:12:40 +0100 | [diff] [blame] | 22 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 23 | - Get curl package from MacPorts: |
Yohann Roussel | 9710d33 | 2016-01-06 16:12:40 +0100 | [diff] [blame] | 24 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 25 | $ POSIXLY_CORRECT=1 sudo port install curl +ssl |
Yohann Roussel | 9710d33 | 2016-01-06 16:12:40 +0100 | [diff] [blame] | 26 | |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 27 | Starting the server |
| 28 | ------------------- |
| 29 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 30 | You may need to start the Jack server manually. |
| 31 | Use jack-admin start-server. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 32 | |
| 33 | Client info |
| 34 | ----------- |
| 35 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 36 | The client is a bash script simply named jack. |
| 37 | It can be configured in $HOME/.jack-settings |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 38 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 39 | .jack-settings file |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 40 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 41 | This file contains script shell variables: |
| 42 | SERVER_HOST: IP address of the server |
| 43 | by default: SERVER_HOST=127.0.0.1. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 44 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 45 | SERVER_PORT_SERVICE: Server service TCP port number. Needs to match the |
| 46 | service port number defined in $HOME/.jack-server/config.properties on |
| 47 | the server host (See Server info below) |
| 48 | by default: SERVER_PORT_SERVICE=8076. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 49 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 50 | SERVER_PORT_ADMIN: Server admin TCP port number. Needs to match the |
| 51 | admin port number defined in $HOME/.jack-server/config.properties on the |
| 52 | server host (See Server info below) |
| 53 | by default: SERVER_PORT_ADMIN=8077. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 54 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 55 | SETTING_VERSION: Internal, do not modify. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 56 | |
| 57 | Server info |
| 58 | ----------- |
| 59 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 60 | The server is composed of 2 jars named jack-server.jar and |
| 61 | jack-launcher.jar. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 62 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 63 | Check Admin section to know how to install and administrate the Jack |
| 64 | server. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 65 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 66 | The server can also be configured in |
| 67 | $HOME/.jack-server/config.properties. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 68 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 69 | config.properties file |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 70 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 71 | It contains Jack server configuration properties. |
Yohann Roussel | c9eb6ec | 2016-05-26 15:49:42 +0200 | [diff] [blame] | 72 | Modifications to those settings are taken into account after restarting |
| 73 | the server. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 74 | Description with default values follows: |
| 75 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 76 | jack.server.max-service=<number> |
| 77 | Maximum number of simultaneous Jack tasks. Default is 4. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 78 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 79 | jack.server.max-jars-size=<size-in-bytes> |
| 80 | Maximum size for Jars, in bytes. -1 means no limit. Default is 100 MiB. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 81 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 82 | jack.server.time-out=<time-in-seconds> |
| 83 | Time out delay before Jack gets to sleep. When Jack sleeps, its memory |
| 84 | usage is reduced, but it is slower to wake up. -1 means "do not sleep". |
| 85 | Default is 2 weeks. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 86 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 87 | jack.server.service.port=<port-number> |
| 88 | Server service TCP port number. Default is 8076. Needs to match the |
| 89 | service port defined in $HOME/.jack-settings on the client host (See |
| 90 | Client section). |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 91 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 92 | jack.server.admin.port=<port-number> |
| 93 | Server admin TCP port number. Default is 8077. Needs to match the |
| 94 | service port defined in $HOME/.jack-settings on the client host (See |
| 95 | Client section). |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 96 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 97 | jack.server.config.version=<version> |
| 98 | Internal, do not modify. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 99 | |
| 100 | Server logs |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 101 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 102 | Server logs can be found by running jack-admin server-log. Default |
| 103 | location is $HOME/.jack-server/logs/. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 104 | |
| 105 | Admin |
| 106 | ----- |
| 107 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 108 | The jack-admin bash script allows to install and administrate the Jack |
| 109 | server. Here are some commands: |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 110 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 111 | $ jack-admin help |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 112 | Print help. |
| 113 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 114 | $ jack-admin install-server jack-launcher.jar jack-server.jar |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 115 | Install the Jack server. |
| 116 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 117 | $ jack-admin uninstall-server |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 118 | Uninstall the Jack server and all components. |
| 119 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 120 | $ jack-admin list jack |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 121 | List installed versions for Jack. |
| 122 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 123 | $ jack-admin update jack jack.jar |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 124 | Install or update a Jack jar. |
| 125 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 126 | $ jack-admin start-server |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 127 | Start the server. |
| 128 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 129 | $ jack-admin stop-server |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 130 | Stop the server after the last compilation is complete. |
| 131 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 132 | $ jack-admin kill-server |
| 133 | Kill the server process immediately, interrupting abruptly ongoing |
| 134 | compilations. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 135 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 136 | $ jack-admin list-server |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 137 | List Jack server processes. |
| 138 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 139 | $ jack-admin server-stat |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 140 | Print various info about the server and the host. |
| 141 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 142 | $ jack-admin server-log |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 143 | Print log pattern. |
| 144 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 145 | $ jack-admin dump-report |
Jean-Philippe Lesot | 4565799 | 2016-01-20 03:19:22 +0100 | [diff] [blame] | 146 | Produce a report file that can be used to file a bug. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 147 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 148 | Transitioning from server 1.1 (e.g. Marshmallow) to server 1.3 (e.g. N) |
| 149 | ----------------------------------------------------------------------- |
| 150 | |
| 151 | The old Jack server used a $HOME/.jack configuration file. It has now |
| 152 | replaced by a $HOME/.jack-settings and a |
| 153 | $HOME/.jack-server/config.properties. If those new files do not exist, |
| 154 | run jack-admin start-server and they will be created. If you had custom |
| 155 | settings in your $HOME/.jack, here's how to adapt those. |
| 156 | |
| 157 | SERVER_PORT_SERVICE=XXXX |
| 158 | Replace with SERVER_PORT_SERVICE=XXXX in $HOME/.jack-settings and |
| 159 | jack.server.service.port=XXXX in $HOME/.jack-server/config.properties. |
| 160 | |
| 161 | SERVER_PORT_ADMIN=YYYY |
| 162 | Replace with SERVER_PORT_ADMIN=YYYY in $HOME/.jack-settings and |
| 163 | jack.server.admin.port=YYYY in $HOME/.jack-server/config.properties. |
| 164 | |
| 165 | SERVER_NB_COMPILE=N |
| 166 | Replace with jack.server.max-service=N in |
| 167 | $HOME/.jack-server/config.properties. |
| 168 | |
| 169 | SERVER_TIMEOUT=ZZ |
| 170 | You can replace with jack.server.time-out=ZZ, but it is recommended to |
| 171 | keep the default setting of "7200" (2 hours). |
| 172 | |
| 173 | Other settings in the $HOME/.jack configuration file do not need to be |
| 174 | copied. You should still keep your $HOME/.jack configuration file for |
| 175 | the old Jack server because both server versions can run simultaneously. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 176 | |
| 177 | Troubleshooting |
| 178 | --------------- |
| 179 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 180 | Below you'll find some ways to solve some troubleshooting. If you don't |
| 181 | find a solution, file a bug and attach the file produced by |
| 182 | jack-admin dump-report. |
Jean-Philippe Lesot | 4565799 | 2016-01-20 03:19:22 +0100 | [diff] [blame] | 183 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 184 | If compilation fails on No Jack server running |
Jean-Philippe Lesot | 4565799 | 2016-01-20 03:19:22 +0100 | [diff] [blame] | 185 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 186 | See Starting the server above. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 187 | |
Yohann Roussel | c9eb6ec | 2016-05-26 15:49:42 +0200 | [diff] [blame] | 188 | If your computer becomes unresponsive during compilation: |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 189 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 190 | You can improve the situation by reducing the number of jack |
| 191 | simultaneous compilations by editing your |
| 192 | $HOME/.jack-server/config.properties and changing |
Yohann Roussel | c9eb6ec | 2016-05-26 15:49:42 +0200 | [diff] [blame] | 193 | jack.server.max-service to a lower value and then restarting the server. |
| 194 | |
| 195 | If you experience Jack compilations failing on Out of memory error.: |
| 196 | |
| 197 | You can improve the situation by reducing the number of jack |
| 198 | simultaneous compilations by editing your |
| 199 | $HOME/.jack-server/config.properties and changing |
| 200 | jack.server.max-service to a lower value and then restarting the |
| 201 | server. |
| 202 | If this is not enough, you may change the arguments used to start the |
| 203 | server jvm and force a greater maximum Java heap size ("-Xmx"): |
| 204 | - Stop the server using jack-admin stop-server, then: |
| 205 | - If you start the server manually: |
| 206 | JACK_SERVER_VM_ARGUMENTS="-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation" jack-admin start-server |
| 207 | - If you use the jack server in the android tree then |
| 208 | export ANDROID_JACK_VM_ARGS="-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation" |
| 209 | and restart your build command. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 210 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 211 | If you have trouble starting the server |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 212 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 213 | This may mean that TCP ports are already in use on your computer. You |
| 214 | can try modifying the ports both in your client and server |
| 215 | configurations. See the Server info and Client info sections. If it |
| 216 | doesn't solve the problem, please report and give us additional |
| 217 | information by: |
| 218 | - Attaching your compilation log. |
| 219 | - Attaching the file produced by jack-admin dump-report |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 220 | |
| 221 | If your commands fails on |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 222 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 223 | Failed to contact Jack server: Problem reading<your home>/.jack-server/client.pem |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 224 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 225 | This may mean that your server never managed to start, see If you have |
| 226 | trouble starting the server above. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 227 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 228 | If your compilation gets stuck without any progress |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 229 | |
Yohann Roussel | e3f18c2 | 2016-02-24 16:16:42 +0100 | [diff] [blame] | 230 | Please report and give us additional information by attaching the file |
| 231 | produced by jack-admin dump-report. |
| 232 | Then restart the server by issuing commands |
| 233 | jack-admin kill-server; jack-admin start-server |