Repository navigation
Notebook E2E in a macOS GraalVM native image (#191 milestone 1, #249) - #250
Merged
Merged
Conversation
The same 20 scenarios run in a GraalVM native image with JAVA_HOME and PYTHONHOME removed and no libjvm, the prefix, wheel and app beside the executable; the image takes ui, ui-text and foundation from the fork, whose main-thread work can go to an AWT-free Dispatchers.Main.
NotebookE2eMain calls the 20 scenarios after their @BeforeTest, with no JUnit, and prints a summary. notebookE2eJvm runs it on the JVM, notebookE2eNativeAgent records Compose and skiko's configuration into src/desktopTest/native-image, notebookE2eNativeCompile builds the image, and notebookE2eNativeRun requires 20 of 20 with JAVA_HOME and PYTHONHOME removed and no libjvm. The image's classpath takes the fork's ui, ui-text and foundation (composeExtended.* in gradle.properties, one place) and registers a single-thread Dispatchers.Main with no AWT. Closes #249
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.
Closes #249
#191's first milestone, met locally: the notebook E2E's 20 scenarios pass inside a GraalVM native image on macOS.
JAVA_HOMEandPYTHONHOMEremoved, and the image links nolibjvm;otool -Lshows only system frameworks.env -ialso passes 20/20.Feature added (
python-multiplatform-compose/fixtures/notebook-e2e):NotebookE2eMainruns the same 20 scenarios by direct calls after each class's@BeforeTest, with no JUnit or reflection. It printsNOTEBOOK_E2E: n passed, m failed of 20and exits non-zero on any failure.notebookE2eJvm: the JVM sanity run.notebookE2eNativeAgent: records the Compose and Skiko configuration intosrc/desktopTest/native-image, which is committed and contains no machine paths.notebookE2eNativeCompile: callsnative-imagedirectly, as:sample:nativeCompiledoes, with--no-fallback --enable-native-access=ALL-UNNAMED. It registers the 28 downcalls and 5 upcalls from python-multiplatform's jar metadata, plus Skiko's JNI.notebookE2eNativeRun.python-multiplatform-home/(stageNativeImagePythonHome, Desktop: find PYTHONHOME beside a native-image executable, and stage it there #246),site-packages/(the wheel) andapp/.What it took, and why the fork's Compose:
GlobalSnapshotManagerandpostDelayeddispatch to Skiko'sSwingDispatcher, which starts AWT. The first image rancell05and then failed every scenario looking forlibawt_lwawt.dylib.libawt.dyliblinks@rpath/libjvm.dylib(checked withotool).ui-desktopsends that work toDispatchers.Mainwhencompose.main.dispatcher=coroutines(ExtendedMainDispatcher). So the image's classpath, and only it, takesui,ui-textandfoundationfrom compose-multiplatform-core-extended's mavenLocal build.NotebookE2eMainDispatcherFactorysupplies a single-threadDispatchers.Mainwith no AWT. It is registered fromsrc/desktopTest/native-image-main/on the image's classpath only.composeExtended.version,.groupPrefix,.modulesand.mavenLocalin the rootgradle.properties. The coming move toorg.thisisthepy.compose.*/1.11.1-ext.1is a property edit.desktopTestkeeps upstream Compose: 20 passed after this change.Not done here: the macOS CI job. The fork's artefacts exist only in this machine's mavenLocal, which a CI runner cannot reach. It follows once the fork publishes to a repository CI can read, and I'll open it as its own issue.