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 <[email protected]>

* changed action provider for prerelease

Signed-off-by: Georgi Georgiev <[email protected]>

* removed creating pre-release

Signed-off-by: Georgi Georgiev <[email protected]>

* update gradelev

Signed-off-by: Georgi Georgiev <[email protected]>

* added echo command for arch

Signed-off-by: Georgi Georgiev <[email protected]>

* added line

Signed-off-by: Georgi Georgiev <[email protected]>

* fix

Signed-off-by: Georgi Georgiev <[email protected]>

* trying

Signed-off-by: Georgi Georgiev <[email protected]>

* added missing line

Signed-off-by: Georgi Georgiev <[email protected]>

* switched sopaces for tabs

Signed-off-by: Georgi Georgiev <[email protected]>

* small changes

Signed-off-by: Georgi Georgiev <[email protected]>

* typo

Signed-off-by: Georgi Georgiev <[email protected]>

* added a separate file for the mac release

Signed-off-by: Georgi Georgiev <[email protected]>

* 2nd try with arch

Signed-off-by: Georgi Georgiev <[email protected]>

* distribution

Signed-off-by: Georgi Georgiev <[email protected]>

* added additional file for building the dylibs

Signed-off-by: Georgi Georgiev <[email protected]>

* nerf eddition level

Signed-off-by: Georgi Georgiev <[email protected]>

* another nerf

Signed-off-by: Georgi Georgiev <[email protected]>

* aded file for dylib generation

Signed-off-by: Georgi Georgiev <[email protected]>

* /testing

Signed-off-by: Georgi Georgiev <[email protected]>

* changed generation command

Signed-off-by: Georgi Georgiev <[email protected]>

* changed release action

Signed-off-by: Georgi Georgiev <[email protected]>

* added rustup target

Signed-off-by: Georgi Georgiev <[email protected]>

* typo

Signed-off-by: Georgi Georgiev <[email protected]>

* typo

Signed-off-by: Georgi Georgiev <[email protected]>

* testing

Signed-off-by: Georgi Georgiev <[email protected]>

* testing

Signed-off-by: Georgi Georgiev <[email protected]>

* testing

Signed-off-by: Georgi Georgiev <[email protected]>

* testing

Signed-off-by: Georgi Georgiev <[email protected]>

* testing

Signed-off-by: Georgi Georgiev <[email protected]>

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

Signed-off-by: Georgi Georgiev <[email protected]>

* added some logs as well

Signed-off-by: Georgi Georgiev <[email protected]>

* 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 <[email protected]>

* change to on push

Signed-off-by: Georgi Georgiev <[email protected]>

* the aarch64v linux is incompatible too

Signed-off-by: Georgi Georgiev <[email protected]>

* removed slashes

Signed-off-by: Georgi Georgiev <[email protected]>

* deleted the outdated commandd in makefile

Signed-off-by: Georgi Georgiev <[email protected]>

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

Signed-off-by: Georgi Georgiev <[email protected]>

* 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 <[email protected]>
Co-authored-by: Yordan Atanasov <[email protected]>
@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