Skip to content
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

GraalVM native-image build support #337

Merged
merged 29 commits into from
Dec 23, 2022
Merged

GraalVM native-image build support #337

merged 29 commits into from
Dec 23, 2022

Conversation

whilo
Copy link
Member

@whilo whilo commented May 25, 2021

This branch provides a prototype CLI tools built as a native image. The build uses https://github.com/taylorwood/clj.native-image. Preliminary documentation for the CLI can be found under doc/cli.md.

@whilo whilo marked this pull request as draft May 25, 2021 05:46
@kordano kordano requested a review from jsmassa November 18, 2021 15:08
@whilo whilo changed the base branch from development to 60-add-documentation December 22, 2021 21:36
@whilo whilo changed the base branch from 60-add-documentation to main December 22, 2021 21:36
@whilo whilo marked this pull request as ready for review December 22, 2021 21:37
@jsmassa
Copy link
Collaborator

jsmassa commented Jan 8, 2022

Needs an update to pass the tests.

tests.edn Outdated
@@ -3,6 +3,6 @@
#_{:id :cljs
:type :kaocha.type/cljs
:ns-patterns ["datahike.test."]}
{:id :integration
#_{:id :integration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be uncommented and working

@jsmassa
Copy link
Collaborator

jsmassa commented Sep 23, 2022

Blocked by #542

@whilo whilo force-pushed the 336-native-image-cli branch 2 times, most recently from b20f3e2 to 5127656 Compare October 20, 2022 09:56
@whilo whilo force-pushed the 336-native-image-cli branch from 5127656 to 4f4bdf1 Compare October 20, 2022 10:05
@whilo
Copy link
Member Author

whilo commented Oct 20, 2022

@jsmassa Except for the backward-compatibility-test this should be ready to be merged now. Let me know what needs to be changed for this or feel free to fix it directly. konserve after merge of replikativ/konserve#79 and the hitchhiker-tree also need to be released and changed in the dependencies.

This PR now only makes sure that the native-image can be built and works (tests not yet integrated, they are in bin/run-native-image-tests). I have left all changes to the memory model for #332 or follow-ups.

@whilo whilo requested a review from jsmassa October 20, 2022 10:16
Copy link
Collaborator

@jsmassa jsmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. But as you say, it needs proper release versions for the dependencies and some benchmark checks

@whilo whilo marked this pull request as draft November 24, 2022 09:22
@whilo whilo marked this pull request as ready for review December 9, 2022 05:38
Copy link
Collaborator

@jsmassa jsmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in general.

I am personally not a big fan of the package / directory name 'impl' though as it doesn't really say anything about the content. Since 'java' is taken, I guess I would choose something like 'interop' or 'native' in this case. But since we will have to do some restructuring anyway when changing to polylith, I am also ok with leaving it as is for now.

.circleci/config.yml Show resolved Hide resolved
@whilo
Copy link
Member Author

whilo commented Dec 23, 2022

I agree, I strongly dislike impl as well unless it would disambiguate internals of something that is already scoped and then internal would probably be better. I actually tried native but native is a protected keyword in Java, so we would have to use something else. I inherited impl from libsci actually.

@whilo whilo merged commit 35773c5 into main Dec 23, 2022
whilo added a commit that referenced this pull request Dec 26, 2022
* Use konserve synchronous IO. Support native-image compilation.

* Remove sleeping to make times match.

* Handler InterruptedException.

* ci: add pipeline for native-image

* fixup! ci: add pipeline for native-image

* 336 native image cli (#568)

* fixup! ci: add pipeline for native-image

* ci: correct env backward-compatibility-tests (#569)

* changed ci and script to improve local run (#570)

* fixup! ci: correct env backward-compatibility-tests (#569)

* from-datom slipped in again during rebase; remove.

* Use released versions of hh-tree and konserve.

* ci: add native-image test (#573)

* ci: add native-image test

* Try konserve version that detects small headers for backwards compat.

* Use release version of konserve

* Fix reflection error.

* Update Java API, export as native shared lib, update native cli.

* Add resources.

* Complete CLI interface.

* Update help for cli.

* Add CBOR serialization.

* Fix format.

* Support different formats for transact piping and inputs.

* Handle variable input/output formats, exceptions in shared library.

Shorten command line tool name.

* Handle memory of return type through callback.

* Complete first stage shared library and cli.

* Fix cicrcleci path to cli.

* Ensure UTF8 encoding.

* Use base64 encoding for CBOR for now to avoid char* truncation.

Co-authored-by: Timo Kramer <fw-github@timokramer.de>
Co-authored-by: Timo Kramer <4785848+TimoKramer@users.noreply.github.com>
Co-authored-by: Judith <j.massa@lambdaforge.io>
whilo added a commit that referenced this pull request Jan 3, 2023
* Use konserve synchronous IO. Support native-image compilation.

* Remove sleeping to make times match.

* Handler InterruptedException.

* ci: add pipeline for native-image

* fixup! ci: add pipeline for native-image

* 336 native image cli (#568)

* fixup! ci: add pipeline for native-image

* ci: correct env backward-compatibility-tests (#569)

* changed ci and script to improve local run (#570)

* fixup! ci: correct env backward-compatibility-tests (#569)

* from-datom slipped in again during rebase; remove.

* Use released versions of hh-tree and konserve.

* ci: add native-image test (#573)

* ci: add native-image test

* Try konserve version that detects small headers for backwards compat.

* Use release version of konserve

* Fix reflection error.

* Update Java API, export as native shared lib, update native cli.

* Add resources.

* Complete CLI interface.

* Update help for cli.

* Add CBOR serialization.

* Fix format.

* Support different formats for transact piping and inputs.

* Handle variable input/output formats, exceptions in shared library.

Shorten command line tool name.

* Handle memory of return type through callback.

* Complete first stage shared library and cli.

* Fix cicrcleci path to cli.

* Ensure UTF8 encoding.

* Use base64 encoding for CBOR for now to avoid char* truncation.

Co-authored-by: Timo Kramer <fw-github@timokramer.de>
Co-authored-by: Timo Kramer <4785848+TimoKramer@users.noreply.github.com>
Co-authored-by: Judith <j.massa@lambdaforge.io>
whilo added a commit that referenced this pull request Jan 6, 2023
* Use konserve synchronous IO. Support native-image compilation.

* Remove sleeping to make times match.

* Handler InterruptedException.

* ci: add pipeline for native-image

* fixup! ci: add pipeline for native-image

* 336 native image cli (#568)

* fixup! ci: add pipeline for native-image

* ci: correct env backward-compatibility-tests (#569)

* changed ci and script to improve local run (#570)

* fixup! ci: correct env backward-compatibility-tests (#569)

* from-datom slipped in again during rebase; remove.

* Use released versions of hh-tree and konserve.

* ci: add native-image test (#573)

* ci: add native-image test

* Try konserve version that detects small headers for backwards compat.

* Use release version of konserve

* Fix reflection error.

* Update Java API, export as native shared lib, update native cli.

* Add resources.

* Complete CLI interface.

* Update help for cli.

* Add CBOR serialization.

* Fix format.

* Support different formats for transact piping and inputs.

* Handle variable input/output formats, exceptions in shared library.

Shorten command line tool name.

* Handle memory of return type through callback.

* Complete first stage shared library and cli.

* Fix cicrcleci path to cli.

* Ensure UTF8 encoding.

* Use base64 encoding for CBOR for now to avoid char* truncation.

Co-authored-by: Timo Kramer <fw-github@timokramer.de>
Co-authored-by: Timo Kramer <4785848+TimoKramer@users.noreply.github.com>
Co-authored-by: Judith <j.massa@lambdaforge.io>
whilo added a commit that referenced this pull request Mar 5, 2023
* Use konserve synchronous IO. Support native-image compilation.

* Remove sleeping to make times match.

* Handler InterruptedException.

* ci: add pipeline for native-image

* fixup! ci: add pipeline for native-image

* 336 native image cli (#568)

* fixup! ci: add pipeline for native-image

* ci: correct env backward-compatibility-tests (#569)

* changed ci and script to improve local run (#570)

* fixup! ci: correct env backward-compatibility-tests (#569)

* from-datom slipped in again during rebase; remove.

* Use released versions of hh-tree and konserve.

* ci: add native-image test (#573)

* ci: add native-image test

* Try konserve version that detects small headers for backwards compat.

* Use release version of konserve

* Fix reflection error.

* Update Java API, export as native shared lib, update native cli.

* Add resources.

* Complete CLI interface.

* Update help for cli.

* Add CBOR serialization.

* Fix format.

* Support different formats for transact piping and inputs.

* Handle variable input/output formats, exceptions in shared library.

Shorten command line tool name.

* Handle memory of return type through callback.

* Complete first stage shared library and cli.

* Fix cicrcleci path to cli.

* Ensure UTF8 encoding.

* Use base64 encoding for CBOR for now to avoid char* truncation.

Co-authored-by: Timo Kramer <fw-github@timokramer.de>
Co-authored-by: Timo Kramer <4785848+TimoKramer@users.noreply.github.com>
Co-authored-by: Judith <j.massa@lambdaforge.io>
@whilo whilo deleted the 336-native-image-cli branch March 5, 2023 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants