-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sketch Linker implementation. #9
Conversation
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
The latest SNAPSHOT on main includes a `Store` facility that does not track direct dependencies between components; it does not recursively instantiate required modules, it just assumes that instantiating a given module at a given moment means that all the requirements are satisfied at that time. The missing bit to turning the Store into a linker is a layer that tracks dependencies, linearizes them into a sequence, and then instantiate them in order. We also track cycles, introducing an indirection (a trampoline) to break out of them. Signed-off-by: Edoardo Vacchi <[email protected]>
The latest SNAPSHOT on main includes a The missing bit to turning the Store into a linker |
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
Signed-off-by: Edoardo Vacchi <[email protected]>
|
||
public class ChicoryModule { | ||
|
||
static final boolean IS_NATIVE_IMAGE_AOT = Boolean.getBoolean("com.oracle.graalvm.isaot"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not strictly related to this PR, but it's necessary to compile this under graalvm native image. This flag is true when the native image builder it's running. We want to make sure that the code path below is pruned at build-time, because the AoT in its current state is not compatible with the way native image works.
Signed-off-by: Edoardo Vacchi <[email protected]>
@@ -18,23 +18,25 @@ | |||
<maven.compiler.source>11</maven.compiler.source> | |||
<maven.compiler.target>11</maven.compiler.target> | |||
<maven.compiler.release>11</maven.compiler.release> | |||
|
|||
<chicory.version>999-SNAPSHOT</chicory.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we might want to wait for a release before merging
I can finally rebase this on https://github.com/dylibso/chicory/releases/tag/1.0.0-M1 😅 |
I started looking at the Go implementation, and I think this is VERY ROUGHLY what happens there. In particular, take a look at
LinkedModules link()
inLinker
.Essentially the flow is the same as before, except that, when a
Plugin
is created with thePlugin.Builder
, onbuild()
theLinker
is instantiated and wires together all theModule.Builder
instances. (Yes, this is very Java). I moved most of the logic from thePlugin
constructor to this newLinker
class.Adding a bunch of folks as reviewer, feel free to add some comments if you have some time.
Will backfill the tests, hence why this is a Draft. Good thing the single-module version still works, meaning at least I am doing something right.