Skip to content

Conversation

@evacchi
Copy link
Collaborator

@evacchi evacchi commented Feb 20, 2025

Adjust all usages of unsupported APIs:

  • InputStream.readAllBytes() -> com.dylibso.chicory.wasm.io.InputStreams#readAllBytes(is)
  • List.toArray(T[]::new) -> List.toArray(new T[0])
  • Stream toArray(T[]::new) -> `collect(toList()).toArray(new T[0]);
  • Stream collect(Collectors.toUnmodifiableList()) -> Collections.toUnmodifiableList(...collect(toList()))

Notably, the changes only affect com.dylibso.chicory:wasm because build-time codegen does not need to be affected.

closes #745

@evacchi evacchi requested a review from andreaTP February 20, 2025 14:28
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 20, 2025

Deploying chicory with  Cloudflare Pages  Cloudflare Pages

Latest commit: ef895bf
Status:⚡️  Build in progress...

View logs


android {
namespace = "com.dylibso.runtimeTests"
compileSdk = 35
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 to change the compileSdk: this way we are allowed to compile using a recent Java version; minSdk will ensure it works on the lower target (in our case 28). In other words, this is similar to java.version vs java.release

@evacchi evacchi changed the title Android compat android: lower floor API version to 28 Feb 20, 2025
@evacchi
Copy link
Collaborator Author

evacchi commented Feb 20, 2025

as noted earlier in #751, ByteArrayMemory won't work on API 28

Adjust all usages of unsupported APIs.

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

Deploying chicory with  Cloudflare Pages  Cloudflare Pages

Latest commit: ef895bf
Status: ✅  Deploy successful!
Preview URL: https://cdc5655c.chicory.pages.dev
Branch Preview URL: https://android-compat.chicory.pages.dev

View logs

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

Deploying chicory with  Cloudflare Pages  Cloudflare Pages

Latest commit: cd2ae23
Status:⚡️  Build in progress...

View logs

@cloudflare-workers-and-pages
Copy link

Deploying chicory with  Cloudflare Pages  Cloudflare Pages

Latest commit: cd2ae23
Status: ✅  Deploy successful!
Preview URL: https://a9f9a1f2.chicory.pages.dev
Branch Preview URL: https://android-compat.chicory.pages.dev

View logs

Copy link
Collaborator

@andreaTP andreaTP left a comment

Choose a reason for hiding this comment

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

LGTM thanks a lot for this valuable contribution!

cc. @illarionov @yigit

@andreaTP andreaTP merged commit 658f8e9 into main Feb 21, 2025
27 checks passed
@andreaTP andreaTP deleted the android-compat branch February 21, 2025 09:27
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.

Increase Android compatibility by avoiding the usage of readAllBytes

2 participants