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

Package all natives in a single jar. #9

Merged
merged 41 commits into from
Jun 10, 2024

Conversation

Zurcusa
Copy link
Collaborator

@Zurcusa Zurcusa commented Jun 6, 2024

The goal of this PR is to group all the cross compiled native wasmer_jni into. While doing so we kill the need of multiple jar files and ease the user experience of projects using the wasmer-java dependency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I left the workflow trigger to "on push" because the Workflow UI would only update when this is merged to master branch. From what I see that doesn't happen often.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Manual invocation wold be better imo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't need this anymore since all natives are bundled in a single jar.

id: setip_dir
shell: bash
run: |
random_string=$(uuidgen)
Copy link
Member

Choose a reason for hiding this comment

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

why not use a custom name like "dynamic_libs" or something similar?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It will be less likely for someone to create a dir with the same name ( even though there's not a high chance anyways).

Choose a reason for hiding this comment

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

I think mktemp is the exact GNU cureutil for this job. SO answer
I'm not sure whether that's necessary in a GH runner, but don't forget to delete it afterwards, too. 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The VM used for each workflow run is destroyed and re-created from a fresh instance each run. Deleting isn't needed. Will make the change.

build.gradle Outdated Show resolved Hide resolved
@georg-getz georg-getz merged commit edb0ec2 into binaries-update Jun 10, 2024
7 checks passed
georg-getz added a commit that referenced this pull request Jun 10, 2024
* removed bintray mentions and added bonus configuration in the release yaml that requires testing

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* changed action provider for prerelease

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* removed creating pre-release

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* update gradelev

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* added echo command for arch

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* added line

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* fix

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* trying

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* added missing line

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* switched sopaces for tabs

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* small changes

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* typo

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* added a separate file for the mac release

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* 2nd try with arch

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* distribution

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* added additional file for building the dylibs

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* nerf eddition level

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* another nerf

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* aded file for dylib generation

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* /testing

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* changed generation command

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* changed release action

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* added rustup target

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* typo

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* typo

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* testing

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* testing

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* testing

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* testing

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* testing

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* changed all the yamls to activate on release to test everything together

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* added some logs as well

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* removed the 32 linux platform as github doesnt support such images and wasmer-vm causes crash when trying to cross-compile

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* change to on push

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* the aarch64v linux is incompatible too

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* removed slashes

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* deleted the outdated commandd in makefile

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* undo deleting the makefile rust build commands as it is apperantly used by the test yaml as well

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>

* Package all natives in a single jar. (#9)

* Adapt dynamic_libs.yaml so that it uploads libs as artifacts.

* Add condition when copying native libs to build dir.
Test download artifacts in release.yaml.

* Test fix pattern.

* Test fix pattern.

* Remove matrix.

* Test remove pattern from artifact download.

* Refactor dynamic_libs.yaml so that it's callable from release.yaml.

* Add needs flag to release.yaml

* Test list structure in native-libs directory.

* Rework dynamic_libs.yaml so that it's reusable.
Adapt release.yaml to use dynamic_libs_reusable.yaml.
Executing release.yaml from a branch uploads the jar with all the possible native libs inside the workflow artifacts.
Executing it from a tag uploads it to the tag's release.

* Test param passs fix.

* test

* test

* Remove github.event from the reusable workflow.

* Use github.ref.type instead of github.ref

* test

* test

* test

* Remove test step from dynamic_libs_reusable.yaml.
Use startsWith expression in release.yaml.

* Add docs.
Change name of JAR.

* Test using randomizes artifacts dir.

* Fix export syntax.

* Add section in README.md for env variable.
Rename GH_ARTIFACTS_DIR to EXT_ARTIFACTS_DIR

* Change 'native-libs' to using env var.

* test

* test

* Push EXT_ARTIFACTS_DIR to gh env.

* Add mkdir.

* Fix mkdir.

* Fix mkdir.

* Fix usage of env var in "with" section of step.

* Test

* Remove comments.

* Remove leftovers.

* fix: use "uname -m" when retrieving os arch in Native.java. Change win32 to windows.

* fix: translate x86_64 to amd64 to keep uniform naming of artifacts.

* Substitute random uuid for mktemp command.

* Test fix env var assign

* Test fix env var assign

* Test remove cache steps.

* Revert cache removal.

---------

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Co-authored-by: Yordan Atanasov <99724706+Zurcusa@users.noreply.github.com>
@Zurcusa Zurcusa deleted the single-jar-multiple-jnis branch June 10, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants