You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, layer build compatibility checking is very limited and is only performed for the image builder arguments.
207
+
Layer build compatibility checks are performed to ensure the consistency of _image builder arguments_ and _classpath/modulepath entries_.
208
+
These will be covered in the following subsections.
209
+
210
+
#### Image builder arguments compatibility
211
+
199
212
The list below gives a few examples of checks that are already implemented.
200
213
201
214
- Module system options `--add-exports`, `--add-opens`, `--add-reads` that were passed in the previous image build also need to be passed in the current image build.
202
215
Note that additional module system options not found in the previous image build are allowed to be used in the current image build.
203
216
- Builder options of the form `-H:NeverInline=<pattern>` follow the same logic as the module system options above.
204
217
- If debug option `-g` was passed in the previous image build it must also be passed in the current image build at the same position.
205
218
- Other options like `-H:EntryPointNamePrefix=...`, `-H:APIFunctionPrefix=...`, ... follow the same logic as the `-g` option.
219
+
- Environment variables provided using `-E` to the previous image build must be passed to the current image build, with their values remaining unchanged. Additional environment variables may be supplied to the current build if needed.
220
+
221
+
#### Classpath & modulepath compatibility
222
+
223
+
The classpath/modulepath entries used in the previous image layer build must also be included in the current image layer build.
224
+
These entries must retain the same content. If any of the shared entries are modified (.e.g, updated jar files), the previous image layer must be rebuilt with the updated versions.
225
+
226
+
For example, assume the previous layer build used the classpath: `/path/to/foo.jar:/path/to/bar.jar`.
227
+
Then the current layer build must include both `/path/to/foo.jar` and `/path/to/bar.jar`, possibly alongside additional entries: `path/to/foo.jar:/path/to/bar.jar:/path/to/extra.jar`.
228
+
Additionally, the contents of `foo.jar` and `bar.jar` should remain unchanged between the two builds.
206
229
207
-
The number of checks is subject to change and will be further improved in the future.
230
+
**Exception**: Classpath or modulepath entries that include a `native-image.properties` file specifying the `--layer-create` option with the `digest-ignore` suboption are exempt from this rule.
231
+
These entries should be _excluded_ from subsequent layer builds.
0 commit comments